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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"volumeConversion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/volumeConversion.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"volumeConversion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/volumeConversion.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,QAAQ,EAcT,MAAM,mBAAmB,CAAC;AAE3B,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,0BAA0B,EAAE,MAAM,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAwIF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAclD,CAAC"}
|
|
@@ -2,6 +2,8 @@ import { Decimal, DecimalConstructor, } from "../../../math/numbers/decimals/dec
|
|
|
2
2
|
import { randint } from "../../../math/utils/random/randint.js";
|
|
3
3
|
import { frac } from "../../../tree/nodes/operators/fractionNode.js";
|
|
4
4
|
import { multiply } from "../../../tree/nodes/operators/multiplyNode.js";
|
|
5
|
+
import { substract } from "../../../tree/nodes/operators/substractNode.js";
|
|
6
|
+
import { parseAlgebraic } from "../../../tree/parsers/latexParser.js";
|
|
5
7
|
import { shuffle } from "../../../utils/alea/shuffle.js";
|
|
6
8
|
import { doWhile } from "../../../utils/doWhile.js";
|
|
7
9
|
import { alignTex } from "../../../utils/latex/alignTex.js";
|
|
@@ -99,7 +101,11 @@ const getPropositions = (n, { answer, randomUnitIndex, randomUnitInstructionInde
|
|
|
99
101
|
return shuffle(propositions);
|
|
100
102
|
};
|
|
101
103
|
const isAnswerValid = (ans, { answer }) => {
|
|
102
|
-
return ans === answer
|
|
104
|
+
return (ans === answer ||
|
|
105
|
+
(() => {
|
|
106
|
+
const [nodeAns, nodeAnswer] = [ans, answer].map((tex) => parseAlgebraic(tex));
|
|
107
|
+
return substract(nodeAns, nodeAnswer).evaluate() === 0;
|
|
108
|
+
})());
|
|
103
109
|
};
|
|
104
110
|
export const volumeConversion = {
|
|
105
111
|
id: "volumeConversion",
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
barChart: BarChart;
|
|
4
|
+
itemAsked: AskedItem;
|
|
5
|
+
questionStr: string;
|
|
6
|
+
answerStr: string;
|
|
7
|
+
displayType: "horizMulti" | "vertStacked";
|
|
8
|
+
};
|
|
9
|
+
type AskedItem = {
|
|
10
|
+
type: "xForCategory" | "categoryForX";
|
|
11
|
+
isLess: boolean;
|
|
12
|
+
ordinal: number;
|
|
13
|
+
index: number;
|
|
14
|
+
};
|
|
15
|
+
type ColorStyle = {
|
|
16
|
+
type: "color";
|
|
17
|
+
color: string;
|
|
18
|
+
frStr: string;
|
|
19
|
+
};
|
|
20
|
+
type FillStyle = {
|
|
21
|
+
type: "fill";
|
|
22
|
+
fill: number;
|
|
23
|
+
frStr: string;
|
|
24
|
+
};
|
|
25
|
+
type CategoryProps = {
|
|
26
|
+
name: string;
|
|
27
|
+
frStr: string;
|
|
28
|
+
};
|
|
29
|
+
type CategoryStyle = ColorStyle | FillStyle;
|
|
30
|
+
type Category = {
|
|
31
|
+
props: CategoryProps;
|
|
32
|
+
style: CategoryStyle;
|
|
33
|
+
};
|
|
34
|
+
type BarProps = {
|
|
35
|
+
label: string;
|
|
36
|
+
frStr: string;
|
|
37
|
+
};
|
|
38
|
+
type Bar = {
|
|
39
|
+
props: BarProps;
|
|
40
|
+
data: number[];
|
|
41
|
+
};
|
|
42
|
+
type BarChart = {
|
|
43
|
+
description: string;
|
|
44
|
+
axisLabels: string[];
|
|
45
|
+
bars: Bar[];
|
|
46
|
+
categories: Category[];
|
|
47
|
+
};
|
|
48
|
+
export declare const barChartInterpreting: Exercise<Identifiers>;
|
|
49
|
+
export {};
|
|
50
|
+
//# sourceMappingURL=barChartInterpreting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"barChartInterpreting.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/barChartInterpreting.ts"],"names":[],"mappings":"AAAA,OAAO,EAaL,QAAQ,EAET,MAAM,6BAA6B,CAAC;AAiBrC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,YAAY,GAAG,aAAa,CAAC;CAC3C,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,cAAc,GAAG,cAAc,CAAC;IACtC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,UAAU,GAAG;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,aAAa,GAAG,UAAU,GAAG,SAAS,CAAC;AAE5C,KAAK,QAAQ,GAAG;IACd,KAAK,EAAE,aAAa,CAAC;IACrB,KAAK,EAAE,aAAa,CAAC;CACtB,CAAC;AAEF,KAAK,QAAQ,GAAG;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,GAAG,GAAG;IACT,KAAK,EAAE,QAAQ,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;AAEF,KAAK,QAAQ,GAAG;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,UAAU,EAAE,QAAQ,EAAE,CAAC;CACxB,CAAC;AAisBF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAetD,CAAC"}
|
|
@@ -0,0 +1,517 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
2
|
+
import { random, randomMany } from "../../../utils/alea/random.js";
|
|
3
|
+
import { randfloat } from "../../../math/utils/random/randfloat.js";
|
|
4
|
+
import { blueMain, greenMain, orange, purpleDark, red, } from "../../../geogebra/colors.js";
|
|
5
|
+
import { coinFlip } from "../../../utils/alea/coinFlip.js";
|
|
6
|
+
import { probaLawFlip } from "../../../utils/alea/probaLawFlip.js";
|
|
7
|
+
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
8
|
+
import { randint } from "../../../math/utils/random/randint.js";
|
|
9
|
+
import { GeogebraConstructor } from "../../../geogebra/geogebraConstructor.js";
|
|
10
|
+
import { capitalize } from "../../../utils/strings/capitalize.js";
|
|
11
|
+
class BarChartConstructor {
|
|
12
|
+
static stylesPools = {
|
|
13
|
+
color: [
|
|
14
|
+
{
|
|
15
|
+
type: "color",
|
|
16
|
+
color: red,
|
|
17
|
+
frStr: "rouge",
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
type: "color",
|
|
21
|
+
color: orange,
|
|
22
|
+
frStr: "orange",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
type: "color",
|
|
26
|
+
color: purpleDark,
|
|
27
|
+
frStr: "violet",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
type: "color",
|
|
31
|
+
color: blueMain,
|
|
32
|
+
frStr: "bleu",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
type: "color",
|
|
36
|
+
color: greenMain,
|
|
37
|
+
frStr: "vert",
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
fill: [
|
|
41
|
+
{
|
|
42
|
+
type: "fill",
|
|
43
|
+
fill: 1,
|
|
44
|
+
frStr: "hachures simples",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
type: "fill",
|
|
48
|
+
fill: 2,
|
|
49
|
+
frStr: "hachures croisées",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
type: "fill",
|
|
53
|
+
fill: 5,
|
|
54
|
+
frStr: "nid d'abeille",
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
type: "fill",
|
|
58
|
+
fill: 4,
|
|
59
|
+
frStr: "petits points",
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
type: "fill",
|
|
63
|
+
fill: 3,
|
|
64
|
+
frStr: "échiquier",
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
};
|
|
68
|
+
static randomFromSkeleton(skeleton, nbBars, nbCateg, styleType) {
|
|
69
|
+
const categoryIndexes = randomMany([...Array(skeleton.categoryProps.length).keys()], nbCateg);
|
|
70
|
+
const dictIsUsingCategory = Object.fromEntries(categoryIndexes.map((i) => [i, true]));
|
|
71
|
+
const bars = this.createRandomBars(nbBars, dictIsUsingCategory, skeleton.barProps, skeleton.referenceData, skeleton.evoRanges).toSorted((bar1, bar2) => bar1.props.label.localeCompare(bar2.props.label));
|
|
72
|
+
const categories = this.createRandomCategories(dictIsUsingCategory, skeleton.categoryProps, styleType);
|
|
73
|
+
return {
|
|
74
|
+
description: skeleton.description,
|
|
75
|
+
axisLabels: skeleton.axisLabels,
|
|
76
|
+
bars,
|
|
77
|
+
categories,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
static createRandomBars(nbBars, dictIsUsingCategory, barPropsPool, referenceDataIn, evoRangesIn) {
|
|
81
|
+
const barProps = randomMany(barPropsPool, nbBars);
|
|
82
|
+
function createRandomDataByPerturbatingData(data, evoRanges) {
|
|
83
|
+
return data.map((nb, i) => {
|
|
84
|
+
const evoRange = evoRanges[i];
|
|
85
|
+
return nb * randfloat(evoRange.min, evoRange.max);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
const evoRanges = evoRangesIn.filter((_, categIndex) => dictIsUsingCategory[categIndex]);
|
|
89
|
+
let referenceData = referenceDataIn.filter((_, categIndex) => dictIsUsingCategory[categIndex]);
|
|
90
|
+
const datas = [];
|
|
91
|
+
for (let i = 0; i < nbBars; i++) {
|
|
92
|
+
const data = createRandomDataByPerturbatingData(referenceData, evoRanges);
|
|
93
|
+
datas.push(data);
|
|
94
|
+
referenceData = data;
|
|
95
|
+
}
|
|
96
|
+
return [...Array(nbBars).keys()].map((i) => {
|
|
97
|
+
return {
|
|
98
|
+
props: barProps[i],
|
|
99
|
+
data: datas[i],
|
|
100
|
+
};
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
static createRandomCategories(dictIsUsingCategory, categoryPropsPool, styleType) {
|
|
104
|
+
const nbCategUsed = Object.keys(dictIsUsingCategory).length;
|
|
105
|
+
const styles = randomMany(this.stylesPools[styleType], nbCategUsed);
|
|
106
|
+
return categoryPropsPool
|
|
107
|
+
.filter((_, i) => dictIsUsingCategory[i])
|
|
108
|
+
.map((props, i) => {
|
|
109
|
+
const style = styles[i];
|
|
110
|
+
return {
|
|
111
|
+
props,
|
|
112
|
+
style,
|
|
113
|
+
};
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
const frenchOrdinals = [``, "deuxième", "troisième", "quatrième"];
|
|
118
|
+
const arrayOfBarChartSkeleton = [
|
|
119
|
+
{
|
|
120
|
+
description: `Le diagramme en barres ci-contre donne la production d'électricité, en TWh (téraWatt-heure) selon son origine.`,
|
|
121
|
+
questionXForCategFunc(categName, isLess, ordinal) {
|
|
122
|
+
return `Quelle était l'année où la production d'électricité d'origine ${categName.toLocaleLowerCase()} était
|
|
123
|
+
la ${ordinal > 0 ? `${frenchOrdinals[ordinal]} la` : ``} ${isLess ? `moins` : `plus`} importante de toutes ces années ?`;
|
|
124
|
+
},
|
|
125
|
+
answerXForCategFunc(categName, isLess, ordinal) {
|
|
126
|
+
return `l'année où la production d'électricité d'origine ${categName.toLocaleLowerCase()} était
|
|
127
|
+
la ${ordinal > 0 ? `${frenchOrdinals[ordinal]} la` : ``} ${isLess ? `moins` : `plus`} importante de toutes ces années`;
|
|
128
|
+
},
|
|
129
|
+
questionCategForXFunc(barLabel, isLess, ordinal) {
|
|
130
|
+
return `Quelle était l'origine de production d'électricité
|
|
131
|
+
la ${ordinal > 0 ? `${frenchOrdinals[ordinal]} la` : ``} ${isLess ? `moins` : `plus`} importante pour l'année $${barLabel}$ ?`;
|
|
132
|
+
},
|
|
133
|
+
answerCategForXFunc(barLabel, isLess, ordinal) {
|
|
134
|
+
return `la production d'électricité
|
|
135
|
+
la ${ordinal > 0 ? `${frenchOrdinals[ordinal]} la` : ``} ${isLess ? `moins` : `plus`} importante pour l'année $${barLabel}$`;
|
|
136
|
+
},
|
|
137
|
+
axisLabels: ["Année", "Production d'électricité (en TWh)"],
|
|
138
|
+
categoryProps: (() => {
|
|
139
|
+
const categoryNames = [
|
|
140
|
+
"Nucléaire",
|
|
141
|
+
"Thermique",
|
|
142
|
+
"Hydraulique",
|
|
143
|
+
"Solaire",
|
|
144
|
+
"Éolienne",
|
|
145
|
+
];
|
|
146
|
+
return categoryNames.map((name) => {
|
|
147
|
+
return {
|
|
148
|
+
name,
|
|
149
|
+
frStr: `la production d'électricité d'origine ${name.toLocaleLowerCase()}`,
|
|
150
|
+
};
|
|
151
|
+
});
|
|
152
|
+
})(),
|
|
153
|
+
barProps: (() => {
|
|
154
|
+
const labels = [...Array(30).keys()].map((i) => `${1995 + i}`);
|
|
155
|
+
return labels.map((label) => {
|
|
156
|
+
return {
|
|
157
|
+
label,
|
|
158
|
+
frStr: `l'année $${label}$`,
|
|
159
|
+
};
|
|
160
|
+
});
|
|
161
|
+
})(),
|
|
162
|
+
referenceData: [500, 450, 400, 350, 300],
|
|
163
|
+
evoRanges: [
|
|
164
|
+
{ min: 0.95, max: 1.05 },
|
|
165
|
+
{ min: 0.9, max: 1.1 },
|
|
166
|
+
{ min: 0.8, max: 1.2 },
|
|
167
|
+
{ min: 0.7, max: 1.3 },
|
|
168
|
+
{ min: 0.7, max: 1.3 },
|
|
169
|
+
],
|
|
170
|
+
},
|
|
171
|
+
];
|
|
172
|
+
const getInstruction = (identifiers) => {
|
|
173
|
+
const { barChart, questionStr } = identifiers;
|
|
174
|
+
return `${barChart.description}
|
|
175
|
+
|
|
176
|
+
${questionStr}
|
|
177
|
+
|
|
178
|
+
Légende :
|
|
179
|
+
|
|
180
|
+
${barChart.categories
|
|
181
|
+
.map((category) => {
|
|
182
|
+
return `${category.props.name} (${category.style.frStr})
|
|
183
|
+
|
|
184
|
+
`;
|
|
185
|
+
})
|
|
186
|
+
.join("")}
|
|
187
|
+
`;
|
|
188
|
+
};
|
|
189
|
+
const getAnswerCategory = (barChart, itemAsked) => {
|
|
190
|
+
const bar = barChart.bars[itemAsked.index];
|
|
191
|
+
const categIndex = bar.data
|
|
192
|
+
.map((data, i) => {
|
|
193
|
+
return { data: data, categIndex: i };
|
|
194
|
+
})
|
|
195
|
+
.toSorted((obj1, obj2) => (itemAsked.isLess ? +1 : -1) * (obj1.data - obj2.data))[itemAsked.ordinal].categIndex;
|
|
196
|
+
return barChart.categories[categIndex];
|
|
197
|
+
};
|
|
198
|
+
const getAnswerBar = (barChart, itemAsked) => {
|
|
199
|
+
const categIndex = itemAsked.index;
|
|
200
|
+
const barIndex = barChart.bars
|
|
201
|
+
.map((bar) => bar.data[categIndex])
|
|
202
|
+
.map((data, i) => {
|
|
203
|
+
return { data: data, barIndex: i };
|
|
204
|
+
})
|
|
205
|
+
.toSorted((obj1, obj2) => (itemAsked.isLess ? +1 : -1) * (obj1.data - obj2.data))[itemAsked.ordinal].barIndex;
|
|
206
|
+
return barChart.bars[barIndex];
|
|
207
|
+
};
|
|
208
|
+
const getAnswer = (identifiers) => {
|
|
209
|
+
const { barChart, itemAsked } = identifiers;
|
|
210
|
+
switch (itemAsked.type) {
|
|
211
|
+
case "categoryForX":
|
|
212
|
+
return getAnswerCategory(barChart, itemAsked).props.name;
|
|
213
|
+
case "xForCategory":
|
|
214
|
+
return getAnswerBar(barChart, itemAsked).props.label;
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
218
|
+
const { barChart, itemAsked } = identifiers;
|
|
219
|
+
const propositions = [];
|
|
220
|
+
switch (itemAsked.type) {
|
|
221
|
+
case "categoryForX":
|
|
222
|
+
{
|
|
223
|
+
addValidProp(propositions, answer, "raw");
|
|
224
|
+
barChart.categories.forEach((categ) => {
|
|
225
|
+
tryToAddWrongProp(propositions, categ.props.name, "raw");
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
break;
|
|
229
|
+
case "xForCategory":
|
|
230
|
+
{
|
|
231
|
+
addValidProp(propositions, answer, "raw");
|
|
232
|
+
barChart.bars.forEach((bar) => {
|
|
233
|
+
tryToAddWrongProp(propositions, bar.props.label, "raw");
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
break;
|
|
237
|
+
}
|
|
238
|
+
return shuffleProps(propositions, n);
|
|
239
|
+
};
|
|
240
|
+
const getHint = (identifiers) => {
|
|
241
|
+
const { barChart, itemAsked } = identifiers;
|
|
242
|
+
switch (itemAsked.type) {
|
|
243
|
+
case "categoryForX": {
|
|
244
|
+
const bar = barChart.bars[itemAsked.index];
|
|
245
|
+
return `Concentre-toi sur ${bar.props.frStr}.`;
|
|
246
|
+
}
|
|
247
|
+
case "xForCategory": {
|
|
248
|
+
const category = barChart.categories[itemAsked.index];
|
|
249
|
+
return `Concentre-toi sur les barres ${category.style.type === "color"
|
|
250
|
+
? `en ${category.style.frStr}`
|
|
251
|
+
: `en style ${category.style.frStr}`}.`;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
const getCorrection = (identifiers) => {
|
|
256
|
+
const { barChart, itemAsked, answerStr } = identifiers;
|
|
257
|
+
switch (itemAsked.type) {
|
|
258
|
+
case "categoryForX": {
|
|
259
|
+
const answerCategory = getAnswerCategory(barChart, itemAsked);
|
|
260
|
+
return `On cherche ${answerStr}.
|
|
261
|
+
${capitalize(answerStr)} est ${answerCategory.props.frStr}.`;
|
|
262
|
+
}
|
|
263
|
+
case "xForCategory": {
|
|
264
|
+
const category = barChart.categories[itemAsked.index];
|
|
265
|
+
const answerBar = getAnswerBar(barChart, itemAsked);
|
|
266
|
+
return `Comme ${category.props.frStr} est indiquée ${category.style.type === "color"
|
|
267
|
+
? `en ${category.style.frStr}`
|
|
268
|
+
: `en style ${category.style.frStr}`} sur le diagramme , on cherche ${answerStr}.
|
|
269
|
+
${capitalize(answerStr)} est ${answerBar.props.frStr}.`;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
const getGGBOptionsHorizMulti = (identifiers) => {
|
|
274
|
+
const { barChart } = identifiers;
|
|
275
|
+
const nbTotalBar = barChart.bars.length;
|
|
276
|
+
const nbTotalCateg = barChart.categories.length;
|
|
277
|
+
const yMax = Math.max(...barChart.bars.flatMap((bar) => bar.data));
|
|
278
|
+
const xMax = 3.0 * yMax;
|
|
279
|
+
function getXRangeForCategory(barIndex, categIndex) {
|
|
280
|
+
const xRangeBar = {
|
|
281
|
+
min: (xMax * (2 * barIndex + 1)) / (2 * nbTotalBar + 2),
|
|
282
|
+
max: (xMax * (2 * barIndex + 2)) / (2 * nbTotalBar + 2),
|
|
283
|
+
};
|
|
284
|
+
const progressMin = categIndex / (nbTotalCateg + 1);
|
|
285
|
+
const progressMax = (categIndex + 1) / (nbTotalCateg + 1);
|
|
286
|
+
return {
|
|
287
|
+
min: xRangeBar.min + progressMin * (xRangeBar.max - xRangeBar.min),
|
|
288
|
+
max: xRangeBar.min + progressMax * (xRangeBar.max - xRangeBar.min),
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
function createBarChartCommandsForCategory(barChart, categIndex) {
|
|
292
|
+
const arrayXRange = barChart.bars.map((_, barIndex) => getXRangeForCategory(barIndex, categIndex));
|
|
293
|
+
const arrayX = arrayXRange.map((xRange) => xRange.min);
|
|
294
|
+
const arrayY = barChart.bars.map((bar) => bar.data[categIndex]);
|
|
295
|
+
const categ = barChart.categories[categIndex];
|
|
296
|
+
const style = categ.style;
|
|
297
|
+
const B = `B_${categIndex}`;
|
|
298
|
+
const barChartCommand = [
|
|
299
|
+
`${B} = BarChart({${arrayX.join(",")}}, {${arrayY.join(",")}}, ${xMax / ((2 * nbTotalBar + 2) * (nbTotalCateg + 1))})`,
|
|
300
|
+
`ShowLabel(${B},false)`,
|
|
301
|
+
style.type === "color"
|
|
302
|
+
? `SetColor(${B}, "${barChart.categories[categIndex].style.color}")`
|
|
303
|
+
: `SetDecoration(${B}, ${barChart.categories[categIndex].style.fill})`,
|
|
304
|
+
];
|
|
305
|
+
return barChartCommand;
|
|
306
|
+
}
|
|
307
|
+
const commands = [
|
|
308
|
+
//offsetted barCharts
|
|
309
|
+
...barChart.categories.flatMap((_, categIndex) => createBarChartCommandsForCategory(barChart, categIndex)),
|
|
310
|
+
//bar labels
|
|
311
|
+
...barChart.bars.map((bar, barIndex) => `Text("\\footnotesize ${bar.props.label}", (${(xMax * (2 * barIndex + 1)) / (2 * nbTotalBar + 2)}, ${-yMax / 500}), true, true, 0, -1)`),
|
|
312
|
+
];
|
|
313
|
+
const ggb = new GeogebraConstructor({
|
|
314
|
+
commands,
|
|
315
|
+
gridDistance: [xMax, yMax],
|
|
316
|
+
fontSize: 16,
|
|
317
|
+
lockedAxesRatio: 4 / 3,
|
|
318
|
+
xAxis: {
|
|
319
|
+
hideNumbers: true,
|
|
320
|
+
steps: 10 * xMax,
|
|
321
|
+
showPositive: true,
|
|
322
|
+
label: barChart.axisLabels[0],
|
|
323
|
+
},
|
|
324
|
+
yAxis: {
|
|
325
|
+
showPositive: true,
|
|
326
|
+
label: barChart.axisLabels[1],
|
|
327
|
+
// steps: 100,
|
|
328
|
+
},
|
|
329
|
+
});
|
|
330
|
+
return ggb.getOptions({
|
|
331
|
+
coords: ggb.getAdaptedCoords({
|
|
332
|
+
xMin: 0,
|
|
333
|
+
xMax: xMax,
|
|
334
|
+
yMin: 0,
|
|
335
|
+
yMax: yMax,
|
|
336
|
+
}),
|
|
337
|
+
});
|
|
338
|
+
};
|
|
339
|
+
const getGGBOptionsVertStacked = (identifiers) => {
|
|
340
|
+
const { barChart } = identifiers;
|
|
341
|
+
const nbTotalBar = barChart.bars.length;
|
|
342
|
+
const arrayOfBarHeights = barChart.bars.map((bar) => bar.data.reduce((acc, data) => acc + data, 0));
|
|
343
|
+
const yMax = Math.max(...arrayOfBarHeights);
|
|
344
|
+
const xMax = 3.0 * yMax;
|
|
345
|
+
const xPadding = 0.1 * xMax;
|
|
346
|
+
const xMargin = xPadding;
|
|
347
|
+
const barWidth = (xMax - 2 * xMargin - (nbTotalBar - 1) * xPadding) / nbTotalBar;
|
|
348
|
+
function getXRangeForBarIndex(barIndex) {
|
|
349
|
+
const xMin = xMargin + barIndex * (xPadding + barWidth);
|
|
350
|
+
return {
|
|
351
|
+
min: xMin,
|
|
352
|
+
max: xMin + barWidth,
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
function getYRangeForCategory(barIndex, categIndex) {
|
|
356
|
+
const slice = barChart.bars[barIndex].data.slice(0, categIndex);
|
|
357
|
+
const yMinForCateg = slice.reduce((acc, data) => acc + data, 0);
|
|
358
|
+
const yMaxForCateg = yMinForCateg + barChart.bars[barIndex].data[categIndex];
|
|
359
|
+
return {
|
|
360
|
+
min: yMinForCateg,
|
|
361
|
+
max: yMaxForCateg,
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
function createCommandsForBar(barChart, barIndex) {
|
|
365
|
+
//const bar = barChart.bars[barIndex];
|
|
366
|
+
const commands = barChart.categories.flatMap((categ, categIndex) => {
|
|
367
|
+
const xRange = getXRangeForBarIndex(barIndex);
|
|
368
|
+
const yRange = getYRangeForCategory(barIndex, categIndex);
|
|
369
|
+
const style = categ.style;
|
|
370
|
+
const B = `B_{${barIndex}${categIndex}}`;
|
|
371
|
+
const barChartCommand = [
|
|
372
|
+
`${B} = Polygon((${xRange.min}, ${yRange.min}), (${xRange.min}, ${yRange.max}),(${xRange.max}, ${yRange.max}),(${xRange.max}, ${yRange.min}))`,
|
|
373
|
+
`ShowLabel(${B},false)`,
|
|
374
|
+
style.type === "color"
|
|
375
|
+
? `SetColor(${B}, "${barChart.categories[categIndex].style.color}")`
|
|
376
|
+
: `SetDecoration(${B}, ${barChart.categories[categIndex].style.fill})`,
|
|
377
|
+
];
|
|
378
|
+
return barChartCommand;
|
|
379
|
+
});
|
|
380
|
+
return commands;
|
|
381
|
+
}
|
|
382
|
+
const commands = [
|
|
383
|
+
//stacked bars
|
|
384
|
+
...barChart.bars.flatMap((_, barIndex) => createCommandsForBar(barChart, barIndex)),
|
|
385
|
+
//bar labels
|
|
386
|
+
...barChart.bars.map((bar, barIndex) => `Text("\\footnotesize ${bar.props.label}", (${getXRangeForBarIndex(barIndex).min}, ${-yMax / 500}), true, true, 0, -1)`),
|
|
387
|
+
];
|
|
388
|
+
const ggb = new GeogebraConstructor({
|
|
389
|
+
commands,
|
|
390
|
+
gridDistance: [xMax, yMax],
|
|
391
|
+
fontSize: 16,
|
|
392
|
+
lockedAxesRatio: 4 / 3,
|
|
393
|
+
xAxis: {
|
|
394
|
+
hideNumbers: true,
|
|
395
|
+
steps: 10 * xMax,
|
|
396
|
+
showPositive: true,
|
|
397
|
+
label: barChart.axisLabels[0],
|
|
398
|
+
},
|
|
399
|
+
yAxis: {
|
|
400
|
+
showPositive: true,
|
|
401
|
+
label: barChart.axisLabels[1],
|
|
402
|
+
// steps: 100,
|
|
403
|
+
},
|
|
404
|
+
});
|
|
405
|
+
return ggb.getOptions({
|
|
406
|
+
coords: ggb.getAdaptedCoords({
|
|
407
|
+
xMin: 0,
|
|
408
|
+
xMax: xMax,
|
|
409
|
+
yMin: 0,
|
|
410
|
+
yMax: yMax,
|
|
411
|
+
}),
|
|
412
|
+
});
|
|
413
|
+
};
|
|
414
|
+
const getGGBOptions = (identifiers) => {
|
|
415
|
+
const { displayType } = identifiers;
|
|
416
|
+
switch (displayType) {
|
|
417
|
+
case "horizMulti":
|
|
418
|
+
return getGGBOptionsHorizMulti(identifiers);
|
|
419
|
+
case "vertStacked":
|
|
420
|
+
return getGGBOptionsVertStacked(identifiers);
|
|
421
|
+
}
|
|
422
|
+
};
|
|
423
|
+
const getBarChartInterpretingQuestion = () => {
|
|
424
|
+
const styleType = coinFlip() ? "color" : "fill";
|
|
425
|
+
const displayType = coinFlip() ? "horizMulti" : "vertStacked";
|
|
426
|
+
let nbBars;
|
|
427
|
+
let nbCateg;
|
|
428
|
+
switch (displayType) {
|
|
429
|
+
case "horizMulti":
|
|
430
|
+
{
|
|
431
|
+
nbBars = 3;
|
|
432
|
+
nbCateg = 3;
|
|
433
|
+
}
|
|
434
|
+
break;
|
|
435
|
+
case "vertStacked":
|
|
436
|
+
{
|
|
437
|
+
nbBars = 5;
|
|
438
|
+
nbCateg = 3;
|
|
439
|
+
}
|
|
440
|
+
break;
|
|
441
|
+
}
|
|
442
|
+
const barChartSkeleton = random(arrayOfBarChartSkeleton);
|
|
443
|
+
const barChart = BarChartConstructor.randomFromSkeleton(barChartSkeleton, nbBars, nbCateg, styleType);
|
|
444
|
+
const itemAsked = random([
|
|
445
|
+
// {
|
|
446
|
+
// type: "xForCategory",
|
|
447
|
+
// isLess: coinFlip(),
|
|
448
|
+
// ordinal: probaLawFlip([
|
|
449
|
+
// [0, 0.7],
|
|
450
|
+
// [1, 0.3],
|
|
451
|
+
// ]),
|
|
452
|
+
// index: randint(0, nbCateg),
|
|
453
|
+
// },
|
|
454
|
+
{
|
|
455
|
+
type: "categoryForX",
|
|
456
|
+
isLess: coinFlip(),
|
|
457
|
+
ordinal: probaLawFlip([
|
|
458
|
+
[0, 0.7],
|
|
459
|
+
[1, 0.3],
|
|
460
|
+
]),
|
|
461
|
+
index: randint(0, nbBars),
|
|
462
|
+
},
|
|
463
|
+
]);
|
|
464
|
+
function questionStrForItemAsked(itemAsked) {
|
|
465
|
+
switch (itemAsked.type) {
|
|
466
|
+
case "xForCategory":
|
|
467
|
+
return barChartSkeleton.questionXForCategFunc(barChart.categories[itemAsked.index].props.name, itemAsked.isLess, itemAsked.ordinal);
|
|
468
|
+
case "categoryForX":
|
|
469
|
+
return barChartSkeleton.questionCategForXFunc(barChart.bars[itemAsked.index].props.label, itemAsked.isLess, itemAsked.ordinal);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
const questionStr = questionStrForItemAsked(itemAsked);
|
|
473
|
+
function answerStrForItemAsked(itemAsked) {
|
|
474
|
+
switch (itemAsked.type) {
|
|
475
|
+
case "xForCategory":
|
|
476
|
+
return barChartSkeleton.answerXForCategFunc(barChart.categories[itemAsked.index].props.name, itemAsked.isLess, itemAsked.ordinal);
|
|
477
|
+
case "categoryForX":
|
|
478
|
+
return barChartSkeleton.answerCategForXFunc(barChart.bars[itemAsked.index].props.label, itemAsked.isLess, itemAsked.ordinal);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
const answerStr = answerStrForItemAsked(itemAsked);
|
|
482
|
+
return getQuestionFromIdentifiers({
|
|
483
|
+
barChart,
|
|
484
|
+
itemAsked,
|
|
485
|
+
questionStr,
|
|
486
|
+
answerStr,
|
|
487
|
+
displayType,
|
|
488
|
+
});
|
|
489
|
+
};
|
|
490
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
491
|
+
const question = {
|
|
492
|
+
answer: getAnswer(identifiers),
|
|
493
|
+
instruction: getInstruction(identifiers),
|
|
494
|
+
keys: [],
|
|
495
|
+
answerFormat: "tex",
|
|
496
|
+
identifiers,
|
|
497
|
+
hint: getHint(identifiers),
|
|
498
|
+
correction: getCorrection(identifiers),
|
|
499
|
+
ggbOptions: getGGBOptions(identifiers),
|
|
500
|
+
};
|
|
501
|
+
return question;
|
|
502
|
+
};
|
|
503
|
+
export const barChartInterpreting = {
|
|
504
|
+
id: "barChartInterpreting",
|
|
505
|
+
label: "Interpréter un diagramme en bâtons",
|
|
506
|
+
isSingleStep: true,
|
|
507
|
+
generator: (nb, opts) => getDistinctQuestions(() => getBarChartInterpretingQuestion(opts), nb),
|
|
508
|
+
qcmTimer: 60,
|
|
509
|
+
freeTimer: 60,
|
|
510
|
+
getPropositions,
|
|
511
|
+
hasHintAndCorrection: true,
|
|
512
|
+
subject: "Mathématiques",
|
|
513
|
+
getQuestionFromIdentifiers,
|
|
514
|
+
hasGeogebra: true,
|
|
515
|
+
answerType: "QCM",
|
|
516
|
+
isQCM: true,
|
|
517
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boxPlotInterpreting.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/boxPlotInterpreting.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAgRF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAmBrD,CAAC"}
|