math-exercises 2.2.94 → 2.2.96
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/fractionSquare.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionSquare.js +2 -1
- package/lib/exercises/math/calcul/fractions/fractionsSum.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSum.js +2 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.js +2 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.js +2 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.js +2 -1
- package/lib/exercises/math/calcul/proportionality/findCoeffInProportionalTableNonIntegers.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/findCoeffInProportionalTableNonIntegers.js +2 -1
- package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivityWithCoeff.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivityWithCoeff.js +0 -4
- package/lib/exercises/math/calculLitteral/distributivity/firstIdentity.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/firstIdentity.js +82 -34
- package/lib/exercises/math/calculLitteral/distributivity/identitiesWithNonIntegers.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/identitiesWithNonIntegers.js +2 -1
- package/lib/exercises/math/calculLitteral/distributivity/secondIdentity.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/secondIdentity.js +86 -36
- package/lib/exercises/math/calculLitteral/distributivity/thirdIdentity.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/thirdIdentity.js +82 -32
- package/lib/exercises/math/calculLitteral/equation/equationSimpleSquare.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationSimpleSquare.js +2 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoByX.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoByX.js +2 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.js +2 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.js +2 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq3.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq3.js +2 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.js +3 -1
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType0.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType0.js +2 -1
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType1.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType1.js +2 -1
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType2.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType2.js +2 -1
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.js +2 -1
- package/lib/exercises/math/calculLitteral/inequations/squareFunctionInequation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/inequations/squareFunctionInequation.js +2 -1
- package/lib/exercises/math/calculLitteral/simplifying/distributeAndSimplify.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/simplifying/distributeAndSimplify.js +38 -16
- package/lib/exercises/math/calculLitteral/simplifying/reduceExpression.d.ts +3 -3
- package/lib/exercises/math/calculLitteral/simplifying/reduceExpression.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/simplifying/reduceExpression.js +171 -75
- package/lib/exercises/math/dataReading/index.d.ts +2 -0
- package/lib/exercises/math/dataReading/index.d.ts.map +1 -0
- package/lib/exercises/math/dataReading/index.js +17 -0
- package/lib/exercises/math/dataReading/tableReading.d.ts +8 -0
- package/lib/exercises/math/dataReading/tableReading.d.ts.map +1 -0
- package/lib/exercises/math/dataReading/tableReading.js +105 -0
- package/lib/exercises/math/derivation/derivative/convexityQuadrinomials.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/convexityQuadrinomials.js +2 -1
- package/lib/exercises/math/derivation/derivative/expDerivativeFour.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/expDerivativeFour.js +2 -1
- package/lib/exercises/math/derivation/derivative/expDerivativeThree.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/expDerivativeThree.js +2 -1
- package/lib/exercises/math/derivation/derivative/lnDerivativeThree.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/lnDerivativeThree.js +2 -1
- package/lib/exercises/math/derivation/derivative/powerCompositionDerivation.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/powerCompositionDerivation.js +75 -11
- package/lib/exercises/math/derivation/derivative/quotientDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/quotientDerivative.js +2 -1
- package/lib/exercises/math/derivation/derivative/rootFunctionDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/rootFunctionDerivative.js +2 -1
- package/lib/exercises/math/derivation/derivative/sqrtCompositionDerivation.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/sqrtCompositionDerivation.js +2 -1
- package/lib/exercises/math/derivation/derivative/thirdDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/thirdDegreeDerivative.js +2 -1
- package/lib/exercises/math/derivation/derivative/thirdDegreeFunctionVariation.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/thirdDegreeFunctionVariation.js +2 -1
- package/lib/exercises/math/functions/absolute/absolueValueAffineEquation.d.ts.map +1 -1
- package/lib/exercises/math/functions/absolute/absolueValueAffineEquation.js +2 -1
- package/lib/exercises/math/functions/absolute/absolueValueInequationsSup.d.ts.map +1 -1
- package/lib/exercises/math/functions/absolute/absolueValueInequationsSup.js +2 -1
- package/lib/exercises/math/functions/absolute/absoluteValueInequations.d.ts.map +1 -1
- package/lib/exercises/math/functions/absolute/absoluteValueInequations.js +2 -1
- package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.js +2 -2
- package/lib/exercises/math/functions/affines/affineExpressionReading.js +2 -1
- package/lib/exercises/math/functions/affines/signFunction.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/signFunction.js +2 -1
- package/lib/exercises/math/functions/basics/graphicEquation.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/graphicEquation.js +2 -1
- package/lib/exercises/math/functions/basics/graphicInequation.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/graphicInequation.js +2 -1
- package/lib/exercises/math/functions/basics/graphicInequationAffine.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/graphicInequationAffine.js +2 -1
- package/lib/exercises/math/functions/basics/imageFunction.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/imageFunction.js +2 -1
- package/lib/exercises/math/functions/basics/twoFunctionsInequation.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/twoFunctionsInequation.js +2 -1
- package/lib/exercises/math/functions/exponential/expEquation.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/expEquation.js +2 -1
- package/lib/exercises/math/functions/logarithm/logPowerEquation.d.ts.map +1 -1
- package/lib/exercises/math/functions/logarithm/logPowerEquation.js +2 -1
- package/lib/exercises/math/functions/sign/affineProductSign.d.ts.map +1 -1
- package/lib/exercises/math/functions/sign/affineProductSign.js +2 -1
- package/lib/exercises/math/functions/square/squareImageInterval.d.ts.map +1 -1
- package/lib/exercises/math/functions/square/squareImageInterval.js +2 -1
- package/lib/exercises/math/functions/trinoms/coefficientsIdentification.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/coefficientsIdentification.js +2 -1
- package/lib/exercises/math/functions/trinoms/secondDegreeInequation.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/secondDegreeInequation.js +2 -1
- package/lib/exercises/math/functions/trinoms/trinomSignFromRoots.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/trinomSignFromRoots.js +2 -1
- package/lib/exercises/math/geometry/cartesian/readAbscissOnLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/readAbscissOnLine.js +2 -1
- package/lib/exercises/math/geometry/cartesian/readAbscissOnSemiLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/readAbscissOnSemiLine.js +2 -1
- package/lib/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.d.ts.map +1 -1
- package/lib/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.js +2 -1
- package/lib/exercises/math/geometry/parametric/extractPointFromParametricLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/parametric/extractPointFromParametricLine.js +2 -1
- package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.js +2 -1
- package/lib/exercises/math/index.d.ts +1 -0
- package/lib/exercises/math/index.d.ts.map +1 -1
- package/lib/exercises/math/index.js +1 -0
- package/lib/exercises/math/matrices/matrixInversibilityDomain.d.ts.map +1 -1
- package/lib/exercises/math/matrices/matrixInversibilityDomain.js +2 -1
- 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 -1
- package/lib/exercises/math/percent/percentWritings.d.ts.map +1 -1
- package/lib/exercises/math/percent/percentWritings.js +10 -1
- package/lib/exercises/math/powers/powersMixOperations.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersMixOperations.js +2 -1
- package/lib/exercises/math/probaStat/diceBasicProbas.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/diceBasicProbas.js +72 -20
- package/lib/exercises/math/probaStat/probabilityTree.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probabilityTree.js +2 -1
- package/lib/exercises/math/sampling/confidenceInterval.d.ts.map +1 -1
- package/lib/exercises/math/sampling/confidenceInterval.js +2 -1
- package/lib/exercises/math/sampling/fluctuationInterval.d.ts.map +1 -1
- package/lib/exercises/math/sampling/fluctuationInterval.js +2 -1
- package/lib/exercises/math/sequences/geometric/geometricExplicitFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricExplicitFormulaUsage.js +2 -1
- package/lib/exercises/math/sets/intervals/inequalityToInterval.d.ts.map +1 -1
- package/lib/exercises/math/sets/intervals/inequalityToInterval.js +2 -1
- package/lib/exercises/math/sets/intervals/intervalsIntersection.d.ts.map +1 -1
- package/lib/exercises/math/sets/intervals/intervalsIntersection.js +2 -1
- package/lib/exercises/math/sets/intervals/intervalsUnion.d.ts.map +1 -1
- package/lib/exercises/math/sets/intervals/intervalsUnion.js +2 -1
- package/lib/exercises/math/trigonometry/degreeToRadians.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/degreeToRadians.js +2 -1
- package/lib/exercises/math/trigonometry/mainAngleMeasure.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/mainAngleMeasure.js +2 -1
- package/lib/exercises/vea/equationVEA.d.ts.map +1 -1
- package/lib/exercises/vea/equationVEA.js +2 -1
- package/lib/exercises/vea/rationalVEA.d.ts.map +1 -1
- package/lib/exercises/vea/rationalVEA.js +3 -2
- package/lib/exercises/vea/sqrtVEA.d.ts.map +1 -1
- package/lib/exercises/vea/sqrtVEA.js +2 -1
- package/lib/index.d.ts +9 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/tree/nodes/algebraicNode.d.ts +1 -0
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.d.ts +2 -1
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +22 -4
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +1 -1
- package/lib/tree/nodes/operators/multiplyNode.d.ts +2 -1
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +13 -1
- package/lib/tree/nodes/operators/operatorNode.d.ts +5 -0
- package/lib/tree/nodes/operators/operatorNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/operatorNode.js +5 -1
- package/lib/tree/nodes/polynomials/monomNode.d.ts +2 -6
- package/lib/tree/nodes/polynomials/monomNode.d.ts.map +1 -1
- package/lib/tree/nodes/polynomials/monomNode.js +102 -94
- package/lib/tree/parsers/affineParser.d.ts +1 -1
- package/lib/tree/parsers/affineParser.d.ts.map +1 -1
- package/lib/tree/parsers/affineParser.js +18 -22
- package/lib/tree/parsers/discreteSetParser.d.ts.map +1 -1
- package/lib/tree/parsers/discreteSetParser.js +2 -1
- package/lib/tree/parsers/equationSolutionParser.d.ts.map +1 -1
- package/lib/tree/parsers/equationSolutionParser.js +2 -1
- package/lib/tree/parsers/inequationParser.d.ts.map +1 -1
- package/lib/tree/parsers/inequationParser.js +2 -1
- package/lib/tree/parsers/intervalParser.d.ts.map +1 -1
- package/lib/tree/parsers/intervalParser.js +3 -2
- package/lib/tree/parsers/latexParser.js +3 -3
- package/lib/tree/parsers/monomParser.d.ts.map +1 -1
- package/lib/tree/parsers/monomParser.js +2 -1
- package/lib/tree/parsers/polynomialParser.d.ts +5 -1
- package/lib/tree/parsers/polynomialParser.d.ts.map +1 -1
- package/lib/tree/parsers/polynomialParser.js +5 -4
- package/lib/tree/parsers/powerParser.d.ts.map +1 -1
- package/lib/tree/parsers/powerParser.js +2 -1
- package/lib/tree/parsers/purifyLatex.d.ts +1 -1
- package/lib/tree/parsers/purifyLatex.js +1 -1
- package/lib/tree/parsers/sqrtParser.d.ts.map +1 -1
- package/lib/tree/parsers/sqrtParser.js +2 -1
- package/lib/tree/parsers/trinomParser.d.ts.map +1 -1
- package/lib/tree/parsers/trinomParser.js +2 -1
- package/lib/tree/parsers/unionIntervalParser.d.ts.map +1 -1
- package/lib/tree/parsers/unionIntervalParser.js +2 -1
- package/lib/utils/alea/random.js +1 -1
- package/lib/utils/alea/shuffle.js +1 -1
- package/lib/utils/errors/handleVEAError.d.ts +2 -0
- package/lib/utils/errors/handleVEAError.d.ts.map +1 -0
- package/lib/utils/errors/handleVEAError.js +9 -0
- package/package.json +1 -1
|
@@ -9,32 +9,54 @@ const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
|
9
9
|
const substractNode_1 = require("../../../../tree/nodes/operators/substractNode");
|
|
10
10
|
const alignTex_1 = require("../../../../utils/latex/alignTex");
|
|
11
11
|
const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const latexParser_1 = require("../../../../tree/parsers/latexParser");
|
|
13
|
+
const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
14
|
+
const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
|
|
15
|
+
const getStatementNode = (identifiers) => {
|
|
16
|
+
const { affine1Coeffs, affine2Coeffs } = identifiers;
|
|
17
|
+
const affine = new affine_1.Affine(affine1Coeffs[1], affine1Coeffs[0]);
|
|
18
|
+
const affine2 = new affine_1.Affine(affine2Coeffs[1], affine2Coeffs[0]);
|
|
15
19
|
const statementTree = new multiplyNode_1.MultiplyNode(affine.toTree(), affine2.toTree());
|
|
20
|
+
return statementTree;
|
|
21
|
+
};
|
|
22
|
+
const getStartStatement = (identifiers) => {
|
|
23
|
+
return getStatementNode(identifiers).toTex();
|
|
24
|
+
};
|
|
25
|
+
const getInstruction = (identifiers) => {
|
|
26
|
+
return `Développer et réduire :
|
|
27
|
+
|
|
28
|
+
$$
|
|
29
|
+
${getStartStatement(identifiers)}
|
|
30
|
+
$$`;
|
|
31
|
+
};
|
|
32
|
+
const getAnswer = (identifiers) => {
|
|
33
|
+
const { affine1Coeffs, affine2Coeffs } = identifiers;
|
|
34
|
+
const affine = new affine_1.Affine(affine1Coeffs[1], affine1Coeffs[0]);
|
|
35
|
+
const affine2 = new affine_1.Affine(affine2Coeffs[1], affine2Coeffs[0]);
|
|
16
36
|
const answer = affine.multiply(affine2).toTree().toTex();
|
|
37
|
+
return answer;
|
|
38
|
+
};
|
|
39
|
+
const getHint = (identifiers) => {
|
|
40
|
+
const { affine1Coeffs, affine2Coeffs } = identifiers;
|
|
41
|
+
const affine = new affine_1.Affine(affine1Coeffs[1], affine1Coeffs[0]);
|
|
17
42
|
const aMonom = new multiplyNode_1.MultiplyNode(affine.a.toTree(), "x".toTree());
|
|
18
43
|
const bPositive = Math.abs(affine.b);
|
|
19
|
-
|
|
20
|
-
const question = {
|
|
21
|
-
instruction: `Développer et réduire : $${statementTex}$`,
|
|
22
|
-
startStatement: statementTex,
|
|
23
|
-
answer,
|
|
24
|
-
keys: ["x"],
|
|
25
|
-
answerFormat: "tex",
|
|
26
|
-
identifiers: {
|
|
27
|
-
affine1Coeffs: affine.coefficients,
|
|
28
|
-
affine2Coeffs: affine2.coefficients,
|
|
29
|
-
},
|
|
30
|
-
hint: `Utilise l'identité remarquable
|
|
44
|
+
return `Utilise l'identité remarquable
|
|
31
45
|
|
|
32
46
|
$$
|
|
33
47
|
(a-b)(a+b) = a^2 - b^2
|
|
34
48
|
$$
|
|
35
49
|
|
|
36
|
-
en prenant $a=${aMonom.toTex()}$ et $b=${bPositive}
|
|
37
|
-
|
|
50
|
+
en prenant $a=${aMonom.toTex()}$ et $b=${bPositive}$`;
|
|
51
|
+
};
|
|
52
|
+
const getCorrection = (identifiers) => {
|
|
53
|
+
const { affine1Coeffs, affine2Coeffs } = identifiers;
|
|
54
|
+
const affine = new affine_1.Affine(affine1Coeffs[1], affine1Coeffs[0]);
|
|
55
|
+
const aMonom = new multiplyNode_1.MultiplyNode(affine.a.toTree(), "x".toTree());
|
|
56
|
+
const bPositive = Math.abs(affine.b);
|
|
57
|
+
const statementTex = getStartStatement(identifiers);
|
|
58
|
+
const answer = getAnswer(identifiers);
|
|
59
|
+
return `
|
|
38
60
|
On utilise l'identité remarquable
|
|
39
61
|
|
|
40
62
|
$$
|
|
@@ -44,13 +66,30 @@ $$
|
|
|
44
66
|
en prenant $a=${aMonom.toTex()}$ et $b=${bPositive}$.
|
|
45
67
|
|
|
46
68
|
${(0, alignTex_1.alignTex)([
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
69
|
+
[
|
|
70
|
+
statementTex,
|
|
71
|
+
"=",
|
|
72
|
+
new substractNode_1.SubstractNode(new powerNode_1.SquareNode(aMonom), new powerNode_1.SquareNode(bPositive.toTree())).toTex(),
|
|
73
|
+
],
|
|
74
|
+
["", "=", answer],
|
|
75
|
+
])}`;
|
|
76
|
+
};
|
|
77
|
+
const getThirdIdentityQuestion = () => {
|
|
78
|
+
const affine = affine_1.AffineConstructor.random(undefined, { excludes: [0] });
|
|
79
|
+
const affine2 = new affine_1.Affine(affine.a, -affine.b);
|
|
80
|
+
const identifiers = {
|
|
81
|
+
affine1Coeffs: affine.coefficients,
|
|
82
|
+
affine2Coeffs: affine2.coefficients,
|
|
83
|
+
};
|
|
84
|
+
const question = {
|
|
85
|
+
instruction: getInstruction(identifiers),
|
|
86
|
+
startStatement: getStartStatement(identifiers),
|
|
87
|
+
answer: getAnswer(identifiers),
|
|
88
|
+
keys: ["x"],
|
|
89
|
+
answerFormat: "tex",
|
|
90
|
+
identifiers,
|
|
91
|
+
hint: getHint(identifiers),
|
|
92
|
+
correction: getCorrection(identifiers),
|
|
54
93
|
};
|
|
55
94
|
return question;
|
|
56
95
|
};
|
|
@@ -74,20 +113,26 @@ const getThirdIdentityPropositions = (n, { answer, affine1Coeffs, affine2Coeffs
|
|
|
74
113
|
return (0, shuffle_1.shuffle)(propositions);
|
|
75
114
|
};
|
|
76
115
|
exports.getThirdIdentityPropositions = getThirdIdentityPropositions;
|
|
77
|
-
const isThirdIdentityAnswerValid = (ans, { affine1Coeffs, affine2Coeffs }) => {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
116
|
+
const isThirdIdentityAnswerValid = (ans, { answer, affine1Coeffs, affine2Coeffs }) => {
|
|
117
|
+
try {
|
|
118
|
+
const parsed = (0, latexParser_1.parseAlgebraic)(ans);
|
|
119
|
+
if (!parsed)
|
|
120
|
+
return false;
|
|
121
|
+
if (!(0, addNode_1.isAddNode)(parsed) && !(0, substractNode_1.isSubstractNode)(parsed))
|
|
122
|
+
return false;
|
|
123
|
+
return (parsed
|
|
124
|
+
.simplify({ forbidFactorize: true, towardsDistribute: true })
|
|
125
|
+
.toTex() === answer);
|
|
126
|
+
}
|
|
127
|
+
catch (err) {
|
|
128
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
129
|
+
}
|
|
83
130
|
};
|
|
84
131
|
exports.isThirdIdentityAnswerValid = isThirdIdentityAnswerValid;
|
|
85
132
|
exports.thirdIdentity = {
|
|
86
133
|
id: "idRmq3",
|
|
87
134
|
connector: "=",
|
|
88
135
|
label: "Identité remarquable $(a+b)(a-b)$",
|
|
89
|
-
levels: ["3ème", "2nde"],
|
|
90
|
-
sections: ["Calcul littéral"],
|
|
91
136
|
isSingleStep: false,
|
|
92
137
|
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(exports.getThirdIdentityQuestion, nb),
|
|
93
138
|
getPropositions: exports.getThirdIdentityPropositions,
|
|
@@ -96,4 +141,9 @@ exports.thirdIdentity = {
|
|
|
96
141
|
freeTimer: 60,
|
|
97
142
|
subject: "Mathématiques",
|
|
98
143
|
hasHintAndCorrection: true,
|
|
144
|
+
getInstruction,
|
|
145
|
+
getCorrection,
|
|
146
|
+
getHint,
|
|
147
|
+
getAnswer,
|
|
148
|
+
getStartStatement,
|
|
99
149
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equationSimpleSquare.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationSimpleSquare.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"equationSimpleSquare.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationSimpleSquare.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,0BAA0B,CAAC;AA4BlC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AA+JF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAkBtD,CAAC"}
|
|
@@ -15,6 +15,7 @@ const diceFlip_1 = require("../../../../utils/alea/diceFlip");
|
|
|
15
15
|
const isInt_1 = require("../../../../utils/isInt");
|
|
16
16
|
const random_1 = require("../../../../utils/alea/random");
|
|
17
17
|
const discreteSetParser_1 = require("../../../../tree/parsers/discreteSetParser");
|
|
18
|
+
const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
|
|
18
19
|
const squares = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map((el) => el ** 2);
|
|
19
20
|
const higherFactor = (n) => {
|
|
20
21
|
for (let i = Math.floor(Math.sqrt(n)); i > 0; i--)
|
|
@@ -141,7 +142,7 @@ const isAnswerValid = (ans, { answer, randNbr }) => {
|
|
|
141
142
|
return "S=" + parsed.simplify().toTex() === answer;
|
|
142
143
|
}
|
|
143
144
|
catch (err) {
|
|
144
|
-
return
|
|
145
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
145
146
|
}
|
|
146
147
|
};
|
|
147
148
|
exports.equationSimpleSquare = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factoByX.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoByX.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"factoByX.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoByX.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAkBlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAqJF,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAiB1C,CAAC"}
|
|
@@ -11,6 +11,7 @@ const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
|
11
11
|
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
12
12
|
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
13
13
|
const latexParser_1 = require("../../../../tree/parsers/latexParser");
|
|
14
|
+
const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
|
|
14
15
|
const alignTex_1 = require("../../../../utils/latex/alignTex");
|
|
15
16
|
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
16
17
|
const propositions = [];
|
|
@@ -106,7 +107,7 @@ const isAnswerValid = (ans, { answer, ...identifiers }) => {
|
|
|
106
107
|
.toTex() === statement.toTex());
|
|
107
108
|
}
|
|
108
109
|
catch (err) {
|
|
109
|
-
return
|
|
110
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
110
111
|
}
|
|
111
112
|
};
|
|
112
113
|
const getFactoByXQuestion = (ops) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factoIdRmq1.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoIdRmq1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"factoIdRmq1.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoIdRmq1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,0BAA0B,CAAC;AAuBlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAqIF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAkB7C,CAAC"}
|
|
@@ -12,6 +12,7 @@ const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
|
12
12
|
const alignTex_1 = require("../../../../utils/latex/alignTex");
|
|
13
13
|
const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
14
14
|
const latexParser_1 = require("../../../../tree/parsers/latexParser");
|
|
15
|
+
const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
|
|
15
16
|
const getStatementNode = (identifiers) => {
|
|
16
17
|
const affine = new affine_1.Affine(identifiers.a, identifiers.b);
|
|
17
18
|
const statementTree = affine.multiply(affine).toTree();
|
|
@@ -105,7 +106,7 @@ const isAnswerValid = (ans, { answer, a, b }) => {
|
|
|
105
106
|
return parsed.simplify().toTex() === answer;
|
|
106
107
|
}
|
|
107
108
|
catch (err) {
|
|
108
|
-
return
|
|
109
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
109
110
|
}
|
|
110
111
|
};
|
|
111
112
|
exports.factoIdRmq1 = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factoIdRmq2.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoIdRmq2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"factoIdRmq2.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoIdRmq2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,0BAA0B,CAAC;AAwBlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA+HF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAkB7C,CAAC"}
|
|
@@ -13,6 +13,7 @@ const substractNode_1 = require("../../../../tree/nodes/operators/substractNode"
|
|
|
13
13
|
const alignTex_1 = require("../../../../utils/latex/alignTex");
|
|
14
14
|
const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
15
15
|
const latexParser_1 = require("../../../../tree/parsers/latexParser");
|
|
16
|
+
const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
|
|
16
17
|
const getInstruction = (identifiers) => {
|
|
17
18
|
return `Factoriser :
|
|
18
19
|
|
|
@@ -103,7 +104,7 @@ const isAnswerValid = (ans, { answer, a, b }) => {
|
|
|
103
104
|
return parsed.simplify().toTex() === answer;
|
|
104
105
|
}
|
|
105
106
|
catch (err) {
|
|
106
|
-
return
|
|
107
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
107
108
|
}
|
|
108
109
|
};
|
|
109
110
|
exports.factoIdRmq2 = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factoIdRmq3.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoIdRmq3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"factoIdRmq3.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoIdRmq3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAmBlC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAmKF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAkB7C,CAAC"}
|
|
@@ -9,6 +9,7 @@ const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
|
9
9
|
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
10
10
|
const substractNode_1 = require("../../../../tree/nodes/operators/substractNode");
|
|
11
11
|
const latexParser_1 = require("../../../../tree/parsers/latexParser");
|
|
12
|
+
const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
|
|
12
13
|
const alignTex_1 = require("../../../../utils/latex/alignTex");
|
|
13
14
|
const getAnswer = (identifiers) => {
|
|
14
15
|
const affine = new affine_1.Affine(identifiers.affine1Coeffs[1], identifiers.affine1Coeffs[0]);
|
|
@@ -112,7 +113,7 @@ const isAnswerValid = (ans, { answer, ...identifiers }) => {
|
|
|
112
113
|
.toTex() === getStartStatement(identifiers));
|
|
113
114
|
}
|
|
114
115
|
catch (err) {
|
|
115
|
-
return
|
|
116
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
116
117
|
}
|
|
117
118
|
};
|
|
118
119
|
exports.factoIdRmq3 = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factoType1Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoType1Exercise.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"factoType1Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoType1Exercise.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAmBlC;;;GAGG;AACH,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAiKF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAepD,CAAC"}
|
|
@@ -14,6 +14,7 @@ const substractNode_1 = require("../../../../tree/nodes/operators/substractNode"
|
|
|
14
14
|
const latexParser_1 = require("../../../../tree/parsers/latexParser");
|
|
15
15
|
const random_1 = require("../../../../utils/alea/random");
|
|
16
16
|
const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
17
|
+
const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
|
|
17
18
|
const getStatementNode = (identifiers) => {
|
|
18
19
|
const { affinesCoeffs, operation } = identifiers;
|
|
19
20
|
const affines = affinesCoeffs.map((coeffs) => new affine_1.Affine(coeffs[1], coeffs[0]));
|
|
@@ -102,6 +103,7 @@ const getPropositions = (n, { answer, affinesCoeffs, operation }) => {
|
|
|
102
103
|
};
|
|
103
104
|
const isAnswerValid = (ans, { answer, ...identifiers }) => {
|
|
104
105
|
try {
|
|
106
|
+
console.log(ans, answer);
|
|
105
107
|
const parsed = (0, latexParser_1.parseAlgebraic)(ans);
|
|
106
108
|
if (!parsed)
|
|
107
109
|
return false;
|
|
@@ -118,7 +120,7 @@ const isAnswerValid = (ans, { answer, ...identifiers }) => {
|
|
|
118
120
|
return simp.toTex() === answerSimp.toTex();
|
|
119
121
|
}
|
|
120
122
|
catch (err) {
|
|
121
|
-
return
|
|
123
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
122
124
|
}
|
|
123
125
|
};
|
|
124
126
|
exports.factoType1Exercise = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firstDegreeInequationsType0.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/inequations/firstDegreeInequationsType0.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"firstDegreeInequationsType0.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/inequations/firstDegreeInequationsType0.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAgB3C,cAAc;AAEd,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,gBAAgB,CAAC;CAC5B,CAAC;AA6JF,KAAK,OAAO,GAAG;IACb,wBAAwB,EAAE,MAAM,CAAC;CAClC,CAAC;AAGF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAqBtE,CAAC"}
|
|
@@ -15,6 +15,7 @@ const inequationParser_1 = require("../../../../tree/parsers/inequationParser");
|
|
|
15
15
|
const intervalParser_1 = require("../../../../tree/parsers/intervalParser");
|
|
16
16
|
const coinFlip_1 = require("../../../../utils/alea/coinFlip");
|
|
17
17
|
const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
18
|
+
const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
|
|
18
19
|
const getHint = (identifiers) => {
|
|
19
20
|
return `Pour résoudre cette inéquation, il faut isoler $x$ à gauche. Pour cela, il faut effectuer des deux côtés de l'inéquation la bonne opération qui permet de supprimer le terme $${identifiers.b < 0 ? "" : "+"}${identifiers.b}$.`;
|
|
20
21
|
};
|
|
@@ -115,7 +116,7 @@ const isAnswerValid = (ans, { answer, ineqType, b, c }, opts) => {
|
|
|
115
116
|
}
|
|
116
117
|
}
|
|
117
118
|
catch (err) {
|
|
118
|
-
return
|
|
119
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
119
120
|
}
|
|
120
121
|
};
|
|
121
122
|
const options = [inequationSolutionFormat_1.inequationSolutionFormat];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firstDegreeInequationsType1.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/inequations/firstDegreeInequationsType1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"firstDegreeInequationsType1.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/inequations/firstDegreeInequationsType1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAe3C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,gBAAgB,CAAC;CAC5B,CAAC;AAgLF,KAAK,OAAO,GAAG;IACb,wBAAwB,EAAE,MAAM,CAAC;CAClC,CAAC;AAGF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAsBtE,CAAC"}
|
|
@@ -15,6 +15,7 @@ const inequationParser_1 = require("../../../../tree/parsers/inequationParser");
|
|
|
15
15
|
const intervalParser_1 = require("../../../../tree/parsers/intervalParser");
|
|
16
16
|
const coinFlip_1 = require("../../../../utils/alea/coinFlip");
|
|
17
17
|
const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
18
|
+
const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
|
|
18
19
|
/**ax<b */
|
|
19
20
|
const getHint = (identifiers) => {
|
|
20
21
|
return `Pour résoudre cette inéquation, il faut isoler $x$ à gauche. Pour cela, il faut effectuer des deux côtés de l'inéquation la bonne opération qui permet de supprimer le facteur $${identifiers.a}$.`;
|
|
@@ -124,7 +125,7 @@ const isAnswerValid = (ans, { answer, a, b, ineqType }, opts) => {
|
|
|
124
125
|
}
|
|
125
126
|
}
|
|
126
127
|
catch (err) {
|
|
127
|
-
return
|
|
128
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
128
129
|
}
|
|
129
130
|
};
|
|
130
131
|
const options = [inequationSolutionFormat_1.inequationSolutionFormat];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firstDegreeInequationsType2.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/inequations/firstDegreeInequationsType2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"firstDegreeInequationsType2.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/inequations/firstDegreeInequationsType2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAY3C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAwIF,KAAK,OAAO,GAAG;IACb,wBAAwB,EAAE,MAAM,CAAC;CAClC,CAAC;AAGF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkBtE,CAAC"}
|
|
@@ -14,6 +14,7 @@ const inequationParser_1 = require("../../../../tree/parsers/inequationParser");
|
|
|
14
14
|
const intervalParser_1 = require("../../../../tree/parsers/intervalParser");
|
|
15
15
|
const coinFlip_1 = require("../../../../utils/alea/coinFlip");
|
|
16
16
|
const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
17
|
+
const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
|
|
17
18
|
/**ax+b<c */
|
|
18
19
|
const getKeys = (identifiers, opts) => {
|
|
19
20
|
const isInterval = opts?.inequationSolutionFormat === "Intervalle (S = [a;b])";
|
|
@@ -99,7 +100,7 @@ const isAnswerValid = (ans, { answer, a, b, c, ineqType }, opts) => {
|
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
102
|
catch (err) {
|
|
102
|
-
return
|
|
103
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
103
104
|
}
|
|
104
105
|
};
|
|
105
106
|
const options = [inequationSolutionFormat_1.inequationSolutionFormat];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firstDegreeInequationsType3.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"firstDegreeInequationsType3.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAY3C,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAmJF,KAAK,OAAO,GAAG;IACb,wBAAwB,EAAE,MAAM,CAAC;CAClC,CAAC;AAGF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkBtE,CAAC"}
|
|
@@ -14,6 +14,7 @@ const inequationParser_1 = require("../../../../tree/parsers/inequationParser");
|
|
|
14
14
|
const intervalParser_1 = require("../../../../tree/parsers/intervalParser");
|
|
15
15
|
const coinFlip_1 = require("../../../../utils/alea/coinFlip");
|
|
16
16
|
const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
17
|
+
const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
|
|
17
18
|
/**ax+b<cx+d */
|
|
18
19
|
const getInstruction = (identifiers) => {
|
|
19
20
|
const { ineqType, a, b, c, d } = identifiers;
|
|
@@ -108,7 +109,7 @@ const isAnswerValid = (ans, { answer, a, b, c, d, ineqType }, opts) => {
|
|
|
108
109
|
}
|
|
109
110
|
}
|
|
110
111
|
catch (err) {
|
|
111
|
-
return
|
|
112
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
112
113
|
}
|
|
113
114
|
};
|
|
114
115
|
const options = [inequationSolutionFormat_1.inequationSolutionFormat];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"squareFunctionInequation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/inequations/squareFunctionInequation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"squareFunctionInequation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/inequations/squareFunctionInequation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAgB3C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,gBAAgB,EAAE,gBAAgB,CAAC;CACpC,CAAC;AAqFF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAgB1D,CAAC"}
|
|
@@ -12,6 +12,7 @@ const closure_1 = require("../../../../tree/nodes/sets/closure");
|
|
|
12
12
|
const intervalNode_1 = require("../../../../tree/nodes/sets/intervalNode");
|
|
13
13
|
const unionIntervalParser_1 = require("../../../../tree/parsers/unionIntervalParser");
|
|
14
14
|
const coinFlip_1 = require("../../../../utils/alea/coinFlip");
|
|
15
|
+
const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
|
|
15
16
|
const getAnswer = (identifiers) => {
|
|
16
17
|
const { k, inequationSymbol } = identifiers;
|
|
17
18
|
const sqrtTree = (0, sqrtNode_1.sqrt)(k).simplify();
|
|
@@ -66,7 +67,7 @@ const isAnswerValid = (ans, { answer, k, inequationSymbol }) => {
|
|
|
66
67
|
return "S=\\ " + parsed.simplify().toTex() === answer;
|
|
67
68
|
}
|
|
68
69
|
catch (err) {
|
|
69
|
-
return
|
|
70
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
70
71
|
}
|
|
71
72
|
};
|
|
72
73
|
exports.squareFunctionInequation = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"distributeAndSimplify.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/simplifying/distributeAndSimplify.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"distributeAndSimplify.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/simplifying/distributeAndSimplify.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA+EF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAcvD,CAAC"}
|
|
@@ -7,9 +7,32 @@ const affine_1 = require("../../../../math/polynomials/affine");
|
|
|
7
7
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
8
8
|
const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
9
9
|
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
10
|
+
const polynomialParser_1 = require("../../../../tree/parsers/polynomialParser");
|
|
10
11
|
const coinFlip_1 = require("../../../../utils/alea/coinFlip");
|
|
12
|
+
const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
|
|
11
13
|
//[a]|[b*(cx+d)] +- e*(fx+g)]
|
|
12
14
|
// c & f > 0
|
|
15
|
+
const getStatementNode = (identifiers) => {
|
|
16
|
+
const { firstTermIsAffine, a, b, c, d, e, f, g } = identifiers;
|
|
17
|
+
const statement = new addNode_1.AddNode(firstTermIsAffine
|
|
18
|
+
? new multiplyNode_1.MultiplyNode(b.toTree(), new affine_1.Affine(c, d).toTree())
|
|
19
|
+
: a.toTree(), new multiplyNode_1.MultiplyNode(e.toTree(), new affine_1.Affine(f, g).toTree()));
|
|
20
|
+
return statement;
|
|
21
|
+
};
|
|
22
|
+
const getInstruction = (identifiers) => {
|
|
23
|
+
return `Développer et réduire :
|
|
24
|
+
|
|
25
|
+
$$
|
|
26
|
+
${getStatementNode(identifiers).toTex()}
|
|
27
|
+
$$`;
|
|
28
|
+
};
|
|
29
|
+
const getAnswer = (identifiers) => {
|
|
30
|
+
const { firstTermIsAffine, a, b, c, d, e, f, g } = identifiers;
|
|
31
|
+
const answer = firstTermIsAffine
|
|
32
|
+
? new affine_1.Affine(b * c + e * f, b * d + e * g).toTree().toTex()
|
|
33
|
+
: new affine_1.Affine(e * f, a + e * g).toTree().toTex();
|
|
34
|
+
return answer;
|
|
35
|
+
};
|
|
13
36
|
const getDistributeAndSimplifyQuestion = () => {
|
|
14
37
|
const firstTermIsAffine = (0, coinFlip_1.coinFlip)();
|
|
15
38
|
const a = (0, randint_1.randint)(-5, 6, [0]);
|
|
@@ -22,18 +45,13 @@ const getDistributeAndSimplifyQuestion = () => {
|
|
|
22
45
|
f = (0, randint_1.randint)(1, 6);
|
|
23
46
|
} while (b * c + e * f === 0);
|
|
24
47
|
const g = (0, randint_1.randint)(-5, 6, [0]);
|
|
25
|
-
const
|
|
26
|
-
? new multiplyNode_1.MultiplyNode(b.toTree(), new affine_1.Affine(c, d).toTree())
|
|
27
|
-
: a.toTree(), new multiplyNode_1.MultiplyNode(e.toTree(), new affine_1.Affine(f, g).toTree())).simplify();
|
|
28
|
-
const answer = firstTermIsAffine
|
|
29
|
-
? new affine_1.Affine(b * c + e * f, b * d + e * g).toTree().toTex()
|
|
30
|
-
: new affine_1.Affine(e * f, a + e * g).toTree().toTex();
|
|
48
|
+
const identifiers = { firstTermIsAffine, a, b, c, d, e, f, g };
|
|
31
49
|
const question = {
|
|
32
|
-
answer,
|
|
33
|
-
instruction:
|
|
50
|
+
answer: getAnswer(identifiers),
|
|
51
|
+
instruction: getInstruction(identifiers),
|
|
34
52
|
keys: ["x"],
|
|
35
53
|
answerFormat: "tex",
|
|
36
|
-
identifiers
|
|
54
|
+
identifiers,
|
|
37
55
|
};
|
|
38
56
|
return question;
|
|
39
57
|
};
|
|
@@ -46,23 +64,27 @@ const getPropositions = (n, { answer }) => {
|
|
|
46
64
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
47
65
|
};
|
|
48
66
|
const isAnswerValid = (ans, { answer, firstTermIsAffine, a, b, c, d, e, f, g }) => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
67
|
+
try {
|
|
68
|
+
const parsed = (0, polynomialParser_1.polynomialParser)(ans);
|
|
69
|
+
if (!parsed)
|
|
70
|
+
return false;
|
|
71
|
+
return parsed.simplify().toTex() === answer;
|
|
72
|
+
}
|
|
73
|
+
catch (err) {
|
|
74
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
75
|
+
}
|
|
54
76
|
};
|
|
55
77
|
exports.distributeAndSimplify = {
|
|
56
78
|
id: "distributeAndSimplify",
|
|
57
79
|
connector: "=",
|
|
58
80
|
label: "Développer et réduire une expression",
|
|
59
|
-
levels: ["4ème", "3ème", "2nde"],
|
|
60
81
|
isSingleStep: true,
|
|
61
|
-
sections: ["Calcul littéral"],
|
|
62
82
|
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getDistributeAndSimplifyQuestion, nb),
|
|
63
83
|
qcmTimer: 60,
|
|
64
84
|
freeTimer: 60,
|
|
65
85
|
getPropositions,
|
|
66
86
|
isAnswerValid,
|
|
67
87
|
subject: "Mathématiques",
|
|
88
|
+
getAnswer,
|
|
89
|
+
getInstruction,
|
|
68
90
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Exercise } from "../../../../exercises/exercise";
|
|
2
2
|
type Identifiers = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
variable: string;
|
|
4
|
+
coeffs: number[][];
|
|
5
|
+
order: number[];
|
|
6
6
|
};
|
|
7
7
|
export declare const reduceExpression: Exercise<Identifiers>;
|
|
8
8
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reduceExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/simplifying/reduceExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"reduceExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/simplifying/reduceExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,0BAA0B,CAAC;AAkBlC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;IAOjB,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;IAGnB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AA+MF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAgBlD,CAAC"}
|