math-exercises 3.0.56 → 3.0.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/exercises/math/calcul/operations/operationsPriorities.d.ts +2 -0
- package/lib/exercises/math/calcul/operations/operationsPriorities.d.ts.map +1 -1
- package/lib/exercises/math/calcul/operations/operationsPriorities.js +46 -36
- package/lib/exercises/math/calculLitteral/equation/choseOperationToSolveEquation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/choseOperationToSolveEquation.js +65 -13
- package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +1 -4
- package/lib/exercises/math/calculLitteral/factorisation/facto1.d.ts +16 -0
- package/lib/exercises/math/calculLitteral/factorisation/facto1.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/factorisation/facto1.js +184 -0
- package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.js +43 -0
- package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/index.js +1 -1
- package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.js +23 -0
- package/lib/exercises/math/calculLitteral/systems/basicSystemResolution.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/systems/basicSystemResolution.js +23 -0
- package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.js +49 -0
- package/lib/exercises/math/conversion/capacityConversion.d.ts.map +1 -1
- package/lib/exercises/math/conversion/capacityConversion.js +68 -12
- package/lib/exercises/math/conversion/hoursToDecimal.d.ts.map +1 -1
- package/lib/exercises/math/conversion/hoursToDecimal.js +73 -15
- package/lib/exercises/math/conversion/lengthConversion.d.ts.map +1 -1
- package/lib/exercises/math/conversion/lengthConversion.js +55 -6
- package/lib/exercises/math/conversion/massConversion.d.ts.map +1 -1
- package/lib/exercises/math/conversion/massConversion.js +72 -16
- package/lib/exercises/math/conversion/volumeConversion.d.ts.map +1 -1
- package/lib/exercises/math/conversion/volumeConversion.js +72 -12
- package/lib/exercises/math/derivation/convexity/convexityQuadrinomials.d.ts +8 -0
- package/lib/exercises/math/derivation/convexity/convexityQuadrinomials.d.ts.map +1 -0
- package/lib/exercises/math/derivation/convexity/convexityQuadrinomials.js +102 -0
- package/lib/exercises/math/derivation/convexity/convexityTrinomials.d.ts +7 -0
- package/lib/exercises/math/derivation/convexity/convexityTrinomials.d.ts.map +1 -0
- package/lib/exercises/math/derivation/convexity/convexityTrinomials.js +52 -0
- package/lib/exercises/math/derivation/convexity/index.d.ts +4 -0
- package/lib/exercises/math/derivation/convexity/index.d.ts.map +1 -0
- package/lib/exercises/math/derivation/convexity/index.js +3 -0
- package/lib/exercises/math/derivation/convexity/inflexionPointQuadrinomials.d.ts +7 -0
- package/lib/exercises/math/derivation/convexity/inflexionPointQuadrinomials.d.ts.map +1 -0
- package/lib/exercises/math/derivation/convexity/inflexionPointQuadrinomials.js +134 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.d.ts +8 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.js +79 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.d.ts +8 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.js +85 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.d.ts +8 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.js +86 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.d.ts +8 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.js +76 -0
- package/lib/exercises/math/derivation/derivative/exp/index.d.ts +6 -0
- package/lib/exercises/math/derivation/derivative/exp/index.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/exp/index.js +5 -0
- package/lib/exercises/math/derivation/derivative/exp/secondDerivativeOfExpoFunction.d.ts +7 -0
- package/lib/exercises/math/derivation/derivative/exp/secondDerivativeOfExpoFunction.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/exp/secondDerivativeOfExpoFunction.js +84 -0
- package/lib/exercises/math/derivation/derivative/index.d.ts +6 -27
- package/lib/exercises/math/derivation/derivative/index.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/index.js +6 -27
- package/lib/exercises/math/derivation/derivative/ln/index.d.ts +4 -0
- package/lib/exercises/math/derivation/derivative/ln/index.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/ln/index.js +3 -0
- package/lib/exercises/math/derivation/derivative/ln/lnDerivativeOne.d.ts +8 -0
- package/lib/exercises/math/derivation/derivative/ln/lnDerivativeOne.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/ln/lnDerivativeOne.js +81 -0
- package/lib/exercises/math/derivation/derivative/ln/lnDerivativeThree.d.ts +8 -0
- package/lib/exercises/math/derivation/derivative/ln/lnDerivativeThree.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/ln/lnDerivativeThree.js +103 -0
- package/lib/exercises/math/derivation/derivative/ln/lnDerivativeTwo.d.ts +8 -0
- package/lib/exercises/math/derivation/derivative/ln/lnDerivativeTwo.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/ln/lnDerivativeTwo.js +77 -0
- package/lib/exercises/math/derivation/derivative/polynomial/constanteDerivative.d.ts +10 -0
- package/lib/exercises/math/derivation/derivative/polynomial/constanteDerivative.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/polynomial/constanteDerivative.js +71 -0
- package/lib/exercises/math/derivation/derivative/polynomial/firstDegreeDerivative.d.ts +11 -0
- package/lib/exercises/math/derivation/derivative/polynomial/firstDegreeDerivative.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/polynomial/firstDegreeDerivative.js +88 -0
- package/lib/exercises/math/derivation/derivative/polynomial/index.d.ts +8 -0
- package/lib/exercises/math/derivation/derivative/polynomial/index.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/polynomial/index.js +7 -0
- package/lib/exercises/math/derivation/derivative/polynomial/secondDegreeDerivative.d.ts +10 -0
- package/lib/exercises/math/derivation/derivative/polynomial/secondDegreeDerivative.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/polynomial/secondDegreeDerivative.js +115 -0
- package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfThirdDegreeFunction.d.ts +10 -0
- package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfThirdDegreeFunction.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfThirdDegreeFunction.js +80 -0
- package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfTrinom.d.ts +9 -0
- package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfTrinom.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfTrinom.js +67 -0
- package/lib/exercises/math/derivation/derivative/polynomial/thirdDegreeDerivative.d.ts +10 -0
- package/lib/exercises/math/derivation/derivative/polynomial/thirdDegreeDerivative.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/polynomial/thirdDegreeDerivative.js +134 -0
- package/lib/exercises/math/derivation/derivative/polynomial/usualderivative.d.ts +11 -0
- package/lib/exercises/math/derivation/derivative/polynomial/usualderivative.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/polynomial/usualderivative.js +97 -0
- package/lib/exercises/math/derivation/derivative/power/index.d.ts +3 -0
- package/lib/exercises/math/derivation/derivative/power/index.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/power/index.js +2 -0
- package/lib/exercises/math/derivation/derivative/power/powerCompositionDerivation.d.ts +9 -0
- package/lib/exercises/math/derivation/derivative/power/powerCompositionDerivation.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/power/powerCompositionDerivation.js +122 -0
- package/lib/exercises/math/derivation/derivative/power/powerFunctionDerivative.d.ts +8 -0
- package/lib/exercises/math/derivation/derivative/power/powerFunctionDerivative.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/power/powerFunctionDerivative.js +118 -0
- package/lib/exercises/math/derivation/derivative/sqrt/index.d.ts +3 -0
- package/lib/exercises/math/derivation/derivative/sqrt/index.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/sqrt/index.js +3 -0
- package/lib/exercises/math/derivation/derivative/sqrt/rootFunctionDerivative.d.ts +7 -0
- package/lib/exercises/math/derivation/derivative/sqrt/rootFunctionDerivative.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/sqrt/rootFunctionDerivative.js +115 -0
- package/lib/exercises/math/derivation/derivative/sqrt/sqrtCompositionDerivation.d.ts +8 -0
- package/lib/exercises/math/derivation/derivative/sqrt/sqrtCompositionDerivation.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/sqrt/sqrtCompositionDerivation.js +77 -0
- package/lib/exercises/math/derivation/derivative/sqrt/sqrtProductDerivative.d.ts +8 -0
- package/lib/exercises/math/derivation/derivative/sqrt/sqrtProductDerivative.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/sqrt/sqrtProductDerivative.js +85 -0
- package/lib/exercises/math/derivation/derivative/trigo/cosCompositionDerivation.d.ts +8 -0
- package/lib/exercises/math/derivation/derivative/trigo/cosCompositionDerivation.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/trigo/cosCompositionDerivation.js +81 -0
- package/lib/exercises/math/derivation/derivative/trigo/cosSecondDegreeDerivative.d.ts +7 -0
- package/lib/exercises/math/derivation/derivative/trigo/cosSecondDegreeDerivative.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/trigo/cosSecondDegreeDerivative.js +103 -0
- package/lib/exercises/math/derivation/derivative/trigo/index.d.ts +5 -0
- package/lib/exercises/math/derivation/derivative/trigo/index.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/trigo/index.js +4 -0
- package/lib/exercises/math/derivation/derivative/trigo/sinCompositionDerivation.d.ts +8 -0
- package/lib/exercises/math/derivation/derivative/trigo/sinCompositionDerivation.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/trigo/sinCompositionDerivation.js +70 -0
- package/lib/exercises/math/derivation/derivative/trigo/sinSecondDegreeDerivative.d.ts +7 -0
- package/lib/exercises/math/derivation/derivative/trigo/sinSecondDegreeDerivative.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/trigo/sinSecondDegreeDerivative.js +91 -0
- package/lib/exercises/math/derivation/derivativeNumberCalcul.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivativeNumberCalcul.js +4 -2
- package/lib/exercises/math/derivation/index.d.ts +2 -0
- package/lib/exercises/math/derivation/index.d.ts.map +1 -1
- package/lib/exercises/math/derivation/index.js +2 -0
- package/lib/exercises/math/derivation/variations/index.d.ts +2 -0
- package/lib/exercises/math/derivation/variations/index.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/index.js +1 -0
- package/lib/exercises/math/derivation/variations/thirdDegreeFunctionVariation.d.ts +11 -0
- package/lib/exercises/math/derivation/variations/thirdDegreeFunctionVariation.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/thirdDegreeFunctionVariation.js +168 -0
- package/lib/exercises/math/equaDiff/equaDiffAyPlusB.d.ts.map +1 -1
- package/lib/exercises/math/equaDiff/equaDiffAyPlusB.js +39 -22
- package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.d.ts.map +1 -1
- package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.js +7 -1
- package/lib/exercises/math/equaDiff/equaDiffGeneralForme.d.ts.map +1 -1
- package/lib/exercises/math/equaDiff/equaDiffGeneralForme.js +38 -15
- package/lib/exercises/math/equaDiff/equaDiffGeneralFormeWithIC.d.ts.map +1 -1
- package/lib/exercises/math/equaDiff/equaDiffGeneralFormeWithIC.js +29 -8
- package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.d.ts +8 -0
- package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.d.ts.map +1 -0
- package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.js +86 -0
- package/lib/exercises/math/equaDiff/index.d.ts +1 -1
- package/lib/exercises/math/equaDiff/index.d.ts.map +1 -1
- package/lib/exercises/math/equaDiff/index.js +1 -1
- package/lib/exercises/math/functions/affines/signFunction.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/signFunction.js +23 -11
- package/lib/exercises/math/functions/exponential/expEquation.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/expEquation.js +3 -0
- package/lib/exercises/math/functions/exponential/expFactorization.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/expFactorization.js +3 -0
- package/lib/exercises/math/functions/exponential/expSimplifiying.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/expSimplifiying.js +83 -45
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.js +12 -5
- package/lib/exercises/math/geometry/euclidianConstructions/buildRhombus.d.ts +2 -0
- package/lib/exercises/math/geometry/euclidianConstructions/buildRhombus.d.ts.map +1 -0
- package/lib/exercises/math/geometry/euclidianConstructions/buildRhombus.js +63 -0
- package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.js +68 -29
- package/lib/exercises/math/geometry/lines/cartesianEquationsIntersection.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/cartesianEquationsIntersection.js +56 -4
- package/lib/exercises/math/geometry/lines/drawLineFromCartesianEquation.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/drawLineFromCartesianEquation.js +71 -25
- package/lib/exercises/math/limits/polynomLimit.d.ts +1 -1
- package/lib/exercises/math/limits/polynomLimit.d.ts.map +1 -1
- package/lib/exercises/math/limits/polynomLimit.js +28 -9
- package/lib/exercises/math/limits/polynomLimitNoFI.d.ts +1 -1
- package/lib/exercises/math/limits/polynomLimitNoFI.d.ts.map +1 -1
- package/lib/exercises/math/limits/polynomLimitNoFI.js +29 -10
- package/lib/exercises/math/powers/calculateNegativePower.d.ts.map +1 -1
- package/lib/exercises/math/powers/calculateNegativePower.js +59 -16
- package/lib/exercises/math/powers/decimalToScientific.d.ts.map +1 -1
- package/lib/exercises/math/powers/decimalToScientific.js +55 -11
- package/lib/exercises/math/powers/index.d.ts +1 -0
- package/lib/exercises/math/powers/index.d.ts.map +1 -1
- package/lib/exercises/math/powers/index.js +1 -0
- package/lib/exercises/math/powers/powersDivision.d.ts +5 -2
- package/lib/exercises/math/powers/powersDivision.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersDivision.js +68 -53
- package/lib/exercises/math/powers/powersMixOperations.d.ts +1 -0
- package/lib/exercises/math/powers/powersMixOperations.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersMixOperations.js +88 -17
- package/lib/exercises/math/powers/powersOfTenMixOperations.d.ts +10 -0
- package/lib/exercises/math/powers/powersOfTenMixOperations.d.ts.map +1 -0
- package/lib/exercises/math/powers/powersOfTenMixOperations.js +129 -0
- package/lib/exercises/math/powers/powersOfTenToDecimal.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersOfTenToDecimal.js +32 -3
- package/lib/exercises/math/powers/powersProduct.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersProduct.js +1 -0
- package/lib/exercises/math/powers/scientificToDecimal.d.ts.map +1 -1
- package/lib/exercises/math/powers/scientificToDecimal.js +50 -10
- package/lib/exercises/math/primitive/klogUPrimitive.js +1 -1
- package/lib/exercises/math/primitive/logarithmePrimitive.js +1 -1
- package/lib/exercises/math/primitive/polynomialPrimitive.d.ts.map +1 -1
- package/lib/exercises/math/primitive/polynomialPrimitive.js +1 -0
- package/lib/exercises/math/probaStat/stats1var/averageList.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/averageList.js +4 -4
- package/lib/exercises/math/probaStat/stats1var/averageWithTable.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/averageWithTable.js +42 -11
- package/lib/exercises/math/probaStat/stats1var/choseReasoningForIndicator.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/choseReasoningForIndicator.js +8 -20
- package/lib/exercises/math/probaStat/stats1var/etendueList.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/etendueList.js +4 -6
- package/lib/exercises/math/probaStat/stats1var/interquartilesList.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/interquartilesList.js +4 -4
- package/lib/exercises/math/probaStat/stats1var/interquartilesTable.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/interquartilesTable.js +4 -4
- package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.js +13 -9
- package/lib/exercises/math/probaStat/stats1var/median.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/median.js +19 -14
- package/lib/exercises/math/probaStat/stats1var/medianList.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/medianList.js +3 -0
- package/lib/exercises/math/probaStat/stats1var/quartiles.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/quartiles.js +16 -11
- package/lib/exercises/math/probaStat/stats1var/quartilesList.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/quartilesList.js +18 -14
- package/lib/exercises/math/probaStat/stats1var/standardDeviationList.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/standardDeviationList.js +4 -4
- package/lib/exercises/math/probaStat/stats1var/standardDeviationTable.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/standardDeviationTable.js +4 -4
- package/lib/exercises/math/probaStat/stats1var/varianceList.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/varianceList.js +4 -4
- package/lib/exercises/math/probaStat/stats1var/varianceTable.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/varianceTable.js +4 -4
- package/lib/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.js +40 -2
- package/lib/exercises/math/sequences/geometric/geometricFirstTermsSum.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFirstTermsSum.js +32 -0
- package/lib/exercises/math/trigonometry/trigonometry.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/trigonometry.js +67 -1
- package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.js +89 -0
- package/lib/exercises/pc/index.d.ts +5 -5
- package/lib/exercises/pc/index.d.ts.map +1 -1
- package/lib/exercises/pc/index.js +5 -5
- package/lib/index.d.ts +56 -45
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/angle.d.ts.map +1 -1
- package/lib/math/geometry/angle.js +0 -5
- package/lib/math/geometry/vector.d.ts +1 -0
- package/lib/math/geometry/vector.d.ts.map +1 -1
- package/lib/math/geometry/vector.js +19 -0
- 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 +2 -0
- package/lib/math/systems/generalSystem.d.ts +6 -1
- package/lib/math/systems/generalSystem.d.ts.map +1 -1
- package/lib/math/systems/generalSystem.js +137 -0
- package/lib/math/utils/arithmetic/lcm.js +1 -1
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +4 -34
- package/lib/tree/nodes/algebraicNode.d.ts +1 -0
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equalNode.d.ts +7 -1
- package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equalNode.js +17 -9
- package/lib/tree/nodes/functions/logNode.js +2 -4
- package/lib/tree/nodes/operators/addNode.js +1 -1
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +35 -11
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +4 -3
- package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/powerNode.js +5 -0
- package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/intervalNode.js +3 -1
- package/lib/tree/parsers/latexParser.js +6 -2
- package/package.json +1 -1
|
@@ -6,12 +6,14 @@
|
|
|
6
6
|
* a/b ± c*d
|
|
7
7
|
*/
|
|
8
8
|
import { Exercise } from "../../../../exercises/exercise.js";
|
|
9
|
+
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
|
|
9
10
|
type Identifiers = {
|
|
10
11
|
type: number;
|
|
11
12
|
a: number;
|
|
12
13
|
b: number;
|
|
13
14
|
c: number;
|
|
14
15
|
d: number | undefined;
|
|
16
|
+
statementIds: NodeIdentifiers;
|
|
15
17
|
};
|
|
16
18
|
export declare const operationsPriorities: Exercise<Identifiers>;
|
|
17
19
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operationsPriorities.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/operations/operationsPriorities.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"operationsPriorities.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/operations/operationsPriorities.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAS7C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEtB,YAAY,EAAE,eAAe,CAAC;CAC/B,CAAC;AA6JF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAYtD,CAAC"}
|
|
@@ -7,17 +7,49 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
9
9
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
10
|
+
import { numberVEA } from "../../../../exercises/vea/numberVEA.js";
|
|
10
11
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
12
|
+
import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
11
13
|
import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
|
|
12
14
|
import { AddNode } from "../../../../tree/nodes/operators/addNode.js";
|
|
13
15
|
import { DivideNode } from "../../../../tree/nodes/operators/divideNode.js";
|
|
14
16
|
import { MultiplyNode } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
15
17
|
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
16
18
|
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
19
|
+
const getStartStatement = (identifiers) => {
|
|
20
|
+
const { statementIds } = identifiers;
|
|
21
|
+
return reifyAlgebraic(statementIds).toTex();
|
|
22
|
+
};
|
|
23
|
+
const getInstruction = (identifiers) => {
|
|
24
|
+
return `Calculer :
|
|
25
|
+
|
|
26
|
+
$$
|
|
27
|
+
${getStartStatement(identifiers)}
|
|
28
|
+
$$`;
|
|
29
|
+
};
|
|
30
|
+
const getAnswer = (identifiers) => {
|
|
31
|
+
const { statementIds } = identifiers;
|
|
32
|
+
return reifyAlgebraic(statementIds).simplify().toTex();
|
|
33
|
+
};
|
|
34
|
+
const getHint = (identifiers) => {
|
|
35
|
+
return ``;
|
|
36
|
+
};
|
|
37
|
+
const getCorrection = (identifiers) => {
|
|
38
|
+
return ``;
|
|
39
|
+
};
|
|
40
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
41
|
+
const question = {
|
|
42
|
+
instruction: getInstruction(identifiers),
|
|
43
|
+
startStatement: getStartStatement(identifiers),
|
|
44
|
+
answer: getAnswer(identifiers),
|
|
45
|
+
keys: [],
|
|
46
|
+
answerFormat: "tex",
|
|
47
|
+
identifiers,
|
|
48
|
+
};
|
|
49
|
+
return question;
|
|
50
|
+
};
|
|
17
51
|
const getPriorityQuestions = () => {
|
|
18
52
|
const type = randint(1, 9);
|
|
19
|
-
let startStatement = "";
|
|
20
|
-
let answer = "";
|
|
21
53
|
let a, b, c, d;
|
|
22
54
|
let statement;
|
|
23
55
|
switch (type) {
|
|
@@ -30,8 +62,6 @@ const getPriorityQuestions = () => {
|
|
|
30
62
|
: //a*b middle
|
|
31
63
|
new AddNode(new AddNode(new NumberNode(c), new MultiplyNode(new NumberNode(a), new NumberNode(b))), new NumberNode(d));
|
|
32
64
|
statement = statement.shuffle();
|
|
33
|
-
startStatement = statement.toTex();
|
|
34
|
-
answer = (a * b + c + d).toString();
|
|
35
65
|
break;
|
|
36
66
|
case 2: // a/b ±c±d
|
|
37
67
|
[b, c, d] = [1, 2, 3].map((el) => randint(-10, 11, [0]));
|
|
@@ -42,67 +72,50 @@ const getPriorityQuestions = () => {
|
|
|
42
72
|
: //a/b middle
|
|
43
73
|
new AddNode(new AddNode(new NumberNode(c), new DivideNode(new NumberNode(a), new NumberNode(b))), new NumberNode(d));
|
|
44
74
|
statement = statement.shuffle();
|
|
45
|
-
startStatement = statement.toTex();
|
|
46
|
-
answer = (a / b + c + d).toString();
|
|
47
75
|
break;
|
|
48
76
|
case 3: // a*b ± c*d
|
|
49
77
|
[a, b, c, d] = [1, 2, 3, 4].map((el) => randint(-10, 11));
|
|
50
78
|
statement = new AddNode(new MultiplyNode(new NumberNode(a), new NumberNode(b)), new MultiplyNode(new NumberNode(c), new NumberNode(d)));
|
|
51
|
-
startStatement = statement.toTex();
|
|
52
|
-
answer = (a * b + c * d).toString();
|
|
53
79
|
break;
|
|
54
80
|
case 4: // a*b ± c/d
|
|
55
81
|
[a, b] = [1, 2].map((el) => randint(-10, 11));
|
|
56
82
|
d = randint(-10, 11, [0]);
|
|
57
83
|
c = d * randint(0, 11);
|
|
58
84
|
statement = new AddNode(new MultiplyNode(new NumberNode(a), new NumberNode(b)), new DivideNode(new NumberNode(c), new NumberNode(d)));
|
|
59
|
-
statement = statement.shuffle();
|
|
60
|
-
startStatement = statement.toTex();
|
|
61
|
-
answer = (a * b + c / d).toString();
|
|
62
85
|
break;
|
|
63
86
|
case 5: // a/b ± c/d
|
|
64
87
|
[b, d] = [1, 2].map((el) => randint(-10, 11, [0]));
|
|
65
88
|
a = b * randint(0, 11);
|
|
66
89
|
c = d * randint(0, 11);
|
|
67
90
|
statement = new AddNode(new DivideNode(new NumberNode(a), new NumberNode(b)), new DivideNode(new NumberNode(c), new NumberNode(d)));
|
|
68
|
-
startStatement = statement.toTex();
|
|
69
|
-
answer = (a / b + c / d).toString();
|
|
70
91
|
break;
|
|
71
92
|
case 6: // a*b*c ± d
|
|
72
93
|
[a, b, c, d] = [1, 2, 3, 4].map((el) => randint(-10, 11, [0]));
|
|
73
94
|
statement = new AddNode(new MultiplyNode(new MultiplyNode(new NumberNode(a), new NumberNode(b)), new NumberNode(c)), new NumberNode(d));
|
|
74
|
-
statement = statement.shuffle();
|
|
75
|
-
startStatement = statement.toTex();
|
|
76
|
-
answer = (a * b * c + d).toString();
|
|
77
95
|
break;
|
|
78
96
|
case 7: //a/b*c et c*a/b
|
|
79
97
|
b = randint(2, 10);
|
|
80
98
|
a = b * randint(2, 10);
|
|
81
99
|
c = randint(2, 10);
|
|
82
100
|
statement = new MultiplyNode(new DivideNode(a.toTree(), b.toTree()), c.toTree()).shuffle();
|
|
83
|
-
answer = ((a / b) * c).frenchify();
|
|
84
|
-
startStatement = statement.toTex();
|
|
85
101
|
break;
|
|
86
102
|
case 8: //a+-b+-c
|
|
103
|
+
default:
|
|
87
104
|
a = randint(-15, 15);
|
|
88
105
|
b = randint(-10, 10);
|
|
89
106
|
c = b > 0 ? randint(-10, 0) : randint(-10, 10);
|
|
90
107
|
statement = new AddNode(new AddNode(a.toTree(), b.toTree()), c.toTree());
|
|
91
|
-
answer = (a + b + c).frenchify();
|
|
92
|
-
startStatement = statement.toTex();
|
|
93
108
|
break;
|
|
94
|
-
default:
|
|
95
|
-
throw Error("impossible");
|
|
96
109
|
}
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
110
|
+
const identifiers = {
|
|
111
|
+
type,
|
|
112
|
+
a,
|
|
113
|
+
b,
|
|
114
|
+
c,
|
|
115
|
+
d,
|
|
116
|
+
statementIds: statement.toIdentifiers(),
|
|
104
117
|
};
|
|
105
|
-
return
|
|
118
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
106
119
|
};
|
|
107
120
|
const getPropositions = (n, { answer }) => {
|
|
108
121
|
const propositions = [];
|
|
@@ -112,17 +125,13 @@ const getPropositions = (n, { answer }) => {
|
|
|
112
125
|
}
|
|
113
126
|
return shuffle(propositions);
|
|
114
127
|
};
|
|
115
|
-
const isAnswerValid = (
|
|
116
|
-
|
|
117
|
-
const texs = answerTree.toAllValidTexs();
|
|
118
|
-
return texs.includes(studentAns);
|
|
128
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
129
|
+
return numberVEA(ans, answer);
|
|
119
130
|
};
|
|
120
131
|
export const operationsPriorities = {
|
|
121
132
|
id: "operationsPriorities",
|
|
122
133
|
connector: "=",
|
|
123
134
|
label: "Priorités opératoires",
|
|
124
|
-
levels: ["5ème", "4ème"],
|
|
125
|
-
sections: ["Calculs"],
|
|
126
135
|
isSingleStep: true,
|
|
127
136
|
generator: (nb) => getDistinctQuestions(getPriorityQuestions, nb),
|
|
128
137
|
qcmTimer: 60,
|
|
@@ -130,4 +139,5 @@ export const operationsPriorities = {
|
|
|
130
139
|
getPropositions,
|
|
131
140
|
isAnswerValid,
|
|
132
141
|
subject: "Mathématiques",
|
|
142
|
+
getQuestionFromIdentifiers,
|
|
133
143
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"choseOperationToSolveEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/choseOperationToSolveEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;
|
|
1
|
+
{"version":3,"file":"choseOperationToSolveEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/choseOperationToSolveEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AA6MF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAoB/D,CAAC"}
|
|
@@ -77,17 +77,6 @@ $$
|
|
|
77
77
|
il faut d'abord effectuer :
|
|
78
78
|
`;
|
|
79
79
|
};
|
|
80
|
-
// const getHint: GetHint<Identifiers> = (identifiers) => {
|
|
81
|
-
// };
|
|
82
|
-
// const getCorrection: GetCorrection<Identifiers> = (identifiers) => {
|
|
83
|
-
// return ``
|
|
84
|
-
// };
|
|
85
|
-
const getKeys = (identifiers) => {
|
|
86
|
-
return [];
|
|
87
|
-
};
|
|
88
|
-
const isAnswerValid = (ans, { answer }) => {
|
|
89
|
-
throw Error("VEA not implemented");
|
|
90
|
-
};
|
|
91
80
|
const getChoseOperationToSolveEquationQuestion = (opts) => {
|
|
92
81
|
//ax=b avec a entier, ax+b = c tout entier, x/a = b tout entier, x+-a = b entiers ,
|
|
93
82
|
let a;
|
|
@@ -132,13 +121,76 @@ const getChoseOperationToSolveEquationQuestion = (opts) => {
|
|
|
132
121
|
const identifiers = { type, a, b, c };
|
|
133
122
|
return getQuestionFromIdentifiers(identifiers);
|
|
134
123
|
};
|
|
124
|
+
const getHint = (identifiers) => {
|
|
125
|
+
const { type } = identifiers;
|
|
126
|
+
switch (type) {
|
|
127
|
+
case 1:
|
|
128
|
+
//ax = b tous entiers
|
|
129
|
+
return `L'écriture $ax$ signifie $a$ multiplié par $x$.
|
|
130
|
+
|
|
131
|
+
Quelle opération permet d'annuler une multiplication ?`;
|
|
132
|
+
case 2:
|
|
133
|
+
// ax + b = c tous entiers
|
|
134
|
+
return `Quelle opération permet d'annuler une addition ?`;
|
|
135
|
+
case 3:
|
|
136
|
+
//ax-b = c tous entiers
|
|
137
|
+
return `Quelle opération permet d'annuler une soustraction ?`;
|
|
138
|
+
case 4:
|
|
139
|
+
//x/a = b tous entiers
|
|
140
|
+
return `Quelle opération permet d'annuler une division ?`;
|
|
141
|
+
case 5:
|
|
142
|
+
//x+a = b
|
|
143
|
+
return `Quelle opération permet d'annuler une addition ?`;
|
|
144
|
+
case 6:
|
|
145
|
+
default:
|
|
146
|
+
//x-a = b
|
|
147
|
+
return `Quelle opération permet d'annuler une soustraction ?`;
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
const getCorrection = (identifiers) => {
|
|
151
|
+
const { type, a, b, c } = identifiers;
|
|
152
|
+
switch (type) {
|
|
153
|
+
case 1:
|
|
154
|
+
//ax = b tous entiers
|
|
155
|
+
return `$${multiply(a, "x").toTex()}$ est une multiplication de $${a}$ par $x$.
|
|
156
|
+
|
|
157
|
+
Pour isoler $x$, il faut donc diviser par $${a}$.`;
|
|
158
|
+
case 2:
|
|
159
|
+
// ax + b = c tous entiers
|
|
160
|
+
return `Pour isoler $x$, on commence par passer $${b}$ à droite de l'équation.
|
|
161
|
+
|
|
162
|
+
Pour cela, il faut soustraire par $${b}$.`;
|
|
163
|
+
case 3:
|
|
164
|
+
//ax-b = c tous entiers
|
|
165
|
+
return `Pour isoler $x$, on commence par passer $${-b}$ à droite de l'équation.
|
|
166
|
+
|
|
167
|
+
Pour cela, il faut additionner par $${b}$.`;
|
|
168
|
+
case 4:
|
|
169
|
+
//x/a = b tous entiers
|
|
170
|
+
return `Pour isoler $x$, on doit "annuler" la division par $${a}$.
|
|
171
|
+
|
|
172
|
+
Pour cela, on multiplie par $${a}$.`;
|
|
173
|
+
case 5:
|
|
174
|
+
//x+a = b
|
|
175
|
+
return `Pour isoler $x$, il faut faire passer $${a}$ à droite de l'équation.
|
|
176
|
+
|
|
177
|
+
Pour cela, il faut soustraire par $${a}$.`;
|
|
178
|
+
case 6:
|
|
179
|
+
default:
|
|
180
|
+
//x-a = b
|
|
181
|
+
return `Pour isoler $x$, il faut faire passer $${-a}$ à droite de l'équation.
|
|
182
|
+
|
|
183
|
+
Pour cela, il faut additionner par $${a}$.`;
|
|
184
|
+
}
|
|
185
|
+
};
|
|
135
186
|
const getQuestionFromIdentifiers = (identifiers) => {
|
|
136
187
|
const question = {
|
|
137
188
|
answer: getAnswer(identifiers),
|
|
138
189
|
instruction: getInstruction(identifiers),
|
|
139
|
-
keys: getKeys(identifiers),
|
|
140
190
|
answerFormat: "tex",
|
|
141
191
|
identifiers,
|
|
192
|
+
hint: getHint(identifiers),
|
|
193
|
+
correction: getCorrection(identifiers),
|
|
142
194
|
};
|
|
143
195
|
return question;
|
|
144
196
|
};
|
|
@@ -151,10 +203,10 @@ export const choseOperationToSolveEquation = {
|
|
|
151
203
|
qcmTimer: 60,
|
|
152
204
|
freeTimer: 60,
|
|
153
205
|
getPropositions,
|
|
154
|
-
isAnswerValid,
|
|
155
206
|
subject: "Mathématiques",
|
|
156
207
|
getInstruction,
|
|
157
208
|
getAnswer,
|
|
158
209
|
answerType: "QCU",
|
|
159
210
|
getQuestionFromIdentifiers,
|
|
211
|
+
hasHintAndCorrection: true,
|
|
160
212
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiplicationEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/multiplicationEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAarC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA8HF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"multiplicationEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/multiplicationEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAarC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA8HF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAcxD,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* type (ax+b)(cx+d) ± (ax+b)(ex+f)
|
|
3
|
+
*/
|
|
4
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
5
|
+
/**
|
|
6
|
+
* facto du type (ax+b)(cx+d) ± (ax+b)(ex+f)
|
|
7
|
+
* b, d, f non nuls
|
|
8
|
+
*/
|
|
9
|
+
type Identifiers = {
|
|
10
|
+
affinesCoeffs: number[][];
|
|
11
|
+
operation: string;
|
|
12
|
+
affinesOrder: number[];
|
|
13
|
+
};
|
|
14
|
+
export declare const factoType1Exercise: Exercise<Identifiers>;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=facto1.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"facto1.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/facto1.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAwBrC;;;GAGG;AACH,KAAK,WAAW,GAAG;IAEjB,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAIlB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AA4NF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAepD,CAAC"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* type (ax+b)(cx+d) ± (ax+b)(ex+f)
|
|
3
|
+
*/
|
|
4
|
+
import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
5
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
6
|
+
import { Affine, AffineConstructor } from "../../../../math/polynomials/affine.js";
|
|
7
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
8
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
9
|
+
import { MultiplyNode, isMultiplyNode, multiply, } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
10
|
+
import { isPowerNode, isSquareNode, } from "../../../../tree/nodes/operators/powerNode.js";
|
|
11
|
+
import { substract, } from "../../../../tree/nodes/operators/substractNode.js";
|
|
12
|
+
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
13
|
+
import { random } from "../../../../utils/alea/random.js";
|
|
14
|
+
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
15
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
16
|
+
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
17
|
+
const getStatementNode = (identifiers) => {
|
|
18
|
+
const { affinesCoeffs, operation, affinesOrder } = identifiers;
|
|
19
|
+
const affines = affinesCoeffs.map((coeffs) => new Affine(coeffs[1], coeffs[0]));
|
|
20
|
+
const order = [[], []];
|
|
21
|
+
order[0][affinesOrder[0]] = affines[1];
|
|
22
|
+
order[1][affinesOrder[1]] = affines[2];
|
|
23
|
+
order[0][1 - affinesOrder[0]] = affines[0];
|
|
24
|
+
order[1][1 - affinesOrder[1]] = affines[0];
|
|
25
|
+
const statementTree = (operation === "add" ? add : substract)(new MultiplyNode(order[0][0].toTree(), order[0][1].toTree()), new MultiplyNode(order[1][0].toTree(), order[1][1].toTree()));
|
|
26
|
+
return statementTree;
|
|
27
|
+
};
|
|
28
|
+
const getInstruction = (identifiers) => {
|
|
29
|
+
const { affinesCoeffs, operation } = identifiers;
|
|
30
|
+
return `Factoriser et réduire :
|
|
31
|
+
|
|
32
|
+
$$
|
|
33
|
+
${getStatementNode(identifiers).toTex()}
|
|
34
|
+
$$`;
|
|
35
|
+
};
|
|
36
|
+
const getAnswerNode = (identifiers) => {
|
|
37
|
+
const { affinesCoeffs, operation } = identifiers;
|
|
38
|
+
const factor = new Affine(affinesCoeffs[0][1], affinesCoeffs[0][0]);
|
|
39
|
+
const affine2 = new Affine(affinesCoeffs[2][1], affinesCoeffs[2][0]);
|
|
40
|
+
const affine1 = new Affine(affinesCoeffs[1][1], affinesCoeffs[1][0]);
|
|
41
|
+
const secondTerm = (operation === "add"
|
|
42
|
+
? add(affine1.toTree(), affine2.toTree())
|
|
43
|
+
: substract(affine1.toTree(), affine2.toTree())).simplify({ forbidFactorize: true, towardsDistribute: true });
|
|
44
|
+
const sol = multiply(factor.toTree(), secondTerm).simplify({});
|
|
45
|
+
return sol;
|
|
46
|
+
};
|
|
47
|
+
const getAnswer = (identifiers) => {
|
|
48
|
+
return getAnswerNode(identifiers).toTex();
|
|
49
|
+
};
|
|
50
|
+
const getFactoType1Question = () => {
|
|
51
|
+
const a = randint(-9, 10, [0]);
|
|
52
|
+
const b = randint(-9, 10, [0]);
|
|
53
|
+
let operation = random(["add", "substract"]);
|
|
54
|
+
let c, d;
|
|
55
|
+
let e, f;
|
|
56
|
+
do {
|
|
57
|
+
c = randint(-9, 10, [0]);
|
|
58
|
+
d = randint(-9, 10, [0]);
|
|
59
|
+
e = randint(-9, 10, [0]);
|
|
60
|
+
f = randint(-9, 10, [0]);
|
|
61
|
+
} while (c / a === d / b ||
|
|
62
|
+
e / a === f / b ||
|
|
63
|
+
//éviter un multiple +-1
|
|
64
|
+
(operation === "add" && f === -d && Math.abs(e + c) === 1) ||
|
|
65
|
+
(operation === "substract" && f === d && Math.abs(e - c) === 1));
|
|
66
|
+
const identifiers = {
|
|
67
|
+
affinesCoeffs: [
|
|
68
|
+
[a, b],
|
|
69
|
+
[c, d],
|
|
70
|
+
[e, f],
|
|
71
|
+
],
|
|
72
|
+
operation,
|
|
73
|
+
affinesOrder: [random([0, 1]), random([0, 1])],
|
|
74
|
+
};
|
|
75
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
76
|
+
};
|
|
77
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
78
|
+
const question = {
|
|
79
|
+
instruction: getInstruction(identifiers),
|
|
80
|
+
startStatement: getStatementNode(identifiers).toTex(),
|
|
81
|
+
answer: getAnswer(identifiers),
|
|
82
|
+
keys: ["x"],
|
|
83
|
+
answerFormat: "tex",
|
|
84
|
+
identifiers,
|
|
85
|
+
hint: getHint(identifiers),
|
|
86
|
+
correction: getCorrection(identifiers),
|
|
87
|
+
};
|
|
88
|
+
return question;
|
|
89
|
+
};
|
|
90
|
+
const getHint = (identifiers) => {
|
|
91
|
+
return `On repère le facteur commun dans les deux termes de l'expression.
|
|
92
|
+
|
|
93
|
+
On utilise ensuite la propriété :
|
|
94
|
+
|
|
95
|
+
$$
|
|
96
|
+
k\\times a + k \\times b = k\\times (a+b)
|
|
97
|
+
$$`;
|
|
98
|
+
};
|
|
99
|
+
const getCorrection = (identifiers) => {
|
|
100
|
+
const { affinesCoeffs, operation, affinesOrder } = identifiers;
|
|
101
|
+
const affines = affinesCoeffs.map((coeffs) => new Affine(coeffs[1], coeffs[0]));
|
|
102
|
+
const order = [[], []];
|
|
103
|
+
order[0][affinesOrder[0]] = affines[1];
|
|
104
|
+
order[1][affinesOrder[1]] = affines[2];
|
|
105
|
+
order[0][1 - affinesOrder[0]] = affines[0];
|
|
106
|
+
order[1][1 - affinesOrder[1]] = affines[0];
|
|
107
|
+
const statementTree = (operation === "add" ? add : substract)(new MultiplyNode(order[0][0].toTree(), order[0][1].toTree()), new MultiplyNode(order[1][0].toTree(), order[1][1].toTree()));
|
|
108
|
+
return `On repère que le facteur commun dans les deux termes est :
|
|
109
|
+
|
|
110
|
+
$$
|
|
111
|
+
${affines[0].toTree().toTex()}
|
|
112
|
+
$$
|
|
113
|
+
|
|
114
|
+
On a donc :
|
|
115
|
+
|
|
116
|
+
${alignTex([
|
|
117
|
+
["", statementTree.toTex()],
|
|
118
|
+
[
|
|
119
|
+
"=",
|
|
120
|
+
multiply(affines[0].toTree(), (operation === "add" ? add : substract)(affines[1].toTree(), affines[2].toTree())).toTex(),
|
|
121
|
+
],
|
|
122
|
+
["=", getAnswer(identifiers)],
|
|
123
|
+
])}`;
|
|
124
|
+
};
|
|
125
|
+
const getPropositions = (n, { answer, affinesCoeffs, operation }) => {
|
|
126
|
+
const propositions = [];
|
|
127
|
+
addValidProp(propositions, answer);
|
|
128
|
+
const affines = affinesCoeffs.map((coeffs) => new Affine(coeffs[1], coeffs[0]));
|
|
129
|
+
tryToAddWrongProp(propositions, new MultiplyNode(affines[0].toTree(), affines[1]
|
|
130
|
+
.add(operation !== "add" ? affines[2] : affines[2].opposite())
|
|
131
|
+
.toTree()).toTex());
|
|
132
|
+
tryToAddWrongProp(propositions, new MultiplyNode(affines[1].toTree(), affines[0]
|
|
133
|
+
.add(operation === "add" ? affines[2] : affines[2].opposite())
|
|
134
|
+
.toTree()).toTex());
|
|
135
|
+
tryToAddWrongProp(propositions, new MultiplyNode(affines[2].toTree(), affines[0]
|
|
136
|
+
.add(operation === "add" ? affines[2] : affines[2].opposite())
|
|
137
|
+
.toTree()).toTex());
|
|
138
|
+
while (propositions.length < n) {
|
|
139
|
+
const wrongAnswer = new MultiplyNode(affines[0].toTree(), affines[1].add(AffineConstructor.differentRandoms(1)[0]).toTree());
|
|
140
|
+
tryToAddWrongProp(propositions, wrongAnswer.toTex());
|
|
141
|
+
}
|
|
142
|
+
return shuffle(propositions);
|
|
143
|
+
};
|
|
144
|
+
const isAnswerValid = (ans, { answer, ...identifiers }) => {
|
|
145
|
+
try {
|
|
146
|
+
const parsed = parseAlgebraic(ans);
|
|
147
|
+
if (!parsed)
|
|
148
|
+
return false;
|
|
149
|
+
if (answer !== "0" &&
|
|
150
|
+
!isMultiplyNode(parsed) &&
|
|
151
|
+
!isSquareNode(parsed) &&
|
|
152
|
+
!isPowerNode(parsed))
|
|
153
|
+
return false;
|
|
154
|
+
const simp = parsed.simplify({
|
|
155
|
+
forbidFactorize: true,
|
|
156
|
+
towardsDistribute: true,
|
|
157
|
+
});
|
|
158
|
+
const answerSimp = getAnswerNode(identifiers).simplify({
|
|
159
|
+
towardsDistribute: true,
|
|
160
|
+
forbidFactorize: true,
|
|
161
|
+
});
|
|
162
|
+
// const simp = parsed.simplify({});
|
|
163
|
+
return simp.toTex() === answerSimp.toTex();
|
|
164
|
+
}
|
|
165
|
+
catch (err) {
|
|
166
|
+
return handleVEAError(err);
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
export const factoType1Exercise = {
|
|
170
|
+
id: "facto1",
|
|
171
|
+
connector: "=",
|
|
172
|
+
isSingleStep: false,
|
|
173
|
+
label: "Factorisation du type $(ax+b)(cx+d) \\pm (ax+b)(ex+f)$",
|
|
174
|
+
generator: (nb) => getDistinctQuestions(getFactoType1Question, nb),
|
|
175
|
+
qcmTimer: 60,
|
|
176
|
+
freeTimer: 60,
|
|
177
|
+
getPropositions,
|
|
178
|
+
isAnswerValid,
|
|
179
|
+
subject: "Mathématiques",
|
|
180
|
+
getInstruction,
|
|
181
|
+
getAnswer,
|
|
182
|
+
getQuestionFromIdentifiers,
|
|
183
|
+
hasHintAndCorrection: true,
|
|
184
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factoType1Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoType1Exercise.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"factoType1Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoType1Exercise.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAwBrC;;;GAGG;AACH,KAAK,WAAW,GAAG;IAEjB,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAIlB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AA4NF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAepD,CAAC"}
|
|
@@ -13,6 +13,7 @@ import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
|
13
13
|
import { random } from "../../../../utils/alea/random.js";
|
|
14
14
|
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
15
15
|
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
16
|
+
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
16
17
|
const getStatementNode = (identifiers) => {
|
|
17
18
|
const { affinesCoeffs, operation, affinesOrder } = identifiers;
|
|
18
19
|
const affines = affinesCoeffs.map((coeffs) => new Affine(coeffs[1], coeffs[0]));
|
|
@@ -71,6 +72,9 @@ const getFactoType1Question = () => {
|
|
|
71
72
|
operation,
|
|
72
73
|
affinesOrder: [random([0, 1]), random([0, 1])],
|
|
73
74
|
};
|
|
75
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
76
|
+
};
|
|
77
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
74
78
|
const question = {
|
|
75
79
|
instruction: getInstruction(identifiers),
|
|
76
80
|
startStatement: getStatementNode(identifiers).toTex(),
|
|
@@ -78,9 +82,46 @@ const getFactoType1Question = () => {
|
|
|
78
82
|
keys: ["x"],
|
|
79
83
|
answerFormat: "tex",
|
|
80
84
|
identifiers,
|
|
85
|
+
hint: getHint(identifiers),
|
|
86
|
+
correction: getCorrection(identifiers),
|
|
81
87
|
};
|
|
82
88
|
return question;
|
|
83
89
|
};
|
|
90
|
+
const getHint = (identifiers) => {
|
|
91
|
+
return `On repère le facteur commun dans les deux termes de l'expression.
|
|
92
|
+
|
|
93
|
+
On utilise ensuite la propriété :
|
|
94
|
+
|
|
95
|
+
$$
|
|
96
|
+
k\\times a + k \\times b = k\\times (a+b)
|
|
97
|
+
$$`;
|
|
98
|
+
};
|
|
99
|
+
const getCorrection = (identifiers) => {
|
|
100
|
+
const { affinesCoeffs, operation, affinesOrder } = identifiers;
|
|
101
|
+
const affines = affinesCoeffs.map((coeffs) => new Affine(coeffs[1], coeffs[0]));
|
|
102
|
+
const order = [[], []];
|
|
103
|
+
order[0][affinesOrder[0]] = affines[1];
|
|
104
|
+
order[1][affinesOrder[1]] = affines[2];
|
|
105
|
+
order[0][1 - affinesOrder[0]] = affines[0];
|
|
106
|
+
order[1][1 - affinesOrder[1]] = affines[0];
|
|
107
|
+
const statementTree = (operation === "add" ? add : substract)(new MultiplyNode(order[0][0].toTree(), order[0][1].toTree()), new MultiplyNode(order[1][0].toTree(), order[1][1].toTree()));
|
|
108
|
+
return `On repère que le facteur commun dans les deux termes est :
|
|
109
|
+
|
|
110
|
+
$$
|
|
111
|
+
${affines[0].toTree().toTex()}
|
|
112
|
+
$$
|
|
113
|
+
|
|
114
|
+
On a donc :
|
|
115
|
+
|
|
116
|
+
${alignTex([
|
|
117
|
+
["", statementTree.toTex()],
|
|
118
|
+
[
|
|
119
|
+
"=",
|
|
120
|
+
multiply(affines[0].toTree(), (operation === "add" ? add : substract)(affines[1].toTree(), affines[2].toTree())).toTex(),
|
|
121
|
+
],
|
|
122
|
+
["=", getAnswer(identifiers)],
|
|
123
|
+
])}`;
|
|
124
|
+
};
|
|
84
125
|
const getPropositions = (n, { answer, affinesCoeffs, operation }) => {
|
|
85
126
|
const propositions = [];
|
|
86
127
|
addValidProp(propositions, answer);
|
|
@@ -138,4 +179,6 @@ export const factoType1Exercise = {
|
|
|
138
179
|
subject: "Mathématiques",
|
|
139
180
|
getInstruction,
|
|
140
181
|
getAnswer,
|
|
182
|
+
getQuestionFromIdentifiers,
|
|
183
|
+
hasHintAndCorrection: true,
|
|
141
184
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from "./factoIdRmq1.js";
|
|
2
2
|
export * from "./factoIdRmq2.js";
|
|
3
3
|
export * from "./factoIdRmq3.js";
|
|
4
|
-
export * from "./
|
|
4
|
+
export * from "./facto1.js";
|
|
5
5
|
export * from "./factorizeCanonicalForm.js";
|
|
6
6
|
export * from "./factorizeCanonicalFormWithSqrt.js";
|
|
7
7
|
export * from "./factoType2.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qCAAqC,CAAC;AACpD,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from "./factoIdRmq1.js";
|
|
2
2
|
export * from "./factoIdRmq2.js";
|
|
3
3
|
export * from "./factoIdRmq3.js";
|
|
4
|
-
export * from "./
|
|
4
|
+
export * from "./facto1.js";
|
|
5
5
|
export * from "./factorizeCanonicalForm.js";
|
|
6
6
|
export * from "./factorizeCanonicalFormWithSqrt.js";
|
|
7
7
|
export * from "./factoType2.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basicNiceValuesSystemResolution.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"basicNiceValuesSystemResolution.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAKtE,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,eAAe,EAAE,EAAE,CAAC;CAIhC,CAAC;AAkGF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAiBjE,CAAC"}
|
|
@@ -22,6 +22,26 @@ $$
|
|
|
22
22
|
|
|
23
23
|
*Donner le couple solution sous la forme $\\left(x;y\\right)$ : par exemple, si la solution est $x=2$ et $y=3$, alors on écrira $\\left(2;3\\right)$.*`;
|
|
24
24
|
};
|
|
25
|
+
const getHint = (identifiers) => {
|
|
26
|
+
return `On peut utilise la méthode par substitution ou bien celle par combinaison :
|
|
27
|
+
|
|
28
|
+
- Si une des variables est facile à isoler dans une des équations, alors on utilise la méthode par substitution : on isole cette variable, puis on injecte le résultat obtenu dans l'autre équation.
|
|
29
|
+
|
|
30
|
+
- Sinon, on utilise la méthode par combinaison : on multiple une (ou les deux) équation(s) par un nombre, afin que lorsqu'on additionne les deux équations, une des variables disparaisse.`;
|
|
31
|
+
};
|
|
32
|
+
const getCorrection = (identifiers) => {
|
|
33
|
+
const sys = GeneralSystemConstructor.fromIdentifiers(identifiers);
|
|
34
|
+
let corr = "";
|
|
35
|
+
corr += sys.toCorrectionTex();
|
|
36
|
+
corr += `
|
|
37
|
+
|
|
38
|
+
La solution du système est donc le couple :
|
|
39
|
+
|
|
40
|
+
$$
|
|
41
|
+
${getAnswer(identifiers)}
|
|
42
|
+
$$`;
|
|
43
|
+
return corr;
|
|
44
|
+
};
|
|
25
45
|
const getAnswer = (identifiers) => {
|
|
26
46
|
const sys = GeneralSystemConstructor.fromIdentifiers(identifiers);
|
|
27
47
|
const { x, y } = sys.solve();
|
|
@@ -41,6 +61,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
41
61
|
keys: [],
|
|
42
62
|
answerFormat: "tex",
|
|
43
63
|
identifiers,
|
|
64
|
+
hint: getHint(identifiers),
|
|
65
|
+
correction: getCorrection(identifiers),
|
|
44
66
|
};
|
|
45
67
|
return question;
|
|
46
68
|
};
|
|
@@ -80,4 +102,5 @@ export const basicNiceValuesSystemResolution = {
|
|
|
80
102
|
subject: "Mathématiques",
|
|
81
103
|
getQuestionFromIdentifiers,
|
|
82
104
|
rebuildIdentifiers,
|
|
105
|
+
hasHintAndCorrection: true,
|
|
83
106
|
};
|