math-exercises 3.0.171 → 3.0.173
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/derivation/variations/signVarTable3dDegree.js +38 -10
- package/lib/exercises/math/derivation/variations/signVarTableFromDerivativeGraph.d.ts.map +1 -1
- package/lib/exercises/math/derivation/variations/signVarTableFromDerivativeGraph.js +7 -4
- package/lib/exercises/math/derivation/variations/signVarTableFromGraph.d.ts.map +1 -1
- package/lib/exercises/math/derivation/variations/signVarTableFromGraph.js +2 -3
- package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.js +12 -0
- package/lib/exercises/math/functions/trinoms/parabole/index.d.ts +2 -0
- package/lib/exercises/math/functions/trinoms/parabole/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/parabole/index.js +2 -0
- package/lib/exercises/math/functions/trinoms/parabole/parabolaVarTable.d.ts +8 -0
- package/lib/exercises/math/functions/trinoms/parabole/parabolaVarTable.d.ts.map +1 -0
- package/lib/exercises/math/functions/trinoms/parabole/parabolaVarTable.js +106 -0
- package/lib/exercises/math/functions/trinoms/parabole/paraboleSolveGraphEquation.d.ts +14 -0
- package/lib/exercises/math/functions/trinoms/parabole/paraboleSolveGraphEquation.d.ts.map +1 -0
- package/lib/exercises/math/functions/trinoms/parabole/paraboleSolveGraphEquation.js +186 -0
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.d.ts +6 -2
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.js +98 -13
- package/lib/exercises/math/functions/variations/partialVarTableFromGraph.d.ts.map +1 -1
- package/lib/exercises/math/functions/variations/partialVarTableFromGraph.js +2 -1
- package/lib/exercises/math/functions/variations/varTableFromGraph.d.ts.map +1 -1
- package/lib/exercises/math/functions/variations/varTableFromGraph.js +2 -1
- package/lib/exercises/math/functions/variations/varTableFromSentences.d.ts.map +1 -1
- package/lib/exercises/math/functions/variations/varTableFromSentences.js +2 -1
- package/lib/exercises/math/geometry/circles/circleCenterAndRadiusFromEquation.d.ts.map +1 -1
- package/lib/exercises/math/geometry/circles/circleCenterAndRadiusFromEquation.js +0 -2
- package/lib/exercises/math/geometry/lines/index.d.ts +1 -0
- package/lib/exercises/math/geometry/lines/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/index.js +1 -0
- package/lib/exercises/math/geometry/lines/readLineNormalVectorOnGraph.d.ts +13 -0
- package/lib/exercises/math/geometry/lines/readLineNormalVectorOnGraph.d.ts.map +1 -0
- package/lib/exercises/math/geometry/lines/readLineNormalVectorOnGraph.js +195 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.js +64 -60
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.d.ts +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.js +173 -47
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.js +112 -46
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductInOrthonormalBasisIJ.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductInOrthonormalBasisIJ.js +6 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductLamdbaULambdaV.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductLamdbaULambdaV.js +60 -82
- package/lib/exercises/math/geometry/vectors/scalarProduct/angleFromScalarProduct.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/angleFromScalarProduct.js +92 -6
- package/lib/exercises/math/geometry/vectors/scalarProduct/index.d.ts +6 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/index.js +6 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsBasisIJ.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsBasisIJ.js +6 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsUsingCoords.js +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.js +15 -5
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnPerpendicularBisector.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnPerpendicularBisector.js +18 -14
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsRightTriangleUsingPointCoords.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsRightTriangleUsingPointCoords.js +15 -5
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.js +38 -4
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOfVectsOnGrid1.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOfVectsOnGrid1.js +77 -26
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductParallelogramDiagonalPlus.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductParallelogramDiagonalPlus.js +6 -7
- package/lib/exercises/math/probaStat/basicProbas/calculateProbaFromProbaLaw.js +1 -1
- package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaFromTableWithContext.js +3 -16
- package/lib/exercises/math/probaStat/randomVariable/decideWhichGameIsLessRisky.d.ts +14 -0
- package/lib/exercises/math/probaStat/randomVariable/decideWhichGameIsLessRisky.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/decideWhichGameIsLessRisky.js +167 -0
- package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.js +29 -56
- package/lib/exercises/math/probaStat/randomVariable/index.d.ts +8 -0
- package/lib/exercises/math/probaStat/randomVariable/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/index.js +9 -0
- package/lib/exercises/math/probaStat/randomVariable/isTableProbabilityLaw.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/isTableProbabilityLaw.js +6 -6
- package/lib/exercises/math/probaStat/randomVariable/missingValueInRandomVariableProbabilityLaw.d.ts +9 -0
- package/lib/exercises/math/probaStat/randomVariable/missingValueInRandomVariableProbabilityLaw.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/missingValueInRandomVariableProbabilityLaw.js +119 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableAverage.js +1 -1
- package/lib/exercises/math/probaStat/randomVariable/randomVariableFindMissingProbabilityInLaw.d.ts +9 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableFindMissingProbabilityInLaw.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableFindMissingProbabilityInLaw.js +116 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationAverage.d.ts +11 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationAverage.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationAverage.js +112 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationComputeProbability.d.ts +9 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationComputeProbability.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationComputeProbability.js +176 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationIsGameFavorable.d.ts +8 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationIsGameFavorable.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationIsGameFavorable.js +94 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.d.ts +9 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.js +162 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationStandardDeviation.d.ts +8 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationStandardDeviation.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationStandardDeviation.js +133 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationValues.d.ts +8 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationValues.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationValues.js +211 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationVariance.d.ts +8 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationVariance.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationVariance.js +113 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableStandardDeviation.js +1 -1
- package/lib/exercises/math/probaStat/randomVariable/randomVariableVariance.js +1 -1
- package/lib/exercises/math/probaStat/randomVariable/utils/buildVAOfGivenAverage.d.ts +31 -0
- package/lib/exercises/math/probaStat/randomVariable/utils/buildVAOfGivenAverage.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/utils/buildVAOfGivenAverage.js +192 -0
- package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.d.ts +40 -11
- package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.js +172 -30
- package/lib/exercises/math/probaStat/stats1var/medianWithList.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/medianWithList.js +16 -2
- package/lib/exercises/math/python/sequences/index.d.ts +8 -0
- package/lib/exercises/math/python/sequences/index.d.ts.map +1 -0
- package/lib/exercises/math/python/sequences/index.js +7 -0
- package/lib/exercises/math/python/sequences/pySequenceFactorialInstructionFalseOneOut.d.ts +11 -0
- package/lib/exercises/math/python/sequences/pySequenceFactorialInstructionFalseOneOut.d.ts.map +1 -0
- package/lib/exercises/math/python/sequences/pySequenceFactorialInstructionFalseOneOut.js +274 -0
- package/lib/exercises/math/python/sequences/pySequenceFirstTermsListInstructionCompletion.d.ts +12 -0
- package/lib/exercises/math/python/sequences/pySequenceFirstTermsListInstructionCompletion.d.ts.map +1 -0
- package/lib/exercises/math/python/sequences/pySequenceFirstTermsListInstructionCompletion.js +368 -0
- package/lib/exercises/math/python/sequences/pySequenceFirstTermsSumInstructionCompletion.d.ts +13 -0
- package/lib/exercises/math/python/sequences/pySequenceFirstTermsSumInstructionCompletion.d.ts.map +1 -0
- package/lib/exercises/math/python/sequences/pySequenceFirstTermsSumInstructionCompletion.js +254 -0
- package/lib/exercises/math/python/sequences/pySequenceProgramReading.d.ts +14 -0
- package/lib/exercises/math/python/sequences/pySequenceProgramReading.d.ts.map +1 -0
- package/lib/exercises/math/python/sequences/pySequenceProgramReading.js +365 -0
- package/lib/exercises/math/python/sequences/pySequenceTermForLoopInstructionCompletion.d.ts +11 -0
- package/lib/exercises/math/python/sequences/pySequenceTermForLoopInstructionCompletion.d.ts.map +1 -0
- package/lib/exercises/math/python/sequences/pySequenceTermForLoopInstructionCompletion.js +298 -0
- package/lib/exercises/math/python/sequences/pySequenceTermFromFunctionCallInstructionCompletion.d.ts +12 -0
- package/lib/exercises/math/python/sequences/pySequenceTermFromFunctionCallInstructionCompletion.d.ts.map +1 -0
- package/lib/exercises/math/python/sequences/pySequenceTermFromFunctionCallInstructionCompletion.js +408 -0
- package/lib/exercises/math/python/sequences/pySequenceThresholdInstructionCompletion.d.ts +17 -0
- package/lib/exercises/math/python/sequences/pySequenceThresholdInstructionCompletion.d.ts.map +1 -0
- package/lib/exercises/math/python/sequences/pySequenceThresholdInstructionCompletion.js +498 -0
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFromTwoTerms.d.ts +12 -0
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFromTwoTerms.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFromTwoTerms.js +191 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindExplicitFormulaFromSituation.d.ts +14 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindExplicitFormulaFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindExplicitFormulaFromSituation.js +153 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.d.ts +15 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.js +184 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRecurrenceFormulaFromSituation.d.ts +14 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRecurrenceFormulaFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRecurrenceFormulaFromSituation.js +210 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindTermFromSituation.d.ts +15 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindTermFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindTermFromSituation.js +161 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindThresholdFromSituation.d.ts +17 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindThresholdFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindThresholdFromSituation.js +188 -0
- package/lib/exercises/math/sequences/arithmetic/situations/index.d.ts +6 -0
- package/lib/exercises/math/sequences/arithmetic/situations/index.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/situations/index.js +5 -0
- package/lib/exercises/math/sequences/arithmetic/sum/arithmeticComputeSumWithDots.d.ts +15 -0
- package/lib/exercises/math/sequences/arithmetic/sum/arithmeticComputeSumWithDots.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/sum/arithmeticComputeSumWithDots.js +233 -0
- package/lib/exercises/math/sequences/arithmetic/sum/arithmeticFirstTermsSum.d.ts +13 -0
- package/lib/exercises/math/sequences/arithmetic/sum/arithmeticFirstTermsSum.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/sum/arithmeticFirstTermsSum.js +111 -0
- package/lib/exercises/math/sequences/arithmetic/sum/arithmeticFirstTermsSumThreshold.d.ts +13 -0
- package/lib/exercises/math/sequences/arithmetic/sum/arithmeticFirstTermsSumThreshold.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/sum/arithmeticFirstTermsSumThreshold.js +216 -0
- package/lib/exercises/math/sequences/arithmetic/sum/firstIntegersSum.d.ts +7 -0
- package/lib/exercises/math/sequences/arithmetic/sum/firstIntegersSum.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/sum/firstIntegersSum.js +94 -0
- package/lib/exercises/math/sequences/arithmetic/sum/index.d.ts +5 -0
- package/lib/exercises/math/sequences/arithmetic/sum/index.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/sum/index.js +4 -0
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoTerms.d.ts +14 -0
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoTerms.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoTerms.js +301 -0
- package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoTerms.d.ts +15 -0
- package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoTerms.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoTerms.js +260 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindExplicitFormulaFromSituation.d.ts +14 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindExplicitFormulaFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindExplicitFormulaFromSituation.js +186 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindRankFromSituation.d.ts +15 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindRankFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindRankFromSituation.js +142 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindRecurrenceFormulaFromSituation.d.ts +14 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindRecurrenceFormulaFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindRecurrenceFormulaFromSituation.js +205 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindTermFromSituation.d.ts +15 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindTermFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindTermFromSituation.js +208 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindThresholdFromSituation.d.ts +17 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindThresholdFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindThresholdFromSituation.js +152 -0
- package/lib/exercises/math/sequences/geometric/situations/index.d.ts +4 -0
- package/lib/exercises/math/sequences/geometric/situations/index.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/situations/index.js +5 -0
- package/lib/exercises/math/sequences/geometric/sum/geometricComputeSumWithDots.d.ts +15 -0
- package/lib/exercises/math/sequences/geometric/sum/geometricComputeSumWithDots.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/sum/geometricComputeSumWithDots.js +248 -0
- package/lib/exercises/math/sequences/geometric/sum/geometricFirstTermsGeneralSum.d.ts +14 -0
- package/lib/exercises/math/sequences/geometric/sum/geometricFirstTermsGeneralSum.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/sum/geometricFirstTermsGeneralSum.js +126 -0
- package/lib/exercises/math/sequences/geometric/sum/geometricFirstTermsSum.d.ts +8 -0
- package/lib/exercises/math/sequences/geometric/sum/geometricFirstTermsSum.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/sum/geometricFirstTermsSum.js +91 -0
- package/lib/exercises/math/sequences/geometric/sum/index.d.ts +4 -0
- package/lib/exercises/math/sequences/geometric/sum/index.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/sum/index.js +3 -0
- package/lib/exercises/math/sequences/seqArithmGeom/index.d.ts +2 -0
- package/lib/exercises/math/sequences/seqArithmGeom/index.d.ts.map +1 -0
- package/lib/exercises/math/sequences/seqArithmGeom/index.js +1 -0
- package/lib/exercises/math/sequences/seqArithmGeom/seqArithmGeomRecurrenceFormulaUsage.d.ts +14 -0
- package/lib/exercises/math/sequences/seqArithmGeom/seqArithmGeomRecurrenceFormulaUsage.d.ts.map +1 -0
- package/lib/exercises/math/sequences/seqArithmGeom/seqArithmGeomRecurrenceFormulaUsage.js +202 -0
- package/lib/exercises/math/trigonometry/circle/placeAssociateAngleOnCircle.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/circle/placeAssociateAngleOnCircle.js +0 -2
- package/lib/exercises/options/optionFirstTermRankOne.d.ts +16 -0
- package/lib/exercises/options/optionFirstTermRankOne.d.ts.map +1 -0
- package/lib/exercises/options/optionFirstTermRankOne.js +17 -0
- package/lib/exercises/options/optionIsUsePythonDef.d.ts +16 -0
- package/lib/exercises/options/optionIsUsePythonDef.d.ts.map +1 -0
- package/lib/exercises/options/optionIsUsePythonDef.js +17 -0
- package/lib/exercises/options/optionIsWithSuperfluousData.d.ts +16 -0
- package/lib/exercises/options/optionIsWithSuperfluousData.d.ts.map +1 -0
- package/lib/exercises/options/optionIsWithSuperfluousData.js +17 -0
- package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts +1 -0
- package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts.map +1 -1
- package/lib/exercises/vea/colinearVectorVEA.d.ts +2 -0
- package/lib/exercises/vea/colinearVectorVEA.d.ts.map +1 -0
- package/lib/exercises/vea/colinearVectorVEA.js +11 -0
- package/lib/exercises/vea/rationalVEA.d.ts.map +1 -1
- package/lib/exercises/vea/rationalVEA.js +7 -3
- package/lib/exercises/vea/varLineVEA.d.ts.map +1 -1
- package/lib/exercises/vea/varLineVEA.js +7 -3
- package/lib/exercises/vea/varSignTableVEA.d.ts +8 -0
- package/lib/exercises/vea/varSignTableVEA.d.ts.map +1 -1
- package/lib/exercises/vea/varSignTableVEA.js +8 -0
- package/lib/exercises/vea/xTableLineVEA.d.ts +1 -0
- package/lib/exercises/vea/xTableLineVEA.d.ts.map +1 -1
- package/lib/exercises/vea/xTableLineVEA.js +1 -0
- package/lib/index.d.ts +104 -5
- package/lib/index.d.ts.map +1 -1
- package/lib/latexTester.d.ts.map +1 -1
- package/lib/latexTester.js +3 -1
- package/lib/math/geometry/angle.d.ts +2 -0
- package/lib/math/geometry/angle.d.ts.map +1 -1
- package/lib/math/geometry/angle.js +17 -0
- package/lib/math/geometry/line.d.ts +1 -1
- package/lib/math/geometry/line.d.ts.map +1 -1
- package/lib/math/geometry/line.js +3 -3
- package/lib/math/geometry/point.d.ts +1 -1
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +4 -1
- package/lib/math/geometry/segment.js +1 -1
- package/lib/math/numbers/reals/real.d.ts.map +1 -1
- package/lib/math/numbers/reals/real.js +4 -0
- package/lib/math/probability/randomVariable.d.ts +2 -1
- package/lib/math/probability/randomVariable.d.ts.map +1 -1
- package/lib/math/probability/randomVariable.js +7 -1
- package/lib/math/utils/arithmetic/primeFactors.d.ts +1 -1
- package/lib/math/utils/arithmetic/primeFactors.d.ts.map +1 -1
- package/lib/math/utils/arithmetic/primeFactors.js +23 -9
- package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts +53 -0
- package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts.map +1 -0
- package/lib/math/utils/sequences/situations/seqArithmeticSituations.js +1928 -0
- package/lib/math/utils/sequences/situations/seqArithmeticUtils.d.ts +15 -0
- package/lib/math/utils/sequences/situations/seqArithmeticUtils.d.ts.map +1 -0
- package/lib/math/utils/sequences/situations/seqArithmeticUtils.js +136 -0
- package/lib/math/utils/sequences/situations/seqGeometricSituations.d.ts +42 -0
- package/lib/math/utils/sequences/situations/seqGeometricSituations.d.ts.map +1 -0
- package/lib/math/utils/sequences/situations/seqGeometricSituations.js +932 -0
- package/lib/math/utils/sequences/situations/seqGeometricUtils.d.ts +12 -0
- package/lib/math/utils/sequences/situations/seqGeometricUtils.d.ts.map +1 -0
- package/lib/math/utils/sequences/situations/seqGeometricUtils.js +90 -0
- package/lib/tests/pdfs/mdTableToLatexTabular.js +1 -1
- package/lib/tree/nodes/algebraicNode.d.ts +1 -0
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/complex/complexNode.d.ts +1 -0
- package/lib/tree/nodes/complex/complexNode.d.ts.map +1 -1
- package/lib/tree/nodes/complex/complexNode.js +3 -0
- package/lib/tree/nodes/equations/equalNode.d.ts +1 -0
- package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equalNode.js +3 -0
- package/lib/tree/nodes/equations/equationSolutionNode.d.ts +1 -0
- package/lib/tree/nodes/equations/equationSolutionNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equationSolutionNode.js +3 -0
- package/lib/tree/nodes/equations/multiEqualNode.d.ts +1 -0
- package/lib/tree/nodes/equations/multiEqualNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/multiEqualNode.js +3 -0
- package/lib/tree/nodes/equations/notEqualNode.d.ts +1 -0
- package/lib/tree/nodes/equations/notEqualNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/notEqualNode.js +3 -0
- package/lib/tree/nodes/functions/absNode.d.ts +1 -0
- package/lib/tree/nodes/functions/absNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/absNode.js +7 -0
- package/lib/tree/nodes/functions/arcSinNode.d.ts +1 -0
- package/lib/tree/nodes/functions/arcSinNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/arcSinNode.js +7 -0
- package/lib/tree/nodes/functions/arccosNode.d.ts +1 -0
- package/lib/tree/nodes/functions/arccosNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/arccosNode.js +7 -0
- package/lib/tree/nodes/functions/arctanNode.d.ts +1 -0
- package/lib/tree/nodes/functions/arctanNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/arctanNode.js +7 -0
- package/lib/tree/nodes/functions/cosNode.d.ts +1 -0
- package/lib/tree/nodes/functions/cosNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/cosNode.js +7 -0
- package/lib/tree/nodes/functions/expNode.d.ts +1 -0
- package/lib/tree/nodes/functions/expNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/expNode.js +7 -0
- package/lib/tree/nodes/functions/factorialNode.d.ts +30 -0
- package/lib/tree/nodes/functions/factorialNode.d.ts.map +1 -0
- package/lib/tree/nodes/functions/factorialNode.js +79 -0
- package/lib/tree/nodes/functions/functionNode.d.ts +2 -1
- package/lib/tree/nodes/functions/functionNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/functionNode.js +1 -0
- package/lib/tree/nodes/functions/integralNode.d.ts +1 -0
- package/lib/tree/nodes/functions/integralNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/integralNode.js +7 -0
- package/lib/tree/nodes/functions/log10Node.d.ts +1 -0
- package/lib/tree/nodes/functions/log10Node.d.ts.map +1 -1
- package/lib/tree/nodes/functions/log10Node.js +7 -0
- package/lib/tree/nodes/functions/logNode.d.ts +1 -0
- package/lib/tree/nodes/functions/logNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/logNode.js +9 -0
- package/lib/tree/nodes/functions/oppositeNode.d.ts +1 -0
- package/lib/tree/nodes/functions/oppositeNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/oppositeNode.js +7 -0
- package/lib/tree/nodes/functions/sinNode.d.ts +1 -0
- package/lib/tree/nodes/functions/sinNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sinNode.js +7 -0
- package/lib/tree/nodes/functions/sqrtNode.d.ts +1 -0
- package/lib/tree/nodes/functions/sqrtNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sqrtNode.js +7 -0
- package/lib/tree/nodes/functions/tanNode.d.ts +1 -0
- package/lib/tree/nodes/functions/tanNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/tanNode.js +7 -0
- package/lib/tree/nodes/geometry/degree.d.ts +1 -0
- package/lib/tree/nodes/geometry/degree.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/degree.js +7 -0
- package/lib/tree/nodes/geometry/lengthNode.d.ts +1 -0
- package/lib/tree/nodes/geometry/lengthNode.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/lengthNode.js +7 -0
- package/lib/tree/nodes/geometry/pointNode.d.ts +1 -0
- package/lib/tree/nodes/geometry/pointNode.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/pointNode.js +7 -0
- package/lib/tree/nodes/geometry/vectorNode.d.ts +1 -0
- package/lib/tree/nodes/geometry/vectorNode.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/vectorNode.js +7 -0
- package/lib/tree/nodes/inequations/inequationNode.d.ts +1 -0
- package/lib/tree/nodes/inequations/inequationNode.d.ts.map +1 -1
- package/lib/tree/nodes/inequations/inequationNode.js +7 -0
- package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts +1 -0
- package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts.map +1 -1
- package/lib/tree/nodes/inequations/inequationSolutionNode.js +7 -0
- package/lib/tree/nodes/node.d.ts +2 -1
- package/lib/tree/nodes/node.d.ts.map +1 -1
- package/lib/tree/nodes/node.js +2 -0
- package/lib/tree/nodes/nodeConstructor.d.ts.map +1 -1
- package/lib/tree/nodes/nodeConstructor.js +4 -0
- package/lib/tree/nodes/numbers/percentNode.d.ts +1 -0
- package/lib/tree/nodes/numbers/percentNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/percentNode.js +7 -0
- package/lib/tree/nodes/operators/addNode.d.ts +1 -0
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +7 -0
- package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts +4 -3
- package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/binomialCoefficientNode.js +24 -5
- package/lib/tree/nodes/operators/divideNode.d.ts +1 -0
- package/lib/tree/nodes/operators/divideNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/divideNode.js +7 -0
- package/lib/tree/nodes/operators/fractionNode.d.ts +1 -0
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +7 -0
- package/lib/tree/nodes/operators/limitNode.d.ts +1 -0
- package/lib/tree/nodes/operators/limitNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/limitNode.js +7 -0
- package/lib/tree/nodes/operators/multiplyNode.d.ts +1 -0
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +7 -0
- package/lib/tree/nodes/operators/powerNode.d.ts +1 -0
- package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/powerNode.js +7 -0
- package/lib/tree/nodes/operators/substractNode.d.ts +1 -0
- package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/substractNode.js +7 -0
- package/lib/tree/nodes/polynomials/monomNode.d.ts +1 -0
- package/lib/tree/nodes/polynomials/monomNode.d.ts.map +1 -1
- package/lib/tree/nodes/polynomials/monomNode.js +7 -0
- package/lib/tree/nodes/polynomials/trinomNode.d.ts +1 -0
- package/lib/tree/nodes/polynomials/trinomNode.d.ts.map +1 -1
- package/lib/tree/nodes/polynomials/trinomNode.js +7 -0
- package/lib/tree/nodes/sets/belongsNode.d.ts +1 -0
- package/lib/tree/nodes/sets/belongsNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/belongsNode.js +7 -0
- 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 +7 -0
- package/lib/tree/nodes/sets/intervalNode.d.ts +1 -0
- package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/intervalNode.js +7 -0
- package/lib/tree/nodes/sets/unionIntervalNode.d.ts +1 -0
- package/lib/tree/nodes/sets/unionIntervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/unionIntervalNode.js +7 -0
- package/lib/tree/nodes/variables/variableNode.d.ts +1 -0
- package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
- package/lib/tree/nodes/variables/variableNode.js +7 -0
- package/lib/tree/parsers/vectorParser.d.ts.map +1 -1
- package/lib/tree/parsers/vectorParser.js +8 -0
- package/lib/tree/utilities/nodeShuffler.d.ts.map +1 -1
- package/lib/tree/utilities/nodeShuffler.js +3 -0
- package/lib/tree/utilities/nodeSimplifier.d.ts.map +1 -1
- package/lib/tree/utilities/nodeSimplifier.js +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
|
|
2
|
+
import { getOptionFirstTermRankOneStuff, } from "../../../../../exercises/options/optionFirstTermRankOne.js";
|
|
3
|
+
import { getOptionIsWithSuperfluousData, } from "../../../../../exercises/options/optionIsWithSuperfluousData.js";
|
|
4
|
+
import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
|
|
5
|
+
import { nodeBySubstitutingVar } from "../../../../../math/utils/functions/functionComposition.js";
|
|
6
|
+
import { randint } from "../../../../../math/utils/random/randint.js";
|
|
7
|
+
import { situationsGeometric, } from "../../../../../math/utils/sequences/situations/seqGeometricSituations.js";
|
|
8
|
+
import { EqualNode, isEqualNode, } from "../../../../../tree/nodes/equations/equalNode.js";
|
|
9
|
+
import { add } from "../../../../../tree/nodes/operators/addNode.js";
|
|
10
|
+
import { multiply } from "../../../../../tree/nodes/operators/multiplyNode.js";
|
|
11
|
+
import { power } from "../../../../../tree/nodes/operators/powerNode.js";
|
|
12
|
+
import { substract } from "../../../../../tree/nodes/operators/substractNode.js";
|
|
13
|
+
import { parseAlgebraic } from "../../../../../tree/parsers/latexParser.js";
|
|
14
|
+
import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
|
|
15
|
+
const _getNodeFactor = (firstRank, varName = "n") => {
|
|
16
|
+
const nodeN = varName.toTree();
|
|
17
|
+
return firstRank === 0 ? nodeN : substract(nodeN, 1);
|
|
18
|
+
};
|
|
19
|
+
const situations = situationsGeometric;
|
|
20
|
+
const getInstruction = (identifiers, optsIn) => {
|
|
21
|
+
const opts = optsIn ?? optsDefault;
|
|
22
|
+
const firstRank = opts?.firstTermRankOne ? 1 : 0;
|
|
23
|
+
const { situationIndex, initial, reason, superfluousData } = identifiers;
|
|
24
|
+
const situation = situations[situationIndex];
|
|
25
|
+
return `${situation.getStrSituation(initial, reason, firstRank, superfluousData)}
|
|
26
|
+
|
|
27
|
+
Donner la relation de récurrence pour la suite $(u_n)$.`;
|
|
28
|
+
};
|
|
29
|
+
const getAnswerNode = (identifiers, opts) => {
|
|
30
|
+
const firstRank = opts?.firstTermRankOne ? 1 : 0;
|
|
31
|
+
const { situationIndex, initial, reason } = identifiers;
|
|
32
|
+
const situation = situations[situationIndex];
|
|
33
|
+
return situation.variationFindRecurrenceFormula.getAnswerNode(initial, reason, firstRank);
|
|
34
|
+
};
|
|
35
|
+
const getAnswer = (identifiers, optsIn) => {
|
|
36
|
+
const opts = optsIn ?? optsDefault;
|
|
37
|
+
return getAnswerNode(identifiers, opts).toTex();
|
|
38
|
+
};
|
|
39
|
+
const getHint = (identifiers, optsIn) => {
|
|
40
|
+
const opts = optsIn ?? optsDefault;
|
|
41
|
+
const firstRank = opts?.firstTermRankOne ? 1 : 0;
|
|
42
|
+
const { situationIndex } = identifiers;
|
|
43
|
+
const situation = situations[situationIndex];
|
|
44
|
+
return situation.variationFindRecurrenceFormula.getHint(firstRank);
|
|
45
|
+
};
|
|
46
|
+
const getCorrection = (identifiers, optsIn) => {
|
|
47
|
+
const opts = optsIn ?? optsDefault;
|
|
48
|
+
const firstRank = opts?.firstTermRankOne ? 1 : 0;
|
|
49
|
+
const { situationIndex, initial, reason } = identifiers;
|
|
50
|
+
const situation = situations[situationIndex];
|
|
51
|
+
return situation.variationFindRecurrenceFormula.getCorrectionStuff(initial, reason, firstRank).str;
|
|
52
|
+
};
|
|
53
|
+
const getPropositions = (n, { answer, ...identifiers }, optsIn) => {
|
|
54
|
+
const opts = optsIn ?? optsDefault;
|
|
55
|
+
const firstRank = opts?.firstTermRankOne ? 1 : 0;
|
|
56
|
+
const { situationIndex, initial, reason } = identifiers;
|
|
57
|
+
const situation = situations[situationIndex];
|
|
58
|
+
const propositions = [];
|
|
59
|
+
addValidProp(propositions, answer);
|
|
60
|
+
//most to least probable mistakes:
|
|
61
|
+
//student: geometric -> arithmetic: u_{n+1} = u_n + reason
|
|
62
|
+
{
|
|
63
|
+
tryToAddWrongProp(propositions, new EqualNode("u_{n+1}".toTree(), add("u_{n}".toTree(), reason)).toTex());
|
|
64
|
+
}
|
|
65
|
+
//student: reason -> initial: u_{n+1} = u_n * initial
|
|
66
|
+
{
|
|
67
|
+
tryToAddWrongProp(propositions, new EqualNode("u_{n+1}".toTree(), multiply("u_{n}".toTree(), initial)).toTex());
|
|
68
|
+
}
|
|
69
|
+
//student: u_{n+1} = u_n * n ^ reason
|
|
70
|
+
{
|
|
71
|
+
tryToAddWrongProp(propositions, new EqualNode("u_{n+1}".toTree(), multiply("u_{n}".toTree(), power("n".toTree(), reason))).toTex());
|
|
72
|
+
}
|
|
73
|
+
//student: mixes explicit with recurrence: u_{n+1} = initial + u_n * reason
|
|
74
|
+
{
|
|
75
|
+
const nodeExplicitFormula = situation.variationFindExplicitFormula.getAnswerNode(initial, reason, firstRank);
|
|
76
|
+
const nodeWrong1 = nodeBySubstitutingVar(nodeExplicitFormula, "u_{n+1}".toTree(), "u_n".toTree());
|
|
77
|
+
const nodeWrong2 = nodeBySubstitutingVar(nodeWrong1, "u_{n}".toTree(), "n".toTree());
|
|
78
|
+
const strWrong2 = nodeWrong2.simplify().toTex();
|
|
79
|
+
tryToAddWrongProp(propositions, strWrong2);
|
|
80
|
+
}
|
|
81
|
+
//student: explicit formula
|
|
82
|
+
{
|
|
83
|
+
tryToAddWrongProp(propositions, situation.variationFindExplicitFormula
|
|
84
|
+
.getAnswerNode(initial, reason, firstRank)
|
|
85
|
+
.toTex());
|
|
86
|
+
}
|
|
87
|
+
//student: explicit formula for u_{n+1}
|
|
88
|
+
{
|
|
89
|
+
const nodeFormula = multiply(initial, power(reason, substract(add("n".toTree(), 1), firstRank).simplify())).simplify();
|
|
90
|
+
const equalNode = new EqualNode("u_{n+1}".toTree(), nodeFormula);
|
|
91
|
+
tryToAddWrongProp(propositions, equalNode.toTex());
|
|
92
|
+
}
|
|
93
|
+
return shuffleProps(propositions, n);
|
|
94
|
+
};
|
|
95
|
+
const isAnswerValid = (ans, { answer, ..._identifiers }, _optsIn) => {
|
|
96
|
+
try {
|
|
97
|
+
if (!ans.includes("=")) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
//TODO faire fonctionner parseAlgebraic("u_n = 3 \\times 2^n") (token _ not implemented)
|
|
101
|
+
// const nodeAns = parseAlgebraic(ans);
|
|
102
|
+
function workaroundParser(strSrc) {
|
|
103
|
+
function workaroundReplacer(strSrc) {
|
|
104
|
+
const dictFromTo = {
|
|
105
|
+
u_n: "x",
|
|
106
|
+
"u_{n+1}": "y",
|
|
107
|
+
};
|
|
108
|
+
return Object.entries(dictFromTo).reduce((acc, [strFrom, strTo]) => {
|
|
109
|
+
return acc.replaceAll(strFrom, strTo);
|
|
110
|
+
}, strSrc);
|
|
111
|
+
}
|
|
112
|
+
const [lhs, rhs] = strSrc.split("=");
|
|
113
|
+
const [lhsRefined, rhsRefined] = [lhs, rhs].map(workaroundReplacer);
|
|
114
|
+
const [nodeLhs, nodeRhs] = [lhsRefined, rhsRefined].map((str) => parseAlgebraic(str));
|
|
115
|
+
return new EqualNode(nodeLhs, nodeRhs);
|
|
116
|
+
}
|
|
117
|
+
const nodeAns = workaroundParser(ans);
|
|
118
|
+
if (!isEqualNode(nodeAns)) {
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
// const nodeAnswer = getAnswerNode(identifiers, opts) as EqualNode;
|
|
122
|
+
const nodeAnswer = workaroundParser(answer);
|
|
123
|
+
const isValidLhs = () => {
|
|
124
|
+
// return (
|
|
125
|
+
// substract(nodeAns.leftChild, nodeAnswer.leftChild)
|
|
126
|
+
// .simplify()
|
|
127
|
+
// .evaluate() === 0
|
|
128
|
+
// );
|
|
129
|
+
return [1, 10, 100].every((y) => {
|
|
130
|
+
return (substract(nodeAns.leftChild, nodeAnswer.leftChild).evaluate({
|
|
131
|
+
y,
|
|
132
|
+
}) === 0);
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
const isValidRhs = () => {
|
|
136
|
+
// return (
|
|
137
|
+
// substract(nodeAns.rightChild, nodeAnswer.rightChild)
|
|
138
|
+
// .simplify()
|
|
139
|
+
// .evaluate() === 0
|
|
140
|
+
// );
|
|
141
|
+
return [1, 10, 100].every((x) => {
|
|
142
|
+
return (substract(nodeAns.rightChild, nodeAnswer.rightChild).evaluate({
|
|
143
|
+
x,
|
|
144
|
+
}) === 0);
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
return isValidLhs() && isValidRhs();
|
|
148
|
+
}
|
|
149
|
+
catch (e) {
|
|
150
|
+
return handleVEAError(e);
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
const getGeometricFindRecurrenceFormulaFromSituationQuestion = (optsIn) => {
|
|
154
|
+
const opts = optsIn ?? optsDefault;
|
|
155
|
+
// const firstRank = opts?.firstTermRankOne ? 1 : 0;
|
|
156
|
+
const situationIndex = randint(0, situations.length);
|
|
157
|
+
const situation = situations[situationIndex];
|
|
158
|
+
const initial = situation.randInitial();
|
|
159
|
+
const reason = situation.randReason();
|
|
160
|
+
const superfluousData = opts.isWithSuperfluousData
|
|
161
|
+
? situation.randSuperfluousData()
|
|
162
|
+
: undefined;
|
|
163
|
+
const identifiers = {
|
|
164
|
+
situationIndex,
|
|
165
|
+
initial,
|
|
166
|
+
reason,
|
|
167
|
+
superfluousData,
|
|
168
|
+
};
|
|
169
|
+
return getQuestionFromIdentifiers(identifiers, opts);
|
|
170
|
+
};
|
|
171
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
172
|
+
const question = {
|
|
173
|
+
answer: getAnswer(identifiers, opts),
|
|
174
|
+
instruction: getInstruction(identifiers, opts),
|
|
175
|
+
keys: ["un", "equal", "n", "unplus1"],
|
|
176
|
+
answerFormat: "tex",
|
|
177
|
+
identifiers,
|
|
178
|
+
hint: getHint(identifiers, opts),
|
|
179
|
+
correction: getCorrection(identifiers, opts),
|
|
180
|
+
options: opts,
|
|
181
|
+
};
|
|
182
|
+
return question;
|
|
183
|
+
};
|
|
184
|
+
const optionsStuffFirstTermRankOne = getOptionFirstTermRankOneStuff(false);
|
|
185
|
+
const optionsStuffIsWithSuperfluousData = getOptionIsWithSuperfluousData(false);
|
|
186
|
+
const optsDefault = Object.assign({}, optionsStuffFirstTermRankOne.optsDefaultFirstTermRankOne, optionsStuffIsWithSuperfluousData.optsDefaultIsWithSuperfluousData);
|
|
187
|
+
const options = [
|
|
188
|
+
optionsStuffFirstTermRankOne.generatorOptionFirstTermRankOne,
|
|
189
|
+
optionsStuffIsWithSuperfluousData.generatorOptionIsWithSuperfluousData,
|
|
190
|
+
];
|
|
191
|
+
export const geometricFindRecurrenceFormulaFromSituation = {
|
|
192
|
+
id: "geometricFindRecurrenceFormulaFromSituation",
|
|
193
|
+
connector: "=",
|
|
194
|
+
label: "À partir d'une situation décrivant une évolution géométrique, exprimer la relation de récurrence",
|
|
195
|
+
isSingleStep: true,
|
|
196
|
+
generator: (nb, opts) => getDistinctQuestions(() => getGeometricFindRecurrenceFormulaFromSituationQuestion(opts), nb),
|
|
197
|
+
options,
|
|
198
|
+
qcmTimer: 60,
|
|
199
|
+
freeTimer: 60,
|
|
200
|
+
getPropositions,
|
|
201
|
+
isAnswerValid,
|
|
202
|
+
subject: "Mathématiques",
|
|
203
|
+
getQuestionFromIdentifiers,
|
|
204
|
+
hasHintAndCorrection: true,
|
|
205
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Exercise } from "../../../../../exercises/exercise.js";
|
|
2
|
+
import { OptionFirstTermRankOne } from "../../../../../exercises/options/optionFirstTermRankOne.js";
|
|
3
|
+
import { OptionIsWithSuperfluousData } from "../../../../../exercises/options/optionIsWithSuperfluousData.js";
|
|
4
|
+
import { SituationGeometricSuperfluousData } from "../../../../../math/utils/sequences/situations/seqGeometricSituations.js";
|
|
5
|
+
type Identifiers = {
|
|
6
|
+
situationIndex: number;
|
|
7
|
+
initial: number;
|
|
8
|
+
reason: number;
|
|
9
|
+
superfluousData?: SituationGeometricSuperfluousData;
|
|
10
|
+
rankAsked: number;
|
|
11
|
+
};
|
|
12
|
+
type Options = OptionFirstTermRankOne & OptionIsWithSuperfluousData;
|
|
13
|
+
export declare const geometricFindTermFromSituation: Exercise<Identifiers, Options>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=geometricFindTermFromSituation.d.ts.map
|
package/lib/exercises/math/sequences/geometric/situations/geometricFindTermFromSituation.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geometricFindTermFromSituation.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/sequences/geometric/situations/geometricFindTermFromSituation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,sBAAsB,EACvB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAEL,2BAA2B,EAC5B,MAAM,wDAAwD,CAAC;AAKhE,OAAO,EAEL,iCAAiC,EAElC,MAAM,iEAAiE,CAAC;AAazE,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,iCAAiC,CAAC;IACpD,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA2OF,KAAK,OAAO,GAAG,sBAAsB,GAAG,2BAA2B,CAAC;AAcpE,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAmBzE,CAAC"}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
|
|
2
|
+
import { getOptionFirstTermRankOneStuff, } from "../../../../../exercises/options/optionFirstTermRankOne.js";
|
|
3
|
+
import { getOptionIsWithSuperfluousData, } from "../../../../../exercises/options/optionIsWithSuperfluousData.js";
|
|
4
|
+
import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
|
|
5
|
+
import { isEquivalentNodes } from "../../../../../math/utils/functions/functionComparison.js";
|
|
6
|
+
import { randint } from "../../../../../math/utils/random/randint.js";
|
|
7
|
+
import { round } from "../../../../../math/utils/round.js";
|
|
8
|
+
import { situationsGeometric, } from "../../../../../math/utils/sequences/situations/seqGeometricSituations.js";
|
|
9
|
+
import { add } from "../../../../../tree/nodes/operators/addNode.js";
|
|
10
|
+
import { multiply } from "../../../../../tree/nodes/operators/multiplyNode.js";
|
|
11
|
+
import { power } from "../../../../../tree/nodes/operators/powerNode.js";
|
|
12
|
+
import { substract } from "../../../../../tree/nodes/operators/substractNode.js";
|
|
13
|
+
import { parseAlgebraic } from "../../../../../tree/parsers/latexParser.js";
|
|
14
|
+
import { coinFlip } from "../../../../../utils/alea/coinFlip.js";
|
|
15
|
+
const _getNodeFactor = (firstRank, varName = "n") => {
|
|
16
|
+
const nodeN = varName.toTree();
|
|
17
|
+
return firstRank === 0 ? nodeN : substract(nodeN, 1);
|
|
18
|
+
};
|
|
19
|
+
const situations = situationsGeometric;
|
|
20
|
+
const getInstruction = (identifiers, optsIn) => {
|
|
21
|
+
const opts = optsIn ?? optsDefault;
|
|
22
|
+
const firstRank = opts?.firstTermRankOne ? 1 : 0;
|
|
23
|
+
const { situationIndex, initial, reason, superfluousData, rankAsked } = identifiers;
|
|
24
|
+
const situation = situations[situationIndex];
|
|
25
|
+
return `${situation.getStrSituation(initial, reason, firstRank, superfluousData)}
|
|
26
|
+
|
|
27
|
+
Que vaut $u_{${rankAsked}}$ ?`;
|
|
28
|
+
};
|
|
29
|
+
const getAnswerNode = (identifiers, opts) => {
|
|
30
|
+
const firstRank = opts?.firstTermRankOne ? 1 : 0;
|
|
31
|
+
const { situationIndex, initial, reason, rankAsked } = identifiers;
|
|
32
|
+
const situation = situations[situationIndex];
|
|
33
|
+
return situation.variationFindRandomTerm.getAnswerNode(initial, reason, firstRank, rankAsked);
|
|
34
|
+
};
|
|
35
|
+
const getAnswer = (identifiers, optsIn) => {
|
|
36
|
+
const opts = optsIn ?? optsDefault;
|
|
37
|
+
return getAnswerNode(identifiers, opts).simplify().toTex();
|
|
38
|
+
};
|
|
39
|
+
const getHint = (identifiers, optsIn) => {
|
|
40
|
+
const opts = optsIn ?? optsDefault;
|
|
41
|
+
const firstRank = opts?.firstTermRankOne ? 1 : 0;
|
|
42
|
+
const { situationIndex, rankAsked } = identifiers;
|
|
43
|
+
const situation = situations[situationIndex];
|
|
44
|
+
return situation.variationFindRandomTerm.getHint(firstRank, rankAsked);
|
|
45
|
+
};
|
|
46
|
+
const getCorrection = (identifiers, optsIn) => {
|
|
47
|
+
const opts = optsIn ?? optsDefault;
|
|
48
|
+
const firstRank = opts?.firstTermRankOne ? 1 : 0;
|
|
49
|
+
const { situationIndex, initial, reason, rankAsked } = identifiers;
|
|
50
|
+
const situation = situations[situationIndex];
|
|
51
|
+
return situation.variationFindRandomTerm.getCorrectionStuff(initial, reason, firstRank, rankAsked).str;
|
|
52
|
+
};
|
|
53
|
+
const getPropositions = (n, { answer, ...identifiers }, optsIn) => {
|
|
54
|
+
const opts = optsIn ?? optsDefault;
|
|
55
|
+
const firstRank = opts?.firstTermRankOne ? 1 : 0;
|
|
56
|
+
const { situationIndex, initial, reason, rankAsked } = identifiers;
|
|
57
|
+
const situation = situations[situationIndex];
|
|
58
|
+
const propositions = [];
|
|
59
|
+
addValidProp(propositions, answer);
|
|
60
|
+
//student: type-specific mistake
|
|
61
|
+
{
|
|
62
|
+
const { situationIndex } = identifiers;
|
|
63
|
+
const situation = situations[situationIndex];
|
|
64
|
+
switch (situation.type) {
|
|
65
|
+
case "factor":
|
|
66
|
+
{
|
|
67
|
+
(() => { })();
|
|
68
|
+
}
|
|
69
|
+
break;
|
|
70
|
+
case "factorPercentage":
|
|
71
|
+
{
|
|
72
|
+
(() => { })();
|
|
73
|
+
}
|
|
74
|
+
break;
|
|
75
|
+
case "evo":
|
|
76
|
+
{
|
|
77
|
+
(() => { })();
|
|
78
|
+
}
|
|
79
|
+
break;
|
|
80
|
+
case "evoPercentage":
|
|
81
|
+
{
|
|
82
|
+
const evoPercentage = round((reason - 1) * 100, 2);
|
|
83
|
+
//student: reason = evoPercentage
|
|
84
|
+
{
|
|
85
|
+
const identifiersWrong = { ...identifiers, reason: evoPercentage };
|
|
86
|
+
tryToAddWrongProp(propositions, getAnswer(identifiersWrong, opts));
|
|
87
|
+
}
|
|
88
|
+
//student: reason = 100 + evoPercentage
|
|
89
|
+
{
|
|
90
|
+
const identifiersWrong = {
|
|
91
|
+
...identifiers,
|
|
92
|
+
reason: 100 + evoPercentage,
|
|
93
|
+
};
|
|
94
|
+
tryToAddWrongProp(propositions, getAnswer(identifiersWrong, opts));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
//student: geometric -> arithmetic
|
|
101
|
+
{
|
|
102
|
+
const nodeWrong = add(initial, multiply(reason, substract(rankAsked, firstRank))).simplify();
|
|
103
|
+
tryToAddWrongProp(propositions, nodeWrong.toTex());
|
|
104
|
+
}
|
|
105
|
+
if (coinFlip()) {
|
|
106
|
+
if (coinFlip()) {
|
|
107
|
+
//student: rankAsked - 1
|
|
108
|
+
{
|
|
109
|
+
const nodeWrong = situation.variationFindRandomTerm
|
|
110
|
+
.getAnswerNode(reason, initial, firstRank, rankAsked - 1)
|
|
111
|
+
.simplify();
|
|
112
|
+
tryToAddWrongProp(propositions, nodeWrong.toTex());
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
//student: rankAsked + 1
|
|
117
|
+
{
|
|
118
|
+
const nodeWrong = situation.variationFindRandomTerm
|
|
119
|
+
.getAnswerNode(reason, initial, firstRank, rankAsked + 1)
|
|
120
|
+
.simplify();
|
|
121
|
+
tryToAddWrongProp(propositions, nodeWrong.toTex());
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
//student: swaps(initial, reason)
|
|
126
|
+
{
|
|
127
|
+
const nodeWrong = situation.variationFindRandomTerm
|
|
128
|
+
.getAnswerNode(reason, initial, firstRank, rankAsked)
|
|
129
|
+
.simplify();
|
|
130
|
+
tryToAddWrongProp(propositions, nodeWrong.toTex());
|
|
131
|
+
}
|
|
132
|
+
//student: u_n = (initial ^ reason) * n
|
|
133
|
+
{
|
|
134
|
+
const nodeWrong = multiply(power(initial, reason), substract(rankAsked, firstRank)).simplify();
|
|
135
|
+
tryToAddWrongProp(propositions, nodeWrong.toTex());
|
|
136
|
+
}
|
|
137
|
+
//student: u_n = (initial * reason) ^ n
|
|
138
|
+
{
|
|
139
|
+
const nodeWrong = power(multiply(initial, reason), substract(rankAsked, firstRank)).simplify();
|
|
140
|
+
tryToAddWrongProp(propositions, nodeWrong.toTex());
|
|
141
|
+
}
|
|
142
|
+
return shuffleProps(propositions, n);
|
|
143
|
+
};
|
|
144
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
145
|
+
if (ans === answer) {
|
|
146
|
+
return true;
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
const nodeAns = parseAlgebraic(ans);
|
|
150
|
+
const nodeAnswer = parseAlgebraic(answer);
|
|
151
|
+
return isEquivalentNodes(nodeAns, nodeAnswer);
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
const getGeometricFindTermFromSituationQuestion = (optsIn) => {
|
|
155
|
+
const opts = optsIn ?? optsDefault;
|
|
156
|
+
const { isWithSuperfluousData } = opts;
|
|
157
|
+
const situationIndex = randint(0, situations.length);
|
|
158
|
+
const situation = situations[situationIndex];
|
|
159
|
+
const initial = situation.randInitial();
|
|
160
|
+
const reason = situation.randReason();
|
|
161
|
+
const superfluousData = isWithSuperfluousData
|
|
162
|
+
? situation.randSuperfluousData()
|
|
163
|
+
: undefined;
|
|
164
|
+
const rankAsked = randint(4, 15);
|
|
165
|
+
const identifiers = {
|
|
166
|
+
situationIndex,
|
|
167
|
+
initial,
|
|
168
|
+
reason,
|
|
169
|
+
superfluousData,
|
|
170
|
+
rankAsked,
|
|
171
|
+
};
|
|
172
|
+
return getQuestionFromIdentifiers(identifiers, opts);
|
|
173
|
+
};
|
|
174
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
175
|
+
const question = {
|
|
176
|
+
answer: getAnswer(identifiers, opts),
|
|
177
|
+
instruction: getInstruction(identifiers, opts),
|
|
178
|
+
keys: [],
|
|
179
|
+
answerFormat: "tex",
|
|
180
|
+
identifiers,
|
|
181
|
+
hint: getHint(identifiers, opts),
|
|
182
|
+
correction: getCorrection(identifiers, opts),
|
|
183
|
+
options: opts,
|
|
184
|
+
};
|
|
185
|
+
return question;
|
|
186
|
+
};
|
|
187
|
+
const optionsStuffFirstTermRankOne = getOptionFirstTermRankOneStuff(false);
|
|
188
|
+
const optionsStuffIsWithSuperfluousData = getOptionIsWithSuperfluousData(false);
|
|
189
|
+
const optsDefault = Object.assign({}, optionsStuffFirstTermRankOne.optsDefaultFirstTermRankOne, optionsStuffIsWithSuperfluousData.optsDefaultIsWithSuperfluousData);
|
|
190
|
+
const options = [
|
|
191
|
+
optionsStuffFirstTermRankOne.generatorOptionFirstTermRankOne,
|
|
192
|
+
optionsStuffIsWithSuperfluousData.generatorOptionIsWithSuperfluousData,
|
|
193
|
+
];
|
|
194
|
+
export const geometricFindTermFromSituation = {
|
|
195
|
+
id: "geometricFindTermFromSituation",
|
|
196
|
+
connector: "=",
|
|
197
|
+
label: "À partir d'une situation décrivant une évolution géométrique, exprimer un terme de rang $n$ demandé",
|
|
198
|
+
isSingleStep: true,
|
|
199
|
+
generator: (nb, opts) => getDistinctQuestions(() => getGeometricFindTermFromSituationQuestion(opts), nb),
|
|
200
|
+
options,
|
|
201
|
+
qcmTimer: 60,
|
|
202
|
+
freeTimer: 60,
|
|
203
|
+
getPropositions,
|
|
204
|
+
isAnswerValid,
|
|
205
|
+
subject: "Mathématiques",
|
|
206
|
+
getQuestionFromIdentifiers,
|
|
207
|
+
hasHintAndCorrection: true,
|
|
208
|
+
};
|
package/lib/exercises/math/sequences/geometric/situations/geometricFindThresholdFromSituation.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Exercise } from "../../../../../exercises/exercise.js";
|
|
2
|
+
import { OptionFirstTermRankOne } from "../../../../../exercises/options/optionFirstTermRankOne.js";
|
|
3
|
+
import { OptionIsWithSuperfluousData } from "../../../../../exercises/options/optionIsWithSuperfluousData.js";
|
|
4
|
+
import { InegalitySymbols } from "../../../../../math/inequations/inequation.js";
|
|
5
|
+
import { SituationGeometricSuperfluousData } from "../../../../../math/utils/sequences/situations/seqGeometricSituations.js";
|
|
6
|
+
type Identifiers = {
|
|
7
|
+
situationIndex: number;
|
|
8
|
+
initial: number;
|
|
9
|
+
reason: number;
|
|
10
|
+
superfluousData?: SituationGeometricSuperfluousData;
|
|
11
|
+
valueThreshold: number;
|
|
12
|
+
inegSymbol: InegalitySymbols;
|
|
13
|
+
};
|
|
14
|
+
type Options = OptionFirstTermRankOne & OptionIsWithSuperfluousData;
|
|
15
|
+
export declare const geometricFindThresholdFromSituation: Exercise<Identifiers, Options>;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=geometricFindThresholdFromSituation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geometricFindThresholdFromSituation.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/sequences/geometric/situations/geometricFindThresholdFromSituation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,sBAAsB,EACvB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAEL,2BAA2B,EAC5B,MAAM,wDAAwD,CAAC;AAGhE,OAAO,EACL,gBAAgB,EAGjB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAEL,iCAAiC,EAElC,MAAM,iEAAiE,CAAC;AAGzE,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,iCAAiC,CAAC;IACpD,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,gBAAgB,CAAC;CAC9B,CAAC;AAqKF,KAAK,OAAO,GAAG,sBAAsB,GAAG,2BAA2B,CAAC;AAcpE,eAAO,MAAM,mCAAmC,EAAE,QAAQ,CACxD,WAAW,EACX,OAAO,CAoBR,CAAC"}
|
package/lib/exercises/math/sequences/geometric/situations/geometricFindThresholdFromSituation.js
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, propWhile, } from "../../../../../exercises/exercise.js";
|
|
2
|
+
import { getOptionFirstTermRankOneStuff, } from "../../../../../exercises/options/optionFirstTermRankOne.js";
|
|
3
|
+
import { getOptionIsWithSuperfluousData, } from "../../../../../exercises/options/optionIsWithSuperfluousData.js";
|
|
4
|
+
import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
|
|
5
|
+
import { numberVEA } from "../../../../../exercises/vea/numberVEA.js";
|
|
6
|
+
import { InequationSymbol, InequationSymbolConstructor, } from "../../../../../math/inequations/inequation.js";
|
|
7
|
+
import { randint } from "../../../../../math/utils/random/randint.js";
|
|
8
|
+
import { situationsGeometric, } from "../../../../../math/utils/sequences/situations/seqGeometricSituations.js";
|
|
9
|
+
import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
|
|
10
|
+
const situations = situationsGeometric;
|
|
11
|
+
const getInstruction = (identifiers, optsIn) => {
|
|
12
|
+
const opts = optsIn ?? optsDefault;
|
|
13
|
+
const firstRank = opts?.firstTermRankOne ? 1 : 0;
|
|
14
|
+
const { situationIndex, initial, reason, superfluousData, inegSymbol } = identifiers;
|
|
15
|
+
const situation = situations[situationIndex];
|
|
16
|
+
const _inequationSymbol = new InequationSymbol(inegSymbol);
|
|
17
|
+
return `${situation.getStrSituation(initial, reason, firstRank, superfluousData)}
|
|
18
|
+
|
|
19
|
+
situation.variationFindThreshold.getStrQuestion!(
|
|
20
|
+
initial,
|
|
21
|
+
reason,
|
|
22
|
+
firstRank,
|
|
23
|
+
valueThreshold,
|
|
24
|
+
inequationSymbol,
|
|
25
|
+
)`;
|
|
26
|
+
};
|
|
27
|
+
const getAnswerNode = (_identifiers, _opts) => {
|
|
28
|
+
// const firstRank = opts?.firstTermRankOne ? 1 : 0;
|
|
29
|
+
// const { situationIndex, initial, reason, valueThreshold, inegSymbol } =
|
|
30
|
+
// identifiers;
|
|
31
|
+
// const situation = situations[situationIndex];
|
|
32
|
+
// const inequationSymbol = new InequationSymbol(inegSymbol);
|
|
33
|
+
// return situation.variationFindThreshold.getAnswerNode(
|
|
34
|
+
// initial,
|
|
35
|
+
// reason,
|
|
36
|
+
// firstRank,
|
|
37
|
+
// valueThreshold,
|
|
38
|
+
// inequationSymbol,
|
|
39
|
+
// );
|
|
40
|
+
return (0).toTree();
|
|
41
|
+
};
|
|
42
|
+
const getAnswer = (identifiers, optsIn) => {
|
|
43
|
+
const opts = optsIn ?? optsDefault;
|
|
44
|
+
return getAnswerNode(identifiers, opts).simplify().toTex();
|
|
45
|
+
};
|
|
46
|
+
const getHint = (_identifiers, _optsIn) => {
|
|
47
|
+
// const opts = optsIn ?? optsDefault;
|
|
48
|
+
// const firstRank = opts?.firstTermRankOne ? 1 : 0;
|
|
49
|
+
// const { situationIndex, valueThreshold, inegSymbol, reason } = identifiers;
|
|
50
|
+
// const situation = situations[situationIndex];
|
|
51
|
+
// const inequationSymbol = new InequationSymbol(inegSymbol);
|
|
52
|
+
// return situation.variationFindThreshold.getHint(
|
|
53
|
+
// firstRank,
|
|
54
|
+
// valueThreshold,
|
|
55
|
+
// inequationSymbol,
|
|
56
|
+
// reason,
|
|
57
|
+
// );
|
|
58
|
+
return "hint";
|
|
59
|
+
};
|
|
60
|
+
const getCorrection = (_identifiers, _optsIn) => {
|
|
61
|
+
// const opts = optsIn ?? optsDefault;
|
|
62
|
+
// const firstRank = opts?.firstTermRankOne ? 1 : 0;
|
|
63
|
+
// const { situationIndex, initial, reason, valueThreshold, inegSymbol } =
|
|
64
|
+
// identifiers;
|
|
65
|
+
// const situation = situations[situationIndex];
|
|
66
|
+
// const inequationSymbol = new InequationSymbol(inegSymbol);
|
|
67
|
+
// return situation.variationFindThreshold.getCorrectionStuff(
|
|
68
|
+
// initial,
|
|
69
|
+
// reason,
|
|
70
|
+
// firstRank,
|
|
71
|
+
// valueThreshold,
|
|
72
|
+
// inequationSymbol,
|
|
73
|
+
// ).str as string;
|
|
74
|
+
return "correction";
|
|
75
|
+
};
|
|
76
|
+
const getPropositions = (n, { answer, ..._identifiers }, _optsIn) => {
|
|
77
|
+
const propositions = [];
|
|
78
|
+
addValidProp(propositions, answer);
|
|
79
|
+
//filler
|
|
80
|
+
{
|
|
81
|
+
propWhile(propositions, n, () => {
|
|
82
|
+
tryToAddWrongProp(propositions, randint(1, 25).frenchify());
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
return shuffleProps(propositions, n);
|
|
86
|
+
};
|
|
87
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
88
|
+
try {
|
|
89
|
+
return numberVEA(ans, answer);
|
|
90
|
+
}
|
|
91
|
+
catch (err) {
|
|
92
|
+
return handleVEAError(err);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
const getGeometricFindThresholdFromSituationQuestion = (optsIn) => {
|
|
96
|
+
const opts = optsIn ?? optsDefault;
|
|
97
|
+
const { isWithSuperfluousData } = opts;
|
|
98
|
+
const firstRank = opts?.firstTermRankOne ? 1 : 0;
|
|
99
|
+
const situationIndex = randint(0, situations.length);
|
|
100
|
+
const situation = situations[situationIndex];
|
|
101
|
+
const initial = situation.randInitial();
|
|
102
|
+
const reason = situation.randReason();
|
|
103
|
+
const superfluousData = isWithSuperfluousData
|
|
104
|
+
? situation.randSuperfluousData()
|
|
105
|
+
: undefined;
|
|
106
|
+
const valueThreshold = situation.randThreshold(initial, reason, firstRank);
|
|
107
|
+
const inegSymbol = InequationSymbolConstructor.randomSymbol();
|
|
108
|
+
const identifiers = {
|
|
109
|
+
situationIndex,
|
|
110
|
+
initial,
|
|
111
|
+
reason,
|
|
112
|
+
superfluousData,
|
|
113
|
+
valueThreshold,
|
|
114
|
+
inegSymbol,
|
|
115
|
+
};
|
|
116
|
+
return getQuestionFromIdentifiers(identifiers, opts);
|
|
117
|
+
};
|
|
118
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
119
|
+
const question = {
|
|
120
|
+
answer: getAnswer(identifiers, opts),
|
|
121
|
+
instruction: getInstruction(identifiers, opts),
|
|
122
|
+
keys: [],
|
|
123
|
+
answerFormat: "tex",
|
|
124
|
+
identifiers,
|
|
125
|
+
hint: getHint(identifiers, opts),
|
|
126
|
+
correction: getCorrection(identifiers, opts),
|
|
127
|
+
options: opts,
|
|
128
|
+
};
|
|
129
|
+
return question;
|
|
130
|
+
};
|
|
131
|
+
const optionsStuffFirstTermRankOne = getOptionFirstTermRankOneStuff(false);
|
|
132
|
+
const optionsStuffIsWithSuperfluousData = getOptionIsWithSuperfluousData(false);
|
|
133
|
+
const optsDefault = Object.assign({}, optionsStuffFirstTermRankOne.optsDefaultFirstTermRankOne, optionsStuffIsWithSuperfluousData.optsDefaultIsWithSuperfluousData);
|
|
134
|
+
const options = [
|
|
135
|
+
optionsStuffFirstTermRankOne.generatorOptionFirstTermRankOne,
|
|
136
|
+
optionsStuffIsWithSuperfluousData.generatorOptionIsWithSuperfluousData,
|
|
137
|
+
];
|
|
138
|
+
export const geometricFindThresholdFromSituation = {
|
|
139
|
+
id: "geometricFindThresholdFromSituation",
|
|
140
|
+
connector: "=",
|
|
141
|
+
label: "À partir d'une situation décrivant une évolution géométrique, calculer un seuil",
|
|
142
|
+
isSingleStep: true,
|
|
143
|
+
generator: (nb, opts) => getDistinctQuestions(() => getGeometricFindThresholdFromSituationQuestion(opts), nb),
|
|
144
|
+
options,
|
|
145
|
+
qcmTimer: 60,
|
|
146
|
+
freeTimer: 60,
|
|
147
|
+
getPropositions,
|
|
148
|
+
isAnswerValid,
|
|
149
|
+
subject: "Mathématiques",
|
|
150
|
+
getQuestionFromIdentifiers,
|
|
151
|
+
hasHintAndCorrection: true,
|
|
152
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/sequences/geometric/situations/index.ts"],"names":[],"mappings":"AAAA,cAAc,gDAAgD,CAAC;AAC/D,cAAc,kDAAkD,CAAC;AACjE,cAAc,qCAAqC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from "./geometricFindExplicitFormulaFromSituation.js";
|
|
2
|
+
export * from "./geometricFindRecurrenceFormulaFromSituation.js";
|
|
3
|
+
export * from "./geometricFindTermFromSituation.js";
|
|
4
|
+
// export * from "./geometricFindRankFromSituation.js";
|
|
5
|
+
// export * from "./geometricFindThresholdFromSituation.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Exercise } from "../../../../../exercises/exercise.js";
|
|
2
|
+
import { OptionFirstTermRankOne } from "../../../../../exercises/options/optionFirstTermRankOne.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
initial: number;
|
|
5
|
+
reason: number;
|
|
6
|
+
nbTerms: number;
|
|
7
|
+
lowRankDots: number;
|
|
8
|
+
highRankDots: number;
|
|
9
|
+
};
|
|
10
|
+
type Options = OptionFirstTermRankOne & {
|
|
11
|
+
isGiveCount: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const geometricComputeSumWithDots: Exercise<Identifiers, Options>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=geometricComputeSumWithDots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geometricComputeSumWithDots.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/sequences/geometric/sum/geometricComputeSumWithDots.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,sBAAsB,EACvB,MAAM,mDAAmD,CAAC;AA0E3D,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AA6OF,KAAK,OAAO,GAAG,sBAAsB,GAAG;IAAE,WAAW,EAAE,OAAO,CAAA;CAAE,CAAC;AAiBjE,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkBtE,CAAC"}
|