math-exercises 2.2.26 → 2.2.28
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/exercise.d.ts +2 -1
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/exercise.js +1 -1
- package/lib/exercises/math/calcul/addAndSub.js +1 -1
- package/lib/exercises/math/calcul/addAndSubWithoutRelatives.js +1 -1
- package/lib/exercises/math/calcul/arithmetics/commonDivisorsList.js +1 -1
- package/lib/exercises/math/calcul/arithmetics/divisibiltyCriteria.js +1 -1
- package/lib/exercises/math/calcul/arithmetics/divisorsList.js +1 -1
- package/lib/exercises/math/calcul/arithmetics/paritySumsAndProducts.js +1 -1
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.js +1 -1
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.js +1 -1
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerProduct.js +1 -1
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerSum.js +1 -1
- package/lib/exercises/math/calcul/fractions/fractionToPercentToDecimal.js +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsDivision.js +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsProduct.js +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSum.js +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.js +1 -1
- package/lib/exercises/math/calcul/fractions/simplifyFraction.js +1 -1
- package/lib/exercises/math/calcul/index.js +1 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSub.js +2 -2
- package/lib/exercises/math/calcul/mentalCaluls/mentalDivisions.js +2 -2
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplications.js +2 -2
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationsNoRelative.js +2 -2
- package/lib/exercises/math/calcul/mentalCaluls/mentalPercentage.js +2 -2
- package/lib/exercises/math/calcul/operations/expressionNature.js +1 -1
- package/lib/exercises/math/calcul/operations/operationsPriorities.js +2 -2
- package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesis.js +1 -1
- package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesisNoRelatives.js +1 -1
- package/lib/exercises/math/calcul/operations/operationsPrioritiesWithoutRelative.js +2 -2
- package/lib/exercises/math/calcul/ordering/decimalOrdering.js +1 -1
- package/lib/exercises/math/calcul/ordering/decimalOrderingNoRelatives.js +1 -1
- package/lib/exercises/math/calcul/ordering/framing.js +2 -2
- package/lib/exercises/math/calcul/ordering/integerOrdering.js +2 -2
- package/lib/exercises/math/calcul/proportionality/proportionalityTable.js +1 -1
- package/lib/exercises/math/calcul/proportionality/proportionalityTableCoefficient.js +1 -1
- package/lib/exercises/math/calcul/proportionality/scaleCalculation.js +1 -1
- package/lib/exercises/math/calcul/proportionality/scaleUsage.js +1 -1
- package/lib/exercises/math/calcul/rounding/rounding.d.ts.map +1 -1
- package/lib/exercises/math/calcul/rounding/rounding.js +5 -6
- package/lib/exercises/math/calcul/writing/index.d.ts +2 -0
- package/lib/exercises/math/calcul/writing/index.d.ts.map +1 -0
- package/lib/exercises/math/calcul/writing/index.js +17 -0
- package/lib/exercises/math/calcul/writing/numberToFrenchWriting.d.ts +7 -0
- package/lib/exercises/math/calcul/writing/numberToFrenchWriting.d.ts.map +1 -0
- package/lib/exercises/math/calcul/writing/numberToFrenchWriting.js +67 -0
- package/lib/exercises/math/calculLitteral/distributivity/allIdentities.js +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivity.js +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/firstIdentity.js +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/secondIdentity.js +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/simpleDistributivity.js +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/thirdIdentity.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationFromSentenceExercise.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationSimpleSquare.js +3 -3
- package/lib/exercises/math/calculLitteral/equation/equationType1Exercise.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType2Exercise.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType3Exercise.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/firstDegreeEquation.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/fractionEquation.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.js +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.js +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.js +2 -2
- package/lib/exercises/math/calculLitteral/factorisation/factoType2.js +1 -1
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType0.js +2 -2
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType1.js +2 -2
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType2.js +2 -2
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.js +2 -2
- package/lib/exercises/math/calculLitteral/inequations/squareFunctionInequation.js +1 -1
- package/lib/exercises/math/calculLitteral/simplifying/distributeAndSimplify.js +1 -1
- package/lib/exercises/math/calculLitteral/simplifying/evaluateExpression.js +2 -2
- package/lib/exercises/math/calculLitteral/simplifying/reduceExpression.js +1 -1
- package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.js +1 -1
- package/lib/exercises/math/calculLitteral/systems/basicSystemResolution.js +1 -1
- package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.js +1 -1
- package/lib/exercises/math/combinatory/anagrams.js +1 -1
- package/lib/exercises/math/complex/addComplex.js +1 -1
- package/lib/exercises/math/complex/argumentFromAlgebraicComplex.js +1 -1
- package/lib/exercises/math/complex/conjugateComplex.ts.js +1 -1
- package/lib/exercises/math/complex/conjugateDivideComplex.js +1 -1
- package/lib/exercises/math/complex/conjugateMultiplyComplex.js +1 -1
- package/lib/exercises/math/complex/divideComplex.js +1 -1
- package/lib/exercises/math/complex/inverseComplex.js +1 -1
- package/lib/exercises/math/complex/linearCombinaisonComplex.js +1 -1
- package/lib/exercises/math/complex/mutiplyComplex.js +1 -1
- package/lib/exercises/math/complex/reAndIm.js +2 -2
- package/lib/exercises/math/conversion/aeraConversion.js +1 -1
- package/lib/exercises/math/conversion/capacityConversion.js +1 -1
- package/lib/exercises/math/conversion/hoursToDecimal.js +1 -1
- package/lib/exercises/math/conversion/lengthConversion.js +1 -1
- package/lib/exercises/math/conversion/massConversion.js +1 -1
- package/lib/exercises/math/conversion/volumeCapacityConversion.js +2 -2
- package/lib/exercises/math/conversion/volumeConversion.js +1 -1
- package/lib/exercises/math/derivation/derivative/convexityQuadrinomials.js +1 -1
- package/lib/exercises/math/derivation/derivative/lnDerivativeTwo.js +1 -1
- package/lib/exercises/math/derivation/derivative/rootFunctionDerivative.js +1 -1
- package/lib/exercises/math/derivation/derivative/secondDegreeDerivative.js +1 -1
- package/lib/exercises/math/derivation/derivative/thirdDegreeFunctionVariation.js +2 -2
- package/lib/exercises/math/derivation/tangent/derivativeNumberReading.js +1 -1
- package/lib/exercises/math/derivation/tangent/derivativeTangentEquationReading.js +1 -1
- package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.js +2 -2
- package/lib/exercises/math/equaDiff/equaDiffGeneralForme.js +1 -1
- package/lib/exercises/math/equaDiff/equaDiffGeneralFormeWithIC.js +1 -1
- package/lib/exercises/math/functions/absolute/absoluteValueEquations.js +2 -2
- package/lib/exercises/math/functions/absolute/absoluteValueInequations.js +1 -1
- package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.js +1 -1
- package/lib/exercises/math/functions/affines/leadingCoeffAndOriginOrdinate.js +1 -1
- package/lib/exercises/math/functions/affines/leadingCoefficient.js +1 -1
- package/lib/exercises/math/functions/affines/leadingCoefficientCalculV1.js +1 -1
- package/lib/exercises/math/functions/affines/leadingCoefficientCalculV2.js +1 -1
- package/lib/exercises/math/functions/affines/signFunction.js +2 -2
- package/lib/exercises/math/functions/basics/graphicEquation.js +1 -1
- package/lib/exercises/math/functions/basics/graphicInequation.js +1 -1
- package/lib/exercises/math/functions/basics/imageFunction.js +2 -2
- package/lib/exercises/math/functions/basics/imageFunctionGeogebra.js +2 -2
- package/lib/exercises/math/functions/basics/inverseImageFunction.js +1 -1
- package/lib/exercises/math/functions/basics/inverseImageFunctionGeogebra.js +2 -2
- package/lib/exercises/math/functions/basics/inverseImageFunctionTable.js +3 -3
- package/lib/exercises/math/functions/basics/twoFunctionsEquation.js +2 -2
- package/lib/exercises/math/functions/basics/twoFunctionsInequation.js +2 -2
- package/lib/exercises/math/functions/cube/cubicEquation.js +1 -1
- package/lib/exercises/math/functions/exponential/expEquation.js +1 -1
- package/lib/exercises/math/functions/exponential/expSimplifiying.js +1 -1
- package/lib/exercises/math/functions/integral/integralExpU.js +1 -1
- package/lib/exercises/math/functions/integral/integralFractions.js +1 -1
- package/lib/exercises/math/functions/logarithm/log10Simplifying.js +1 -1
- package/lib/exercises/math/functions/logarithm/logEquation.js +1 -1
- package/lib/exercises/math/functions/logarithm/logSimplifiying.js +2 -2
- package/lib/exercises/math/functions/parity/parityFromAlgebra.js +3 -3
- package/lib/exercises/math/functions/parity/parityFromGraph.js +3 -3
- package/lib/exercises/math/functions/rationalFraction/rationalFractionForbiddenValue.js +1 -1
- package/lib/exercises/math/functions/trinoms/alphaBetaFromDevForm.js +2 -2
- package/lib/exercises/math/functions/trinoms/alphaBetaInCanonicalForm.js +2 -2
- package/lib/exercises/math/functions/trinoms/canonicalFromDevForm.js +1 -1
- package/lib/exercises/math/functions/trinoms/deltaTrinom.js +1 -1
- package/lib/exercises/math/functions/trinoms/extremumFromCanonicalForm.js +1 -1
- package/lib/exercises/math/functions/trinoms/extremumTypeFromAlgebricForm.js +2 -2
- package/lib/exercises/math/functions/trinoms/factorizedFormFromRoots.js +1 -1
- package/lib/exercises/math/functions/trinoms/niceRootsFromDevForm.js +1 -1
- package/lib/exercises/math/functions/trinoms/rootsFromDevForm.js +1 -1
- package/lib/exercises/math/functions/trinoms/rootsFromFactorizedForm.js +1 -1
- package/lib/exercises/math/functions/trinoms/solveSecondDegreeEquationByFactorisation.js +1 -1
- package/lib/exercises/math/functions/trinoms/variationsFromAlgebricForm.js +2 -2
- package/lib/exercises/math/geometry/areas/circleArea.js +2 -2
- package/lib/exercises/math/geometry/areas/rectangleArea.js +1 -1
- package/lib/exercises/math/geometry/areas/rightTriangleArea.js +1 -1
- package/lib/exercises/math/geometry/areas/squareArea.js +1 -1
- package/lib/exercises/math/geometry/areas/triangleArea.js +1 -1
- package/lib/exercises/math/geometry/areas/triangleAreaV2.js +1 -1
- package/lib/exercises/math/geometry/cartesian/drawAlineInGGB.js +1 -1
- package/lib/exercises/math/geometry/cartesian/index.d.ts +4 -0
- package/lib/exercises/math/geometry/cartesian/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/index.js +4 -0
- package/lib/exercises/math/geometry/cartesian/midpoint.js +1 -1
- package/lib/exercises/math/geometry/cartesian/placeAPoint.js +1 -1
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnLine.d.ts +13 -0
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnLine.d.ts.map +1 -0
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnLine.js +133 -0
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.d.ts +13 -0
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.d.ts.map +1 -0
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.js +132 -0
- package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoOrthonorm.js +1 -1
- package/lib/exercises/math/geometry/cartesian/readAbscissOnLine.d.ts +13 -0
- package/lib/exercises/math/geometry/cartesian/readAbscissOnLine.d.ts.map +1 -0
- package/lib/exercises/math/geometry/cartesian/readAbscissOnLine.js +152 -0
- package/lib/exercises/math/geometry/cartesian/readAbscissOnSemiLine.d.ts +13 -0
- package/lib/exercises/math/geometry/cartesian/readAbscissOnSemiLine.d.ts.map +1 -0
- package/lib/exercises/math/geometry/cartesian/readAbscissOnSemiLine.js +153 -0
- package/lib/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.js +1 -1
- package/lib/exercises/math/geometry/convexity/convexityTrinomialsGeo.js +1 -1
- package/lib/exercises/math/geometry/perimeters/circleCircumference.js +2 -2
- package/lib/exercises/math/geometry/perimeters/rectanglePerimeter.js +1 -1
- package/lib/exercises/math/geometry/perimeters/squarePerimeter.js +1 -1
- package/lib/exercises/math/geometry/perimeters/trianglePerimeter.js +1 -1
- package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.js +2 -2
- package/lib/exercises/math/geometry/thales/thales.js +1 -1
- package/lib/exercises/math/geometry/thales/thalesCalcul.js +2 -2
- package/lib/exercises/math/geometry/vectors/alignementViaColinearity.js +2 -2
- package/lib/exercises/math/geometry/vectors/chasles.js +2 -2
- package/lib/exercises/math/geometry/vectors/colinearity.js +2 -2
- package/lib/exercises/math/geometry/vectors/determinant.js +1 -1
- package/lib/exercises/math/geometry/vectors/equalCaracteristicFromGraph.js +2 -2
- package/lib/exercises/math/geometry/vectors/fourthParallelogramPoint.js +1 -1
- package/lib/exercises/math/geometry/vectors/paralellismViaColinearity.js +2 -2
- package/lib/exercises/math/geometry/vectors/parallelogramViaEqualVectors.js +2 -2
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.js +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCoords.js +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCos.js +1 -1
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithSquareOrRectBase.js +1 -1
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleBase.js +1 -1
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleRectBase.js +1 -1
- package/lib/exercises/math/limits/limitReading.js +1 -1
- package/lib/exercises/math/limits/polynomLimit.js +2 -2
- package/lib/exercises/math/limits/polynomLimitNoFI.js +2 -2
- package/lib/exercises/math/limits/rationalFracForbiddenValueLimit.js +1 -1
- package/lib/exercises/math/limits/rationalFracLimit.js +2 -2
- package/lib/exercises/math/limits/sequencePolynomLimit.js +1 -1
- package/lib/exercises/math/limits/sequencePolynomNoFILimit.js +1 -1
- package/lib/exercises/math/limits/sequencePolynomProductLimit.js +1 -1
- package/lib/exercises/math/limits/sequenceRationalFracLimit.js +1 -1
- package/lib/exercises/math/percent/applyPercent.js +2 -2
- package/lib/exercises/math/percent/averageEvolutionRate.js +1 -1
- package/lib/exercises/math/percent/cmToEvolution.js +1 -1
- package/lib/exercises/math/percent/evolutionRateFromValues.d.ts +8 -0
- package/lib/exercises/math/percent/evolutionRateFromValues.d.ts.map +1 -0
- package/lib/exercises/math/percent/evolutionRateFromValues.js +71 -0
- package/lib/exercises/math/percent/findStartValueAfterEvolution.d.ts +8 -0
- package/lib/exercises/math/percent/findStartValueAfterEvolution.d.ts.map +1 -0
- package/lib/exercises/math/percent/findStartValueAfterEvolution.js +65 -0
- package/lib/exercises/math/percent/findTVA.js +2 -2
- package/lib/exercises/math/percent/globalPercent.js +1 -1
- package/lib/exercises/math/percent/htToTTC.js +2 -2
- package/lib/exercises/math/percent/index.d.ts +4 -0
- package/lib/exercises/math/percent/index.d.ts.map +1 -1
- package/lib/exercises/math/percent/index.js +4 -0
- package/lib/exercises/math/percent/isTableProportional.js +1 -1
- package/lib/exercises/math/percent/percentToDecimal.d.ts.map +1 -1
- package/lib/exercises/math/percent/percentToDecimal.js +70 -27
- package/lib/exercises/math/percent/populationEffectifFromSubPopulation.d.ts +9 -0
- package/lib/exercises/math/percent/populationEffectifFromSubPopulation.d.ts.map +1 -0
- package/lib/exercises/math/percent/populationEffectifFromSubPopulation.js +93 -0
- package/lib/exercises/math/percent/reciprocalPercentage.js +2 -2
- package/lib/exercises/math/percent/subPopulationEffectifFromPercent.d.ts +9 -0
- package/lib/exercises/math/percent/subPopulationEffectifFromPercent.d.ts.map +1 -0
- package/lib/exercises/math/percent/subPopulationEffectifFromPercent.js +85 -0
- package/lib/exercises/math/percent/ttcToHT.js +2 -2
- package/lib/exercises/math/powers/decimalToScientific.js +1 -1
- package/lib/exercises/math/powers/powersDivision.js +1 -1
- package/lib/exercises/math/powers/powersOfTenToDecimal.js +1 -1
- package/lib/exercises/math/powers/powersProduct.js +1 -1
- package/lib/exercises/math/primitive/constantPrimitive.js +1 -1
- package/lib/exercises/math/primitive/logarithmePrimitive.js +1 -1
- package/lib/exercises/math/primitive/polynomialPrimitive.js +1 -1
- package/lib/exercises/math/primitive/sinCosPrimitive.js +2 -2
- package/lib/exercises/math/primitive/sinUCosUPrimitive.js +2 -2
- package/lib/exercises/math/probaStat/cardBasicProbas.js +2 -2
- package/lib/exercises/math/probaStat/conditionalProbability.js +1 -1
- package/lib/exercises/math/probaStat/diceBasicProbas.js +2 -2
- package/lib/exercises/math/probaStat/independancy.js +2 -2
- package/lib/exercises/math/probaStat/issuesCountingForCards.js +3 -3
- package/lib/exercises/math/probaStat/probaFromTableNoContext.js +1 -1
- package/lib/exercises/math/probaStat/probaFromTableWithContext.js +1 -1
- package/lib/exercises/math/probaStat/probabilityTree.js +1 -1
- package/lib/exercises/math/probaStat/stats1var/averageWithTable.js +1 -1
- package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.js +2 -1
- package/lib/exercises/math/probaStat/stats1var/median.js +1 -1
- package/lib/exercises/math/probaStat/stats1var/quartiles.js +1 -1
- package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.js +1 -1
- package/lib/exercises/math/python/pyForLoop1Exercise.js +2 -2
- package/lib/exercises/math/python/pyNestedForLoopExercise.js +1 -1
- package/lib/exercises/math/python/pyWhileLoop1Exercise.js +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticExplicitFormulaUsage.js +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormula.js +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplictFormulaFirstTermRandom.js +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindReason.js +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindReasonRandomRange.js +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindTerm.js +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticFirstTermsSum.js +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticReasonUsage.js +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticRecurrenceFormulaUsage.js +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticThresholdFind.js +1 -1
- package/lib/exercises/math/sequences/arithmetic/firstIntegersSum.js +1 -1
- package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromFirstTerms.js +2 -2
- package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromGraph.js +2 -2
- package/lib/exercises/math/sequences/geometric/geometricExplicitFormulaUsage.js +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormula.js +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstTermRandom.js +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFindReason.js +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFindTerm.js +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.js +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFirstTermsSum.js +1 -1
- package/lib/exercises/math/sequences/geometric/geometricReasonUsage.js +1 -1
- package/lib/exercises/math/sequences/geometric/geometricRecurrenceFormulaUsage.js +1 -1
- package/lib/exercises/math/sequences/sequencePlot.js +1 -1
- package/lib/exercises/math/sets/intervals/inequalityToInterval.js +1 -1
- package/lib/exercises/math/sets/intervals/intervalToInequality.js +1 -1
- package/lib/exercises/math/sets/intervals/intervalsIntersection.js +1 -1
- package/lib/exercises/math/sets/intervals/intervalsUnion.js +1 -1
- package/lib/exercises/math/sets/setBelonging.js +2 -2
- package/lib/exercises/math/squareRoots/simpifySquareRoot.js +1 -1
- package/lib/exercises/math/squareRoots/squareRootEquation.js +1 -1
- package/lib/exercises/math/squareRoots/squareRootIdentities.js +2 -2
- package/lib/exercises/math/squareRoots/squareRootsSum.js +1 -1
- package/lib/exercises/math/trigonometry/arcLength.d.ts +10 -0
- package/lib/exercises/math/trigonometry/arcLength.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/arcLength.js +92 -0
- package/lib/exercises/math/trigonometry/associatePoint.js +1 -1
- package/lib/exercises/math/trigonometry/basicEquationCos.d.ts +7 -0
- package/lib/exercises/math/trigonometry/basicEquationCos.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/basicEquationCos.js +94 -0
- package/lib/exercises/math/trigonometry/basicEquationSin.d.ts +7 -0
- package/lib/exercises/math/trigonometry/basicEquationSin.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/basicEquationSin.js +106 -0
- package/lib/exercises/math/trigonometry/basicTrigoSystemEquation.d.ts +7 -0
- package/lib/exercises/math/trigonometry/basicTrigoSystemEquation.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/basicTrigoSystemEquation.js +85 -0
- package/lib/exercises/math/trigonometry/calculateCosSinAndTan.js +1 -1
- package/lib/exercises/math/trigonometry/degreeToRadians.d.ts +9 -0
- package/lib/exercises/math/trigonometry/degreeToRadians.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/degreeToRadians.js +125 -0
- package/lib/exercises/math/trigonometry/index.d.ts +6 -0
- package/lib/exercises/math/trigonometry/index.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/index.js +6 -0
- package/lib/exercises/math/trigonometry/mainAngleMeasure.d.ts +9 -0
- package/lib/exercises/math/trigonometry/mainAngleMeasure.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/mainAngleMeasure.js +91 -0
- package/lib/exercises/math/trigonometry/mainRemarkableValues.js +2 -2
- package/lib/exercises/math/trigonometry/remarkableValues.js +3 -3
- package/lib/exercises/math/trigonometry/trigonometry.js +1 -1
- package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.js +1 -1
- package/lib/exercises/math/trigonometry/trigonometrySideCalcul.js +1 -1
- package/lib/exercises/pc/calibrationCurveOfSolution.js +2 -2
- package/lib/exercises/pc/chemicalElements/atomicStructureOfNucleus.js +1 -1
- package/lib/exercises/pc/chemicalElements/calculateProtonsNumberFromMass.js +2 -2
- package/lib/exercises/pc/chemicalElements/findAtomEntitiesNumberFromMass.js +1 -1
- package/lib/exercises/pc/chemicalElements/findAtomicStructureElement.js +1 -1
- package/lib/exercises/pc/chemicalElements/findValenceElectronsNumberFromElectronicConfiguration.js +1 -1
- package/lib/exercises/pc/chemicalElements/findValenceElectronsNumberFromTable.js +1 -1
- package/lib/exercises/pc/chemicalElements/identifyRightElectronicConfiguration.js +1 -1
- package/lib/exercises/pc/chemicalElements/massOrVolumeProportion.js +2 -2
- package/lib/exercises/pc/chemicalEquations.js +1 -1
- package/lib/exercises/pc/chemicalReactions/calculateCombustionEnergy.js +1 -1
- package/lib/exercises/pc/chemicalReactions/identifyStoichiometricMixture.js +1 -1
- package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.js +1 -1
- package/lib/exercises/pc/chemicalReactions/titrationEquivalenceRelation.js +1 -1
- package/lib/exercises/pc/chemicalReactionsProduct.js +1 -1
- package/lib/exercises/pc/delution.js +1 -1
- package/lib/exercises/pc/dosage/beerLambertRandomValue.js +1 -1
- package/lib/exercises/pc/electricity/calculateIntensityInSerieOrParallel.js +1 -1
- package/lib/exercises/pc/electricity/calculateVoltage.js +1 -1
- package/lib/exercises/pc/electricity/electricEnergyFromPower.js +1 -1
- package/lib/exercises/pc/electricity/electricPowerOrEnergyCalculation.js +2 -2
- package/lib/exercises/pc/electricity/kirchhoffVoltageLaw.js +1 -1
- package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.js +1 -1
- package/lib/exercises/pc/energy/kineticEnergyOrMassOrSpeed.js +2 -2
- package/lib/exercises/pc/fluids/mariotte.js +1 -1
- package/lib/exercises/pc/forces/calculateNormalOrFrictionForce.js +1 -1
- package/lib/exercises/pc/forces/forceWork.js +1 -1
- package/lib/exercises/pc/forces/massWeight.js +1 -1
- package/lib/exercises/pc/forces/pressingForce.js +1 -1
- package/lib/exercises/pc/formulaFromComposition.js +1 -1
- package/lib/exercises/pc/identifyAtomicMassOrAtomicNb.js +2 -2
- package/lib/exercises/pc/kineticEnergy.js +1 -1
- package/lib/exercises/pc/math/isolateVariables.js +1 -1
- package/lib/exercises/pc/math/proportionnalityCoeffFromLine.js +1 -1
- package/lib/exercises/pc/molarQuantity.js +1 -1
- package/lib/exercises/pc/mole/molarMass.js +1 -1
- package/lib/exercises/pc/mole/moleculeCountFromMassAndAvogadro.js +1 -1
- package/lib/exercises/pc/moleculeFormula.js +1 -1
- package/lib/exercises/pc/moleculeNomenclature.js +1 -1
- package/lib/exercises/pc/motion/averageSpeed.d.ts.map +1 -1
- package/lib/exercises/pc/motion/characteristicsOfVelocityVector.js +1 -1
- package/lib/exercises/pc/motion/motionReference.js +1 -1
- package/lib/exercises/pc/motion/typeOfAcceleration.js +1 -1
- package/lib/exercises/pc/motion/typeOfMovement.js +1 -1
- package/lib/exercises/pc/pH.js +1 -1
- package/lib/exercises/pc/perceivedFrequency.js +1 -1
- package/lib/exercises/pc/potentialEnergy.js +1 -1
- package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.js +1 -1
- package/lib/exercises/pc/snellDescartes.js +1 -1
- package/lib/exercises/pc/sound/findPeriodFromGraph.js +1 -1
- package/lib/exercises/pc/sound/findPeriodOrFrequencyFromGraph.js +1 -1
- package/lib/exercises/pc/sound/frequencyComparison.js +1 -1
- package/lib/exercises/pc/waves/lightDistanceConversion.js +1 -1
- package/lib/exercises/pc/waves/periodicWaveCelerity.js +1 -1
- package/lib/exercises/pc/weight/weightOnTheMoon.js +1 -1
- package/lib/exercises/utils/getDistinctQuestions.d.ts +1 -1
- package/lib/exercises/utils/getDistinctQuestions.d.ts.map +1 -1
- package/lib/exercises/utils/getDistinctQuestions.js +11 -5
- package/lib/geogebra/colors.js +1 -1
- package/lib/geogebra/geogebraConstructor.js +1 -1
- package/lib/geogebra/parsers/ggbPointToCoords.d.ts +5 -0
- package/lib/geogebra/parsers/ggbPointToCoords.d.ts.map +1 -0
- package/lib/geogebra/parsers/ggbPointToCoords.js +12 -0
- package/lib/geogebra/parsers/parseGGBPoints.d.ts +2 -0
- package/lib/geogebra/parsers/parseGGBPoints.d.ts.map +1 -0
- package/lib/geogebra/parsers/parseGGBPoints.js +10 -0
- package/lib/index.d.ts +61 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/line.d.ts.map +1 -1
- package/lib/math/geometry/line.js +0 -1
- package/lib/math/inequations/inequation.js +1 -1
- package/lib/math/numbers/decimals/decimal.d.ts +1 -0
- package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
- package/lib/math/numbers/decimals/decimal.js +10 -0
- package/lib/math/numbers/integer/integer.d.ts +2 -0
- package/lib/math/numbers/integer/integer.d.ts.map +1 -1
- package/lib/math/numbers/integer/integer.js +10 -1
- package/lib/math/numbers/nombre.js +1 -1
- package/lib/math/numbers/rationals/rational.js +3 -3
- package/lib/math/numbers/reals/real.js +2 -2
- package/lib/math/polynomials/polynomial.js +1 -1
- package/lib/math/polynomials/trinom.js +1 -1
- package/lib/math/sequences/geometricSequence.d.ts +2 -2
- package/lib/math/sequences/geometricSequence.d.ts.map +1 -1
- package/lib/math/sequences/geometricSequence.js +13 -11
- package/lib/math/sets/discreteSet.d.ts +2 -2
- package/lib/math/sets/discreteSet.d.ts.map +1 -1
- package/lib/math/sets/discreteSet.js +4 -4
- package/lib/math/sets/intervals/intervals.js +1 -1
- package/lib/math/trigonometry/remarkableValue.js +1 -1
- package/lib/math/trigonometry/remarkableValues.d.ts +3 -0
- package/lib/math/trigonometry/remarkableValues.d.ts.map +1 -1
- package/lib/math/trigonometry/remarkableValues.js +72 -1
- package/lib/math/utils/random/randTupleInt.js +1 -1
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +1 -10
- package/lib/tree/nodes/equations/multiEqualNode.js +2 -2
- package/lib/tree/nodes/geometry/degree.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/degree.js +3 -2
- package/lib/tree/nodes/geometry/pointNode.js +1 -1
- package/lib/tree/nodes/inequations/inequationNode.js +1 -1
- package/lib/tree/nodes/operators/addNode.js +3 -3
- package/lib/tree/nodes/operators/divideNode.js +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +3 -3
- package/lib/tree/nodes/operators/substractNode.js +1 -1
- package/lib/tree/nodes/sets/discreteSetNode.d.ts +1 -0
- package/lib/tree/nodes/sets/discreteSetNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/discreteSetNode.js +8 -2
- package/lib/tree/nodes/sets/intervalNode.js +1 -1
- package/lib/tree/nodes/sets/unionIntervalNode.js +2 -2
- package/lib/tree/parsers/euroParser.d.ts +2 -0
- package/lib/tree/parsers/euroParser.d.ts.map +1 -0
- package/lib/tree/parsers/euroParser.js +12 -0
- package/lib/tree/parsers/percentParser.d.ts +1 -0
- package/lib/tree/parsers/percentParser.d.ts.map +1 -1
- package/lib/tree/parsers/percentParser.js +11 -0
- package/lib/utils/alea/coinFlip.d.ts +2 -0
- package/lib/utils/alea/coinFlip.d.ts.map +1 -0
- package/lib/utils/alea/coinFlip.js +7 -0
- package/lib/utils/alea/diceFlip.d.ts +2 -0
- package/lib/utils/alea/diceFlip.d.ts.map +1 -0
- package/lib/utils/alea/diceFlip.js +8 -0
- package/lib/utils/alea/probaFlip.d.ts +7 -0
- package/lib/utils/alea/probaFlip.d.ts.map +1 -0
- package/lib/utils/alea/probaFlip.js +12 -0
- package/lib/utils/alea/probaLawFlip.d.ts +7 -0
- package/lib/utils/alea/probaLawFlip.d.ts.map +1 -0
- package/lib/utils/alea/probaLawFlip.js +24 -0
- package/lib/utils/alea/random.d.ts +2 -0
- package/lib/utils/alea/random.d.ts.map +1 -0
- package/lib/utils/alea/random.js +7 -0
- package/lib/utils/alea/randomEnumValue.d.ts +2 -0
- package/lib/utils/alea/randomEnumValue.d.ts.map +1 -0
- package/lib/utils/alea/randomEnumValue.js +9 -0
- package/lib/utils/alea/shuffle.d.ts +2 -0
- package/lib/utils/alea/shuffle.d.ts.map +1 -0
- package/lib/utils/alea/shuffle.js +15 -0
- package/lib/utils/arrays/arrayEqual.d.ts +2 -0
- package/lib/utils/arrays/arrayEqual.d.ts.map +1 -0
- package/lib/utils/arrays/arrayEqual.js +13 -0
- package/lib/utils/arrays/arrayHasSameElement.d.ts +2 -0
- package/lib/utils/arrays/arrayHasSameElement.d.ts.map +1 -0
- package/lib/utils/arrays/arrayHasSameElement.js +8 -0
- package/lib/utils/arrays/cartesianProducts.d.ts +13 -0
- package/lib/utils/arrays/cartesianProducts.d.ts.map +1 -0
- package/lib/utils/arrays/cartesianProducts.js +64 -0
- package/lib/utils/arrays/enumToArray.d.ts +8 -0
- package/lib/utils/arrays/enumToArray.d.ts.map +1 -0
- package/lib/utils/arrays/enumToArray.js +16 -0
- package/lib/utils/arrays/permutations.d.ts +2 -0
- package/lib/utils/arrays/permutations.d.ts.map +1 -0
- package/lib/utils/arrays/permutations.js +21 -0
- package/lib/utils/latex/alignTex.d.ts +1 -1
- package/lib/utils/latex/alignTex.d.ts.map +1 -1
- package/lib/utils/latex/alignTex.js +3 -3
- package/lib/utils/strings/frenchNumbers.d.ts +6 -0
- package/lib/utils/strings/frenchNumbers.d.ts.map +1 -0
- package/lib/utils/strings/frenchNumbers.js +50 -0
- package/lib/utils/strings/numberToFrenchWord.d.ts +2 -0
- package/lib/utils/strings/numberToFrenchWord.d.ts.map +1 -0
- package/lib/utils/strings/numberToFrenchWord.js +81 -0
- package/package.json +1 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.evolutionRateFromValues = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const randfloat_1 = require("../../../math/utils/random/randfloat");
|
|
7
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
|
+
const round_1 = require("../../../math/utils/round");
|
|
9
|
+
const percentParser_1 = require("../../../tree/parsers/percentParser");
|
|
10
|
+
const coinFlip_1 = require("../../../utils/alea/coinFlip");
|
|
11
|
+
const doWhile_1 = require("../../../utils/doWhile");
|
|
12
|
+
const getPropositions = (n, { answer, vd, vf }) => {
|
|
13
|
+
const propositions = [];
|
|
14
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
15
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, getAnswer({
|
|
16
|
+
vd: vf,
|
|
17
|
+
vf: vd,
|
|
18
|
+
}));
|
|
19
|
+
while (propositions.length < n) {
|
|
20
|
+
const sign = vf > vd ? 1 : -1;
|
|
21
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (sign * (0, randfloat_1.randfloat)(1, 100, 2)).frenchify() + "\\%");
|
|
22
|
+
}
|
|
23
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
24
|
+
};
|
|
25
|
+
const getAnswer = (identifiers) => {
|
|
26
|
+
const taux = (0, round_1.round)(((identifiers.vf - identifiers.vd) / identifiers.vd) * 100, 2);
|
|
27
|
+
return taux.frenchify() + "\\%";
|
|
28
|
+
};
|
|
29
|
+
const getInstruction = (identifiers) => {
|
|
30
|
+
return `Un prix passe de $${identifiers.vd.frenchify()}€$ à $${identifiers.vf.frenchify()}€$. Quel est le taux d'évolution du prix, en pourcentage ? Arrondir au centième de pourcentage.`;
|
|
31
|
+
};
|
|
32
|
+
// const getHint: GetHint<Identifiers> = (identifiers) => {};
|
|
33
|
+
// const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
|
|
34
|
+
const getKeys = (identifiers) => {
|
|
35
|
+
return ["percent"];
|
|
36
|
+
};
|
|
37
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
38
|
+
return (0, percentParser_1.percentParser)(ans) === answer;
|
|
39
|
+
};
|
|
40
|
+
const getEvolutionRateFromValuesQuestion = () => {
|
|
41
|
+
const vd = (0, coinFlip_1.coinFlip)() ? (0, randint_1.randint)(1, 100) : (0, randfloat_1.randfloat)(1, 100, 2);
|
|
42
|
+
const vf = (0, doWhile_1.doWhile)(() => ((0, coinFlip_1.coinFlip)() ? (0, randint_1.randint)(1, 100) : (0, randfloat_1.randfloat)(1, 100, 2)), (x) => x === vd);
|
|
43
|
+
const identifiers = {
|
|
44
|
+
vf,
|
|
45
|
+
vd,
|
|
46
|
+
};
|
|
47
|
+
const question = {
|
|
48
|
+
answer: getAnswer(identifiers),
|
|
49
|
+
instruction: getInstruction(identifiers),
|
|
50
|
+
keys: getKeys(identifiers),
|
|
51
|
+
answerFormat: "tex",
|
|
52
|
+
identifiers,
|
|
53
|
+
// hint: getHint(identifiers),
|
|
54
|
+
// correction: getCorrection(identifiers),
|
|
55
|
+
};
|
|
56
|
+
return question;
|
|
57
|
+
};
|
|
58
|
+
exports.evolutionRateFromValues = {
|
|
59
|
+
id: "evolutionRateFromValues",
|
|
60
|
+
connector: "=",
|
|
61
|
+
label: "Calculer un taux d'évolution",
|
|
62
|
+
isSingleStep: true,
|
|
63
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getEvolutionRateFromValuesQuestion, nb),
|
|
64
|
+
qcmTimer: 60,
|
|
65
|
+
freeTimer: 60,
|
|
66
|
+
ggbTimer: 60,
|
|
67
|
+
getPropositions,
|
|
68
|
+
isAnswerValid,
|
|
69
|
+
subject: "Mathématiques",
|
|
70
|
+
getAnswer,
|
|
71
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
vf: number;
|
|
4
|
+
percentRate: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const findStartValueAfterEvolution: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=findStartValueAfterEvolution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findStartValueAfterEvolution.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/findStartValueAfterEvolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AA6DF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAe9D,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.findStartValueAfterEvolution = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const randfloat_1 = require("../../../math/utils/random/randfloat");
|
|
7
|
+
const round_1 = require("../../../math/utils/round");
|
|
8
|
+
const euroParser_1 = require("../../../tree/parsers/euroParser");
|
|
9
|
+
const getPropositions = (n, { answer, percentRate, vf }) => {
|
|
10
|
+
const propositions = [];
|
|
11
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
12
|
+
const invCm = 1 - percentRate / 100;
|
|
13
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)(vf * invCm, 2).frenchify() + "€");
|
|
14
|
+
while (propositions.length < n) {
|
|
15
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)((0, randfloat_1.randfloat)(1, 100, 2), 2).frenchify() + "€");
|
|
16
|
+
}
|
|
17
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
18
|
+
};
|
|
19
|
+
const getAnswer = (identifiers) => {
|
|
20
|
+
const cm = 1 + identifiers.percentRate / 100;
|
|
21
|
+
const vd = (0, round_1.round)(identifiers.vf / cm, 2);
|
|
22
|
+
return vd.frenchify() + "€";
|
|
23
|
+
};
|
|
24
|
+
const getInstruction = (identifiers) => {
|
|
25
|
+
const evolution = identifiers.percentRate < 0 ? "baisse" : "hausse";
|
|
26
|
+
return `Après une ${evolution} de $${identifiers.percentRate.frenchify()}\\%$, le prix d'un objet est de $${identifiers.vf.frenchify()}€$. Quel était son prix initial ? Arrondir au centième.`;
|
|
27
|
+
};
|
|
28
|
+
// const getHint: GetHint<Identifiers> = (identifiers) => {};
|
|
29
|
+
// const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
|
|
30
|
+
const getKeys = (identifiers) => {
|
|
31
|
+
return ["euro"];
|
|
32
|
+
};
|
|
33
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
34
|
+
return (0, euroParser_1.euroParser)(ans) === answer;
|
|
35
|
+
};
|
|
36
|
+
const getFindStartValueAfterEvolutionQuestion = () => {
|
|
37
|
+
const vf = (0, randfloat_1.randfloat)(1, 100, 2);
|
|
38
|
+
const percentRate = (0, randfloat_1.randfloat)(-100, 100, 2, [0]);
|
|
39
|
+
const identifiers = {
|
|
40
|
+
vf,
|
|
41
|
+
percentRate,
|
|
42
|
+
};
|
|
43
|
+
const question = {
|
|
44
|
+
answer: getAnswer(identifiers),
|
|
45
|
+
instruction: getInstruction(identifiers),
|
|
46
|
+
keys: getKeys(identifiers),
|
|
47
|
+
answerFormat: "tex",
|
|
48
|
+
identifiers,
|
|
49
|
+
};
|
|
50
|
+
return question;
|
|
51
|
+
};
|
|
52
|
+
exports.findStartValueAfterEvolution = {
|
|
53
|
+
id: "findStartValueAfterEvolution",
|
|
54
|
+
connector: "=",
|
|
55
|
+
label: "Retrouver un prix initial à partir du prix final et du taux d'évolution",
|
|
56
|
+
isSingleStep: true,
|
|
57
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getFindStartValueAfterEvolutionQuestion, nb),
|
|
58
|
+
qcmTimer: 60,
|
|
59
|
+
freeTimer: 60,
|
|
60
|
+
ggbTimer: 60,
|
|
61
|
+
getPropositions,
|
|
62
|
+
isAnswerValid,
|
|
63
|
+
subject: "Mathématiques",
|
|
64
|
+
getAnswer,
|
|
65
|
+
};
|
|
@@ -7,9 +7,9 @@ const randfloat_1 = require("../../../math/utils/random/randfloat");
|
|
|
7
7
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
8
|
const round_1 = require("../../../math/utils/round");
|
|
9
9
|
const numberParser_1 = require("../../../tree/parsers/numberParser");
|
|
10
|
-
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
10
|
+
const coinFlip_1 = require("../../../utils/alea/coinFlip");
|
|
11
11
|
const alignTex_1 = require("../../../utils/latex/alignTex");
|
|
12
|
-
const random_1 = require("../../../utils/random");
|
|
12
|
+
const random_1 = require("../../../utils/alea/random");
|
|
13
13
|
const getPropositions = (n, { answer }) => {
|
|
14
14
|
const propositions = [];
|
|
15
15
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
@@ -4,7 +4,7 @@ exports.globalPercent = void 0;
|
|
|
4
4
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
5
5
|
const exercise_1 = require("../../exercise");
|
|
6
6
|
const getDistinctQuestions_1 = require("../../utils/getDistinctQuestions");
|
|
7
|
-
const shuffle_1 = require("../../../utils/shuffle");
|
|
7
|
+
const shuffle_1 = require("../../../utils/alea/shuffle");
|
|
8
8
|
const round_1 = require("../../../math/utils/round");
|
|
9
9
|
const getGlobalPercentQuestion = () => {
|
|
10
10
|
const tab = ["hausse", "baisse"];
|
|
@@ -7,8 +7,8 @@ const randfloat_1 = require("../../../math/utils/random/randfloat");
|
|
|
7
7
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
8
|
const round_1 = require("../../../math/utils/round");
|
|
9
9
|
const numberParser_1 = require("../../../tree/parsers/numberParser");
|
|
10
|
-
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
11
|
-
const random_1 = require("../../../utils/random");
|
|
10
|
+
const coinFlip_1 = require("../../../utils/alea/coinFlip");
|
|
11
|
+
const random_1 = require("../../../utils/alea/random");
|
|
12
12
|
const getHtToTtcQuestion = () => {
|
|
13
13
|
const TVA = (0, random_1.random)([20, 5.5]);
|
|
14
14
|
const ht = (0, coinFlip_1.coinFlip)() ? (0, randint_1.randint)(50, 1000) : (0, randfloat_1.randfloat)(20, 200, 2);
|
|
@@ -11,4 +11,8 @@ export * from "./cmToEvolution";
|
|
|
11
11
|
export * from "./htToTTC";
|
|
12
12
|
export * from "./ttcToHT";
|
|
13
13
|
export * from "./findTVA";
|
|
14
|
+
export * from "./evolutionRateFromValues";
|
|
15
|
+
export * from "./findStartValueAfterEvolution";
|
|
16
|
+
export * from "./subPopulationEffectifFromPercent";
|
|
17
|
+
export * from "./populationEffectifFromSubPopulation";
|
|
14
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,uCAAuC,CAAC"}
|
|
@@ -27,3 +27,7 @@ __exportStar(require("./cmToEvolution"), exports);
|
|
|
27
27
|
__exportStar(require("./htToTTC"), exports);
|
|
28
28
|
__exportStar(require("./ttcToHT"), exports);
|
|
29
29
|
__exportStar(require("./findTVA"), exports);
|
|
30
|
+
__exportStar(require("./evolutionRateFromValues"), exports);
|
|
31
|
+
__exportStar(require("./findStartValueAfterEvolution"), exports);
|
|
32
|
+
__exportStar(require("./subPopulationEffectifFromPercent"), exports);
|
|
33
|
+
__exportStar(require("./populationEffectifFromSubPopulation"), exports);
|
|
@@ -5,7 +5,7 @@ const exercise_1 = require("../../../exercises/exercise");
|
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
6
|
const randTupleInt_1 = require("../../../math/utils/random/randTupleInt");
|
|
7
7
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
|
-
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
8
|
+
const coinFlip_1 = require("../../../utils/alea/coinFlip");
|
|
9
9
|
const getIsTableProportionalQuestion = () => {
|
|
10
10
|
const xValues = (0, randTupleInt_1.randTupleInt)(3, {
|
|
11
11
|
from: 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"percentToDecimal.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/percentToDecimal.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"percentToDecimal.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/percentToDecimal.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAgBlC,KAAK,WAAW,GAAG;IACjB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAuIF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAelD,CAAC"}
|
|
@@ -4,36 +4,76 @@ exports.percentToDecimal = void 0;
|
|
|
4
4
|
const exercise_1 = require("../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
6
|
const decimal_1 = require("../../../math/numbers/decimals/decimal");
|
|
7
|
+
const integer_1 = require("../../../math/numbers/integer/integer");
|
|
7
8
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
|
-
const
|
|
9
|
+
const round_1 = require("../../../math/utils/round");
|
|
10
|
+
const numberParser_1 = require("../../../tree/parsers/numberParser");
|
|
11
|
+
const coinFlip_1 = require("../../../utils/alea/coinFlip");
|
|
12
|
+
const probaFlip_1 = require("../../../utils/alea/probaFlip");
|
|
13
|
+
const getAnswer = ({ nb, isPercentToDecimal }) => {
|
|
14
|
+
const dec = new decimal_1.Decimal(nb);
|
|
15
|
+
const tex = dec.toTree().toTex();
|
|
16
|
+
const percentTex = dec.toPercentNode().toTex();
|
|
17
|
+
return isPercentToDecimal ? tex : percentTex;
|
|
18
|
+
};
|
|
19
|
+
const getInstruction = ({ isPercentToDecimal, nb, }) => {
|
|
20
|
+
const dec = new decimal_1.Decimal(nb);
|
|
21
|
+
const tex = dec.toTree().toTex();
|
|
22
|
+
const percentTex = dec.toPercentNode().toTex();
|
|
23
|
+
const instru = isPercentToDecimal ? percentTex : tex;
|
|
24
|
+
return `Ecrire le nombre suivant ${isPercentToDecimal
|
|
25
|
+
? "sous forme de nombre décimal"
|
|
26
|
+
: "sous forme de pourcentage"} : $${instru}$`;
|
|
27
|
+
};
|
|
28
|
+
const getHint = ({ isPercentToDecimal }) => {
|
|
29
|
+
return `${isPercentToDecimal
|
|
30
|
+
? `Pour écrire $x\\%$ en décimal, rappelle toi que $x\\% = \\frac{x}{100}$.`
|
|
31
|
+
: `Pour écrire un nombre $x$ en pourcentage, on multiplie $x$ par $100$.`}`;
|
|
32
|
+
};
|
|
33
|
+
const getCorrection = ({ isPercentToDecimal, nb, }) => {
|
|
34
|
+
const answer = getAnswer({ isPercentToDecimal, nb });
|
|
35
|
+
const nbPercent = (0, round_1.round)(nb * 100, 10).frenchify();
|
|
36
|
+
return `${isPercentToDecimal
|
|
37
|
+
? `Le symbole $\\%$ signifie simplement "divisé par $100$".
|
|
38
|
+
|
|
39
|
+
On a donc $${nbPercent}\\% = \\frac{${nbPercent}}{100} = ${answer}$
|
|
40
|
+
`
|
|
41
|
+
: `Pour écrire un nombre sous la forme d'un pourcentage, il suffit de le multiplier par $100$.
|
|
42
|
+
|
|
43
|
+
On a donc $${nb.frenchify()} = ${answer}$.
|
|
44
|
+
|
|
45
|
+
En effet, on a bien $${answer} = \\frac{${answer.replace("\\%", "")}}{100} = ${nb.frenchify()}$.`}`;
|
|
46
|
+
};
|
|
47
|
+
const getKeys = (identifiers) => {
|
|
48
|
+
return ["percent"];
|
|
49
|
+
};
|
|
9
50
|
const getPercentToDecimalQuestion = () => {
|
|
10
51
|
const isPercentToDecimal = (0, coinFlip_1.coinFlip)();
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
52
|
+
const isNatural = (0, coinFlip_1.coinFlip)();
|
|
53
|
+
const percentNb = (0, probaFlip_1.probaFlip)(0.3)
|
|
54
|
+
? isNatural
|
|
55
|
+
? new integer_1.Integer(integer_1.IntegerConstructor.random(1, [0]))
|
|
56
|
+
: decimal_1.DecimalConstructor.random(0, 10)
|
|
57
|
+
: (0, coinFlip_1.coinFlip)()
|
|
58
|
+
? isNatural
|
|
59
|
+
? new integer_1.Integer(integer_1.IntegerConstructor.random(2))
|
|
60
|
+
: decimal_1.DecimalConstructor.random(10, 100)
|
|
61
|
+
: isNatural
|
|
62
|
+
? new integer_1.Integer(integer_1.IntegerConstructor.random(3))
|
|
63
|
+
: decimal_1.DecimalConstructor.random(100, 200);
|
|
64
|
+
const nb = percentNb.times(0.01);
|
|
65
|
+
const identifiers = {
|
|
66
|
+
isPercentToDecimal,
|
|
67
|
+
nb: nb.value,
|
|
68
|
+
};
|
|
16
69
|
const question = {
|
|
17
|
-
answer,
|
|
18
|
-
instruction:
|
|
19
|
-
|
|
20
|
-
: "sous forme de pourcentage"} : $${instru}$`,
|
|
21
|
-
keys: ["percent"],
|
|
70
|
+
answer: getAnswer(identifiers),
|
|
71
|
+
instruction: getInstruction(identifiers),
|
|
72
|
+
keys: getKeys(identifiers),
|
|
22
73
|
answerFormat: "tex",
|
|
23
|
-
identifiers
|
|
24
|
-
hint:
|
|
25
|
-
|
|
26
|
-
: `Pour écrire un nombre $x$ en pourcentage, on multiplie $x$ par $100$.`}`,
|
|
27
|
-
correction: `${isPercentToDecimal
|
|
28
|
-
? `Le symbole $\\%$ signifie simplement "divisé par $100$".
|
|
29
|
-
|
|
30
|
-
On a donc $${(nb.value * 100).frenchify()}\\% = \\frac{${(nb.value * 100).frenchify()}}{100} = ${answer}$
|
|
31
|
-
`
|
|
32
|
-
: `Pour écrire un nombre sous la forme d'un pourcentage, il suffit de le multiplier par $100$.
|
|
33
|
-
|
|
34
|
-
On a donc $${nb.value.frenchify()} = ${answer}$.
|
|
35
|
-
|
|
36
|
-
En effet, on a bien $${answer} = \\frac{${answer.replace("\\%", "")}}{100} = ${nb.value.frenchify()}$.`}`,
|
|
74
|
+
identifiers,
|
|
75
|
+
hint: getHint(identifiers),
|
|
76
|
+
correction: getCorrection(identifiers),
|
|
37
77
|
};
|
|
38
78
|
return question;
|
|
39
79
|
};
|
|
@@ -63,8 +103,11 @@ const isAnswerValid = (ans, { answer, isPercentToDecimal, nb }) => {
|
|
|
63
103
|
return ans === answer;
|
|
64
104
|
}
|
|
65
105
|
else {
|
|
66
|
-
const
|
|
67
|
-
|
|
106
|
+
const rawAns = ans.replace("\\%", "");
|
|
107
|
+
const parsed = (0, numberParser_1.numberParser)(rawAns);
|
|
108
|
+
if (!parsed)
|
|
109
|
+
return false;
|
|
110
|
+
return parsed + "\\%" === answer;
|
|
68
111
|
}
|
|
69
112
|
};
|
|
70
113
|
exports.percentToDecimal = {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
subPopulationEffectif: number;
|
|
4
|
+
subPopulationPercent: number;
|
|
5
|
+
contextType: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const populationEffectifFromSubPopulation: Exercise<Identifiers>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=populationEffectifFromSubPopulation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"populationEffectifFromSubPopulation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/populationEffectifFromSubPopulation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAyGF,eAAO,MAAM,mCAAmC,EAAE,QAAQ,CAAC,WAAW,CAcrE,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.populationEffectifFromSubPopulation = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const randfloat_1 = require("../../../math/utils/random/randfloat");
|
|
7
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
|
+
const round_1 = require("../../../math/utils/round");
|
|
9
|
+
const numberParser_1 = require("../../../tree/parsers/numberParser");
|
|
10
|
+
const coinFlip_1 = require("../../../utils/alea/coinFlip");
|
|
11
|
+
const getPropositions = (n, { answer, contextType, subPopulationEffectif, subPopulationPercent }) => {
|
|
12
|
+
const propositions = [];
|
|
13
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
14
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)((subPopulationPercent * 100) / subPopulationEffectif, 0).frenchify());
|
|
15
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)((subPopulationPercent * subPopulationEffectif) / 100, 0).frenchify());
|
|
16
|
+
while (propositions.length < n) {
|
|
17
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, randint_1.randint)(subPopulationEffectif, subPopulationEffectif * 2 + 10).frenchify());
|
|
18
|
+
}
|
|
19
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
20
|
+
};
|
|
21
|
+
const getAnswer = (identifiers) => {
|
|
22
|
+
return (0, round_1.round)((identifiers.subPopulationEffectif * 100) /
|
|
23
|
+
identifiers.subPopulationPercent, 0).frenchify();
|
|
24
|
+
};
|
|
25
|
+
const getInstruction = (identifiers) => {
|
|
26
|
+
const arrondi = "Arrondir à l'unité si nécessaire.";
|
|
27
|
+
switch (identifiers.contextType) {
|
|
28
|
+
case 0:
|
|
29
|
+
return `Dans une classe, $${identifiers.subPopulationPercent.frenchify()}\\%$ des élèves sont des garcons, ce qui représente $${identifiers.subPopulationEffectif}$ élèves. Quel est le nombre d'élèves dans cette classe ? ${arrondi}`;
|
|
30
|
+
case 1:
|
|
31
|
+
return `Dans un collège, $${identifiers.subPopulationPercent.frenchify()}\\%$ des élèves sont gauchers, ce qui représente $${identifiers.subPopulationEffectif}$ élèves. Quel est le nombre d'élèves dans ce collège ? ${arrondi}`;
|
|
32
|
+
case 2:
|
|
33
|
+
default:
|
|
34
|
+
return `Dans une ville, $${identifiers.subPopulationPercent.frenchify()}\\%$ des habitants sont à la retraite, ce qui représente $${identifiers.subPopulationEffectif}$ habitants. Quel est le nombre d'habitants dans cette ville ? ${arrondi}`;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const getKeys = (identifiers) => {
|
|
38
|
+
return [];
|
|
39
|
+
};
|
|
40
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
41
|
+
return (0, numberParser_1.numberParser)(ans) === answer;
|
|
42
|
+
};
|
|
43
|
+
const getPopulationEffectifFromSubPopulationQuestion = () => {
|
|
44
|
+
const contextType = (0, randint_1.randint)(0, 3);
|
|
45
|
+
let subPopulationEffectif, subPopulationPercent;
|
|
46
|
+
switch (contextType) {
|
|
47
|
+
case 0:
|
|
48
|
+
subPopulationEffectif = (0, randint_1.randint)(5, 10);
|
|
49
|
+
subPopulationPercent = (0, coinFlip_1.coinFlip)()
|
|
50
|
+
? (0, randint_1.randint)(30, 70)
|
|
51
|
+
: (0, randfloat_1.randfloat)(30, 70, 2);
|
|
52
|
+
break;
|
|
53
|
+
case 1:
|
|
54
|
+
subPopulationEffectif = (0, randint_1.randint)(100, 1000);
|
|
55
|
+
subPopulationPercent = (0, coinFlip_1.coinFlip)()
|
|
56
|
+
? (0, randint_1.randint)(1, 100)
|
|
57
|
+
: (0, randfloat_1.randfloat)(1, 100, 2);
|
|
58
|
+
break;
|
|
59
|
+
case 2:
|
|
60
|
+
default:
|
|
61
|
+
subPopulationEffectif = (0, randint_1.randint)(1000, 10000);
|
|
62
|
+
subPopulationPercent = (0, coinFlip_1.coinFlip)()
|
|
63
|
+
? (0, randint_1.randint)(1, 100)
|
|
64
|
+
: (0, randfloat_1.randfloat)(1, 100, 2);
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
const identifiers = {
|
|
68
|
+
contextType,
|
|
69
|
+
subPopulationEffectif,
|
|
70
|
+
subPopulationPercent,
|
|
71
|
+
};
|
|
72
|
+
const question = {
|
|
73
|
+
answer: getAnswer(identifiers),
|
|
74
|
+
instruction: getInstruction(identifiers),
|
|
75
|
+
keys: getKeys(identifiers),
|
|
76
|
+
answerFormat: "tex",
|
|
77
|
+
identifiers,
|
|
78
|
+
};
|
|
79
|
+
return question;
|
|
80
|
+
};
|
|
81
|
+
exports.populationEffectifFromSubPopulation = {
|
|
82
|
+
id: "populationEffectifFromSubPopulation",
|
|
83
|
+
connector: "=",
|
|
84
|
+
label: "Calculer l'effectif d'un ensemble en connaissant la proportion et l'effectif d'un sous-ensemble",
|
|
85
|
+
isSingleStep: true,
|
|
86
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getPopulationEffectifFromSubPopulationQuestion, nb),
|
|
87
|
+
qcmTimer: 60,
|
|
88
|
+
freeTimer: 60,
|
|
89
|
+
ggbTimer: 60,
|
|
90
|
+
getPropositions,
|
|
91
|
+
isAnswerValid,
|
|
92
|
+
subject: "Mathématiques",
|
|
93
|
+
};
|
|
@@ -4,8 +4,8 @@ exports.reciprocalPercentage = void 0;
|
|
|
4
4
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
5
5
|
const exercise_1 = require("../../exercise");
|
|
6
6
|
const getDistinctQuestions_1 = require("../../utils/getDistinctQuestions");
|
|
7
|
-
const shuffle_1 = require("../../../utils/shuffle");
|
|
8
|
-
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
7
|
+
const shuffle_1 = require("../../../utils/alea/shuffle");
|
|
8
|
+
const coinFlip_1 = require("../../../utils/alea/coinFlip");
|
|
9
9
|
const round_1 = require("../../../math/utils/round");
|
|
10
10
|
const getReciprocalPercentageQuestion = () => {
|
|
11
11
|
const randPercent = (0, randint_1.randint)(1, 50);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
contextType: number;
|
|
4
|
+
total: number;
|
|
5
|
+
populationPercent: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const subPopulationEffectifFromPercent: Exercise<Identifiers>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=subPopulationEffectifFromPercent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subPopulationEffectifFromPercent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/subPopulationEffectifFromPercent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AA+EF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CAclE,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.subPopulationEffectifFromPercent = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const randfloat_1 = require("../../../math/utils/random/randfloat");
|
|
7
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
|
+
const round_1 = require("../../../math/utils/round");
|
|
9
|
+
const numberParser_1 = require("../../../tree/parsers/numberParser");
|
|
10
|
+
const coinFlip_1 = require("../../../utils/alea/coinFlip");
|
|
11
|
+
const getPropositions = (n, { answer, total }) => {
|
|
12
|
+
const propositions = [];
|
|
13
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
14
|
+
while (propositions.length < n) {
|
|
15
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, randint_1.randint)(0, total).frenchify());
|
|
16
|
+
}
|
|
17
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
18
|
+
};
|
|
19
|
+
const getAnswer = (identifiers) => {
|
|
20
|
+
return (0, round_1.round)(identifiers.total * (identifiers.populationPercent / 100), 0).frenchify();
|
|
21
|
+
};
|
|
22
|
+
const getInstruction = (identifiers) => {
|
|
23
|
+
const arrondi = "Arrondir à l'unité si nécessaire.";
|
|
24
|
+
switch (identifiers.contextType) {
|
|
25
|
+
case 0:
|
|
26
|
+
return `Dans une classe de $${identifiers.total}$ élèves, $${identifiers.populationPercent.frenchify()}\\%$ des élèves sont des garcons. Quel est le nombre de garcons dans cette classe ? ${arrondi}`;
|
|
27
|
+
case 1:
|
|
28
|
+
return `Dans un collège de $${identifiers.total}$ élèves, $${identifiers.populationPercent.frenchify()}\\%$ des élèves sont gauchers. Quel est le nombre de gauchers dans ce collège ? ${arrondi}`;
|
|
29
|
+
case 2:
|
|
30
|
+
default:
|
|
31
|
+
return `Dans une ville de $${identifiers.total}$ habitants, $${identifiers.populationPercent.frenchify()}\\%$ des habitants sont à la retraite. Quel est le nombre de retraités dans cette ville ? ${arrondi}`;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const getKeys = (identifiers) => {
|
|
35
|
+
return [];
|
|
36
|
+
};
|
|
37
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
38
|
+
return (0, numberParser_1.numberParser)(ans) === answer;
|
|
39
|
+
};
|
|
40
|
+
const getSubPopulationEffectifFromPercentQuestion = () => {
|
|
41
|
+
const contextType = (0, randint_1.randint)(0, 3);
|
|
42
|
+
let total, populationPercent;
|
|
43
|
+
switch (contextType) {
|
|
44
|
+
case 0:
|
|
45
|
+
total = (0, randint_1.randint)(20, 40);
|
|
46
|
+
populationPercent = (0, coinFlip_1.coinFlip)() ? (0, randint_1.randint)(1, 100) : (0, randfloat_1.randfloat)(1, 100, 2);
|
|
47
|
+
break;
|
|
48
|
+
case 1:
|
|
49
|
+
total = (0, randint_1.randint)(100, 1000);
|
|
50
|
+
populationPercent = (0, coinFlip_1.coinFlip)() ? (0, randint_1.randint)(1, 100) : (0, randfloat_1.randfloat)(1, 100, 2);
|
|
51
|
+
break;
|
|
52
|
+
case 2:
|
|
53
|
+
default:
|
|
54
|
+
total = (0, randint_1.randint)(1000, 10000);
|
|
55
|
+
populationPercent = (0, coinFlip_1.coinFlip)() ? (0, randint_1.randint)(1, 100) : (0, randfloat_1.randfloat)(1, 100, 2);
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
const identifiers = {
|
|
59
|
+
contextType,
|
|
60
|
+
populationPercent,
|
|
61
|
+
total,
|
|
62
|
+
};
|
|
63
|
+
const question = {
|
|
64
|
+
answer: getAnswer(identifiers),
|
|
65
|
+
instruction: getInstruction(identifiers),
|
|
66
|
+
keys: getKeys(identifiers),
|
|
67
|
+
answerFormat: "tex",
|
|
68
|
+
identifiers,
|
|
69
|
+
};
|
|
70
|
+
return question;
|
|
71
|
+
};
|
|
72
|
+
exports.subPopulationEffectifFromPercent = {
|
|
73
|
+
id: "subPopulationEffectifFromPercent",
|
|
74
|
+
connector: "=",
|
|
75
|
+
label: "Calculer l'effectif d'un sous-ensemble via sa proportion",
|
|
76
|
+
isSingleStep: true,
|
|
77
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getSubPopulationEffectifFromPercentQuestion, nb),
|
|
78
|
+
qcmTimer: 60,
|
|
79
|
+
freeTimer: 60,
|
|
80
|
+
ggbTimer: 60,
|
|
81
|
+
getPropositions,
|
|
82
|
+
isAnswerValid,
|
|
83
|
+
subject: "Mathématiques",
|
|
84
|
+
getAnswer,
|
|
85
|
+
};
|
|
@@ -7,8 +7,8 @@ const randfloat_1 = require("../../../math/utils/random/randfloat");
|
|
|
7
7
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
8
|
const round_1 = require("../../../math/utils/round");
|
|
9
9
|
const numberParser_1 = require("../../../tree/parsers/numberParser");
|
|
10
|
-
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
11
|
-
const random_1 = require("../../../utils/random");
|
|
10
|
+
const coinFlip_1 = require("../../../utils/alea/coinFlip");
|
|
11
|
+
const random_1 = require("../../../utils/alea/random");
|
|
12
12
|
const getTtcToHtQuestion = () => {
|
|
13
13
|
const TVA = (0, random_1.random)([20, 5.5]);
|
|
14
14
|
const TTC = (0, coinFlip_1.coinFlip)() ? (0, randint_1.randint)(50, 1000) : (0, randfloat_1.randfloat)(20, 200, 2);
|
|
@@ -7,7 +7,7 @@ const randint_1 = require("../../../math/utils/random/randint");
|
|
|
7
7
|
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
8
8
|
const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
|
|
9
9
|
const powerNode_1 = require("../../../tree/nodes/operators/powerNode");
|
|
10
|
-
const probaFlip_1 = require("../../../utils/probaFlip");
|
|
10
|
+
const probaFlip_1 = require("../../../utils/alea/probaFlip");
|
|
11
11
|
const exercise_1 = require("../../exercise");
|
|
12
12
|
const getDistinctQuestions_1 = require("../../utils/getDistinctQuestions");
|
|
13
13
|
const getDecimalToScientificQuestion = () => {
|
|
@@ -11,7 +11,7 @@ const fractionNode_1 = require("../../../tree/nodes/operators/fractionNode");
|
|
|
11
11
|
const powerNode_1 = require("../../../tree/nodes/operators/powerNode");
|
|
12
12
|
const substractNode_1 = require("../../../tree/nodes/operators/substractNode");
|
|
13
13
|
const alignTex_1 = require("../../../utils/latex/alignTex");
|
|
14
|
-
const shuffle_1 = require("../../../utils/shuffle");
|
|
14
|
+
const shuffle_1 = require("../../../utils/alea/shuffle");
|
|
15
15
|
const exercise_1 = require("../../exercise");
|
|
16
16
|
const getDistinctQuestions_1 = require("../../utils/getDistinctQuestions");
|
|
17
17
|
const getPowersDivisionQuestion = (opts) => {
|
|
@@ -8,7 +8,7 @@ const power_1 = require("../../../math/numbers/integer/power");
|
|
|
8
8
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
9
9
|
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
10
10
|
const powerNode_1 = require("../../../tree/nodes/operators/powerNode");
|
|
11
|
-
const shuffle_1 = require("../../../utils/shuffle");
|
|
11
|
+
const shuffle_1 = require("../../../utils/alea/shuffle");
|
|
12
12
|
const exercise_1 = require("../../exercise");
|
|
13
13
|
const getDistinctQuestions_1 = require("../../utils/getDistinctQuestions");
|
|
14
14
|
const getPowersOfTenToDecimalQuestion = () => {
|
|
@@ -11,7 +11,7 @@ const addNode_1 = require("../../../tree/nodes/operators/addNode");
|
|
|
11
11
|
const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
|
|
12
12
|
const powerNode_1 = require("../../../tree/nodes/operators/powerNode");
|
|
13
13
|
const alignTex_1 = require("../../../utils/latex/alignTex");
|
|
14
|
-
const shuffle_1 = require("../../../utils/shuffle");
|
|
14
|
+
const shuffle_1 = require("../../../utils/alea/shuffle");
|
|
15
15
|
const exercise_1 = require("../../exercise");
|
|
16
16
|
const getDistinctQuestions_1 = require("../../utils/getDistinctQuestions");
|
|
17
17
|
const getPowersProductQuestion = (opts) => {
|
|
@@ -7,7 +7,7 @@ const monom_1 = require("../../../math/polynomials/monom");
|
|
|
7
7
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
8
|
const addNode_1 = require("../../../tree/nodes/operators/addNode");
|
|
9
9
|
const variableNode_1 = require("../../../tree/nodes/variables/variableNode");
|
|
10
|
-
const shuffle_1 = require("../../../utils/shuffle");
|
|
10
|
+
const shuffle_1 = require("../../../utils/alea/shuffle");
|
|
11
11
|
const getConstantPrimitive = () => {
|
|
12
12
|
const c = (0, randint_1.randint)(-19, 20, [0]);
|
|
13
13
|
const monom = new monom_1.Monom(1, c);
|
|
@@ -12,7 +12,7 @@ const addNode_1 = require("../../../tree/nodes/operators/addNode");
|
|
|
12
12
|
const fractionNode_1 = require("../../../tree/nodes/operators/fractionNode");
|
|
13
13
|
const powerNode_1 = require("../../../tree/nodes/operators/powerNode");
|
|
14
14
|
const variableNode_1 = require("../../../tree/nodes/variables/variableNode");
|
|
15
|
-
const shuffle_1 = require("../../../utils/shuffle");
|
|
15
|
+
const shuffle_1 = require("../../../utils/alea/shuffle");
|
|
16
16
|
const getLogarithmePrimitive = () => {
|
|
17
17
|
const u = polynomial_1.PolynomialConstructor.randomWithOrder((0, randint_1.randint)(1, 3));
|
|
18
18
|
const uTree = u.toTree();
|