math-exercises 2.2.93 → 2.2.95
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 +8 -0
- package/lib/exercises/math/calcul/fractions/fractionSquare.d.ts.map +1 -0
- package/lib/exercises/math/calcul/fractions/fractionSquare.js +107 -0
- 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/fractions/index.d.ts +1 -0
- package/lib/exercises/math/calcul/fractions/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/index.js +1 -0
- 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/identitiesWithNonIntegers.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/identitiesWithNonIntegers.js +2 -1
- package/lib/exercises/math/calculLitteral/equation/choseOperationToSolveEquation.d.ts +9 -0
- package/lib/exercises/math/calculLitteral/equation/choseOperationToSolveEquation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/choseOperationToSolveEquation.js +160 -126
- 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/equation/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/equation/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/index.js +1 -0
- 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 +76 -41
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.js +71 -40
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq3.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq3.js +79 -47
- package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.js +2 -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/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/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 -1
- package/lib/exercises/math/functions/affines/affineExpressionReading.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineExpressionReading.js +46 -23
- 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/matrices/matrixInversibilityDomain.d.ts.map +1 -1
- package/lib/exercises/math/matrices/matrixInversibilityDomain.js +2 -1
- package/lib/exercises/math/percent/findRightCalcul.d.ts +10 -0
- package/lib/exercises/math/percent/findRightCalcul.d.ts.map +1 -0
- package/lib/exercises/math/percent/findRightCalcul.js +116 -0
- package/lib/exercises/math/percent/htToTTC.d.ts.map +1 -1
- package/lib/exercises/math/percent/htToTTC.js +34 -12
- package/lib/exercises/math/percent/index.d.ts +2 -0
- package/lib/exercises/math/percent/index.d.ts.map +1 -1
- package/lib/exercises/math/percent/index.js +2 -0
- package/lib/exercises/math/percent/percentToDecimal.d.ts.map +1 -1
- package/lib/exercises/math/percent/percentToDecimal.js +6 -2
- package/lib/exercises/math/percent/percentWritings.d.ts +8 -0
- package/lib/exercises/math/percent/percentWritings.d.ts.map +1 -0
- package/lib/exercises/math/percent/percentWritings.js +145 -0
- package/lib/exercises/math/percent/ttcToHT.d.ts.map +1 -1
- package/lib/exercises/math/percent/ttcToHT.js +33 -12
- 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/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 +55 -23
- 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 +2 -1
- package/lib/exercises/vea/sqrtVEA.d.ts.map +1 -1
- package/lib/exercises/vea/sqrtVEA.js +2 -1
- package/lib/index.d.ts +16 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +1 -12
- package/lib/tree/nodes/functions/oppositeNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/oppositeNode.js +1 -1
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +1 -1
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +3 -2
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +1 -1
- package/lib/tree/parsers/affineParser.d.ts.map +1 -1
- package/lib/tree/parsers/affineParser.js +2 -1
- package/lib/tree/parsers/discreteSetParser.d.ts.map +1 -1
- package/lib/tree/parsers/discreteSetParser.js +2 -3
- 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.d.ts.map +1 -1
- package/lib/tree/parsers/latexParser.js +12 -0
- 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.map +1 -1
- package/lib/tree/parsers/polynomialParser.js +2 -1
- package/lib/tree/parsers/powerParser.d.ts.map +1 -1
- package/lib/tree/parsers/powerParser.js +2 -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/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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logPowerEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/logPowerEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"logPowerEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/logPowerEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAmBlC,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;AAgGF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgB3D,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAmB7D,CAAC"}
|
|
@@ -17,6 +17,7 @@ const discreteSetNode_1 = require("../../../../tree/nodes/sets/discreteSetNode")
|
|
|
17
17
|
const variableNode_1 = require("../../../../tree/nodes/variables/variableNode");
|
|
18
18
|
const discreteSetParser_1 = require("../../../../tree/parsers/discreteSetParser");
|
|
19
19
|
const equationSolutionParser_1 = require("../../../../tree/parsers/equationSolutionParser");
|
|
20
|
+
const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
|
|
20
21
|
/**a*b^x+c=d */
|
|
21
22
|
const getKeys = (identifiers, opts) => {
|
|
22
23
|
const keys = ["x", "equal", "S", "lbrace", "semicolon", "rbrace"];
|
|
@@ -77,7 +78,7 @@ const isAnswerValid = (ans, { a, c, k, powered, isLog10, answer }) => {
|
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
80
|
catch (err) {
|
|
80
|
-
return
|
|
81
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
81
82
|
}
|
|
82
83
|
};
|
|
83
84
|
exports.logPowerEquation = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"affineProductSign.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/sign/affineProductSign.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAGL,wBAAwB,EACzB,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"affineProductSign.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/sign/affineProductSign.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAGL,wBAAwB,EACzB,MAAM,sCAAsC,CAAC;AAe9C,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,wBAAwB,CAAC;IACrC,UAAU,EAAE,wBAAwB,CAAC;IACrC,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AA8IF,KAAK,OAAO,GAAG;IACb,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAaF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAiB5D,CAAC"}
|
|
@@ -13,6 +13,7 @@ const unionIntervalNode_1 = require("../../../../tree/nodes/sets/unionIntervalNo
|
|
|
13
13
|
const unionIntervalParser_1 = require("../../../../tree/parsers/unionIntervalParser");
|
|
14
14
|
const coinFlip_1 = require("../../../../utils/alea/coinFlip");
|
|
15
15
|
const doWhile_1 = require("../../../../utils/doWhile");
|
|
16
|
+
const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
|
|
16
17
|
const getPropositions = (n, { answer, ...identifiers }, opts) => {
|
|
17
18
|
const propositions = [];
|
|
18
19
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
@@ -92,7 +93,7 @@ const isAnswerValid = (ans, { answer, ...identifiers }, opts) => {
|
|
|
92
93
|
ansNode.toClosedForm().toTex());
|
|
93
94
|
}
|
|
94
95
|
catch (err) {
|
|
95
|
-
return
|
|
96
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
96
97
|
}
|
|
97
98
|
};
|
|
98
99
|
const getAffineProductSignQuestion = (opts) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"squareImageInterval.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/square/squareImageInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EAAW,WAAW,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"squareImageInterval.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/square/squareImageInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EAAW,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAMrE,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE,WAAW,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAsIF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAarD,CAAC"}
|
|
@@ -7,6 +7,7 @@ const randint_1 = require("../../../../math/utils/random/randint");
|
|
|
7
7
|
const closure_1 = require("../../../../tree/nodes/sets/closure");
|
|
8
8
|
const intervalNode_1 = require("../../../../tree/nodes/sets/intervalNode");
|
|
9
9
|
const intervalParser_1 = require("../../../../tree/parsers/intervalParser");
|
|
10
|
+
const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
|
|
10
11
|
// a < x < b avec a > 0 ==> a^2 < x^2 < b^2
|
|
11
12
|
// a < x < b avec b < 0 ==> b^2 < x^2 < a^2
|
|
12
13
|
// a < x < b avec a<0 et b>0 ==> 0 < x^2 < max(|a|,|b|)^2
|
|
@@ -101,7 +102,7 @@ const isAnswerValid = (ans, { answer, a, b, closure, type }) => {
|
|
|
101
102
|
return parsed.simplify().toTex() === answer;
|
|
102
103
|
}
|
|
103
104
|
catch (err) {
|
|
104
|
-
return
|
|
105
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
105
106
|
}
|
|
106
107
|
};
|
|
107
108
|
exports.squareImageInterval = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coefficientsIdentification.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/coefficientsIdentification.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EAEL,eAAe,EAChB,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"coefficientsIdentification.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/coefficientsIdentification.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EAEL,eAAe,EAChB,MAAM,kCAAkC,CAAC;AAQ1C,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,eAAe,CAAC;IAC9B,YAAY,EAAE,eAAe,CAAC;IAC9B,YAAY,EAAE,eAAe,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAuIF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAgB5D,CAAC"}
|
|
@@ -12,6 +12,7 @@ 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
14
|
const random_1 = require("../../../../utils/alea/random");
|
|
15
|
+
const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
|
|
15
16
|
const getPropositions = (n, { answer, aIdentifiers, bIdentifiers, cIdentifiers, isAsking }) => {
|
|
16
17
|
const propositions = [];
|
|
17
18
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
@@ -79,7 +80,7 @@ const isAnswerValid = (ans, { answer }) => {
|
|
|
79
80
|
return parsed.simplify().toTex() === answer;
|
|
80
81
|
}
|
|
81
82
|
catch (err) {
|
|
82
|
-
return
|
|
83
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
83
84
|
}
|
|
84
85
|
};
|
|
85
86
|
const getCoefficientsIdentificationQuestion = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secondDegreeInequation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/secondDegreeInequation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"secondDegreeInequation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/secondDegreeInequation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAiB3C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,gBAAgB,CAAC;CAC5B,CAAC;AAwHF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAexD,CAAC"}
|
|
@@ -13,6 +13,7 @@ const closure_1 = require("../../../../tree/nodes/sets/closure");
|
|
|
13
13
|
const intervalNode_1 = require("../../../../tree/nodes/sets/intervalNode");
|
|
14
14
|
const unionIntervalNode_1 = require("../../../../tree/nodes/sets/unionIntervalNode");
|
|
15
15
|
const unionIntervalParser_1 = require("../../../../tree/parsers/unionIntervalParser");
|
|
16
|
+
const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
|
|
16
17
|
const getAnswer = ({ a, roots, ineqType }) => {
|
|
17
18
|
const aPositive = a > 0;
|
|
18
19
|
const insideInterval = new intervalNode_1.IntervalNode(roots[0], roots[1], ineqType.isStrict ? closure_1.ClosureType.OO : closure_1.ClosureType.FF);
|
|
@@ -84,7 +85,7 @@ const isAnswerValid = (ans, { answer, a, b, c, ineqType }) => {
|
|
|
84
85
|
return "S=\\ " + parsed.simplify().toTex() === answer;
|
|
85
86
|
}
|
|
86
87
|
catch (err) {
|
|
87
|
-
return
|
|
88
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
88
89
|
}
|
|
89
90
|
};
|
|
90
91
|
exports.secondDegreeInequation = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trinomSignFromRoots.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/trinomSignFromRoots.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"trinomSignFromRoots.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/trinomSignFromRoots.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,0BAA0B,CAAC;AAkBlC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAuHF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAgBrD,CAAC"}
|
|
@@ -10,6 +10,7 @@ const intervalNode_1 = require("../../../../tree/nodes/sets/intervalNode");
|
|
|
10
10
|
const unionIntervalNode_1 = require("../../../../tree/nodes/sets/unionIntervalNode");
|
|
11
11
|
const coinFlip_1 = require("../../../../utils/alea/coinFlip");
|
|
12
12
|
const unionIntervalParser_1 = require("../../../../tree/parsers/unionIntervalParser");
|
|
13
|
+
const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
|
|
13
14
|
const getPropositions = (n, { answer, trinomCoeffs, isAskingPositive }) => {
|
|
14
15
|
const propositions = [];
|
|
15
16
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
@@ -81,7 +82,7 @@ const isAnswerValid = (ans, { answer, isAskingPositive, trinomCoeffs }) => {
|
|
|
81
82
|
return parsed.simplify().toTex() === answer;
|
|
82
83
|
}
|
|
83
84
|
catch (err) {
|
|
84
|
-
return
|
|
85
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
85
86
|
}
|
|
86
87
|
};
|
|
87
88
|
const getTrinomSignFromRootsQuestion = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readAbscissOnLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/readAbscissOnLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"readAbscissOnLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/readAbscissOnLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAYvD,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,UAAU,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAuJF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAgBnD,CAAC"}
|
|
@@ -13,6 +13,7 @@ const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
|
|
|
13
13
|
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
14
14
|
const latexParser_1 = require("../../../../tree/parsers/latexParser");
|
|
15
15
|
const random_1 = require("../../../../utils/alea/random");
|
|
16
|
+
const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
|
|
16
17
|
const getPropositions = (n, { answer, absciss, abscissTex, abscissType, axisUnit, oneUnitTex }) => {
|
|
17
18
|
const propositions = [];
|
|
18
19
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
@@ -66,7 +67,7 @@ const isAnswerValid = (ans, { answer, abscissTex }) => {
|
|
|
66
67
|
return Math.abs(node.evaluate({}) - answerNode.evaluate({})) < 0.00001;
|
|
67
68
|
}
|
|
68
69
|
catch (err) {
|
|
69
|
-
return
|
|
70
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
70
71
|
}
|
|
71
72
|
};
|
|
72
73
|
const getReadAbscissOnLineQuestion = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readAbscissOnSemiLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/readAbscissOnSemiLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"readAbscissOnSemiLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/readAbscissOnSemiLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAWvD,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,UAAU,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAwJF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAgBvD,CAAC"}
|
|
@@ -13,6 +13,7 @@ const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
|
|
|
13
13
|
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
14
14
|
const latexParser_1 = require("../../../../tree/parsers/latexParser");
|
|
15
15
|
const random_1 = require("../../../../utils/alea/random");
|
|
16
|
+
const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
|
|
16
17
|
const getPropositions = (n, { answer, absciss, abscissTex, abscissType, axisUnit, oneUnitTex }) => {
|
|
17
18
|
const propositions = [];
|
|
18
19
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
@@ -67,7 +68,7 @@ const isAnswerValid = (ans, { answer, abscissTex }) => {
|
|
|
67
68
|
return Math.abs(node.evaluate({}) - answerNode.evaluate({})) < 0.00001;
|
|
68
69
|
}
|
|
69
70
|
catch (err) {
|
|
70
|
-
return
|
|
71
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
71
72
|
}
|
|
72
73
|
};
|
|
73
74
|
const getReadAbscissOnSemiLineQuestion = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convexityQuadrinomialsGeo.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"convexityQuadrinomialsGeo.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAsBlC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AA8JF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAc3D,CAAC"}
|
|
@@ -13,6 +13,7 @@ const closure_1 = require("../../../../tree/nodes/sets/closure");
|
|
|
13
13
|
const intervalNode_1 = require("../../../../tree/nodes/sets/intervalNode");
|
|
14
14
|
const intervalParser_1 = require("../../../../tree/parsers/intervalParser");
|
|
15
15
|
const coinFlip_1 = require("../../../../utils/alea/coinFlip");
|
|
16
|
+
const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
|
|
16
17
|
function generatePolynomialWithIntegerInflexionPoint(degree, inflexionPointX) {
|
|
17
18
|
let a, b, c, discriminant;
|
|
18
19
|
do {
|
|
@@ -104,7 +105,7 @@ const isAnswerValid = (ans, { answer }) => {
|
|
|
104
105
|
return parsed.simplify().toTex() === answer;
|
|
105
106
|
}
|
|
106
107
|
catch (err) {
|
|
107
|
-
return
|
|
108
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
108
109
|
}
|
|
109
110
|
};
|
|
110
111
|
exports.convexityQuadrinomialsGeo = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractPointFromParametricLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/parametric/extractPointFromParametricLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"extractPointFromParametricLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/parametric/extractPointFromParametricLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAwHF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,CAkBhE,CAAC"}
|
|
@@ -9,6 +9,7 @@ const spaceVector_1 = require("../../../../math/geometry/spaceVector");
|
|
|
9
9
|
const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
|
|
10
10
|
const spacePointParser_1 = require("../../../../tree/parsers/spacePointParser");
|
|
11
11
|
const doWhile_1 = require("../../../../utils/doWhile");
|
|
12
|
+
const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
|
|
12
13
|
const getPropositions = (n, { answer, startPoint, vector }) => {
|
|
13
14
|
const propositions = [];
|
|
14
15
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
@@ -70,7 +71,7 @@ const isAnswerValid = (ans, { answer, startPoint, vector }) => {
|
|
|
70
71
|
return line.hasPoint(point);
|
|
71
72
|
}
|
|
72
73
|
catch (err) {
|
|
73
|
-
return
|
|
74
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
74
75
|
}
|
|
75
76
|
};
|
|
76
77
|
const getExtractPointFromParametricLineQuestion = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractVectorFromParametricLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/parametric/extractVectorFromParametricLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"extractVectorFromParametricLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/parametric/extractVectorFromParametricLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAWlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AA6GF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAiBjE,CAAC"}
|
|
@@ -8,6 +8,7 @@ const spacePoint_1 = require("../../../../math/geometry/spacePoint");
|
|
|
8
8
|
const spaceVector_1 = require("../../../../math/geometry/spaceVector");
|
|
9
9
|
const spaceVectorParser_1 = require("../../../../tree/parsers/spaceVectorParser");
|
|
10
10
|
const doWhile_1 = require("../../../../utils/doWhile");
|
|
11
|
+
const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
|
|
11
12
|
const getPropositions = (n, { answer, startPoint, vector }) => {
|
|
12
13
|
const propositions = [];
|
|
13
14
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
@@ -70,7 +71,7 @@ const isAnswerValid = (ans, { answer, startPoint, vector }) => {
|
|
|
70
71
|
return v.isColinear(vecAnswer);
|
|
71
72
|
}
|
|
72
73
|
catch (err) {
|
|
73
|
-
return
|
|
74
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
74
75
|
}
|
|
75
76
|
};
|
|
76
77
|
const getExtractVectorFromParametricLineQuestion = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matrixInversibilityDomain.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/matrices/matrixInversibilityDomain.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"matrixInversibilityDomain.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/matrices/matrixInversibilityDomain.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AA2BlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAoGF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAc3D,CAAC"}
|
|
@@ -18,6 +18,7 @@ const unionIntervalNode_1 = require("../../../tree/nodes/sets/unionIntervalNode"
|
|
|
18
18
|
const variableNode_1 = require("../../../tree/nodes/variables/variableNode");
|
|
19
19
|
const latexParser_1 = require("../../../tree/parsers/latexParser");
|
|
20
20
|
const unionIntervalParser_1 = require("../../../tree/parsers/unionIntervalParser");
|
|
21
|
+
const handleVEAError_1 = require("../../../utils/errors/handleVEAError");
|
|
21
22
|
const intervalKeys_1 = require("../../utils/keys/intervalKeys");
|
|
22
23
|
const getMatrixInversibilityDomainQuestion = () => {
|
|
23
24
|
const elements = [[], []];
|
|
@@ -90,7 +91,7 @@ const isAnswerValid = (ans, { answer }) => {
|
|
|
90
91
|
return parsed.simplify().toTex() === answer;
|
|
91
92
|
}
|
|
92
93
|
catch (err) {
|
|
93
|
-
return
|
|
94
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
94
95
|
}
|
|
95
96
|
};
|
|
96
97
|
exports.matrixInversibilityDomain = {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
type: number;
|
|
4
|
+
price: number;
|
|
5
|
+
evolution: number;
|
|
6
|
+
askingFinalPrice: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const findRightCalculForPriceEvolution: Exercise<Identifiers>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=findRightCalcul.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findRightCalcul.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/findRightCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAWlC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAoIF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CAiBlE,CAAC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.findRightCalculForPriceEvolution = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
|
+
const addNode_1 = require("../../../tree/nodes/operators/addNode");
|
|
8
|
+
const divideNode_1 = require("../../../tree/nodes/operators/divideNode");
|
|
9
|
+
const fractionNode_1 = require("../../../tree/nodes/operators/fractionNode");
|
|
10
|
+
const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
|
|
11
|
+
const substractNode_1 = require("../../../tree/nodes/operators/substractNode");
|
|
12
|
+
const coinFlip_1 = require("../../../utils/alea/coinFlip");
|
|
13
|
+
const random_1 = require("../../../utils/alea/random");
|
|
14
|
+
const getPropositions = (n, { answer, evolution, price, type }) => {
|
|
15
|
+
const propositions = [];
|
|
16
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
17
|
+
if (evolution > 0) {
|
|
18
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, multiplyNode_1.multiply)(price, (0, addNode_1.add)(1, (0, fractionNode_1.frac)(Math.abs(evolution), 100))).toTex());
|
|
19
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, multiplyNode_1.multiply)(price, Math.abs(evolution) / 100).toTex());
|
|
20
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, divideNode_1.divide)(price, Math.abs(evolution)).toTex());
|
|
21
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, divideNode_1.divide)(price, (0, addNode_1.add)(1, (0, fractionNode_1.frac)(Math.abs(evolution), 100))).toTex());
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, multiplyNode_1.multiply)(price, (0, substractNode_1.substract)(1, (0, fractionNode_1.frac)(Math.abs(evolution), 100))).toTex());
|
|
25
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, multiplyNode_1.multiply)(price, Math.abs(evolution) / 100).toTex());
|
|
26
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, divideNode_1.divide)(price, Math.abs(evolution)).toTex());
|
|
27
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, divideNode_1.divide)(price, (0, substractNode_1.substract)(1, (0, fractionNode_1.frac)(Math.abs(evolution), 100))).toTex());
|
|
28
|
+
}
|
|
29
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
30
|
+
};
|
|
31
|
+
const getAnswer = (identifiers) => {
|
|
32
|
+
const { type, price, evolution, askingFinalPrice } = identifiers;
|
|
33
|
+
if (askingFinalPrice)
|
|
34
|
+
return (0, multiplyNode_1.multiply)(price, (evolution > 0 ? addNode_1.add : substractNode_1.substract)(1, (0, fractionNode_1.frac)(Math.abs(evolution), 100))).toTex();
|
|
35
|
+
else
|
|
36
|
+
return (0, multiplyNode_1.multiply)(price, Math.abs(evolution) / 100).toTex();
|
|
37
|
+
};
|
|
38
|
+
const getInstruction = (identifiers) => {
|
|
39
|
+
const { type, price, evolution, askingFinalPrice } = identifiers;
|
|
40
|
+
switch (type) {
|
|
41
|
+
case 1:
|
|
42
|
+
return `Un manteau coûte $${price}€$. Le magasin propose une réduction de $${Math.abs(evolution)}\\%$ sur cet article. Quel calcul peut-on faire pour trouver le ${askingFinalPrice
|
|
43
|
+
? "nouveau prix de l'article"
|
|
44
|
+
: "montant de la réduction"} ?`;
|
|
45
|
+
case 2:
|
|
46
|
+
return `Le budget d'un club de sport est de $${price}€$. Suite à des pertes d'abonnés, ce budget diminuera de $${Math.abs(evolution)}\\%$ l'année prochaine. Quel calcul peut-on faire pour trouver le ${askingFinalPrice
|
|
47
|
+
? "budget du club l'an prochain"
|
|
48
|
+
: "montant de la diminution"} ?`;
|
|
49
|
+
case 3:
|
|
50
|
+
return `L'abonnement à une plateforme de streaming coûte $${price}€$. Le mois prochain, ce prix augmentera de $${evolution}\\%$. Quel calcul peut-on faire pour trouver le ${askingFinalPrice
|
|
51
|
+
? "nouveau prix de l'abonnement"
|
|
52
|
+
: "montant de l'augmentation"} ?`;
|
|
53
|
+
case 4:
|
|
54
|
+
return `Le salaire de M. Moulin est de $${price}€$. Le mois prochain, il recevra une augmentation de $${evolution}\\%$. Quel calcul peut-on faire pour trouver le ${askingFinalPrice
|
|
55
|
+
? "nouveau salaire de M. Moulin"
|
|
56
|
+
: "montant de l'augmentation"} ?`;
|
|
57
|
+
}
|
|
58
|
+
return "";
|
|
59
|
+
};
|
|
60
|
+
// const getHint: GetHint<Identifiers> = (identifiers) => {
|
|
61
|
+
// return "";
|
|
62
|
+
// };
|
|
63
|
+
// const getCorrection: GetCorrection<Identifiers> = (identifiers) => {
|
|
64
|
+
// return "";
|
|
65
|
+
// };
|
|
66
|
+
const getKeys = (identifiers) => {
|
|
67
|
+
return [];
|
|
68
|
+
};
|
|
69
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
70
|
+
throw Error("VEA not implemented");
|
|
71
|
+
};
|
|
72
|
+
const getFindRightCalculQuestion = (ops) => {
|
|
73
|
+
const evolution = (0, randint_1.randint)(-6, 7, [0]) * 10;
|
|
74
|
+
const type = evolution < 0 ? (0, random_1.random)([1, 2]) : (0, random_1.random)([3, 4]);
|
|
75
|
+
const price = type === 1
|
|
76
|
+
? (0, randint_1.randint)(30, 400)
|
|
77
|
+
: type === 2
|
|
78
|
+
? 10000 * (0, randint_1.randint)(5, 20)
|
|
79
|
+
: type === 3
|
|
80
|
+
? (0, randint_1.randint)(10, 50)
|
|
81
|
+
: (0, randint_1.randint)(1300, 2000);
|
|
82
|
+
const askingFinalPrice = (0, coinFlip_1.coinFlip)();
|
|
83
|
+
const identifiers = {
|
|
84
|
+
type,
|
|
85
|
+
price,
|
|
86
|
+
evolution,
|
|
87
|
+
askingFinalPrice,
|
|
88
|
+
};
|
|
89
|
+
const question = {
|
|
90
|
+
answer: getAnswer(identifiers),
|
|
91
|
+
instruction: getInstruction(identifiers),
|
|
92
|
+
keys: getKeys(identifiers),
|
|
93
|
+
answerFormat: "tex",
|
|
94
|
+
identifiers,
|
|
95
|
+
// hint: getHint(identifiers),
|
|
96
|
+
// correction: getCorrection(identifiers),
|
|
97
|
+
};
|
|
98
|
+
return question;
|
|
99
|
+
};
|
|
100
|
+
exports.findRightCalculForPriceEvolution = {
|
|
101
|
+
id: "findRightCalculForPriceEvolution",
|
|
102
|
+
connector: "=",
|
|
103
|
+
label: "Choisir le bon calcul pour appliquer une évolution en pourcentage",
|
|
104
|
+
isSingleStep: true,
|
|
105
|
+
generator: (nb, opts) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getFindRightCalculQuestion(opts), nb),
|
|
106
|
+
qcmTimer: 60,
|
|
107
|
+
freeTimer: 60,
|
|
108
|
+
getPropositions,
|
|
109
|
+
isAnswerValid,
|
|
110
|
+
subject: "Mathématiques",
|
|
111
|
+
getInstruction,
|
|
112
|
+
// getHint,
|
|
113
|
+
// getCorrection,
|
|
114
|
+
getAnswer,
|
|
115
|
+
answerType: "QCU",
|
|
116
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"htToTTC.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/htToTTC.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"htToTTC.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/htToTTC.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAWlC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAmEF,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,WAAW,CAkBzC,CAAC"}
|
|
@@ -9,18 +9,23 @@ const round_1 = require("../../../math/utils/round");
|
|
|
9
9
|
const numberParser_1 = require("../../../tree/parsers/numberParser");
|
|
10
10
|
const coinFlip_1 = require("../../../utils/alea/coinFlip");
|
|
11
11
|
const random_1 = require("../../../utils/alea/random");
|
|
12
|
-
const
|
|
13
|
-
const TVA
|
|
14
|
-
const ht = (0, coinFlip_1.coinFlip)() ? (0, randint_1.randint)(50, 1000) : (0, randfloat_1.randfloat)(20, 200, 2);
|
|
12
|
+
const getAnswer = (identifiers) => {
|
|
13
|
+
const { TVA, ht } = identifiers;
|
|
15
14
|
const answer = (0, round_1.round)(ht * (1 + TVA / 100), 2).frenchify();
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
return answer;
|
|
16
|
+
};
|
|
17
|
+
const getInstruction = (identifiers) => {
|
|
18
|
+
const { TVA, ht } = identifiers;
|
|
19
|
+
return `Un objet coûte $${ht.frenchify()}€$ en HT. Quel est son prix TTC, sachant que la TVA est de $${TVA.frenchify()}\\%$ ? (arrondir au centième)`;
|
|
20
|
+
};
|
|
21
|
+
const getHint = (identifiers) => {
|
|
22
|
+
const { TVA, ht } = identifiers;
|
|
23
|
+
return `Pour augmenter un prix de $t\\%$, on le multiplie par $1 + \\frac{t}{100}$.`;
|
|
24
|
+
};
|
|
25
|
+
const getCorrection = (identifiers) => {
|
|
26
|
+
const { TVA, ht } = identifiers;
|
|
27
|
+
const answer = getAnswer(identifiers);
|
|
28
|
+
return `Pour augmenter $${ht.frenchify()}$ de $${TVA.frenchify()}\\%$, on le multiplie par :
|
|
24
29
|
|
|
25
30
|
$$
|
|
26
31
|
1 + \\frac{${TVA.frenchify()}}{100} = ${(0, round_1.round)(1 + TVA / 100, 3).frenchify()}
|
|
@@ -31,7 +36,20 @@ Le prix TTC est donc :
|
|
|
31
36
|
$$
|
|
32
37
|
${ht.frenchify()} \\times ${(0, round_1.round)(1 + TVA / 100, 3).frenchify()} = ${answer}
|
|
33
38
|
$$
|
|
34
|
-
|
|
39
|
+
`;
|
|
40
|
+
};
|
|
41
|
+
const getHtToTtcQuestion = () => {
|
|
42
|
+
const TVA = (0, random_1.random)([20, 5.5]);
|
|
43
|
+
const ht = (0, coinFlip_1.coinFlip)() ? (0, randint_1.randint)(50, 1000) : (0, randfloat_1.randfloat)(20, 200, 2);
|
|
44
|
+
const identifiers = { TVA, ht };
|
|
45
|
+
const question = {
|
|
46
|
+
answer: getAnswer(identifiers),
|
|
47
|
+
instruction: getInstruction(identifiers),
|
|
48
|
+
keys: [],
|
|
49
|
+
answerFormat: "tex",
|
|
50
|
+
identifiers,
|
|
51
|
+
hint: getHint(identifiers),
|
|
52
|
+
correction: getCorrection(identifiers),
|
|
35
53
|
};
|
|
36
54
|
return question;
|
|
37
55
|
};
|
|
@@ -62,4 +80,8 @@ exports.htToTTC = {
|
|
|
62
80
|
isAnswerValid,
|
|
63
81
|
subject: "Mathématiques",
|
|
64
82
|
hasHintAndCorrection: true,
|
|
83
|
+
getAnswer,
|
|
84
|
+
getInstruction,
|
|
85
|
+
getHint,
|
|
86
|
+
getCorrection,
|
|
65
87
|
};
|
|
@@ -15,4 +15,6 @@ export * from "./findStartValueAfterEvolution";
|
|
|
15
15
|
export * from "./subPopulationEffectifFromPercent";
|
|
16
16
|
export * from "./populationEffectifFromSubPopulation";
|
|
17
17
|
export * from "./findEndValueAfterEvolution";
|
|
18
|
+
export * from "./findRightCalcul";
|
|
19
|
+
export * from "./percentWritings";
|
|
18
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,uCAAuC,CAAC;AACtD,cAAc,8BAA8B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,uCAAuC,CAAC;AACtD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC"}
|
|
@@ -31,3 +31,5 @@ __exportStar(require("./findStartValueAfterEvolution"), exports);
|
|
|
31
31
|
__exportStar(require("./subPopulationEffectifFromPercent"), exports);
|
|
32
32
|
__exportStar(require("./populationEffectifFromSubPopulation"), exports);
|
|
33
33
|
__exportStar(require("./findEndValueAfterEvolution"), exports);
|
|
34
|
+
__exportStar(require("./findRightCalcul"), exports);
|
|
35
|
+
__exportStar(require("./percentWritings"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"percentToDecimal.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/percentToDecimal.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAgBlC,KAAK,WAAW,GAAG;IACjB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;
|
|
1
|
+
{"version":3,"file":"percentToDecimal.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/percentToDecimal.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAgBlC,KAAK,WAAW,GAAG;IACjB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AA2IF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAelD,CAAC"}
|
|
@@ -23,7 +23,11 @@ const getInstruction = ({ isPercentToDecimal, nb, }) => {
|
|
|
23
23
|
const instru = isPercentToDecimal ? percentTex : tex;
|
|
24
24
|
return `Ecrire le nombre suivant ${isPercentToDecimal
|
|
25
25
|
? "sous forme de nombre décimal"
|
|
26
|
-
: "sous forme de pourcentage"} :
|
|
26
|
+
: "sous forme de pourcentage"} :
|
|
27
|
+
|
|
28
|
+
$$
|
|
29
|
+
${instru}
|
|
30
|
+
$$`;
|
|
27
31
|
};
|
|
28
32
|
const getHint = ({ isPercentToDecimal }) => {
|
|
29
33
|
return `${isPercentToDecimal
|
|
@@ -64,7 +68,7 @@ const getPercentToDecimalQuestion = () => {
|
|
|
64
68
|
const nb = percentNb.times(0.01);
|
|
65
69
|
const identifiers = {
|
|
66
70
|
isPercentToDecimal,
|
|
67
|
-
nb: nb.value,
|
|
71
|
+
nb: (0, round_1.round)(nb.value, 10),
|
|
68
72
|
};
|
|
69
73
|
const question = {
|
|
70
74
|
answer: getAnswer(identifiers),
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
percent: number;
|
|
4
|
+
target: "decimalToPercent" | "fractionToPercent" | "percentToDecimal" | "percentToFraction";
|
|
5
|
+
};
|
|
6
|
+
export declare const percentWritings: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=percentWritings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"percentWritings.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/percentWritings.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EACF,kBAAkB,GAClB,mBAAmB,GACnB,kBAAkB,GAClB,mBAAmB,CAAC;CACzB,CAAC;AA8JF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAgBjD,CAAC"}
|