math-exercises 3.0.67 → 3.0.69
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/fractions/fractionToPercentToDecimal.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionToPercentToDecimal.js +55 -37
- package/lib/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.js +4 -4
- package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.js +31 -18
- package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.js +59 -35
- package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.js +1 -1
- package/lib/exercises/math/combinatory/anagrams.d.ts.map +1 -1
- package/lib/exercises/math/combinatory/anagrams.js +18 -7
- package/lib/exercises/math/combinatory/ballsCounting.d.ts.map +1 -1
- package/lib/exercises/math/combinatory/ballsCounting.js +8 -6
- package/lib/exercises/math/combinatory/diceCounting.d.ts.map +1 -1
- package/lib/exercises/math/combinatory/diceCounting.js +62 -27
- package/lib/exercises/math/functions/absolute/absolueValueAffineEquation.d.ts.map +1 -1
- package/lib/exercises/math/functions/absolute/absolueValueAffineEquation.js +4 -0
- package/lib/exercises/math/functions/absolute/absolueValueInequationsSup.d.ts.map +1 -1
- package/lib/exercises/math/functions/absolute/absolueValueInequationsSup.js +4 -4
- package/lib/exercises/math/functions/absolute/absoluteValueEquations.d.ts.map +1 -1
- package/lib/exercises/math/functions/absolute/absoluteValueEquations.js +22 -10
- package/lib/exercises/math/functions/absolute/absoluteValueInequations.d.ts.map +1 -1
- package/lib/exercises/math/functions/absolute/absoluteValueInequations.js +22 -8
- package/lib/exercises/math/functions/affines/affineAdjustment.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineAdjustment.js +4 -4
- package/lib/exercises/math/functions/affines/affineAdjustmentComplete.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineAdjustmentComplete.js +4 -4
- package/lib/exercises/math/functions/affines/affineAdjustmentRsquared.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineAdjustmentRsquared.js +4 -4
- package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.js +4 -4
- package/lib/exercises/math/functions/affines/affineExpressionReading.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineExpressionReading.js +1 -0
- package/lib/exercises/math/functions/affines/affineMeanValue.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineMeanValue.js +33 -14
- package/lib/exercises/math/functions/affines/algebricExpressionOfAffine.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/algebricExpressionOfAffine.js +4 -4
- package/lib/exercises/math/functions/affines/leadingCoeffAndOriginOrdinate.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/leadingCoeffAndOriginOrdinate.js +4 -0
- package/lib/exercises/math/functions/affines/leadingCoefficient.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/leadingCoefficient.js +4 -5
- package/lib/exercises/math/functions/affines/leadingCoefficientCalculV1.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/leadingCoefficientCalculV1.js +4 -2
- package/lib/exercises/math/functions/basics/graphicEquation.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/graphicEquation.js +4 -2
- package/lib/exercises/math/functions/basics/graphicInequation.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/graphicInequation.js +4 -2
- package/lib/exercises/math/functions/basics/graphicInequationAffine.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/graphicInequationAffine.js +4 -5
- package/lib/exercises/math/functions/basics/imageAntecedentFromSentence.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/imageAntecedentFromSentence.js +4 -3
- package/lib/exercises/math/functions/basics/inverseImageFunction.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/inverseImageFunction.js +4 -6
- package/lib/exercises/math/functions/basics/inverseImageFunctionGeogebra.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/inverseImageFunctionGeogebra.js +0 -2
- package/lib/exercises/math/functions/basics/inverseImageFunctionTable.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/inverseImageFunctionTable.js +16 -15
- package/lib/exercises/math/functions/basics/twoFunctionsEquation.d.ts +1 -0
- package/lib/exercises/math/functions/basics/twoFunctionsEquation.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/twoFunctionsEquation.js +46 -32
- package/lib/exercises/math/functions/basics/twoFunctionsInequation.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/twoFunctionsInequation.js +4 -2
- package/lib/exercises/math/functions/cube/cubicEquation.d.ts.map +1 -1
- package/lib/exercises/math/functions/cube/cubicEquation.js +4 -3
- package/lib/exercises/math/functions/exponentials/exponentialsVariations.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponentials/exponentialsVariations.js +4 -1
- package/lib/exercises/math/functions/integral/integralAffines.d.ts.map +1 -1
- package/lib/exercises/math/functions/integral/integralAffines.js +4 -2
- package/lib/exercises/math/functions/integral/integralDerivatedUCosU.d.ts.map +1 -1
- package/lib/exercises/math/functions/integral/integralDerivatedUCosU.js +27 -12
- package/lib/exercises/math/functions/integral/integralDerivatedUSinU.d.ts.map +1 -1
- package/lib/exercises/math/functions/integral/integralDerivatedUSinU.js +26 -11
- package/lib/exercises/math/functions/integral/integralExpAxPlusB.d.ts.map +1 -1
- package/lib/exercises/math/functions/integral/integralExpAxPlusB.js +26 -11
- package/lib/exercises/math/functions/integral/integralExpU.d.ts.map +1 -1
- package/lib/exercises/math/functions/integral/integralExpU.js +38 -20
- package/lib/exercises/math/functions/integral/integralFractions.d.ts.map +1 -1
- package/lib/exercises/math/functions/integral/integralFractions.js +40 -21
- package/lib/exercises/math/functions/integral/integralKCosinus.d.ts.map +1 -1
- package/lib/exercises/math/functions/integral/integralKCosinus.js +29 -12
- package/lib/exercises/math/functions/integral/integralKSinus.d.ts.map +1 -1
- package/lib/exercises/math/functions/integral/integralKSinus.js +29 -12
- package/lib/exercises/math/functions/integral/integralTrinomials.d.ts.map +1 -1
- package/lib/exercises/math/functions/integral/integralTrinomials.js +4 -2
- package/lib/exercises/math/functions/logarithm/log10PowerSimplifying.d.ts +0 -1
- package/lib/exercises/math/functions/logarithm/log10PowerSimplifying.d.ts.map +1 -1
- package/lib/exercises/math/functions/logarithm/log10PowerSimplifying.js +36 -15
- package/lib/exercises/math/functions/logarithm/log10Simplifying.d.ts.map +1 -1
- package/lib/exercises/math/functions/logarithm/log10Simplifying.js +43 -22
- package/lib/exercises/math/functions/logarithm/logEquation.d.ts.map +1 -1
- package/lib/exercises/math/functions/logarithm/logEquation.js +20 -11
- package/lib/exercises/math/functions/logarithm/logPowerEquation.d.ts.map +1 -1
- package/lib/exercises/math/functions/logarithm/logPowerEquation.js +26 -14
- package/lib/exercises/math/functions/logarithm/logSimplifiying.d.ts.map +1 -1
- package/lib/exercises/math/functions/logarithm/logSimplifiying.js +4 -3
- package/lib/exercises/math/functions/parity/parityFromAlgebra.d.ts.map +1 -1
- package/lib/exercises/math/functions/parity/parityFromAlgebra.js +29 -13
- package/lib/exercises/math/functions/parity/parityFromGraph.d.ts.map +1 -1
- package/lib/exercises/math/functions/parity/parityFromGraph.js +30 -12
- package/lib/exercises/math/functions/rationalFraction/rationalFractionForbiddenValue.d.ts.map +1 -1
- package/lib/exercises/math/functions/rationalFraction/rationalFractionForbiddenValue.js +27 -14
- package/lib/exercises/math/functions/sign/affineProductSign.d.ts.map +1 -1
- package/lib/exercises/math/functions/sign/affineProductSign.js +4 -4
- package/lib/exercises/math/functions/square/squareImageInterval.d.ts.map +1 -1
- package/lib/exercises/math/functions/square/squareImageInterval.js +39 -19
- package/lib/exercises/math/functions/trinoms/devForm/coefficientsIdentification.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/devForm/coefficientsIdentification.js +4 -3
- package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.d.ts +1 -0
- package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.js +26 -9
- package/lib/exercises/math/functions/trinoms/equation/deltaTrinom.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/equation/deltaTrinom.js +25 -10
- package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationByFactorisation.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationByFactorisation.js +4 -2
- package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationFromCano.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationFromCano.js +4 -2
- package/lib/exercises/math/functions/trinoms/factoForm/factorizedFormFromRoots.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/factoForm/factorizedFormFromRoots.js +4 -4
- package/lib/exercises/math/functions/trinoms/parabole/paraboleExpressionReading.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/parabole/paraboleExpressionReading.js +4 -5
- package/lib/exercises/math/functions/trinoms/parabole/trinomSymetryAxisFromFacto.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/parabole/trinomSymetryAxisFromFacto.js +4 -4
- package/lib/exercises/math/functions/trinoms/roots/findSecondRoot.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/findSecondRoot.js +4 -4
- package/lib/exercises/math/functions/trinoms/roots/niceRootsFromDevForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/niceRootsFromDevForm.js +4 -2
- package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.js +4 -2
- package/lib/exercises/math/functions/trinoms/roots/rootsFromFactorizedForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/rootsFromFactorizedForm.js +4 -2
- package/lib/exercises/math/functions/trinoms/roots/rootsProduct.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/rootsProduct.js +4 -4
- package/lib/exercises/math/functions/trinoms/roots/rootsReading.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/rootsReading.js +4 -3
- package/lib/exercises/math/functions/trinoms/roots/rootsSum.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/rootsSum.js +4 -4
- package/lib/exercises/math/functions/trinoms/sign/trinomSignFromFacto.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/sign/trinomSignFromFacto.js +4 -0
- package/lib/exercises/math/functions/trinoms/sign/trinomSignFromRoots.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/sign/trinomSignFromRoots.js +4 -0
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaFromDevForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaFromDevForm.js +32 -11
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/canonicalFromDevForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/canonicalFromDevForm.js +24 -9
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumFromCanonicalForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumFromCanonicalForm.js +24 -9
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.d.ts +1 -0
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.js +29 -12
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromDevForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromDevForm.js +4 -0
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromRoots.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromRoots.js +4 -0
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitReading.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitReading.js +3 -0
- package/lib/exercises/math/functions/trinoms/trinomialMeanValue.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/trinomialMeanValue.js +33 -14
- package/lib/exercises/math/geometry/cartesian/cartesianFromTwoPoints.js +1 -1
- package/lib/exercises/math/geometry/euclidianConstructions/buildMediatriceWithCompass.d.ts +2 -0
- package/lib/exercises/math/geometry/euclidianConstructions/buildMediatriceWithCompass.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidianConstructions/buildMediatriceWithCompass.js +55 -27
- package/lib/exercises/math/geometry/euclidianConstructions/buildPointFromAxialSymetry.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidianConstructions/buildPointFromAxialSymetry.js +4 -0
- package/lib/exercises/math/geometry/euclidianConstructions/buildTriangleWithSizes.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidianConstructions/buildTriangleWithSizes.js +4 -0
- package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.js +6 -2
- package/lib/exercises/math/geometry/lines/isPointOnCartesianLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/isPointOnCartesianLine.js +7 -5
- package/lib/exercises/math/geometry/lines/isPointOnLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/isPointOnLine.js +4 -0
- package/lib/exercises/math/geometry/parametric/extractPointFromParametricLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/parametric/extractPointFromParametricLine.js +4 -0
- package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.js +4 -0
- package/lib/exercises/math/geometry/parametric/pointFromParametricLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/parametric/pointFromParametricLine.js +4 -0
- package/lib/exercises/math/geometry/perimeters/circleRadiusFromPerimeter.d.ts.map +1 -1
- package/lib/exercises/math/geometry/perimeters/circleRadiusFromPerimeter.js +4 -0
- package/lib/exercises/math/geometry/perimeters/rectangleSideFromPerimeter.d.ts.map +1 -1
- package/lib/exercises/math/geometry/perimeters/rectangleSideFromPerimeter.js +4 -0
- package/lib/exercises/math/geometry/perimeters/squareSideFromPerimeter.d.ts.map +1 -1
- package/lib/exercises/math/geometry/perimeters/squareSideFromPerimeter.js +4 -0
- package/lib/exercises/math/geometry/pythagore/isTriangleRight.d.ts.map +1 -1
- package/lib/exercises/math/geometry/pythagore/isTriangleRight.js +4 -0
- package/lib/exercises/math/geometry/quadrilaterals/parallelogramAngles.d.ts.map +1 -1
- package/lib/exercises/math/geometry/quadrilaterals/parallelogramAngles.js +4 -0
- package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.d.ts.map +1 -1
- package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.js +4 -0
- package/lib/exercises/math/geometry/shapes/basicShapesRecognition.d.ts.map +1 -1
- package/lib/exercises/math/geometry/shapes/basicShapesRecognition.js +42 -23
- package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts.map +1 -1
- package/lib/exercises/math/geometry/thales/thalesCalcul.js +8 -4
- package/lib/exercises/math/geometry/vectors/chasles.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/chasles.js +36 -12
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.js +4 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCoords.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCoords.js +4 -2
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCos.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCos.js +4 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaNorms.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaNorms.js +4 -0
- package/lib/exercises/math/percent/index.d.ts +1 -0
- package/lib/exercises/math/percent/index.d.ts.map +1 -1
- package/lib/exercises/math/percent/index.js +1 -0
- package/lib/exercises/pc/energy/calorificValue.d.ts.map +1 -1
- package/lib/exercises/pc/energy/calorificValue.js +58 -29
- package/lib/exercises/pc/energy/combustionTransferEnergy.d.ts.map +1 -1
- package/lib/exercises/pc/energy/combustionTransferEnergy.js +52 -29
- package/lib/exercises/pc/energy/combustionTransferEnergy2.d.ts.map +1 -1
- package/lib/exercises/pc/energy/combustionTransferEnergy2.js +96 -67
- package/lib/exercises/pc/energy/efficencyOfConverter.d.ts.map +1 -1
- package/lib/exercises/pc/energy/efficencyOfConverter.js +53 -40
- package/lib/exercises/pc/energy/efficiencyCalculation.d.ts.map +1 -1
- package/lib/exercises/pc/energy/efficiencyCalculation.js +66 -38
- package/lib/exercises/pc/energy/energyTransfer.d.ts +0 -2
- package/lib/exercises/pc/energy/energyTransfer.d.ts.map +1 -1
- package/lib/exercises/pc/energy/energyTransfer.js +27 -11
- package/lib/exercises/pc/energy/kineticEnergyOrMassOrSpeed.d.ts.map +1 -1
- package/lib/exercises/pc/energy/kineticEnergyOrMassOrSpeed.js +111 -64
- package/lib/exercises/pc/energy/thermalEnergyTransferCalculation.d.ts.map +1 -1
- package/lib/exercises/pc/energy/thermalEnergyTransferCalculation.js +86 -38
- package/lib/exercises/pc/fluids/mariotte.d.ts.map +1 -1
- package/lib/exercises/pc/fluids/mariotte.js +40 -23
- package/lib/exercises/pc/forces/calculateNormalOrFrictionForce.d.ts.map +1 -1
- package/lib/exercises/pc/forces/calculateNormalOrFrictionForce.js +81 -52
- package/lib/exercises/pc/forces/electroStaticForce.d.ts.map +1 -1
- package/lib/exercises/pc/forces/electroStaticForce.js +73 -58
- package/lib/exercises/pc/forces/forceWork.d.ts.map +1 -1
- package/lib/exercises/pc/forces/forceWork.js +22 -7
- package/lib/exercises/pc/math/proportionnalityCoeffFromLine.d.ts.map +1 -1
- package/lib/exercises/pc/math/proportionnalityCoeffFromLine.js +0 -2
- package/lib/index.d.ts +17 -4
- package/lib/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -17,15 +17,44 @@ const doesTrinomialVanishInInterval = (trinomial, a, b) => {
|
|
|
17
17
|
}
|
|
18
18
|
return false;
|
|
19
19
|
};
|
|
20
|
+
const getInstruction = (identifiers) => {
|
|
21
|
+
const { lowerBound, upperBound, questionType, trinomial } = identifiers;
|
|
22
|
+
const trinom = new Trinom(trinomial[0], trinomial[1], trinomial[2]);
|
|
23
|
+
const affine = trinom.derivate();
|
|
24
|
+
const polynomial = questionType === "Trinomial" ? trinom : affine;
|
|
25
|
+
const expU = new MultiplyNode(polynomial.derivate().toTree(), new ExpNode(polynomial.toTree()));
|
|
26
|
+
const integral = new IntegralNode(expU, lowerBound.toTree(), upperBound.toTree(), "x");
|
|
27
|
+
return `Calculer :
|
|
28
|
+
|
|
29
|
+
$$
|
|
30
|
+
${integral.toTex()}
|
|
31
|
+
$$`;
|
|
32
|
+
};
|
|
33
|
+
const getAnswer = (identifiers) => {
|
|
34
|
+
const { lowerBound, upperBound, questionType, trinomial } = identifiers;
|
|
35
|
+
const trinom = new Trinom(trinomial[0], trinomial[1], trinomial[2]);
|
|
36
|
+
const affine = trinom.derivate();
|
|
37
|
+
const polynomial = questionType === "Trinomial" ? trinom : affine;
|
|
38
|
+
const answer = new SubstractNode(new ExpNode(polynomial.calculate(upperBound).toTree()).simplify(), new ExpNode(polynomial.calculate(lowerBound).toTree()).simplify()).simplify();
|
|
39
|
+
return answer.toTex();
|
|
40
|
+
};
|
|
41
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
42
|
+
const question = {
|
|
43
|
+
answer: getAnswer(identifiers),
|
|
44
|
+
instruction: getInstruction(identifiers),
|
|
45
|
+
keys: ["epower", "e"],
|
|
46
|
+
answerFormat: "tex",
|
|
47
|
+
identifiers,
|
|
48
|
+
};
|
|
49
|
+
return question;
|
|
50
|
+
};
|
|
20
51
|
const getIntegralExpUQuestion = () => {
|
|
21
52
|
const questionType = coinFlip() ? "Trinomial" : "Affine";
|
|
22
53
|
let trinomial;
|
|
23
|
-
let affine;
|
|
24
54
|
let lowerBound;
|
|
25
55
|
let upperBound;
|
|
26
56
|
do {
|
|
27
57
|
trinomial = TrinomConstructor.random({ min: -5, max: 5, excludes: [0] }, { min: -5, max: 5, excludes: [0] }, { min: -5, max: 5, excludes: [0] });
|
|
28
|
-
affine = trinomial.derivate();
|
|
29
58
|
lowerBound = randint(-5, 5, [0]);
|
|
30
59
|
upperBound = randint(-5, 5, [0]);
|
|
31
60
|
while (lowerBound >= upperBound) {
|
|
@@ -33,23 +62,13 @@ const getIntegralExpUQuestion = () => {
|
|
|
33
62
|
upperBound = randint(-5, 5, [0]);
|
|
34
63
|
}
|
|
35
64
|
} while (doesTrinomialVanishInInterval(trinomial, lowerBound, upperBound));
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
answer: answer.toTex(),
|
|
42
|
-
instruction: `Calculer : $${integral.toTex()}$`,
|
|
43
|
-
keys: ["epower", "e"],
|
|
44
|
-
answerFormat: "tex",
|
|
45
|
-
identifiers: {
|
|
46
|
-
questionType,
|
|
47
|
-
trinomial: [trinomial.a, trinomial.b, trinomial.c],
|
|
48
|
-
upperBound,
|
|
49
|
-
lowerBound,
|
|
50
|
-
},
|
|
65
|
+
const identifiers = {
|
|
66
|
+
questionType,
|
|
67
|
+
trinomial: [trinomial.a, trinomial.b, trinomial.c],
|
|
68
|
+
upperBound,
|
|
69
|
+
lowerBound,
|
|
51
70
|
};
|
|
52
|
-
return
|
|
71
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
53
72
|
};
|
|
54
73
|
const getPropositions = (n, { answer, questionType, trinomial, upperBound, lowerBound }) => {
|
|
55
74
|
const propositions = [];
|
|
@@ -80,13 +99,12 @@ const isAnswerValid = (ans, { answer, questionType, upperBound, lowerBound, trin
|
|
|
80
99
|
export const integralExpU = {
|
|
81
100
|
id: "integralExpU",
|
|
82
101
|
label: "Calcul d'intégrales de fonctions du type $u'e^u$",
|
|
83
|
-
levels: ["TermSpé"],
|
|
84
102
|
isSingleStep: true,
|
|
85
|
-
sections: ["Intégration"],
|
|
86
103
|
generator: (nb) => getDistinctQuestions(getIntegralExpUQuestion, nb),
|
|
87
104
|
qcmTimer: 60,
|
|
88
105
|
freeTimer: 60,
|
|
89
106
|
getPropositions,
|
|
90
107
|
isAnswerValid,
|
|
91
108
|
subject: "Mathématiques",
|
|
109
|
+
getQuestionFromIdentifiers,
|
|
92
110
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integralFractions.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/integral/integralFractions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"integralFractions.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/integral/integralFractions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAcrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAuNF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAYnD,CAAC"}
|
|
@@ -17,6 +17,39 @@ const doesTrinomialVanishInInterval = (trinomial, a, b) => {
|
|
|
17
17
|
}
|
|
18
18
|
return false;
|
|
19
19
|
};
|
|
20
|
+
const getInstruction = (identifiers) => {
|
|
21
|
+
const { lowerBound, upperBound, questionType, trinomial } = identifiers;
|
|
22
|
+
const trinom = new Trinom(trinomial[0], trinomial[1], trinomial[2]);
|
|
23
|
+
const affine = trinom.derivate();
|
|
24
|
+
const fraction = questionType === "Trinomial"
|
|
25
|
+
? new FractionNode(affine.toTree(), trinom.toTree())
|
|
26
|
+
: new FractionNode(affine.coefficients[1].toTree(), affine.toTree());
|
|
27
|
+
const integral = new IntegralNode(fraction, lowerBound.toTree(), upperBound.toTree(), "x");
|
|
28
|
+
return `Calculer :
|
|
29
|
+
|
|
30
|
+
$$
|
|
31
|
+
${integral.toTex()}
|
|
32
|
+
$$`;
|
|
33
|
+
};
|
|
34
|
+
const getAnswer = (identifiers) => {
|
|
35
|
+
const { lowerBound, upperBound, questionType, trinomial } = identifiers;
|
|
36
|
+
const trinom = new Trinom(trinomial[0], trinomial[1], trinomial[2]);
|
|
37
|
+
const affine = trinom.derivate();
|
|
38
|
+
const answer = questionType === "Trinomial"
|
|
39
|
+
? new SubstractNode(new LogNode(Math.abs(trinom.calculate(upperBound)).toTree()).simplify(), new LogNode(Math.abs(trinom.calculate(lowerBound)).toTree()).simplify()).simplify()
|
|
40
|
+
: new SubstractNode(new LogNode(Math.abs(affine.calculate(upperBound)).toTree()).simplify(), new LogNode(Math.abs(affine.calculate(lowerBound)).toTree()).simplify()).simplify();
|
|
41
|
+
return answer.toTex();
|
|
42
|
+
};
|
|
43
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
44
|
+
const question = {
|
|
45
|
+
answer: getAnswer(identifiers),
|
|
46
|
+
instruction: getInstruction(identifiers),
|
|
47
|
+
keys: ["lnBrackets"],
|
|
48
|
+
answerFormat: "tex",
|
|
49
|
+
identifiers,
|
|
50
|
+
};
|
|
51
|
+
return question;
|
|
52
|
+
};
|
|
20
53
|
const getIntegralFractionsQuestion = () => {
|
|
21
54
|
const questionType = coinFlip() ? "Trinomial" : "Affine";
|
|
22
55
|
let trinomial;
|
|
@@ -34,26 +67,13 @@ const getIntegralFractionsQuestion = () => {
|
|
|
34
67
|
}
|
|
35
68
|
} while (doesTrinomialVanishInInterval(trinomial, lowerBound, upperBound) ||
|
|
36
69
|
affine.calculate(lowerBound) === 0);
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
? new SubstractNode(new LogNode(Math.abs(trinomial.calculate(upperBound)).toTree()).simplify(), new LogNode(Math.abs(trinomial.calculate(lowerBound)).toTree()).simplify()).simplify()
|
|
43
|
-
: new SubstractNode(new LogNode(Math.abs(affine.calculate(upperBound)).toTree()).simplify(), new LogNode(Math.abs(affine.calculate(lowerBound)).toTree()).simplify()).simplify();
|
|
44
|
-
const question = {
|
|
45
|
-
answer: answer.toTex(),
|
|
46
|
-
instruction: `Calculer : $${integral.toTex()}$`,
|
|
47
|
-
keys: ["lnBrackets"],
|
|
48
|
-
answerFormat: "tex",
|
|
49
|
-
identifiers: {
|
|
50
|
-
questionType,
|
|
51
|
-
trinomial: [trinomial.a, trinomial.b, trinomial.c],
|
|
52
|
-
upperBound,
|
|
53
|
-
lowerBound,
|
|
54
|
-
},
|
|
70
|
+
const identifiers = {
|
|
71
|
+
questionType,
|
|
72
|
+
trinomial: [trinomial.a, trinomial.b, trinomial.c],
|
|
73
|
+
upperBound,
|
|
74
|
+
lowerBound,
|
|
55
75
|
};
|
|
56
|
-
return
|
|
76
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
57
77
|
};
|
|
58
78
|
const getPropositions = (n, { answer, questionType, trinomial, upperBound, lowerBound }) => {
|
|
59
79
|
const propositions = [];
|
|
@@ -95,13 +115,12 @@ const isAnswerValid = (ans, { answer, questionType, upperBound, lowerBound, trin
|
|
|
95
115
|
export const integralFractions = {
|
|
96
116
|
id: "integralFractions",
|
|
97
117
|
label: "Calcul d'intégrales de fonctions du type $\\frac{u'}{u}$",
|
|
98
|
-
levels: ["TermSpé"],
|
|
99
118
|
isSingleStep: true,
|
|
100
|
-
sections: ["Intégration"],
|
|
101
119
|
generator: (nb) => getDistinctQuestions(getIntegralFractionsQuestion, nb),
|
|
102
120
|
qcmTimer: 60,
|
|
103
121
|
freeTimer: 60,
|
|
104
122
|
getPropositions,
|
|
105
123
|
isAnswerValid,
|
|
106
124
|
subject: "Mathématiques",
|
|
125
|
+
getQuestionFromIdentifiers,
|
|
107
126
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integralKCosinus.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/integral/integralKCosinus.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"integralKCosinus.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/integral/integralKCosinus.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAiIF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAYlD,CAAC"}
|
|
@@ -11,9 +11,29 @@ import { SubstractNode } from "../../../../tree/nodes/operators/substractNode.js
|
|
|
11
11
|
import { VariableNode } from "../../../../tree/nodes/variables/variableNode.js";
|
|
12
12
|
const selectedIndices = [0, 1, 2, 3, 4, 8];
|
|
13
13
|
const trigValues = selectedIndices.map((index) => remarkableTrigoValues[index].angle);
|
|
14
|
+
const getInstruction = (identifiers) => {
|
|
15
|
+
const { lowerBoundIndex, upperBoundIndex, k } = identifiers;
|
|
16
|
+
const lowerBound = trigValues[lowerBoundIndex];
|
|
17
|
+
const upperBound = trigValues[upperBoundIndex];
|
|
18
|
+
const cosine = new MultiplyNode(k.toTree(), new CosNode(new VariableNode("x")));
|
|
19
|
+
const integral = new IntegralNode(cosine, lowerBound, upperBound, "x");
|
|
20
|
+
return `Calculez la valeur de l'intégrale suivante :
|
|
21
|
+
|
|
22
|
+
$$
|
|
23
|
+
${integral.toTex()}
|
|
24
|
+
$$`;
|
|
25
|
+
};
|
|
26
|
+
const getAnswer = (identifiers) => {
|
|
27
|
+
const { lowerBoundIndex, upperBoundIndex, k } = identifiers;
|
|
28
|
+
const lowerBound = trigValues[lowerBoundIndex];
|
|
29
|
+
const upperBound = trigValues[upperBoundIndex];
|
|
30
|
+
const sina = new SinNode(lowerBound);
|
|
31
|
+
const sinb = new SinNode(upperBound);
|
|
32
|
+
const answer = new SubstractNode(new MultiplyNode(k.toTree(), sinb), new MultiplyNode(k.toTree(), sina)).simplify();
|
|
33
|
+
return answer.toTex();
|
|
34
|
+
};
|
|
14
35
|
const getIntegralKCosinusQuestion = () => {
|
|
15
36
|
const k = randint(-10, 10, [0]);
|
|
16
|
-
const cosine = new MultiplyNode(k.toTree(), new CosNode(new VariableNode("x")));
|
|
17
37
|
let lowerBoundIndex = randint(0, trigValues.length);
|
|
18
38
|
let upperBoundIndex = randint(0, trigValues.length);
|
|
19
39
|
while (trigValues[lowerBoundIndex].evaluate({}) >=
|
|
@@ -21,18 +41,16 @@ const getIntegralKCosinusQuestion = () => {
|
|
|
21
41
|
lowerBoundIndex = randint(0, trigValues.length);
|
|
22
42
|
upperBoundIndex = randint(0, trigValues.length);
|
|
23
43
|
}
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const sinb = new SinNode(upperBound);
|
|
29
|
-
const answer = new SubstractNode(new MultiplyNode(k.toTree(), sinb), new MultiplyNode(k.toTree(), sina)).simplify();
|
|
44
|
+
const identifiers = { lowerBoundIndex, upperBoundIndex, k };
|
|
45
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
46
|
+
};
|
|
47
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
30
48
|
const question = {
|
|
31
|
-
answer:
|
|
32
|
-
instruction:
|
|
49
|
+
answer: getAnswer(identifiers),
|
|
50
|
+
instruction: getInstruction(identifiers),
|
|
33
51
|
keys: [],
|
|
34
52
|
answerFormat: "tex",
|
|
35
|
-
identifiers
|
|
53
|
+
identifiers,
|
|
36
54
|
};
|
|
37
55
|
return question;
|
|
38
56
|
};
|
|
@@ -68,13 +86,12 @@ const isAnswerValid = (ans, { answer, lowerBoundIndex, upperBoundIndex, k }) =>
|
|
|
68
86
|
export const integralKCosinus = {
|
|
69
87
|
id: "integralKCosinus",
|
|
70
88
|
label: "Calcul d'intégrales de fonctions du type $k\\cos(x)$",
|
|
71
|
-
levels: ["TermSpé"],
|
|
72
89
|
isSingleStep: true,
|
|
73
|
-
sections: ["Intégration"],
|
|
74
90
|
generator: (nb) => getDistinctQuestions(getIntegralKCosinusQuestion, nb),
|
|
75
91
|
qcmTimer: 60,
|
|
76
92
|
freeTimer: 60,
|
|
77
93
|
getPropositions,
|
|
78
94
|
isAnswerValid,
|
|
79
95
|
subject: "Mathématiques",
|
|
96
|
+
getQuestionFromIdentifiers,
|
|
80
97
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integralKSinus.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/integral/integralKSinus.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"integralKSinus.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/integral/integralKSinus.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAkIF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAYhD,CAAC"}
|
|
@@ -11,9 +11,29 @@ import { SubstractNode } from "../../../../tree/nodes/operators/substractNode.js
|
|
|
11
11
|
import { VariableNode } from "../../../../tree/nodes/variables/variableNode.js";
|
|
12
12
|
const selectedIndices = [0, 1, 2, 3, 4, 8];
|
|
13
13
|
const trigValues = selectedIndices.map((index) => remarkableTrigoValues[index].angle);
|
|
14
|
+
const getInstruction = (identifiers) => {
|
|
15
|
+
const { lowerBoundIndex, upperBoundIndex, k } = identifiers;
|
|
16
|
+
const sine = new MultiplyNode(k.toTree(), new SinNode(new VariableNode("x")));
|
|
17
|
+
const lowerBound = trigValues[lowerBoundIndex];
|
|
18
|
+
const upperBound = trigValues[upperBoundIndex];
|
|
19
|
+
const integral = new IntegralNode(sine, lowerBound, upperBound, "x");
|
|
20
|
+
return `Calculer :
|
|
21
|
+
|
|
22
|
+
$$
|
|
23
|
+
${integral.toTex()}
|
|
24
|
+
$$`;
|
|
25
|
+
};
|
|
26
|
+
const getAnswer = (identifiers) => {
|
|
27
|
+
const { lowerBoundIndex, upperBoundIndex, k } = identifiers;
|
|
28
|
+
const lowerBound = trigValues[lowerBoundIndex];
|
|
29
|
+
const upperBound = trigValues[upperBoundIndex];
|
|
30
|
+
const cosa = new CosNode(lowerBound);
|
|
31
|
+
const cosb = new CosNode(upperBound);
|
|
32
|
+
const answer = new SubstractNode(new MultiplyNode(k.toTree(), cosa), new MultiplyNode(k.toTree(), cosb)).simplify();
|
|
33
|
+
return answer.toTex();
|
|
34
|
+
};
|
|
14
35
|
const getIntegralKSinusQuestion = () => {
|
|
15
36
|
const k = randint(-10, 10, [0]);
|
|
16
|
-
const sine = new MultiplyNode(k.toTree(), new SinNode(new VariableNode("x")));
|
|
17
37
|
let lowerBoundIndex = randint(0, trigValues.length);
|
|
18
38
|
let upperBoundIndex = randint(0, trigValues.length);
|
|
19
39
|
while (trigValues[lowerBoundIndex].evaluate({}) >=
|
|
@@ -21,18 +41,16 @@ const getIntegralKSinusQuestion = () => {
|
|
|
21
41
|
lowerBoundIndex = randint(0, trigValues.length);
|
|
22
42
|
upperBoundIndex = randint(0, trigValues.length);
|
|
23
43
|
}
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const cosb = new CosNode(upperBound);
|
|
29
|
-
const answer = new SubstractNode(new MultiplyNode(k.toTree(), cosa), new MultiplyNode(k.toTree(), cosb)).simplify();
|
|
44
|
+
const identifiers = { lowerBoundIndex, upperBoundIndex, k };
|
|
45
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
46
|
+
};
|
|
47
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
30
48
|
const question = {
|
|
31
|
-
answer:
|
|
32
|
-
instruction:
|
|
49
|
+
answer: getAnswer(identifiers),
|
|
50
|
+
instruction: getInstruction(identifiers),
|
|
33
51
|
keys: [],
|
|
34
52
|
answerFormat: "tex",
|
|
35
|
-
identifiers
|
|
53
|
+
identifiers,
|
|
36
54
|
};
|
|
37
55
|
return question;
|
|
38
56
|
};
|
|
@@ -68,13 +86,12 @@ const isAnswerValid = (ans, { answer, lowerBoundIndex, upperBoundIndex, k }) =>
|
|
|
68
86
|
export const integralKSinus = {
|
|
69
87
|
id: "integralKSinus",
|
|
70
88
|
label: "Calcul d'intégrales de fonctions du type $k\\sin(x)$",
|
|
71
|
-
levels: ["TermSpé"],
|
|
72
89
|
isSingleStep: true,
|
|
73
|
-
sections: ["Intégration"],
|
|
74
90
|
generator: (nb) => getDistinctQuestions(getIntegralKSinusQuestion, nb),
|
|
75
91
|
qcmTimer: 60,
|
|
76
92
|
freeTimer: 60,
|
|
77
93
|
getPropositions,
|
|
78
94
|
isAnswerValid,
|
|
79
95
|
subject: "Mathématiques",
|
|
96
|
+
getQuestionFromIdentifiers,
|
|
80
97
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integralTrinomials.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/integral/integralTrinomials.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"integralTrinomials.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/integral/integralTrinomials.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAwGF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAYpD,CAAC"}
|
|
@@ -41,6 +41,9 @@ const getIntegralTrinomialsQuestion = () => {
|
|
|
41
41
|
upperBound,
|
|
42
42
|
quadrinomial: quadCoeffs,
|
|
43
43
|
};
|
|
44
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
45
|
+
};
|
|
46
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
44
47
|
const question = {
|
|
45
48
|
answer: getAnswer(identifiers),
|
|
46
49
|
instruction: getInstruction(identifiers),
|
|
@@ -85,6 +88,5 @@ export const integralTrinomials = {
|
|
|
85
88
|
getPropositions,
|
|
86
89
|
isAnswerValid,
|
|
87
90
|
subject: "Mathématiques",
|
|
88
|
-
|
|
89
|
-
getInstruction,
|
|
91
|
+
getQuestionFromIdentifiers,
|
|
90
92
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log10PowerSimplifying.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/log10PowerSimplifying.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"log10PowerSimplifying.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/log10PowerSimplifying.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAmFF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAevD,CAAC"}
|
|
@@ -5,18 +5,34 @@ import { randint } from "../../../../math/utils/random/randint.js";
|
|
|
5
5
|
import { Log10Node } from "../../../../tree/nodes/functions/log10Node.js";
|
|
6
6
|
import { PowerNode } from "../../../../tree/nodes/operators/powerNode.js";
|
|
7
7
|
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
8
|
-
const
|
|
9
|
-
const tenthPower =
|
|
8
|
+
const getInstruction = (identifiers) => {
|
|
9
|
+
const { tenthPower } = identifiers;
|
|
10
10
|
const nb = new Decimal(1).multiplyByPowerOfTen(tenthPower).toTree();
|
|
11
|
+
return `Calculer :
|
|
12
|
+
|
|
13
|
+
$$
|
|
14
|
+
${new Log10Node(nb).toTex()}
|
|
15
|
+
$$`;
|
|
16
|
+
};
|
|
17
|
+
const getAnswer = (identifiers) => {
|
|
18
|
+
const { tenthPower } = identifiers;
|
|
11
19
|
const answer = tenthPower + "";
|
|
20
|
+
return answer;
|
|
21
|
+
};
|
|
22
|
+
const getLog10PowerSimplifyingQuestion = () => {
|
|
23
|
+
const tenthPower = randint(-6, 8, [1]);
|
|
24
|
+
const identifiers = { tenthPower };
|
|
25
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
26
|
+
};
|
|
27
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
12
28
|
const question = {
|
|
13
|
-
answer,
|
|
14
|
-
instruction:
|
|
15
|
-
hint: getHint(
|
|
16
|
-
correction: getCorrection(
|
|
29
|
+
answer: getAnswer(identifiers),
|
|
30
|
+
instruction: getInstruction(identifiers),
|
|
31
|
+
hint: getHint(identifiers),
|
|
32
|
+
correction: getCorrection(identifiers),
|
|
17
33
|
keys: [],
|
|
18
34
|
answerFormat: "tex",
|
|
19
|
-
identifiers
|
|
35
|
+
identifiers,
|
|
20
36
|
};
|
|
21
37
|
return question;
|
|
22
38
|
};
|
|
@@ -30,18 +46,24 @@ const getPropositions = (n, { answer, tenthPower }) => {
|
|
|
30
46
|
tryToAddWrongProp(propositions, tenthPower - 2 + "");
|
|
31
47
|
return shuffleProps(propositions, n);
|
|
32
48
|
};
|
|
33
|
-
const getHint = (
|
|
34
|
-
|
|
49
|
+
const getHint = (identifiers) => {
|
|
50
|
+
const { tenthPower } = identifiers;
|
|
51
|
+
const nb = new Decimal(1).multiplyByPowerOfTen(tenthPower).toTree();
|
|
52
|
+
const nbTex = nb.toTex();
|
|
53
|
+
return `Pour calculer $\\log(${nbTex})$, il est utile de transformer le nombre $${nbTex}$ en une puissance de $10$.`;
|
|
35
54
|
};
|
|
36
|
-
const getCorrection = (
|
|
55
|
+
const getCorrection = (identifiers) => {
|
|
56
|
+
const { tenthPower } = identifiers;
|
|
57
|
+
const nb = new Decimal(1).multiplyByPowerOfTen(tenthPower).toTree();
|
|
58
|
+
const nbTex = nb.toTex();
|
|
37
59
|
const powerTen = new PowerNode((10).toTree(), tenthPower.toTree());
|
|
38
|
-
return `On exprime $${
|
|
39
|
-
${alignTex(`${
|
|
60
|
+
return `On exprime $${nbTex}$ en puissance de $10$ :
|
|
61
|
+
${alignTex(`${nbTex} = ${powerTen.toTex()}`)}
|
|
40
62
|
On utilise la propriété $\\log(a^{b}) = b\\times \\log(a)$.
|
|
41
63
|
|
|
42
64
|
On a alors
|
|
43
65
|
${alignTex([
|
|
44
|
-
[`\\log(${
|
|
66
|
+
[`\\log(${nbTex})`, `=`, `\\log(${powerTen.toTex()})`],
|
|
45
67
|
["", "=", `${tenthPower}\\times \\log(10)`],
|
|
46
68
|
["", "=", `${tenthPower}`],
|
|
47
69
|
])}
|
|
@@ -54,9 +76,7 @@ export const log10PowerSimplifying = {
|
|
|
54
76
|
id: "log10PowerSimplifying",
|
|
55
77
|
connector: "=",
|
|
56
78
|
label: "Calculer un logarithme décimal",
|
|
57
|
-
levels: ["TermTech", "MathComp"],
|
|
58
79
|
isSingleStep: true,
|
|
59
|
-
sections: ["Logarithme décimal", "Puissances"],
|
|
60
80
|
generator: (nb) => getDistinctQuestions(getLog10PowerSimplifyingQuestion, nb, 10),
|
|
61
81
|
qcmTimer: 60,
|
|
62
82
|
freeTimer: 60,
|
|
@@ -65,4 +85,5 @@ export const log10PowerSimplifying = {
|
|
|
65
85
|
maxAllowedQuestions: 10,
|
|
66
86
|
subject: "Mathématiques",
|
|
67
87
|
hasHintAndCorrection: true,
|
|
88
|
+
getQuestionFromIdentifiers,
|
|
68
89
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log10Simplifying.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/log10Simplifying.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"log10Simplifying.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/log10Simplifying.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAuIF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgB9D,CAAC;AACF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgB5D,CAAC"}
|
|
@@ -10,20 +10,27 @@ import { MultiplyNode } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
|
10
10
|
import { PowerNode } from "../../../../tree/nodes/operators/powerNode.js";
|
|
11
11
|
import { operatorComposition } from "../../../../tree/utilities/operatorComposition.js";
|
|
12
12
|
import { random } from "../../../../utils/alea/random.js";
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
const
|
|
13
|
+
const getInstruction = (identifiers, opts) => {
|
|
14
|
+
const { nb, powers, signs, isLog10 } = identifiers;
|
|
15
|
+
const nbNode = new NumberNode(nb);
|
|
16
|
+
const LNode = opts?.isLog10 ? Log10Node : LogNode;
|
|
17
|
+
const logs = powers.map((power, index) => nb ** power < 100
|
|
18
|
+
? signs[index] > 0
|
|
19
|
+
? new LNode(new NumberNode(nb ** power))
|
|
20
|
+
: new OppositeNode(new LNode(new NumberNode(nb ** power)))
|
|
21
|
+
: signs[index] > 0
|
|
22
|
+
? new LNode(new PowerNode(nbNode, new NumberNode(power)))
|
|
23
|
+
: new OppositeNode(new LNode(new PowerNode(nbNode, new NumberNode(power)))));
|
|
18
24
|
const trueNb = [2, 4, 8].includes(nb) ? 2 : [3, 9].includes(nb) ? 3 : nb;
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
const statement = operatorComposition(AddNode, logs);
|
|
26
|
+
return `Exprimer le nombre suivant sous la forme $a${opts?.isLog10 ? "\\log" : "\\ln"}\\left(${trueNb}\\right)$ :
|
|
27
|
+
|
|
28
|
+
$$
|
|
29
|
+
${statement.toTex()}
|
|
30
|
+
$$`;
|
|
31
|
+
};
|
|
32
|
+
const getAnswer = (identifiers, opts) => {
|
|
33
|
+
const { nb, powers, signs, isLog10 } = identifiers;
|
|
27
34
|
const nbNode = new NumberNode(nb);
|
|
28
35
|
const LNode = opts?.isLog10 ? Log10Node : LogNode;
|
|
29
36
|
const logs = powers.map((power, index) => nb ** power < 100
|
|
@@ -35,16 +42,34 @@ const getLog10SumSimplifyingQuestion = (opts) => {
|
|
|
35
42
|
: new OppositeNode(new LNode(new PowerNode(nbNode, new NumberNode(power)))));
|
|
36
43
|
const statement = operatorComposition(AddNode, logs);
|
|
37
44
|
const answer = statement.simplify();
|
|
38
|
-
|
|
45
|
+
return answer.toTex();
|
|
46
|
+
};
|
|
47
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
39
48
|
const question = {
|
|
40
|
-
answer:
|
|
41
|
-
instruction:
|
|
49
|
+
answer: getAnswer(identifiers, opts),
|
|
50
|
+
instruction: getInstruction(identifiers, opts),
|
|
42
51
|
keys: getKeys(identifiers, opts),
|
|
43
52
|
answerFormat: "tex",
|
|
44
53
|
identifiers,
|
|
45
54
|
};
|
|
46
55
|
return question;
|
|
47
56
|
};
|
|
57
|
+
const getKeys = (identifiers, opts) => {
|
|
58
|
+
return [opts?.isLog10 ? "logBrackets" : "lnBrackets"];
|
|
59
|
+
};
|
|
60
|
+
const getLog10SumSimplifyingQuestion = (opts) => {
|
|
61
|
+
const nb = randint(2, 10);
|
|
62
|
+
const nbTerms = randint(2, 4);
|
|
63
|
+
const powers = [];
|
|
64
|
+
const signs = [];
|
|
65
|
+
for (let i = 0; i < nbTerms; i++) {
|
|
66
|
+
const power = randint(powers.includes(1) ? 2 : 1, 6, powers);
|
|
67
|
+
powers.push(power);
|
|
68
|
+
signs.push(random([-1, 1]));
|
|
69
|
+
}
|
|
70
|
+
const identifiers = { nb, powers, signs, isLog10: opts?.isLog10 ?? false };
|
|
71
|
+
return getQuestionFromIdentifiers(identifiers, opts);
|
|
72
|
+
};
|
|
48
73
|
const getPropositions = (n, { answer, nb, isLog10 }) => {
|
|
49
74
|
const propositions = [];
|
|
50
75
|
addValidProp(propositions, answer);
|
|
@@ -75,29 +100,25 @@ export const log10SumSimplifying = {
|
|
|
75
100
|
id: "log10SumSimplifying",
|
|
76
101
|
connector: "=",
|
|
77
102
|
label: "Simplifer une somme de logarithmes décimaux",
|
|
78
|
-
levels: ["TermTech"],
|
|
79
103
|
isSingleStep: true,
|
|
80
|
-
sections: ["Logarithme décimal"],
|
|
81
104
|
generator: (nb) => getDistinctQuestions(() => getLog10SumSimplifyingQuestion({ isLog10: true }), nb),
|
|
82
105
|
qcmTimer: 60,
|
|
83
106
|
freeTimer: 60,
|
|
84
107
|
getPropositions,
|
|
85
108
|
isAnswerValid,
|
|
86
109
|
subject: "Mathématiques",
|
|
87
|
-
|
|
110
|
+
getQuestionFromIdentifiers,
|
|
88
111
|
};
|
|
89
112
|
export const logSumSimplifying = {
|
|
90
113
|
id: "logSumSimplifying",
|
|
91
114
|
connector: "=",
|
|
92
115
|
label: "Simplifer une somme de logarithmes népériens",
|
|
93
|
-
levels: ["TermSpé", "MathComp"],
|
|
94
116
|
isSingleStep: true,
|
|
95
|
-
sections: ["Logarithme népérien"],
|
|
96
117
|
generator: (nb) => getDistinctQuestions(() => getLog10SumSimplifyingQuestion({ isLog10: false }), nb),
|
|
97
118
|
qcmTimer: 60,
|
|
98
119
|
freeTimer: 60,
|
|
99
120
|
getPropositions,
|
|
100
121
|
isAnswerValid,
|
|
101
122
|
subject: "Mathématiques",
|
|
102
|
-
|
|
123
|
+
getQuestionFromIdentifiers,
|
|
103
124
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/logEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"logEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/logEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAcrC,cAAc;AACd,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA0FF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAY7C,CAAC"}
|
|
@@ -25,19 +25,30 @@ const getKeys = () => {
|
|
|
25
25
|
"rbrace",
|
|
26
26
|
];
|
|
27
27
|
};
|
|
28
|
+
const getInstruction = (identifiers) => {
|
|
29
|
+
const { a, k } = identifiers;
|
|
30
|
+
const equation = new EqualNode(new MultiplyNode(new NumberNode(a), new LogNode(new VariableNode("x"))), new NumberNode(k));
|
|
31
|
+
return `Résoudre l'équation :
|
|
32
|
+
|
|
33
|
+
$$
|
|
34
|
+
${equation.toTex()}
|
|
35
|
+
$$`;
|
|
36
|
+
};
|
|
37
|
+
const getAnswer = (identifiers) => {
|
|
38
|
+
const { a, k } = identifiers;
|
|
39
|
+
const answer = new EquationSolutionNode(new DiscreteSetNode([new ExpNode(new Rational(k, a).simplify().toTree())])).toTex();
|
|
40
|
+
return answer;
|
|
41
|
+
};
|
|
28
42
|
const getLnEquation = () => {
|
|
29
43
|
const a = randint(-9, 20, [0]);
|
|
30
44
|
const k = randint(-9, 20, [0]);
|
|
31
|
-
const equation = new EqualNode(new MultiplyNode(new NumberNode(a), new LogNode(new VariableNode("x"))), new NumberNode(k));
|
|
32
|
-
const answer = new EquationSolutionNode(new DiscreteSetNode([new ExpNode(new Rational(k, a).simplify().toTree())])).toTex();
|
|
33
45
|
const identifiers = { a, k };
|
|
46
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
47
|
+
};
|
|
48
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
34
49
|
const question = {
|
|
35
|
-
instruction:
|
|
36
|
-
|
|
37
|
-
$$
|
|
38
|
-
${equation.toTex()}
|
|
39
|
-
$$`,
|
|
40
|
-
answer,
|
|
50
|
+
instruction: getInstruction(identifiers),
|
|
51
|
+
answer: getAnswer(identifiers),
|
|
41
52
|
keys: getKeys(identifiers),
|
|
42
53
|
answerFormat: "tex",
|
|
43
54
|
identifiers,
|
|
@@ -67,8 +78,6 @@ export const logEquation = {
|
|
|
67
78
|
id: "logEquation",
|
|
68
79
|
connector: "=",
|
|
69
80
|
label: "Résoudre des équations de type $a \\times \\ln(x) = k$",
|
|
70
|
-
levels: ["1reSpé", "TermSpé", "MathComp"],
|
|
71
|
-
sections: ["Logarithme népérien", "Exponentielle"],
|
|
72
81
|
isSingleStep: false,
|
|
73
82
|
generator: (nb) => getDistinctQuestions(getLnEquation, nb),
|
|
74
83
|
getPropositions,
|
|
@@ -76,5 +85,5 @@ export const logEquation = {
|
|
|
76
85
|
freeTimer: 60,
|
|
77
86
|
isAnswerValid,
|
|
78
87
|
subject: "Mathématiques",
|
|
79
|
-
|
|
88
|
+
getQuestionFromIdentifiers,
|
|
80
89
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logPowerEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/logPowerEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"logPowerEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/logPowerEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAmBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE,MAAM,CAAC;IAChB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAyHF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAc3D,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAiB7D,CAAC"}
|