math-exercises 3.0.57 → 3.0.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/exercises/exercise.d.ts +1 -0
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.d.ts.map +1 -1
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.js +46 -17
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.d.ts.map +1 -1
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.js +8 -2
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.js +15 -11
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerProduct.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerProduct.js +4 -5
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerSum.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerSum.js +4 -2
- package/lib/exercises/math/calcul/fractions/fractionSquare.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionSquare.js +0 -4
- package/lib/exercises/math/calcul/fractions/fractionsDivision.d.ts +6 -3
- package/lib/exercises/math/calcul/fractions/fractionsDivision.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsDivision.js +63 -28
- package/lib/exercises/math/calcul/fractions/fractionsOperations.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsOperations.js +0 -4
- package/lib/exercises/math/calcul/fractions/fractionsProduct.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsProduct.js +0 -4
- package/lib/exercises/math/calcul/fractions/fractionsSubstraction.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSubstraction.js +0 -4
- package/lib/exercises/math/calcul/fractions/fractionsSum.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSum.js +33 -12
- 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/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/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/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/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/areas/circleArea.js +1 -1
- 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/percent/findProportion.js +1 -1
- package/lib/exercises/math/percent/findTVA.js +1 -1
- package/lib/exercises/math/percent/htToTTC.js +1 -1
- package/lib/exercises/math/percent/reciprocalPercentage.js +1 -1
- package/lib/exercises/math/percent/ttcToHT.js +1 -1
- package/lib/exercises/math/powers/powersOfTenToDecimal.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersOfTenToDecimal.js +1 -0
- package/lib/exercises/math/primitive/klogUPrimitive.js +1 -1
- package/lib/exercises/math/primitive/logarithmePrimitive.js +1 -1
- 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/squareRoots/simpifySquareRoot.d.ts.map +1 -1
- package/lib/exercises/math/squareRoots/simpifySquareRoot.js +4 -4
- package/lib/exercises/math/squareRoots/squareRootEquation.d.ts.map +1 -1
- package/lib/exercises/math/squareRoots/squareRootEquation.js +4 -4
- package/lib/exercises/math/squareRoots/squareRootIdentities.d.ts +1 -0
- package/lib/exercises/math/squareRoots/squareRootIdentities.d.ts.map +1 -1
- package/lib/exercises/math/squareRoots/squareRootIdentities.js +64 -40
- package/lib/exercises/math/squareRoots/squareRootsDistributivity.d.ts.map +1 -1
- package/lib/exercises/math/squareRoots/squareRootsDistributivity.js +36 -23
- package/lib/exercises/math/squareRoots/squareRootsFractions.d.ts.map +1 -1
- package/lib/exercises/math/squareRoots/squareRootsFractions.js +4 -1
- package/lib/exercises/math/squareRoots/squareRootsProducts.d.ts.map +1 -1
- package/lib/exercises/math/squareRoots/squareRootsProducts.js +4 -1
- package/lib/exercises/math/squareRoots/squareRootsSum.d.ts.map +1 -1
- package/lib/exercises/math/squareRoots/squareRootsSum.js +4 -2
- package/lib/exercises/math/squareRoots/squareRootsToSquare.d.ts.map +1 -1
- package/lib/exercises/math/squareRoots/squareRootsToSquare.js +4 -2
- package/lib/exercises/math/trigonometry/arcValue.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/arcValue.js +67 -31
- package/lib/exercises/math/trigonometry/associatePoint.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/associatePoint.js +33 -16
- package/lib/exercises/math/trigonometry/basicEquationSin.js +6 -6
- package/lib/exercises/math/trigonometry/equationSinOnRandomInterval.js +3 -3
- package/lib/exercises/math/trigonometry/trigonometry.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/trigonometry.js +0 -5
- package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.js +0 -5
- package/lib/exercises/math/trigonometry/trigonometrySideCalcul.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/trigonometrySideCalcul.js +0 -5
- 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 +48 -44
- package/lib/index.d.ts.map +1 -1
- package/lib/tree/nodes/functions/logNode.js +2 -4
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +4 -0
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +4 -3
- package/lib/tree/parsers/latexParser.js +6 -2
- package/package.json +1 -1
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { Affine, AffineConstructor } from "../../../../../math/polynomials/affine.js";
|
|
4
|
+
import { randint } from "../../../../../math/utils/random/randint.js";
|
|
5
|
+
import { MultiplyNode, multiply, } from "../../../../../tree/nodes/operators/multiplyNode.js";
|
|
6
|
+
import { PowerNode, power } from "../../../../../tree/nodes/operators/powerNode.js";
|
|
7
|
+
import { substract } from "../../../../../tree/nodes/operators/substractNode.js";
|
|
8
|
+
import { parseAlgebraic } from "../../../../../tree/parsers/latexParser.js";
|
|
9
|
+
import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
|
|
10
|
+
import { alignTex } from "../../../../../utils/latex/alignTex.js";
|
|
11
|
+
const getInstruction = (identifiers) => {
|
|
12
|
+
const { affineA, affineB, power } = identifiers;
|
|
13
|
+
const affine = new Affine(affineA, affineB);
|
|
14
|
+
const powerTree = power.toTree();
|
|
15
|
+
const affineTree = affine.toTree();
|
|
16
|
+
const fct = new PowerNode(affineTree, powerTree);
|
|
17
|
+
return `Déterminer la fonction dérivée de la fonction $f$ définie par :
|
|
18
|
+
|
|
19
|
+
$$
|
|
20
|
+
f(x) = ${fct.toTex()}
|
|
21
|
+
$$`;
|
|
22
|
+
};
|
|
23
|
+
const getAnswer = (identifiers) => {
|
|
24
|
+
const { affineA, affineB, power } = identifiers;
|
|
25
|
+
const affine = new Affine(affineA, affineB);
|
|
26
|
+
const affineTree = affine.toTree();
|
|
27
|
+
const deriv = new MultiplyNode((power * affine.a).toTree(), new PowerNode(affineTree, (power - 1).toTree()));
|
|
28
|
+
return deriv.toTex();
|
|
29
|
+
};
|
|
30
|
+
const getHint = (identifiers) => {
|
|
31
|
+
return `On rappelle la règle de dérivation suivante :
|
|
32
|
+
|
|
33
|
+
$$
|
|
34
|
+
\\left(u^n \\right)' = n \\times u' \\times u^{n-1}
|
|
35
|
+
$$
|
|
36
|
+
`;
|
|
37
|
+
};
|
|
38
|
+
const getCorrection = (identifiers) => {
|
|
39
|
+
const { affineA, affineB, power: pow } = identifiers;
|
|
40
|
+
const affine = new Affine(affineA, affineB).toTree();
|
|
41
|
+
const affineTex = affine.toTex();
|
|
42
|
+
const answer = getAnswer(identifiers);
|
|
43
|
+
return `On sait que :
|
|
44
|
+
|
|
45
|
+
$$
|
|
46
|
+
\\left(u^n \\right)' = n \\times u' \\times u^{n-1}
|
|
47
|
+
$$
|
|
48
|
+
|
|
49
|
+
Ici, on a $n = ${pow}$, et $u(x) = ${affineTex}$, donc $u'(x) = ${affineA}$.
|
|
50
|
+
|
|
51
|
+
Ainsi,
|
|
52
|
+
|
|
53
|
+
${alignTex([
|
|
54
|
+
[
|
|
55
|
+
"f'(x)",
|
|
56
|
+
"=",
|
|
57
|
+
multiply(pow, multiply(affineA, power(affine, substract(pow, 1)))).toTex(),
|
|
58
|
+
],
|
|
59
|
+
["", "=", answer],
|
|
60
|
+
])}
|
|
61
|
+
`;
|
|
62
|
+
};
|
|
63
|
+
const getPowerCompositionDerivationQuestion = () => {
|
|
64
|
+
const affine = AffineConstructor.random(undefined, { excludes: [0] });
|
|
65
|
+
const power = randint(3, 10);
|
|
66
|
+
const identifiers = { affineA: affine.a, affineB: affine.b, power };
|
|
67
|
+
const question = {
|
|
68
|
+
answer: getAnswer(identifiers),
|
|
69
|
+
instruction: getInstruction(identifiers),
|
|
70
|
+
hint: getHint(identifiers),
|
|
71
|
+
correction: getCorrection(identifiers),
|
|
72
|
+
keys: ["x"],
|
|
73
|
+
answerFormat: "tex",
|
|
74
|
+
identifiers,
|
|
75
|
+
};
|
|
76
|
+
return question;
|
|
77
|
+
};
|
|
78
|
+
const getPropositions = (n, { answer, affineA, affineB, power }) => {
|
|
79
|
+
const propositions = [];
|
|
80
|
+
const affineTree = new Affine(affineA, affineB).toTree();
|
|
81
|
+
addValidProp(propositions, answer);
|
|
82
|
+
const powerN = new PowerNode(affineTree, power.toTree());
|
|
83
|
+
const powerNMinusOne = new PowerNode(affineTree, (power - 1).toTree());
|
|
84
|
+
tryToAddWrongProp(propositions, new MultiplyNode(power.toTree(), powerNMinusOne).toTex());
|
|
85
|
+
tryToAddWrongProp(propositions, new MultiplyNode(affineA.toTree(), powerN).toTex());
|
|
86
|
+
tryToAddWrongProp(propositions, new MultiplyNode(affineA.toTree(), powerNMinusOne).toTex());
|
|
87
|
+
tryToAddWrongProp(propositions, new MultiplyNode((power * affineA).toTree(), powerN).toTex());
|
|
88
|
+
while (propositions.length < n) {
|
|
89
|
+
tryToAddWrongProp(propositions, new MultiplyNode(randint(-10, 10).toTree(), powerN).toTex());
|
|
90
|
+
}
|
|
91
|
+
return shuffleProps(propositions, n);
|
|
92
|
+
};
|
|
93
|
+
const isAnswerValid = (ans, { answer, power, affineA, affineB }) => {
|
|
94
|
+
try {
|
|
95
|
+
const parsed = parseAlgebraic(ans);
|
|
96
|
+
if (!parsed)
|
|
97
|
+
return false;
|
|
98
|
+
return parsed.simplify({ forbidFactorize: true }).toTex() === answer;
|
|
99
|
+
}
|
|
100
|
+
catch (err) {
|
|
101
|
+
return handleVEAError(err);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
export const powerCompositionDerivation = {
|
|
105
|
+
id: "powerCompositionDerivation",
|
|
106
|
+
connector: "=",
|
|
107
|
+
label: "Dérivée de $\\left(ax+b\\right)^n$",
|
|
108
|
+
levels: ["1reSpé"],
|
|
109
|
+
isSingleStep: true,
|
|
110
|
+
sections: ["Dérivation"],
|
|
111
|
+
generator: (nb) => getDistinctQuestions(getPowerCompositionDerivationQuestion, nb),
|
|
112
|
+
qcmTimer: 60,
|
|
113
|
+
freeTimer: 60,
|
|
114
|
+
getPropositions,
|
|
115
|
+
isAnswerValid,
|
|
116
|
+
subject: "Mathématiques",
|
|
117
|
+
getAnswer,
|
|
118
|
+
getInstruction,
|
|
119
|
+
getHint,
|
|
120
|
+
getCorrection,
|
|
121
|
+
hasHintAndCorrection: true,
|
|
122
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"powerFunctionDerivative.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/derivation/derivative/power/powerFunctionDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAsJF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAiBzD,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { randint } from "../../../../../math/utils/random/randint.js";
|
|
4
|
+
import { NumberNode } from "../../../../../tree/nodes/numbers/numberNode.js";
|
|
5
|
+
import { MultiplyNode } from "../../../../../tree/nodes/operators/multiplyNode.js";
|
|
6
|
+
import { PowerNode } from "../../../../../tree/nodes/operators/powerNode.js";
|
|
7
|
+
import { VariableNode } from "../../../../../tree/nodes/variables/variableNode.js";
|
|
8
|
+
import { parseAlgebraic } from "../../../../../tree/parsers/latexParser.js";
|
|
9
|
+
import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
|
|
10
|
+
import { alignTex } from "../../../../../utils/latex/alignTex.js";
|
|
11
|
+
const getHint = (identifiers) => {
|
|
12
|
+
return `On rappelle que la dérivée de la fonction $kx^n$ est :
|
|
13
|
+
|
|
14
|
+
$$
|
|
15
|
+
k\\times n \\times x^{n-1}
|
|
16
|
+
$$`;
|
|
17
|
+
};
|
|
18
|
+
const getCorrection = (identifiers) => {
|
|
19
|
+
const { a, power } = identifiers;
|
|
20
|
+
return `La dérivée de la fonction $kx^n$ est :
|
|
21
|
+
|
|
22
|
+
$$
|
|
23
|
+
k\\times n \\times x^{n-1}
|
|
24
|
+
$$
|
|
25
|
+
|
|
26
|
+
Ici, on a $k = ${a}$ et $n = ${power}$.
|
|
27
|
+
|
|
28
|
+
On obtient donc :
|
|
29
|
+
|
|
30
|
+
${alignTex([
|
|
31
|
+
["f'(x)", "=", `${a} \\times ${power} \\times x^{${power}-1}`],
|
|
32
|
+
["", "=", getAnswer(identifiers)],
|
|
33
|
+
])}`;
|
|
34
|
+
};
|
|
35
|
+
const getInstruction = (identifiers) => {
|
|
36
|
+
const { a, power } = identifiers;
|
|
37
|
+
const statement = new MultiplyNode(new NumberNode(a), new PowerNode(new VariableNode("x"), new NumberNode(power)));
|
|
38
|
+
return `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par :
|
|
39
|
+
|
|
40
|
+
$$
|
|
41
|
+
f(x)=${statement.toTex()}
|
|
42
|
+
$$`;
|
|
43
|
+
};
|
|
44
|
+
const getAnswer = (identifiers) => {
|
|
45
|
+
const { a, power } = identifiers;
|
|
46
|
+
const answerStatement = power > 2
|
|
47
|
+
? new MultiplyNode(new NumberNode(a * power), new PowerNode(new VariableNode("x"), new NumberNode(power - 1)))
|
|
48
|
+
: new MultiplyNode(new NumberNode(a * power), new VariableNode("x"));
|
|
49
|
+
const answer = answerStatement.toTex();
|
|
50
|
+
return answer;
|
|
51
|
+
};
|
|
52
|
+
const getPowerFunctionDerivative = () => {
|
|
53
|
+
const a = randint(-9, 10, [0]);
|
|
54
|
+
const power = randint(2, 10);
|
|
55
|
+
const identifiers = { a, power };
|
|
56
|
+
const question = {
|
|
57
|
+
instruction: getInstruction(identifiers),
|
|
58
|
+
startStatement: `f'(x)`,
|
|
59
|
+
answer: getAnswer(identifiers),
|
|
60
|
+
keys: ["x"],
|
|
61
|
+
answerFormat: "tex",
|
|
62
|
+
identifiers,
|
|
63
|
+
hint: getHint(identifiers),
|
|
64
|
+
correction: getCorrection(identifiers),
|
|
65
|
+
};
|
|
66
|
+
return question;
|
|
67
|
+
};
|
|
68
|
+
const getPropositions = (n, { answer, a, power }) => {
|
|
69
|
+
const propositions = [];
|
|
70
|
+
addValidProp(propositions, answer);
|
|
71
|
+
if (power === 2)
|
|
72
|
+
tryToAddWrongProp(propositions, new MultiplyNode(new NumberNode(a), new VariableNode("x")).toTex());
|
|
73
|
+
if (power > 2)
|
|
74
|
+
tryToAddWrongProp(propositions, new MultiplyNode(new NumberNode(a), new PowerNode(new VariableNode("x"), new NumberNode(power - 1))).toTex());
|
|
75
|
+
tryToAddWrongProp(propositions, new MultiplyNode(new NumberNode(a * power), new PowerNode(new VariableNode("x"), new NumberNode(power))).toTex());
|
|
76
|
+
if (a !== 1)
|
|
77
|
+
tryToAddWrongProp(propositions, new MultiplyNode(new NumberNode(a - 1), new PowerNode(new VariableNode("x"), new NumberNode(power))).toTex());
|
|
78
|
+
while (propositions.length < n) {
|
|
79
|
+
const wrongExponent = randint(2, 10);
|
|
80
|
+
if (wrongExponent === 2) {
|
|
81
|
+
tryToAddWrongProp(propositions, new MultiplyNode(new NumberNode(a * wrongExponent), new VariableNode("x")).toTex());
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
tryToAddWrongProp(propositions, new MultiplyNode(new NumberNode(a * wrongExponent), new PowerNode(new VariableNode("x"), new NumberNode(wrongExponent - 1))).toTex());
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return shuffleProps(propositions, n);
|
|
88
|
+
};
|
|
89
|
+
const isAnswerValid = (ans, { answer, a, power }) => {
|
|
90
|
+
try {
|
|
91
|
+
const parsed = parseAlgebraic(ans);
|
|
92
|
+
if (!parsed)
|
|
93
|
+
return false;
|
|
94
|
+
return (parsed
|
|
95
|
+
.simplify({ towardsDistribute: true, forbidFactorize: true })
|
|
96
|
+
.toTex() === answer);
|
|
97
|
+
}
|
|
98
|
+
catch (err) {
|
|
99
|
+
return handleVEAError(err);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
export const powerFunctionDerivative = {
|
|
103
|
+
id: "powerFunctionDerivative",
|
|
104
|
+
connector: "=",
|
|
105
|
+
label: "Dérivée d'une fonction monôme",
|
|
106
|
+
isSingleStep: false,
|
|
107
|
+
generator: (nb) => getDistinctQuestions(getPowerFunctionDerivative, nb),
|
|
108
|
+
getPropositions,
|
|
109
|
+
isAnswerValid,
|
|
110
|
+
qcmTimer: 60,
|
|
111
|
+
freeTimer: 60,
|
|
112
|
+
subject: "Mathématiques",
|
|
113
|
+
getInstruction,
|
|
114
|
+
getAnswer,
|
|
115
|
+
getHint,
|
|
116
|
+
getCorrection,
|
|
117
|
+
hasHintAndCorrection: true,
|
|
118
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/derivation/derivative/sqrt/index.ts"],"names":[],"mappings":"AACA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rootFunctionDerivative.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/derivation/derivative/sqrt/rootFunctionDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA+FF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAiBxD,CAAC"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { addValidProp, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { randint } from "../../../../../math/utils/random/randint.js";
|
|
4
|
+
import { round } from "../../../../../math/utils/round.js";
|
|
5
|
+
import { sqrt } from "../../../../../tree/nodes/functions/sqrtNode.js";
|
|
6
|
+
import { frac } from "../../../../../tree/nodes/operators/fractionNode.js";
|
|
7
|
+
import { multiply } from "../../../../../tree/nodes/operators/multiplyNode.js";
|
|
8
|
+
import { parseAlgebraic } from "../../../../../tree/parsers/latexParser.js";
|
|
9
|
+
import { shuffle } from "../../../../../utils/alea/shuffle.js";
|
|
10
|
+
import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
|
|
11
|
+
import { alignTex } from "../../../../../utils/latex/alignTex.js";
|
|
12
|
+
const getStatementNode = (identifiers) => {
|
|
13
|
+
return multiply(identifiers.a, sqrt("x"));
|
|
14
|
+
};
|
|
15
|
+
const getInstruction = (identifiers) => {
|
|
16
|
+
return `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par :
|
|
17
|
+
|
|
18
|
+
$$
|
|
19
|
+
f(x) = ${getStatementNode(identifiers).toTex()}
|
|
20
|
+
$$ `;
|
|
21
|
+
};
|
|
22
|
+
const getAnswer = (identifiers) => {
|
|
23
|
+
return frac(identifiers.a, multiply(2, sqrt("x")))
|
|
24
|
+
.simplify()
|
|
25
|
+
.toTex();
|
|
26
|
+
};
|
|
27
|
+
const getHint = (identifiers) => {
|
|
28
|
+
return `La dérivée sur $]0; +\\infty[$ de la fonction $f(x) =\\sqrt{x}$ est :
|
|
29
|
+
|
|
30
|
+
$$
|
|
31
|
+
f'(x) = \\frac{1}{2\\sqrt{x}}
|
|
32
|
+
$$`;
|
|
33
|
+
};
|
|
34
|
+
const getCorrection = (identifiers) => {
|
|
35
|
+
const statement = getStatementNode(identifiers);
|
|
36
|
+
const answer = getAnswer(identifiers);
|
|
37
|
+
const a = identifiers.a;
|
|
38
|
+
return `La dérivée sur $]0; +\\infty[$ de la fonction $\\sqrt{x}$ est :
|
|
39
|
+
|
|
40
|
+
$$
|
|
41
|
+
\\frac{1}{2\\sqrt{x}}
|
|
42
|
+
$$
|
|
43
|
+
|
|
44
|
+
Ici, on a $f(x) = ${statement.toTex()}$.
|
|
45
|
+
|
|
46
|
+
On a donc :
|
|
47
|
+
|
|
48
|
+
${alignTex([
|
|
49
|
+
["f'(x)", "=", multiply(a, frac(1, multiply(2, sqrt("x")))).toTex()],
|
|
50
|
+
["", "=", answer],
|
|
51
|
+
])}
|
|
52
|
+
`;
|
|
53
|
+
};
|
|
54
|
+
const getRootFunctionDerivative = () => {
|
|
55
|
+
const a = randint(-19, 20, [0, 1]);
|
|
56
|
+
const identifiers = { a };
|
|
57
|
+
const question = {
|
|
58
|
+
instruction: getInstruction(identifiers),
|
|
59
|
+
startStatement: `f'(x)`,
|
|
60
|
+
answer: getAnswer(identifiers),
|
|
61
|
+
keys: ["x"],
|
|
62
|
+
answerFormat: "tex",
|
|
63
|
+
identifiers,
|
|
64
|
+
hint: getHint(identifiers),
|
|
65
|
+
correction: getCorrection(identifiers),
|
|
66
|
+
};
|
|
67
|
+
return question;
|
|
68
|
+
};
|
|
69
|
+
const getPropositions = (n, { answer, a }) => {
|
|
70
|
+
const propositions = [];
|
|
71
|
+
addValidProp(propositions, answer);
|
|
72
|
+
tryToAddWrongProp(propositions, `\\frac{${a}}{\\sqrt(x)}`);
|
|
73
|
+
tryToAddWrongProp(propositions, `${a}`);
|
|
74
|
+
tryToAddWrongProp(propositions, `\\frac{${a}}{x}`);
|
|
75
|
+
while (propositions.length < n) {
|
|
76
|
+
const randomA = randint(-9, 10, [0]);
|
|
77
|
+
const isEvenA = randomA / 2 === round(randomA / 2, 0);
|
|
78
|
+
if (isEvenA) {
|
|
79
|
+
tryToAddWrongProp(propositions, `\\frac{${randomA / 2}}{\\sqrt{x}}`);
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
tryToAddWrongProp(propositions, `\\frac{${randomA}}{2\\sqrt{x}}`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return shuffle(propositions);
|
|
86
|
+
};
|
|
87
|
+
const isAnswerValid = (ans, { answer, a }) => {
|
|
88
|
+
try {
|
|
89
|
+
const parsed = parseAlgebraic(ans);
|
|
90
|
+
if (!parsed)
|
|
91
|
+
return false;
|
|
92
|
+
const simplified = parsed.simplify();
|
|
93
|
+
return simplified.toTex() === answer;
|
|
94
|
+
}
|
|
95
|
+
catch (err) {
|
|
96
|
+
return handleVEAError(err);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
export const rootFunctionDerivative = {
|
|
100
|
+
id: "rootFunctionDerivative",
|
|
101
|
+
connector: "=",
|
|
102
|
+
label: "Dérivée d'une fonction racine carrée",
|
|
103
|
+
isSingleStep: false,
|
|
104
|
+
generator: (nb) => getDistinctQuestions(getRootFunctionDerivative, nb),
|
|
105
|
+
qcmTimer: 60,
|
|
106
|
+
freeTimer: 60,
|
|
107
|
+
getPropositions,
|
|
108
|
+
isAnswerValid,
|
|
109
|
+
subject: "Mathématiques",
|
|
110
|
+
getHint,
|
|
111
|
+
getCorrection,
|
|
112
|
+
getInstruction,
|
|
113
|
+
getAnswer,
|
|
114
|
+
hasHintAndCorrection: true,
|
|
115
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
affineA: number;
|
|
4
|
+
affineB: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const sqrtCompositionDerivation: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=sqrtCompositionDerivation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqrtCompositionDerivation.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/derivation/derivative/sqrt/sqrtCompositionDerivation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAqFF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAc3D,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { Affine, AffineConstructor } from "../../../../../math/polynomials/affine.js";
|
|
4
|
+
import { randint } from "../../../../../math/utils/random/randint.js";
|
|
5
|
+
import { SqrtNode } from "../../../../../tree/nodes/functions/sqrtNode.js";
|
|
6
|
+
import { FractionNode } from "../../../../../tree/nodes/operators/fractionNode.js";
|
|
7
|
+
import { MultiplyNode } from "../../../../../tree/nodes/operators/multiplyNode.js";
|
|
8
|
+
import { parseAlgebraic } from "../../../../../tree/parsers/latexParser.js";
|
|
9
|
+
import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
|
|
10
|
+
const getInstruction = (identifiers) => {
|
|
11
|
+
const { affineA, affineB } = identifiers;
|
|
12
|
+
const affine = new Affine(affineA, affineB);
|
|
13
|
+
const fct = new SqrtNode(affine.toTree());
|
|
14
|
+
return `Déterminer la dérivée de la fonction $f$ définie par :
|
|
15
|
+
|
|
16
|
+
$$
|
|
17
|
+
f(x) = ${fct.toTex()}
|
|
18
|
+
$$`;
|
|
19
|
+
};
|
|
20
|
+
const getAnswer = (identifiers) => {
|
|
21
|
+
const { affineA, affineB } = identifiers;
|
|
22
|
+
const affine = new Affine(affineA, affineB);
|
|
23
|
+
const fct = new SqrtNode(affine.toTree());
|
|
24
|
+
const fraction = new FractionNode(affine.a.toTree(), new MultiplyNode((2).toTree(), fct)).simplify();
|
|
25
|
+
return fraction.toTex();
|
|
26
|
+
};
|
|
27
|
+
const getSqrtCompositionDerivationQuestion = () => {
|
|
28
|
+
const affine = AffineConstructor.random();
|
|
29
|
+
const identifiers = { affineA: affine.a, affineB: affine.b };
|
|
30
|
+
const question = {
|
|
31
|
+
answer: getAnswer(identifiers),
|
|
32
|
+
instruction: getInstruction(identifiers),
|
|
33
|
+
keys: ["x"],
|
|
34
|
+
answerFormat: "tex",
|
|
35
|
+
identifiers,
|
|
36
|
+
};
|
|
37
|
+
return question;
|
|
38
|
+
};
|
|
39
|
+
const getPropositions = (n, { answer, affineA, affineB }) => {
|
|
40
|
+
const propositions = [];
|
|
41
|
+
addValidProp(propositions, answer);
|
|
42
|
+
const affine = new Affine(affineA, affineB);
|
|
43
|
+
const fct = new SqrtNode(affine.toTree());
|
|
44
|
+
tryToAddWrongProp(propositions, new MultiplyNode(affineA.toTree(), fct).toTex());
|
|
45
|
+
tryToAddWrongProp(propositions, new FractionNode(affine.a.toTree(), fct).simplify().toTex());
|
|
46
|
+
tryToAddWrongProp(propositions, new SqrtNode(affineA.toTree()).simplify().toTex());
|
|
47
|
+
while (propositions.length < n) {
|
|
48
|
+
tryToAddWrongProp(propositions, new FractionNode(randint(-10, 10).toTree(), new MultiplyNode((2).toTree(), fct))
|
|
49
|
+
.simplify()
|
|
50
|
+
.toTex());
|
|
51
|
+
}
|
|
52
|
+
return shuffleProps(propositions, n);
|
|
53
|
+
};
|
|
54
|
+
const isAnswerValid = (ans, { answer, affineA, affineB }) => {
|
|
55
|
+
try {
|
|
56
|
+
const parsed = parseAlgebraic(ans);
|
|
57
|
+
const simplified = parsed.simplify();
|
|
58
|
+
return simplified.toTex() === answer;
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
return handleVEAError(err);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
export const sqrtCompositionDerivation = {
|
|
65
|
+
id: "sqrtCompositionDerivation",
|
|
66
|
+
connector: "=",
|
|
67
|
+
label: "Dérivée de $\\sqrt{ax+b}$",
|
|
68
|
+
isSingleStep: true,
|
|
69
|
+
generator: (nb) => getDistinctQuestions(getSqrtCompositionDerivationQuestion, nb),
|
|
70
|
+
qcmTimer: 60,
|
|
71
|
+
freeTimer: 60,
|
|
72
|
+
getPropositions,
|
|
73
|
+
isAnswerValid,
|
|
74
|
+
subject: "Mathématiques",
|
|
75
|
+
getAnswer,
|
|
76
|
+
getInstruction,
|
|
77
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqrtProductDerivative.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/derivation/derivative/sqrt/sqrtProductDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA4EF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAiBvD,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, } from "../../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { randint } from "../../../../../math/utils/random/randint.js";
|
|
4
|
+
import { sqrt } from "../../../../../tree/nodes/functions/sqrtNode.js";
|
|
5
|
+
import { add } from "../../../../../tree/nodes/operators/addNode.js";
|
|
6
|
+
import { frac } from "../../../../../tree/nodes/operators/fractionNode.js";
|
|
7
|
+
import { multiply } from "../../../../../tree/nodes/operators/multiplyNode.js";
|
|
8
|
+
import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
|
|
9
|
+
const getPropositions = (n, { answer }) => {
|
|
10
|
+
const propositions = [];
|
|
11
|
+
addValidProp(propositions, answer);
|
|
12
|
+
while (propositions.length < n) {
|
|
13
|
+
throw Error("QCM not implemented");
|
|
14
|
+
}
|
|
15
|
+
return shuffleProps(propositions, n);
|
|
16
|
+
};
|
|
17
|
+
const getAnswer = (identifiers) => {
|
|
18
|
+
const { a, b } = identifiers;
|
|
19
|
+
//asqrt(x) + (ax+b)/2sqrt(x) = (2ax+ ax+b)/2sqrt(x)
|
|
20
|
+
return frac(add(multiply(3 * a, "x"), b), multiply(2, sqrt("x")))
|
|
21
|
+
.simplify()
|
|
22
|
+
.toTex();
|
|
23
|
+
};
|
|
24
|
+
const getFunction = (identifiers) => {
|
|
25
|
+
const { a, b } = identifiers;
|
|
26
|
+
return multiply(add(multiply(a, "x"), b).simplify({ forbidFactorize: true }), sqrt("x"));
|
|
27
|
+
};
|
|
28
|
+
const getInstruction = (identifiers) => {
|
|
29
|
+
return `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie sur $[0; +\\infty[$ par :
|
|
30
|
+
|
|
31
|
+
$$
|
|
32
|
+
f(x) = ${getFunction(identifiers).toTex()}
|
|
33
|
+
$$`;
|
|
34
|
+
};
|
|
35
|
+
const getHint = (identifiers) => {
|
|
36
|
+
return ``;
|
|
37
|
+
};
|
|
38
|
+
const getCorrection = (identifiers) => {
|
|
39
|
+
return ``;
|
|
40
|
+
};
|
|
41
|
+
const getKeys = (identifiers) => {
|
|
42
|
+
return ["x"];
|
|
43
|
+
};
|
|
44
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
45
|
+
try {
|
|
46
|
+
throw Error("VEA not implemented");
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
return handleVEAError(err);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
const getSqrtProductDerivativeQuestion = (ops) => {
|
|
53
|
+
const a = randint(-9, 10, [0]);
|
|
54
|
+
const b = randint(-9, 10);
|
|
55
|
+
const identifiers = { a, b };
|
|
56
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
57
|
+
};
|
|
58
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
59
|
+
return {
|
|
60
|
+
answer: getAnswer(identifiers),
|
|
61
|
+
instruction: getInstruction(identifiers),
|
|
62
|
+
keys: getKeys(identifiers),
|
|
63
|
+
answerFormat: "tex",
|
|
64
|
+
identifiers,
|
|
65
|
+
// hint: getHint(identifiers),
|
|
66
|
+
// correction: getCorrection(identifiers)
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
export const sqrtProductDerivative = {
|
|
70
|
+
id: "sqrtProductDerivative",
|
|
71
|
+
connector: "=",
|
|
72
|
+
label: "Dérivée de $(ax+b)\\sqrt{x}$",
|
|
73
|
+
isSingleStep: true,
|
|
74
|
+
generator: (nb, opts) => getDistinctQuestions(() => getSqrtProductDerivativeQuestion(opts), nb),
|
|
75
|
+
qcmTimer: 60,
|
|
76
|
+
freeTimer: 60,
|
|
77
|
+
getPropositions,
|
|
78
|
+
isAnswerValid,
|
|
79
|
+
subject: "Mathématiques",
|
|
80
|
+
getInstruction,
|
|
81
|
+
getHint,
|
|
82
|
+
getCorrection,
|
|
83
|
+
getAnswer,
|
|
84
|
+
getQuestionFromIdentifiers,
|
|
85
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
affineA: number;
|
|
4
|
+
affineB: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const cosCompositionDerivation: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=cosCompositionDerivation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cosCompositionDerivation.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/derivation/derivative/trigo/cosCompositionDerivation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAarC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAmFF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAc1D,CAAC"}
|