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
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.percentWritings = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const numberVEA_1 = require("../../../exercises/vea/numberVEA");
|
|
7
|
+
const rationalVEA_1 = require("../../../exercises/vea/rationalVEA");
|
|
8
|
+
const rational_1 = require("../../../math/numbers/rationals/rational");
|
|
9
|
+
const randfloat_1 = require("../../../math/utils/random/randfloat");
|
|
10
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
11
|
+
const round_1 = require("../../../math/utils/round");
|
|
12
|
+
const fractionNode_1 = require("../../../tree/nodes/operators/fractionNode");
|
|
13
|
+
const percentParser_1 = require("../../../tree/parsers/percentParser");
|
|
14
|
+
const random_1 = require("../../../utils/alea/random");
|
|
15
|
+
const getPropositions = (n, { answer, percent, target }) => {
|
|
16
|
+
const propositions = [];
|
|
17
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
18
|
+
switch (target) {
|
|
19
|
+
case "decimalToPercent":
|
|
20
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)(percent / 10, 5).frenchify() + "\\%");
|
|
21
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)(percent / 100, 5).frenchify() + "\\%");
|
|
22
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)(percent * 10, 5).frenchify() + "\\%");
|
|
23
|
+
break;
|
|
24
|
+
case "fractionToPercent":
|
|
25
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)(percent / 10, 5).frenchify() + "\\%");
|
|
26
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)(percent / 100, 5).frenchify() + "\\%");
|
|
27
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)(percent * 10, 5).frenchify() + "\\%");
|
|
28
|
+
break;
|
|
29
|
+
case "percentToDecimal":
|
|
30
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)(percent / 10, 5).frenchify());
|
|
31
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)(percent * 100, 5).frenchify());
|
|
32
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)(percent * 10, 5).frenchify());
|
|
33
|
+
break;
|
|
34
|
+
case "percentToFraction":
|
|
35
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, fractionNode_1.frac)(100, percent).toTex());
|
|
36
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, fractionNode_1.frac)(percent, 10).toTex());
|
|
37
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, fractionNode_1.frac)((0, round_1.round)(percent / 100, 5), 100).toTex());
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
while (propositions.length < n) {
|
|
41
|
+
switch (target) {
|
|
42
|
+
case "decimalToPercent":
|
|
43
|
+
case "fractionToPercent":
|
|
44
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, randint_1.randint)(0, 100) + "\\%");
|
|
45
|
+
break;
|
|
46
|
+
case "percentToDecimal":
|
|
47
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, randfloat_1.randfloat)(0.1, 2, 2).frenchify());
|
|
48
|
+
break;
|
|
49
|
+
case "percentToFraction":
|
|
50
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, rational_1.RationalConstructor.randomIrreductible().toTree().toTex());
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
55
|
+
};
|
|
56
|
+
const getAnswer = (identifiers) => {
|
|
57
|
+
const { percent, target } = identifiers;
|
|
58
|
+
const dec = (0, round_1.round)(percent / 100, 4).frenchify();
|
|
59
|
+
const fraction = (0, fractionNode_1.frac)(percent, 100).toTex();
|
|
60
|
+
switch (target) {
|
|
61
|
+
case "decimalToPercent":
|
|
62
|
+
case "fractionToPercent":
|
|
63
|
+
return percent + "\\%";
|
|
64
|
+
case "percentToDecimal":
|
|
65
|
+
return dec;
|
|
66
|
+
case "percentToFraction":
|
|
67
|
+
return fraction;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
const getInstruction = (identifiers) => {
|
|
71
|
+
const { percent, target } = identifiers;
|
|
72
|
+
const dec = (0, round_1.round)(percent / 100, 4).frenchify();
|
|
73
|
+
const fraction = (0, fractionNode_1.frac)(percent, 100).toTex();
|
|
74
|
+
const nb = target === "decimalToPercent"
|
|
75
|
+
? dec
|
|
76
|
+
: target === "fractionToPercent"
|
|
77
|
+
? fraction
|
|
78
|
+
: percent + "\\%";
|
|
79
|
+
const targetType = target === "percentToDecimal"
|
|
80
|
+
? "nombre décimal"
|
|
81
|
+
: target === "percentToFraction"
|
|
82
|
+
? "fraction"
|
|
83
|
+
: "pourcentage";
|
|
84
|
+
return `Écrire le nombre $${nb}$ sous forme de ${targetType}.`;
|
|
85
|
+
};
|
|
86
|
+
// const getHint: GetHint<Identifiers> = (identifiers) => {};
|
|
87
|
+
// const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
|
|
88
|
+
const getKeys = (identifiers) => {
|
|
89
|
+
return ["percent"];
|
|
90
|
+
};
|
|
91
|
+
const isAnswerValid = (ans, { answer, percent, target }) => {
|
|
92
|
+
try {
|
|
93
|
+
switch (target) {
|
|
94
|
+
case "decimalToPercent":
|
|
95
|
+
case "fractionToPercent":
|
|
96
|
+
return (0, percentParser_1.percentParser)(ans) === answer;
|
|
97
|
+
case "percentToDecimal":
|
|
98
|
+
return (0, numberVEA_1.numberVEA)(ans, answer);
|
|
99
|
+
case "percentToFraction":
|
|
100
|
+
return (0, rationalVEA_1.rationalVEA)(ans, answer);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
catch (err) {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
const getPercentWritingsQuestion = (ops) => {
|
|
108
|
+
const percent = (0, randint_1.randint)(1, 150);
|
|
109
|
+
const target = (0, random_1.random)([
|
|
110
|
+
"decimalToPercent",
|
|
111
|
+
"fractionToPercent",
|
|
112
|
+
"percentToDecimal",
|
|
113
|
+
"percentToFraction",
|
|
114
|
+
]);
|
|
115
|
+
const identifiers = {
|
|
116
|
+
percent,
|
|
117
|
+
target,
|
|
118
|
+
};
|
|
119
|
+
const question = {
|
|
120
|
+
answer: getAnswer(identifiers),
|
|
121
|
+
instruction: getInstruction(identifiers),
|
|
122
|
+
keys: getKeys(identifiers),
|
|
123
|
+
answerFormat: "tex",
|
|
124
|
+
identifiers,
|
|
125
|
+
// hint: getHint(identifiers),
|
|
126
|
+
// correction: getCorrection(identifiers),
|
|
127
|
+
};
|
|
128
|
+
return question;
|
|
129
|
+
};
|
|
130
|
+
exports.percentWritings = {
|
|
131
|
+
id: "percentWritings",
|
|
132
|
+
connector: "=",
|
|
133
|
+
label: "Passer d'une écriture de pourcentage à une autre",
|
|
134
|
+
isSingleStep: true,
|
|
135
|
+
generator: (nb, opts) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getPercentWritingsQuestion(opts), nb),
|
|
136
|
+
qcmTimer: 60,
|
|
137
|
+
freeTimer: 60,
|
|
138
|
+
getPropositions,
|
|
139
|
+
isAnswerValid,
|
|
140
|
+
subject: "Mathématiques",
|
|
141
|
+
getInstruction,
|
|
142
|
+
// getHint,
|
|
143
|
+
// getCorrection,
|
|
144
|
+
getAnswer,
|
|
145
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ttcToHT.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/ttcToHT.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"ttcToHT.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/ttcToHT.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AA6EF,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,WAAW,CAkBzC,CAAC"}
|
|
@@ -9,18 +9,22 @@ 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
|
-
|
|
12
|
+
const getInstruction = (identifiers) => {
|
|
13
|
+
const { TVA, TTC } = identifiers;
|
|
14
|
+
return `Un objet coûte $${TTC.frenchify()}€$ en TTC. Quel est son prix HT, sachant que la TVA est de $${TVA.frenchify()}\\%$ ? (arrondir au centième)`;
|
|
15
|
+
};
|
|
16
|
+
const getAnswer = (identifiers) => {
|
|
17
|
+
const { TVA, TTC } = identifiers;
|
|
15
18
|
const answer = (0, round_1.round)(TTC / (1 + TVA / 100), 2).frenchify();
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
return answer;
|
|
20
|
+
};
|
|
21
|
+
const getHint = (identifiers) => {
|
|
22
|
+
return `Pour retrouver le prix HT d'un objet après une hausse de $t\\%$, on divise le prix TTC par $1 + \\frac{t}{100}$.`;
|
|
23
|
+
};
|
|
24
|
+
const getCorrection = (identifiers) => {
|
|
25
|
+
const { TVA, TTC } = identifiers;
|
|
26
|
+
const answer = getAnswer(identifiers);
|
|
27
|
+
return `Pour retrouver le prix HT après une hausse de $${TVA.frenchify()}\\%$, on divise le prix TTC par :
|
|
24
28
|
|
|
25
29
|
$$
|
|
26
30
|
1 + \\frac{${TVA.frenchify()}}{100} = ${(0, round_1.round)(1 + TVA / 100, 3).frenchify()}
|
|
@@ -31,7 +35,20 @@ Le prix HT est donc :
|
|
|
31
35
|
$$
|
|
32
36
|
${TTC.frenchify()} \\div ${(0, round_1.round)(1 + TVA / 100, 3).frenchify()} \\approx ${answer}
|
|
33
37
|
$$
|
|
34
|
-
|
|
38
|
+
`;
|
|
39
|
+
};
|
|
40
|
+
const getTtcToHtQuestion = () => {
|
|
41
|
+
const TVA = (0, random_1.random)([20, 5.5]);
|
|
42
|
+
const TTC = (0, coinFlip_1.coinFlip)() ? (0, randint_1.randint)(50, 1000) : (0, randfloat_1.randfloat)(20, 200, 2);
|
|
43
|
+
const identifiers = { TTC, TVA };
|
|
44
|
+
const question = {
|
|
45
|
+
answer: getAnswer(identifiers),
|
|
46
|
+
instruction: getInstruction(identifiers),
|
|
47
|
+
keys: [],
|
|
48
|
+
answerFormat: "tex",
|
|
49
|
+
identifiers,
|
|
50
|
+
hint: getHint(identifiers),
|
|
51
|
+
correction: getCorrection(identifiers),
|
|
35
52
|
};
|
|
36
53
|
return question;
|
|
37
54
|
};
|
|
@@ -62,4 +79,8 @@ exports.ttcToHT = {
|
|
|
62
79
|
isAnswerValid,
|
|
63
80
|
subject: "Mathématiques",
|
|
64
81
|
hasHintAndCorrection: true,
|
|
82
|
+
getInstruction,
|
|
83
|
+
getCorrection,
|
|
84
|
+
getHint,
|
|
85
|
+
getAnswer,
|
|
65
86
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"powersMixOperations.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/powersMixOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"powersMixOperations.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/powersMixOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAelC,KAAK,WAAW,GAAG;IACjB,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;AAwFF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAgBrD,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 powerParser_1 = require("../../../tree/parsers/powerParser");
|
|
11
11
|
const doWhile_1 = require("../../../utils/doWhile");
|
|
12
|
+
const handleVEAError_1 = require("../../../utils/errors/handleVEAError");
|
|
12
13
|
const getStatementNode = (identifiers) => {
|
|
13
14
|
const { a, b, k, l, m } = identifiers;
|
|
14
15
|
const n = k + l * m;
|
|
@@ -53,7 +54,7 @@ const isAnswerValid = (ans, { answer }) => {
|
|
|
53
54
|
return parsed.simplify({ keepPowers: true }).toTex() === answer;
|
|
54
55
|
}
|
|
55
56
|
catch (err) {
|
|
56
|
-
return
|
|
57
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
57
58
|
}
|
|
58
59
|
};
|
|
59
60
|
const getPowersMixOperationsQuestion = (ops) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"probabilityTree.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/probabilityTree.ts"],"names":[],"mappings":"AAYA,OAAO,EAEL,eAAe,EAChB,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"probabilityTree.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/probabilityTree.ts"],"names":[],"mappings":"AAYA,OAAO,EAEL,eAAe,EAChB,MAAM,kCAAkC,CAAC;AAa1C,OAAO,EACL,QAAQ,EAeT,MAAM,gBAAgB,CAAC;AAmCxB,KAAK,WAAW,GAAG;IAIjB,CAAC,EAAE,eAAe,CAAC;IACnB,CAAC,EAAE,eAAe,CAAC;IACnB,EAAE,EAAE,eAAe,CAAC;IACpB,EAAE,EAAE,eAAe,CAAC;IACpB,EAAE,EAAE,eAAe,CAAC;IACpB,EAAE,EAAE,eAAe,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA4MF,KAAK,OAAO,GAAG;IACb,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA+CF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAiB1D,CAAC"}
|
|
@@ -14,6 +14,7 @@ const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
|
|
|
14
14
|
const substractNode_1 = require("../../../tree/nodes/operators/substractNode");
|
|
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 exercise_1 = require("../../exercise");
|
|
18
19
|
const getDistinctQuestions_1 = require("../../utils/getDistinctQuestions");
|
|
19
20
|
const rebuildIdentifiers = (oldIdentifiers) => {
|
|
@@ -233,7 +234,7 @@ const isAnswerValid = (ans, { answer, ...identifiers }, opts) => {
|
|
|
233
234
|
});
|
|
234
235
|
}
|
|
235
236
|
catch (err) {
|
|
236
|
-
return
|
|
237
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
237
238
|
}
|
|
238
239
|
};
|
|
239
240
|
const options = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confidenceInterval.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sampling/confidenceInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"confidenceInterval.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sampling/confidenceInterval.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;IACV,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAyHF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAiBpD,CAAC"}
|
|
@@ -14,6 +14,7 @@ const closure_1 = require("../../../tree/nodes/sets/closure");
|
|
|
14
14
|
const intervalNode_1 = require("../../../tree/nodes/sets/intervalNode");
|
|
15
15
|
const intervalParser_1 = require("../../../tree/parsers/intervalParser");
|
|
16
16
|
const coinFlip_1 = require("../../../utils/alea/coinFlip");
|
|
17
|
+
const handleVEAError_1 = require("../../../utils/errors/handleVEAError");
|
|
17
18
|
const alignTex_1 = require("../../../utils/latex/alignTex");
|
|
18
19
|
const approxOrEqual_1 = require("../../../utils/latex/approxOrEqual");
|
|
19
20
|
const getPropositions = (nb, { answer, n, k, wordingType }) => {
|
|
@@ -93,7 +94,7 @@ const isAnswerValid = (ans, { answer }) => {
|
|
|
93
94
|
return parsed.toTex() === answer;
|
|
94
95
|
}
|
|
95
96
|
catch (err) {
|
|
96
|
-
return
|
|
97
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
97
98
|
}
|
|
98
99
|
};
|
|
99
100
|
const getConfidenceIntervalQuestion = (ops) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluctuationInterval.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sampling/fluctuationInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"fluctuationInterval.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sampling/fluctuationInterval.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;IACV,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAiHF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAiBrD,CAAC"}
|
|
@@ -14,6 +14,7 @@ const closure_1 = require("../../../tree/nodes/sets/closure");
|
|
|
14
14
|
const intervalNode_1 = require("../../../tree/nodes/sets/intervalNode");
|
|
15
15
|
const intervalParser_1 = require("../../../tree/parsers/intervalParser");
|
|
16
16
|
const coinFlip_1 = require("../../../utils/alea/coinFlip");
|
|
17
|
+
const handleVEAError_1 = require("../../../utils/errors/handleVEAError");
|
|
17
18
|
const alignTex_1 = require("../../../utils/latex/alignTex");
|
|
18
19
|
const getPropositions = (nb, { answer, n, p, wordingType }) => {
|
|
19
20
|
const propositions = [];
|
|
@@ -90,7 +91,7 @@ const isAnswerValid = (ans, { answer }) => {
|
|
|
90
91
|
return parsed.toTex() === answer;
|
|
91
92
|
}
|
|
92
93
|
catch (err) {
|
|
93
|
-
return
|
|
94
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
94
95
|
}
|
|
95
96
|
};
|
|
96
97
|
const getFluctuationIntervalQuestion = (ops) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometricExplicitFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/geometric/geometricExplicitFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"geometricExplicitFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/geometric/geometricExplicitFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAyFF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAoB/D,CAAC"}
|
|
@@ -10,40 +10,67 @@ const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
|
10
10
|
const variableNode_1 = require("../../../../tree/nodes/variables/variableNode");
|
|
11
11
|
const alignTex_1 = require("../../../../utils/latex/alignTex");
|
|
12
12
|
const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
13
|
+
const latexParser_1 = require("../../../../tree/parsers/latexParser");
|
|
14
|
+
const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
|
|
15
|
+
const getInstruction = (identifiers) => {
|
|
16
|
+
const { firstValue, reason, askedRank } = identifiers;
|
|
17
|
+
const formula = new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(firstValue), new powerNode_1.PowerNode(new numberNode_1.NumberNode(reason), new variableNode_1.VariableNode("n")));
|
|
18
|
+
const formulaTex = formula.toTex();
|
|
19
|
+
return `$(u_n)$ est une suite géométrique définie par $u_n = ${formulaTex}$. Calculer : $u_{${askedRank}}$`;
|
|
20
|
+
};
|
|
21
|
+
const getAnswer = (identifiers) => {
|
|
22
|
+
const { firstValue, reason, askedRank } = identifiers;
|
|
23
|
+
const answer = (firstValue * Math.pow(reason, askedRank)).toString();
|
|
24
|
+
return answer;
|
|
25
|
+
};
|
|
26
|
+
const getHint = (identifiers) => {
|
|
27
|
+
const { askedRank } = identifiers;
|
|
28
|
+
return `Il suffit de remplacer $n$ par $${askedRank}$ dans la formule donnée.`;
|
|
29
|
+
};
|
|
30
|
+
const getCorrection = (identifiers) => {
|
|
31
|
+
const { firstValue, reason, askedRank } = identifiers;
|
|
32
|
+
const answer = getAnswer(identifiers);
|
|
33
|
+
return `On remplace $n$ par $${askedRank}$ dans la formule donnée :
|
|
34
|
+
|
|
35
|
+
${(0, alignTex_1.alignTex)([
|
|
36
|
+
[
|
|
37
|
+
`u_{${askedRank}}`,
|
|
38
|
+
"=",
|
|
39
|
+
new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(firstValue), new powerNode_1.PowerNode(new numberNode_1.NumberNode(reason), askedRank.toTree())).toTex(),
|
|
40
|
+
],
|
|
41
|
+
["", "=", answer],
|
|
42
|
+
])}`;
|
|
43
|
+
};
|
|
44
|
+
const getKeys = () => {
|
|
45
|
+
return [];
|
|
46
|
+
};
|
|
13
47
|
const getGeometricExplicitFormulaUsage = () => {
|
|
14
48
|
const askedRank = (0, randint_1.randint)(0, 10);
|
|
15
49
|
const firstValue = (0, randint_1.randint)(-5, 10, [0]);
|
|
16
50
|
const reason = (0, randint_1.randint)(2, 10);
|
|
17
|
-
const
|
|
18
|
-
const formulaTex = formula.toTex();
|
|
19
|
-
const answer = (firstValue * Math.pow(reason, askedRank)).toString();
|
|
51
|
+
const identifiers = { firstValue, reason, askedRank };
|
|
20
52
|
const question = {
|
|
21
|
-
instruction:
|
|
53
|
+
instruction: getInstruction(identifiers),
|
|
22
54
|
startStatement: `u_{${askedRank}}`,
|
|
23
|
-
answer,
|
|
24
|
-
keys:
|
|
55
|
+
answer: getAnswer(identifiers),
|
|
56
|
+
keys: getKeys(identifiers),
|
|
25
57
|
answerFormat: "tex",
|
|
26
|
-
identifiers
|
|
27
|
-
hint:
|
|
28
|
-
correction:
|
|
29
|
-
|
|
30
|
-
${(0, alignTex_1.alignTex)([
|
|
31
|
-
[
|
|
32
|
-
`u_{${askedRank}}`,
|
|
33
|
-
"=",
|
|
34
|
-
new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(firstValue), new powerNode_1.PowerNode(new numberNode_1.NumberNode(reason), askedRank.toTree())).toTex(),
|
|
35
|
-
],
|
|
36
|
-
["", "=", answer],
|
|
37
|
-
])}`,
|
|
58
|
+
identifiers,
|
|
59
|
+
hint: getHint(identifiers),
|
|
60
|
+
correction: getCorrection(identifiers),
|
|
38
61
|
};
|
|
39
62
|
return question;
|
|
40
63
|
};
|
|
41
64
|
const isAnswerValid = (ans, { answer, askedRank }) => {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
65
|
+
try {
|
|
66
|
+
const parsed = (0, latexParser_1.parseAlgebraic)(ans);
|
|
67
|
+
if (!parsed)
|
|
68
|
+
return false;
|
|
69
|
+
return parsed.simplify().toTex() === answer;
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
73
|
+
}
|
|
47
74
|
};
|
|
48
75
|
const getPropositions = (n, { answer, firstValue, reason, askedRank }) => {
|
|
49
76
|
const propositions = [];
|
|
@@ -67,4 +94,9 @@ exports.geometricExplicitFormulaUsage = {
|
|
|
67
94
|
isAnswerValid,
|
|
68
95
|
subject: "Mathématiques",
|
|
69
96
|
hasHintAndCorrection: true,
|
|
97
|
+
getInstruction,
|
|
98
|
+
getAnswer,
|
|
99
|
+
getHint,
|
|
100
|
+
getCorrection,
|
|
101
|
+
getKeys,
|
|
70
102
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inequalityToInterval.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sets/intervals/inequalityToInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,0BAA0B,CAAC;AAQlC,OAAO,EAGL,uBAAuB,EACxB,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"inequalityToInterval.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sets/intervals/inequalityToInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,0BAA0B,CAAC;AAQlC,OAAO,EAGL,uBAAuB,EACxB,MAAM,oCAAoC,CAAC;AAK5C,KAAK,WAAW,GAAG;IAIjB,mBAAmB,EAAE,uBAAuB,CAAC;CAC9C,CAAC;AAwGF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAiBtD,CAAC"}
|
|
@@ -7,6 +7,7 @@ const infiniteNode_1 = require("../../../../tree/nodes/numbers/infiniteNode");
|
|
|
7
7
|
const intervalNode_1 = require("../../../../tree/nodes/sets/intervalNode");
|
|
8
8
|
const intervalParser_1 = require("../../../../tree/parsers/intervalParser");
|
|
9
9
|
const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
10
|
+
const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
|
|
10
11
|
const rebuildIdentifiers = (oldIds) => {
|
|
11
12
|
if (!!oldIds.intervalIdentifiers)
|
|
12
13
|
return oldIds;
|
|
@@ -79,7 +80,7 @@ const isAnswerValid = (ans, { answer }) => {
|
|
|
79
80
|
return "x\\in\\ " + 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
|
exports.inequalityToInterval = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intervalsIntersection.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sets/intervals/intervalsIntersection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,0BAA0B,CAAC;AAYlC,OAAO,EAGL,uBAAuB,EAExB,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"intervalsIntersection.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sets/intervals/intervalsIntersection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,0BAA0B,CAAC;AAYlC,OAAO,EAGL,uBAAuB,EAExB,MAAM,oCAAoC,CAAC;AAM5C,KAAK,WAAW,GAAG;IAOjB,eAAe,EAAE,uBAAuB,CAAC;IACzC,eAAe,EAAE,uBAAuB,CAAC;CAC1C,CAAC;AAgKF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAgBvD,CAAC"}
|
|
@@ -9,6 +9,7 @@ const intervalNode_1 = require("../../../../tree/nodes/sets/intervalNode");
|
|
|
9
9
|
const discreteSetParser_1 = require("../../../../tree/parsers/discreteSetParser");
|
|
10
10
|
const intervalParser_1 = require("../../../../tree/parsers/intervalParser");
|
|
11
11
|
const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
12
|
+
const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
|
|
12
13
|
const rebuildIdentifiers = (oldIds) => {
|
|
13
14
|
if (!!oldIds.int1Identifiers)
|
|
14
15
|
return oldIds;
|
|
@@ -143,7 +144,7 @@ const isAnswerValid = (ans, { answer, int1Identifiers, int2Identifiers }) => {
|
|
|
143
144
|
}
|
|
144
145
|
}
|
|
145
146
|
catch (err) {
|
|
146
|
-
return
|
|
147
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
147
148
|
}
|
|
148
149
|
};
|
|
149
150
|
exports.intervalsIntersection = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intervalsUnion.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sets/intervals/intervalsUnion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAGL,uBAAuB,EACxB,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"intervalsUnion.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sets/intervals/intervalsUnion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAGL,uBAAuB,EACxB,MAAM,oCAAoC,CAAC;AAK5C,KAAK,WAAW,GAAG;IAOjB,eAAe,EAAE,uBAAuB,CAAC;IACzC,eAAe,EAAE,uBAAuB,CAAC;CAC1C,CAAC;AA8GF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAehD,CAAC"}
|
|
@@ -7,6 +7,7 @@ const infiniteNode_1 = require("../../../../tree/nodes/numbers/infiniteNode");
|
|
|
7
7
|
const intervalNode_1 = require("../../../../tree/nodes/sets/intervalNode");
|
|
8
8
|
const unionIntervalParser_1 = require("../../../../tree/parsers/unionIntervalParser");
|
|
9
9
|
const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
10
|
+
const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
|
|
10
11
|
const rebuildIdentifiers = (oldIds) => {
|
|
11
12
|
if (!!oldIds.int1Identifiers)
|
|
12
13
|
return oldIds;
|
|
@@ -97,7 +98,7 @@ const isAnswerValid = (ans, { answer }) => {
|
|
|
97
98
|
return parsed.simplify().toTex() === answer;
|
|
98
99
|
}
|
|
99
100
|
catch (err) {
|
|
100
|
-
return
|
|
101
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
101
102
|
}
|
|
102
103
|
};
|
|
103
104
|
exports.intervalsUnion = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"degreeToRadians.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/degreeToRadians.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"degreeToRadians.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/degreeToRadians.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAiBlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,GAAG,CAAC;IACnB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAwJF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAiBjD,CAAC"}
|
|
@@ -14,6 +14,7 @@ const degreeParser_1 = require("../../../tree/parsers/degreeParser");
|
|
|
14
14
|
const latexParser_1 = require("../../../tree/parsers/latexParser");
|
|
15
15
|
const coinFlip_1 = require("../../../utils/alea/coinFlip");
|
|
16
16
|
const random_1 = require("../../../utils/alea/random");
|
|
17
|
+
const handleVEAError_1 = require("../../../utils/errors/handleVEAError");
|
|
17
18
|
const getPropositions = (n, { answer, isDegreeToRadian }) => {
|
|
18
19
|
const propositions = [];
|
|
19
20
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
@@ -93,7 +94,7 @@ const isAnswerValid = (ans, { answer, degree, isDegreeToRadian, radianNodeIds })
|
|
|
93
94
|
}
|
|
94
95
|
}
|
|
95
96
|
catch (err) {
|
|
96
|
-
return
|
|
97
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
97
98
|
}
|
|
98
99
|
};
|
|
99
100
|
const getIdentifiers = (prevIds) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mainAngleMeasure.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/mainAngleMeasure.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"mainAngleMeasure.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/mainAngleMeasure.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAgBlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,MAAM,CAAC;IAC3B,OAAO,EAAE,GAAG,CAAC;CACd,CAAC;AA4FF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAiBlD,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 latexParser_1 = require("../../../tree/parsers/latexParser");
|
|
13
13
|
const random_1 = require("../../../utils/alea/random");
|
|
14
|
+
const handleVEAError_1 = require("../../../utils/errors/handleVEAError");
|
|
14
15
|
const getPropositions = (n, { answer, degree }) => {
|
|
15
16
|
const propositions = [];
|
|
16
17
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
@@ -62,7 +63,7 @@ const isAnswerValid = (ans, { answer, degree }) => {
|
|
|
62
63
|
// return value.angle.toAllValidTexs().includes(ans);
|
|
63
64
|
}
|
|
64
65
|
catch (err) {
|
|
65
|
-
return
|
|
66
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
66
67
|
}
|
|
67
68
|
};
|
|
68
69
|
const getMainAngleMeasureQuestion = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equationVEA.d.ts","sourceRoot":"","sources":["../../../src/exercises/vea/equationVEA.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"equationVEA.d.ts","sourceRoot":"","sources":["../../../src/exercises/vea/equationVEA.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,WAAW,QAAS,MAAM,eAAe,MAAM,YAa3D,CAAC"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.equationVEA = void 0;
|
|
4
4
|
const discreteSetParser_1 = require("../../tree/parsers/discreteSetParser");
|
|
5
5
|
const equationSolutionParser_1 = require("../../tree/parsers/equationSolutionParser");
|
|
6
|
+
const handleVEAError_1 = require("../../utils/errors/handleVEAError");
|
|
6
7
|
const rationalVEA_1 = require("./rationalVEA");
|
|
7
8
|
const equationVEA = (ans, solutionTex) => {
|
|
8
9
|
try {
|
|
@@ -18,7 +19,7 @@ const equationVEA = (ans, solutionTex) => {
|
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
catch (err) {
|
|
21
|
-
return
|
|
22
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
22
23
|
}
|
|
23
24
|
};
|
|
24
25
|
exports.equationVEA = equationVEA;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rationalVEA.d.ts","sourceRoot":"","sources":["../../../src/exercises/vea/rationalVEA.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rationalVEA.d.ts","sourceRoot":"","sources":["../../../src/exercises/vea/rationalVEA.ts"],"names":[],"mappings":"AAMA,KAAK,IAAI,GAAG;IACV,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AACF,eAAO,MAAM,WAAW,eACV,MAAM,UACV,MAAM,6DAC4C,IAAI,YAoC/D,CAAC"}
|
|
@@ -4,6 +4,7 @@ exports.rationalVEA = void 0;
|
|
|
4
4
|
const numberNode_1 = require("../../tree/nodes/numbers/numberNode");
|
|
5
5
|
const latexParser_1 = require("../../tree/parsers/latexParser");
|
|
6
6
|
const rationalParser_1 = require("../../tree/parsers/rationalParser");
|
|
7
|
+
const handleVEAError_1 = require("../../utils/errors/handleVEAError");
|
|
7
8
|
const rationalVEA = (studentAns, answer, { allowNonIrreductible, decimalPrecision, allowDecimal } = {
|
|
8
9
|
allowNonIrreductible: true,
|
|
9
10
|
decimalPrecision: undefined,
|
|
@@ -38,7 +39,7 @@ const rationalVEA = (studentAns, answer, { allowNonIrreductible, decimalPrecisio
|
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
catch (err) {
|
|
41
|
-
return
|
|
42
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
42
43
|
}
|
|
43
44
|
};
|
|
44
45
|
exports.rationalVEA = rationalVEA;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sqrtVEA.d.ts","sourceRoot":"","sources":["../../../src/exercises/vea/sqrtVEA.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sqrtVEA.d.ts","sourceRoot":"","sources":["../../../src/exercises/vea/sqrtVEA.ts"],"names":[],"mappings":"AAOA,KAAK,IAAI,GAAG;IACV,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AACF,eAAO,MAAM,OAAO,eACN,MAAM,UACV,MAAM,mDACkC,IAAI,YA0BrD,CAAC"}
|
|
@@ -4,6 +4,7 @@ exports.sqrtVEA = void 0;
|
|
|
4
4
|
const numberNode_1 = require("../../tree/nodes/numbers/numberNode");
|
|
5
5
|
const latexParser_1 = require("../../tree/parsers/latexParser");
|
|
6
6
|
const sqrtParser_1 = require("../../tree/parsers/sqrtParser");
|
|
7
|
+
const handleVEAError_1 = require("../../utils/errors/handleVEAError");
|
|
7
8
|
const sqrtVEA = (studentAns, answer, { allowNonIrreductible, decimalApproxAllowed } = {
|
|
8
9
|
allowNonIrreductible: true,
|
|
9
10
|
}) => {
|
|
@@ -27,7 +28,7 @@ const sqrtVEA = (studentAns, answer, { allowNonIrreductible, decimalApproxAllowe
|
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
catch (err) {
|
|
30
|
-
return
|
|
31
|
+
return (0, handleVEAError_1.handleVEAError)(err);
|
|
31
32
|
}
|
|
32
33
|
};
|
|
33
34
|
exports.sqrtVEA = sqrtVEA;
|