math-exercises 2.2.80 → 2.2.82
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/arithmetics/divisibiltyCriteria.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/divisibiltyCriteria.js +1 -0
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType2.d.ts +4 -1
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType2.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType2.js +79 -30
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.d.ts +4 -1
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.js +89 -39
- package/lib/exercises/math/calculLitteral/inequations/squareFunctionInequation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/inequations/squareFunctionInequation.js +37 -17
- package/lib/exercises/math/calculLitteral/simplifying/evaluateExpression.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/simplifying/evaluateExpression.js +55 -15
- package/lib/exercises/math/derivation/derivative/convexityQuadrinomials.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/convexityQuadrinomials.js +9 -18
- package/lib/exercises/math/derivation/derivative/lnDerivativeThree.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/lnDerivativeThree.js +3 -0
- package/lib/exercises/math/derivation/derivative/thirdDegreeFunctionVariation.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/thirdDegreeFunctionVariation.js +11 -11
- package/lib/exercises/math/functions/absolute/absolueValueInequationsSup.d.ts.map +1 -1
- package/lib/exercises/math/functions/absolute/absolueValueInequationsSup.js +10 -2
- package/lib/exercises/math/functions/absolute/absoluteValueInequations.d.ts.map +1 -1
- package/lib/exercises/math/functions/absolute/absoluteValueInequations.js +11 -4
- package/lib/exercises/math/functions/basics/graphicEquation.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/graphicEquation.js +46 -28
- package/lib/exercises/math/functions/basics/graphicInequation.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/graphicInequation.js +0 -1
- package/lib/exercises/math/functions/basics/graphicInequationAffine.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/graphicInequationAffine.js +10 -3
- package/lib/exercises/math/functions/basics/twoFunctionsInequation.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/twoFunctionsInequation.js +74 -58
- package/lib/exercises/math/functions/exponentials/exponentialsVariations.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponentials/exponentialsVariations.js +1 -0
- package/lib/exercises/math/functions/logarithm/log10Simplifying.d.ts +5 -2
- package/lib/exercises/math/functions/logarithm/log10Simplifying.d.ts.map +1 -1
- package/lib/exercises/math/functions/logarithm/log10Simplifying.js +2 -0
- package/lib/exercises/math/functions/logarithm/logEquation.d.ts.map +1 -1
- package/lib/exercises/math/functions/logarithm/logEquation.js +1 -0
- package/lib/exercises/math/functions/logarithm/logPowerEquation.d.ts +5 -2
- package/lib/exercises/math/functions/logarithm/logPowerEquation.d.ts.map +1 -1
- package/lib/exercises/math/functions/logarithm/logPowerEquation.js +2 -0
- package/lib/exercises/math/functions/logarithm/logSimplifiying.d.ts.map +1 -1
- package/lib/exercises/math/functions/logarithm/logSimplifiying.js +1 -0
- package/lib/exercises/math/functions/square/squareImageInterval.d.ts.map +1 -1
- package/lib/exercises/math/functions/square/squareImageInterval.js +13 -4
- package/lib/exercises/math/functions/trinoms/secondDegreeInequation.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/secondDegreeInequation.js +10 -6
- package/lib/exercises/math/functions/trinoms/trinomSignFromRoots.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/trinomSignFromRoots.js +12 -6
- package/lib/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.d.ts.map +1 -1
- package/lib/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.js +9 -14
- package/lib/exercises/math/matrices/matrixInversibilityDomain.d.ts.map +1 -1
- package/lib/exercises/math/matrices/matrixInversibilityDomain.js +15 -2
- package/lib/exercises/math/probaStat/binomial/binomialInequation.d.ts.map +1 -1
- package/lib/exercises/math/python/pyForLoop1Exercise.d.ts.map +1 -1
- package/lib/exercises/math/sequences/genericSequenceVariations.d.ts.map +1 -1
- package/lib/exercises/math/sets/intervals/inequalityToInterval.d.ts +2 -4
- package/lib/exercises/math/sets/intervals/inequalityToInterval.d.ts.map +1 -1
- package/lib/exercises/math/sets/intervals/inequalityToInterval.js +28 -25
- package/lib/exercises/math/sets/intervals/intervalToInequality.d.ts +2 -4
- package/lib/exercises/math/sets/intervals/intervalToInequality.d.ts.map +1 -1
- package/lib/exercises/math/sets/intervals/intervalToInequality.js +40 -78
- package/lib/exercises/math/sets/intervals/intervalsIntersection.d.ts +3 -7
- package/lib/exercises/math/sets/intervals/intervalsIntersection.d.ts.map +1 -1
- package/lib/exercises/math/sets/intervals/intervalsIntersection.js +91 -31
- package/lib/exercises/math/sets/intervals/intervalsUnion.d.ts +3 -7
- package/lib/exercises/math/sets/intervals/intervalsUnion.d.ts.map +1 -1
- package/lib/exercises/math/sets/intervals/intervalsUnion.js +58 -19
- package/lib/exercises/pc/index.d.ts +4 -0
- package/lib/exercises/pc/index.d.ts.map +1 -1
- package/lib/exercises/pc/index.js +4 -6
- package/lib/exercises/vea/equationVEA.js +2 -2
- package/lib/geogebra/lagrange.d.ts.map +1 -1
- package/lib/geogebra/spline.d.ts.map +1 -1
- package/lib/index.d.ts +49 -23
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/inequations/inequation.d.ts +1 -1
- package/lib/math/inequations/inequation.d.ts.map +1 -1
- package/lib/math/numbers/integer/integer.d.ts.map +1 -1
- package/lib/math/numbers/rationals/rational.d.ts +2 -3
- package/lib/math/numbers/rationals/rational.d.ts.map +1 -1
- package/lib/math/polynomials/trinom.d.ts +2 -4
- package/lib/math/polynomials/trinom.d.ts.map +1 -1
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +4 -4
- package/lib/tree/nodes/equations/equationSolutionNode.d.ts +0 -1
- package/lib/tree/nodes/equations/equationSolutionNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equationSolutionNode.js +0 -3
- package/lib/tree/nodes/inequations/inequationNode.d.ts +2 -1
- package/lib/tree/nodes/inequations/inequationNode.d.ts.map +1 -1
- package/lib/tree/nodes/inequations/inequationNode.js +4 -3
- package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts +0 -1
- package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts.map +1 -1
- package/lib/tree/nodes/inequations/inequationSolutionNode.js +0 -3
- package/lib/tree/nodes/numbers/numberNode.d.ts +1 -1
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +6 -1
- package/lib/tree/nodes/sets/closure.d.ts +5 -0
- package/lib/tree/nodes/sets/closure.d.ts.map +1 -1
- package/lib/tree/nodes/sets/closure.js +32 -0
- package/lib/tree/nodes/sets/discreteSetNode.d.ts +4 -4
- package/lib/tree/nodes/sets/discreteSetNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/discreteSetNode.js +3 -4
- package/lib/tree/nodes/sets/intervalNode.d.ts +13 -1
- package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/intervalNode.js +154 -3
- package/lib/tree/parsers/discreteSetParser.d.ts +2 -2
- package/lib/tree/parsers/discreteSetParser.d.ts.map +1 -1
- package/lib/tree/parsers/discreteSetParser.js +2 -1
- package/lib/tree/parsers/equationSolutionParser.js +1 -1
- package/lib/tree/parsers/powerParser.d.ts +1 -1
- package/lib/tree/parsers/rationalParser.d.ts +1 -1
- package/lib/tree/parsers/unionIntervalParser.d.ts.map +1 -1
- package/lib/tree/parsers/unionIntervalParser.js +3 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thirdDegreeFunctionVariation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/thirdDegreeFunctionVariation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"thirdDegreeFunctionVariation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/thirdDegreeFunctionVariation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAmBlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAkHF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAwB9D,CAAC"}
|
|
@@ -12,6 +12,7 @@ const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
|
|
|
12
12
|
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
|
+
const unionIntervalParser_1 = require("../../../../tree/parsers/unionIntervalParser");
|
|
15
16
|
const coinFlip_1 = require("../../../../utils/alea/coinFlip");
|
|
16
17
|
const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
17
18
|
const getThirdDegreeFunctionVariation = () => {
|
|
@@ -86,17 +87,16 @@ const getPropositions = (n, { answer, racine1, racine2 }) => {
|
|
|
86
87
|
}
|
|
87
88
|
return (0, shuffle_1.shuffle)(propositions);
|
|
88
89
|
};
|
|
89
|
-
const isAnswerValid = (ans, { racine1, racine2, coin, a }) => {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
return texs.includes(ans);
|
|
90
|
+
const isAnswerValid = (ans, { answer, racine1, racine2, coin, a }) => {
|
|
91
|
+
try {
|
|
92
|
+
const parsed = (0, unionIntervalParser_1.unionIntervalParser)(ans);
|
|
93
|
+
if (!parsed)
|
|
94
|
+
return false;
|
|
95
|
+
return parsed.simplify().toTex() === answer;
|
|
96
|
+
}
|
|
97
|
+
catch (err) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
100
|
};
|
|
101
101
|
exports.thirdDegreeFunctionVariation = {
|
|
102
102
|
id: "thirdDegreeFunctionVariation",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"absolueValueInequationsSup.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/absolute/absolueValueInequationsSup.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"absolueValueInequationsSup.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/absolute/absolueValueInequationsSup.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAqBlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAqGF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAgB5D,CAAC"}
|
|
@@ -14,6 +14,7 @@ const substractNode_1 = require("../../../../tree/nodes/operators/substractNode"
|
|
|
14
14
|
const closure_1 = require("../../../../tree/nodes/sets/closure");
|
|
15
15
|
const intervalNode_1 = require("../../../../tree/nodes/sets/intervalNode");
|
|
16
16
|
const unionIntervalNode_1 = require("../../../../tree/nodes/sets/unionIntervalNode");
|
|
17
|
+
const unionIntervalParser_1 = require("../../../../tree/parsers/unionIntervalParser");
|
|
17
18
|
const coinFlip_1 = require("../../../../utils/alea/coinFlip");
|
|
18
19
|
const getPropositions = (n, { answer, a, b, c, isStrict }) => {
|
|
19
20
|
const propositions = [];
|
|
@@ -56,8 +57,15 @@ const getKeys = (identifiers) => {
|
|
|
56
57
|
return ["S", "equal", "lbracket", "semicolon", "rbracket", "cup", "infty"];
|
|
57
58
|
};
|
|
58
59
|
const isAnswerValid = (ans, { answer, ...identifiers }) => {
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
try {
|
|
61
|
+
const parsed = (0, unionIntervalParser_1.unionIntervalParser)(ans.replaceAll("S", "").replaceAll("=", ""));
|
|
62
|
+
if (!parsed)
|
|
63
|
+
return false;
|
|
64
|
+
return "S=\\ " + parsed.simplify().toTex() === answer;
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
61
69
|
};
|
|
62
70
|
const getAbsolueValueInequationsSupQuestion = (ops) => {
|
|
63
71
|
const a = (0, randint_1.randint)(-10, 11, [0]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"absoluteValueInequations.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/absolute/absoluteValueInequations.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"absoluteValueInequations.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/absolute/absoluteValueInequations.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAuFF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAc1D,CAAC"}
|
|
@@ -9,6 +9,7 @@ const inequationSolutionNode_1 = require("../../../../tree/nodes/inequations/ine
|
|
|
9
9
|
const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
|
|
10
10
|
const closure_1 = require("../../../../tree/nodes/sets/closure");
|
|
11
11
|
const intervalNode_1 = require("../../../../tree/nodes/sets/intervalNode");
|
|
12
|
+
const unionIntervalParser_1 = require("../../../../tree/parsers/unionIntervalParser");
|
|
12
13
|
const coinFlip_1 = require("../../../../utils/alea/coinFlip");
|
|
13
14
|
const getAbsoluteValueInequationsQuestion = () => {
|
|
14
15
|
const poly = new polynomial_1.Polynomial([(0, randint_1.randint)(-9, 10, [0]), 1]);
|
|
@@ -53,10 +54,16 @@ const getPropositions = (n, { answer, a, b }) => {
|
|
|
53
54
|
}
|
|
54
55
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
55
56
|
};
|
|
56
|
-
const isAnswerValid = (ans, { a, b, isStrict }) => {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
const isAnswerValid = (ans, { answer, a, b, isStrict }) => {
|
|
58
|
+
try {
|
|
59
|
+
const parsed = (0, unionIntervalParser_1.unionIntervalParser)(ans.replaceAll("S", "").replaceAll("=", ""));
|
|
60
|
+
if (!parsed)
|
|
61
|
+
return false;
|
|
62
|
+
return "S=\\ " + parsed.simplify().toTex() === answer;
|
|
63
|
+
}
|
|
64
|
+
catch (err) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
60
67
|
};
|
|
61
68
|
exports.absoluteValueInequations = {
|
|
62
69
|
id: "absoluteValueInequations",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphicEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/graphicEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"graphicEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/graphicEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,0BAA0B,CAAC;AAgBlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;CAClC,CAAC;AAuHF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAejD,CAAC"}
|
|
@@ -10,7 +10,38 @@ const randint_1 = require("../../../../math/utils/random/randint");
|
|
|
10
10
|
const equationSolutionNode_1 = require("../../../../tree/nodes/equations/equationSolutionNode");
|
|
11
11
|
const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
|
|
12
12
|
const discreteSetNode_1 = require("../../../../tree/nodes/sets/discreteSetNode");
|
|
13
|
+
const discreteSetParser_1 = require("../../../../tree/parsers/discreteSetParser");
|
|
13
14
|
const coinFlip_1 = require("../../../../utils/alea/coinFlip");
|
|
15
|
+
const getInstruction = (identifiers) => {
|
|
16
|
+
return `Déterminer graphiquement les solutions de l'équation $f(x) = ${identifiers.yValue}$ où $f$ est la fonction représentée ci-dessous.`;
|
|
17
|
+
};
|
|
18
|
+
const getGGBOptions = (identifiers) => {
|
|
19
|
+
const { splinePoints } = identifiers;
|
|
20
|
+
const xMin = Math.min(...splinePoints.map((point) => point[0]));
|
|
21
|
+
const yMin = Math.min(...splinePoints.map((point) => point[1]));
|
|
22
|
+
const xMax = Math.max(...splinePoints.map((point) => point[0]));
|
|
23
|
+
const yMax = Math.max(...splinePoints.map((point) => point[1]));
|
|
24
|
+
const commands = [
|
|
25
|
+
`S = Spline(${splinePoints
|
|
26
|
+
.map((point) => `(${point[0]},${point[1]})`)
|
|
27
|
+
.join(",")})`,
|
|
28
|
+
"SetFixed(S, true)",
|
|
29
|
+
`SetColor(S, "${(0, colors_1.randomColor)()}")`,
|
|
30
|
+
];
|
|
31
|
+
const ggb = new geogebraConstructor_1.GeogebraConstructor({
|
|
32
|
+
commands,
|
|
33
|
+
});
|
|
34
|
+
return ggb.getOptions({
|
|
35
|
+
coords: ggb.getAdaptedCoords({ xMin, xMax, yMin, yMax }),
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
const getAnswer = (identifiers) => {
|
|
39
|
+
const xSolutions = identifiers.splinePoints
|
|
40
|
+
.filter((p) => p[1] === identifiers.yValue)
|
|
41
|
+
.map((p) => p[0]);
|
|
42
|
+
const answer = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode(xSolutions.map((sol) => new numberNode_1.NumberNode(sol)))).toTex();
|
|
43
|
+
return answer;
|
|
44
|
+
};
|
|
14
45
|
const getGraphicEquationQuestion = () => {
|
|
15
46
|
let xSolutions = [];
|
|
16
47
|
const nb = (0, randint_1.randint)(2, 4);
|
|
@@ -19,7 +50,6 @@ const getGraphicEquationQuestion = () => {
|
|
|
19
50
|
xSolutions.push((0, randint_1.randint)(-9, 10, xSolutions));
|
|
20
51
|
}
|
|
21
52
|
xSolutions.sort((a, b) => a - b);
|
|
22
|
-
const answer = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode(xSolutions.map((sol) => new numberNode_1.NumberNode(sol)))).toTex();
|
|
23
53
|
const yValue = (0, randint_1.randint)(-5, 6);
|
|
24
54
|
const splinePoints = [];
|
|
25
55
|
let prevYWasAbove = (0, coinFlip_1.coinFlip)();
|
|
@@ -47,29 +77,14 @@ const getGraphicEquationQuestion = () => {
|
|
|
47
77
|
yValue + y,
|
|
48
78
|
]);
|
|
49
79
|
}
|
|
50
|
-
const
|
|
51
|
-
const yMin = Math.min(...splinePoints.map((point) => point[1]));
|
|
52
|
-
const xMax = Math.max(...splinePoints.map((point) => point[0]));
|
|
53
|
-
const yMax = Math.max(...splinePoints.map((point) => point[1]));
|
|
54
|
-
const commands = [
|
|
55
|
-
`S = Spline(${splinePoints
|
|
56
|
-
.map((point) => `(${point[0]},${point[1]})`)
|
|
57
|
-
.join(",")})`,
|
|
58
|
-
"SetFixed(S, true)",
|
|
59
|
-
`SetColor(S, "${(0, colors_1.randomColor)()}")`,
|
|
60
|
-
];
|
|
61
|
-
const ggb = new geogebraConstructor_1.GeogebraConstructor({
|
|
62
|
-
commands,
|
|
63
|
-
});
|
|
80
|
+
const identifiers = { yValue, splinePoints };
|
|
64
81
|
const question = {
|
|
65
|
-
answer,
|
|
66
|
-
instruction:
|
|
82
|
+
answer: getAnswer(identifiers),
|
|
83
|
+
instruction: getInstruction(identifiers),
|
|
67
84
|
keys: discreteSetKeys_1.discreteSetKeys,
|
|
68
85
|
answerFormat: "tex",
|
|
69
|
-
ggbOptions:
|
|
70
|
-
|
|
71
|
-
}),
|
|
72
|
-
identifiers: { yValue, splinePoints },
|
|
86
|
+
ggbOptions: getGGBOptions(identifiers),
|
|
87
|
+
identifiers,
|
|
73
88
|
};
|
|
74
89
|
return question;
|
|
75
90
|
};
|
|
@@ -89,13 +104,16 @@ const getPropositions = (n, { answer }) => {
|
|
|
89
104
|
}
|
|
90
105
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
91
106
|
};
|
|
92
|
-
const isAnswerValid = (ans, { yValue, splinePoints }) => {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
107
|
+
const isAnswerValid = (ans, { answer, yValue, splinePoints }) => {
|
|
108
|
+
try {
|
|
109
|
+
const parsed = (0, discreteSetParser_1.discreteSetParser)(ans);
|
|
110
|
+
if (!parsed)
|
|
111
|
+
return false;
|
|
112
|
+
return "S=" + parsed.simplify().toTex() === answer;
|
|
113
|
+
}
|
|
114
|
+
catch (err) {
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
99
117
|
};
|
|
100
118
|
exports.graphicEquation = {
|
|
101
119
|
id: "graphicEquation",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphicInequation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/graphicInequation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,0BAA0B,CAAC;AAQlC,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAO5D,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,WAAW,CAAA;KAAE,EAAE,CAAC;CAC7D,CAAC;
|
|
1
|
+
{"version":3,"file":"graphicInequation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/graphicInequation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,0BAA0B,CAAC;AAQlC,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAO5D,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,WAAW,CAAA;KAAE,EAAE,CAAC;CAC7D,CAAC;AA+MF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAgBnD,CAAC"}
|
|
@@ -161,7 +161,6 @@ const isAnswerValid = (ans, { answer, intervals }) => {
|
|
|
161
161
|
const parsed = (0, unionIntervalParser_1.unionIntervalParser)(ans.replaceAll("S", "").replaceAll("=", ""));
|
|
162
162
|
if (!parsed)
|
|
163
163
|
return false;
|
|
164
|
-
console.log(parsed.simplify().toTex(), answer);
|
|
165
164
|
return "S=\\ " + parsed.simplify().toTex() === answer;
|
|
166
165
|
}
|
|
167
166
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphicInequationAffine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/graphicInequationAffine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"graphicInequationAffine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/graphicInequationAffine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAc3C,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,gBAAgB,CAAC;IAClC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA4HF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAkBzD,CAAC"}
|
|
@@ -11,6 +11,7 @@ const randint_1 = require("../../../../math/utils/random/randint");
|
|
|
11
11
|
const infiniteNode_1 = require("../../../../tree/nodes/numbers/infiniteNode");
|
|
12
12
|
const closure_1 = require("../../../../tree/nodes/sets/closure");
|
|
13
13
|
const intervalNode_1 = require("../../../../tree/nodes/sets/intervalNode");
|
|
14
|
+
const unionIntervalParser_1 = require("../../../../tree/parsers/unionIntervalParser");
|
|
14
15
|
const coinFlip_1 = require("../../../../utils/alea/coinFlip");
|
|
15
16
|
const random_1 = require("../../../../utils/alea/random");
|
|
16
17
|
const getPropositions = (n, { answer }) => {
|
|
@@ -75,9 +76,15 @@ const getKeys = (identifiers) => {
|
|
|
75
76
|
];
|
|
76
77
|
};
|
|
77
78
|
const isAnswerValid = (ans, { answer }) => {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
try {
|
|
80
|
+
const parsed = (0, unionIntervalParser_1.unionIntervalParser)(ans.replaceAll("S", "").replaceAll("=", ""));
|
|
81
|
+
if (!parsed)
|
|
82
|
+
return false;
|
|
83
|
+
return parsed.simplify().toTex() === answer;
|
|
84
|
+
}
|
|
85
|
+
catch (err) {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
81
88
|
};
|
|
82
89
|
const getGraphicInequationAffineQuestion = (opts) => {
|
|
83
90
|
const yValue = (0, randint_1.randint)(-5, 6);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"twoFunctionsInequation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/twoFunctionsInequation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"twoFunctionsInequation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/twoFunctionsInequation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAK3C,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAS5D,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,UAAU,EAAE,gBAAgB,CAAC;IAC7B,SAAS,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,WAAW,CAAA;KAAE,EAAE,CAAC;CAC7D,CAAC;AAyPF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAcxD,CAAC"}
|
|
@@ -7,13 +7,65 @@ const colors_1 = require("../../../../geogebra/colors");
|
|
|
7
7
|
const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor");
|
|
8
8
|
const inequation_1 = require("../../../../math/inequations/inequation");
|
|
9
9
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
10
|
-
const inequationSolutionNode_1 = require("../../../../tree/nodes/inequations/inequationSolutionNode");
|
|
11
10
|
const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
|
|
12
11
|
const closure_1 = require("../../../../tree/nodes/sets/closure");
|
|
13
12
|
const intervalNode_1 = require("../../../../tree/nodes/sets/intervalNode");
|
|
14
13
|
const unionIntervalNode_1 = require("../../../../tree/nodes/sets/unionIntervalNode");
|
|
15
14
|
const coinFlip_1 = require("../../../../utils/alea/coinFlip");
|
|
16
15
|
const random_1 = require("../../../../utils/alea/random");
|
|
16
|
+
const unionIntervalParser_1 = require("../../../../tree/parsers/unionIntervalParser");
|
|
17
|
+
const getInstruction = (identifiers) => {
|
|
18
|
+
return `Déterminer graphiquement les solutions de l'inéquation $f(x) ${identifiers.ineqSymbol} g(x)$ où $f$ et $g$ sont les fonctions représentées ci-dessous.`;
|
|
19
|
+
};
|
|
20
|
+
const getKeys = (identifiers) => {
|
|
21
|
+
return [
|
|
22
|
+
"S",
|
|
23
|
+
"equal",
|
|
24
|
+
"lbracket",
|
|
25
|
+
"semicolon",
|
|
26
|
+
"rbracket",
|
|
27
|
+
"cup",
|
|
28
|
+
"lbrace",
|
|
29
|
+
"rbrace",
|
|
30
|
+
"varnothing",
|
|
31
|
+
];
|
|
32
|
+
};
|
|
33
|
+
const getAnswer = (identifiers) => {
|
|
34
|
+
const intervalsNodes = identifiers.intervals.map((i) => new intervalNode_1.IntervalNode(new numberNode_1.NumberNode(i.a), new numberNode_1.NumberNode(i.b), i.closure));
|
|
35
|
+
const answer = intervalsNodes.length === 1
|
|
36
|
+
? `S=\\ ${intervalsNodes[0].toTex()}`
|
|
37
|
+
: `S=\\ ${new unionIntervalNode_1.UnionIntervalNode(intervalsNodes).toTex()}`;
|
|
38
|
+
return answer;
|
|
39
|
+
};
|
|
40
|
+
const getGGBOptions = (identifiers) => {
|
|
41
|
+
const { fSplinePoints, gSplinePoints } = identifiers;
|
|
42
|
+
const fColor = (0, random_1.random)(colors_1.blues);
|
|
43
|
+
const gColor = (0, random_1.random)(colors_1.oranges);
|
|
44
|
+
const commands = [
|
|
45
|
+
`S = Spline(${fSplinePoints
|
|
46
|
+
.map((point) => `(${point[0]},${point[1]})`)
|
|
47
|
+
.join(",")})`,
|
|
48
|
+
"SetFixed(S, true)",
|
|
49
|
+
`SetColor(S, "${fColor}")`,
|
|
50
|
+
`SetCaption(S, "$f$")`,
|
|
51
|
+
`ShowLabel(S, true)`,
|
|
52
|
+
`T = Spline(${gSplinePoints
|
|
53
|
+
.map((point) => `(${point[0]},${point[1]})`)
|
|
54
|
+
.join(",")})`,
|
|
55
|
+
"SetFixed(T, true)",
|
|
56
|
+
`SetColor(T, "${gColor}")`,
|
|
57
|
+
`SetCaption(T, "$g$")`,
|
|
58
|
+
`ShowLabel(T, true)`,
|
|
59
|
+
];
|
|
60
|
+
const xMin = Math.min(...[...fSplinePoints, ...gSplinePoints].map((point) => point[0]));
|
|
61
|
+
const yMin = Math.min(...[...fSplinePoints, ...gSplinePoints].map((point) => point[1]));
|
|
62
|
+
const xMax = Math.max(...[...fSplinePoints, ...gSplinePoints].map((point) => point[0]));
|
|
63
|
+
const yMax = Math.max(...[...fSplinePoints, ...gSplinePoints].map((point) => point[1]));
|
|
64
|
+
const ggb = new geogebraConstructor_1.GeogebraConstructor({ commands });
|
|
65
|
+
return ggb.getOptions({
|
|
66
|
+
coords: ggb.getAdaptedCoords({ xMax, xMin, yMax, yMin }),
|
|
67
|
+
});
|
|
68
|
+
};
|
|
17
69
|
const getTwoFunctionsInequationQuestion = () => {
|
|
18
70
|
const ineq = inequation_1.InequationSymbolConstructor.random();
|
|
19
71
|
const yValue = (0, randint_1.randint)(-5, 5);
|
|
@@ -83,58 +135,20 @@ const getTwoFunctionsInequationQuestion = () => {
|
|
|
83
135
|
b: xEnd,
|
|
84
136
|
closure: ineq.isStrict ? closure_1.ClosureType.OF : closure_1.ClosureType.FF,
|
|
85
137
|
});
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
`S = Spline(${fSplinePoints
|
|
94
|
-
.map((point) => `(${point[0]},${point[1]})`)
|
|
95
|
-
.join(",")})`,
|
|
96
|
-
"SetFixed(S, true)",
|
|
97
|
-
`SetColor(S, "${fColor}")`,
|
|
98
|
-
`SetCaption(S, "$f$")`,
|
|
99
|
-
`ShowLabel(S, true)`,
|
|
100
|
-
`T = Spline(${gSplinePoints
|
|
101
|
-
.map((point) => `(${point[0]},${point[1]})`)
|
|
102
|
-
.join(",")})`,
|
|
103
|
-
"SetFixed(T, true)",
|
|
104
|
-
`SetColor(T, "${gColor}")`,
|
|
105
|
-
`SetCaption(T, "$g$")`,
|
|
106
|
-
`ShowLabel(T, true)`,
|
|
107
|
-
];
|
|
108
|
-
const ggb = new geogebraConstructor_1.GeogebraConstructor({ commands });
|
|
109
|
-
const intervalsNodes = intervals.map((i) => new intervalNode_1.IntervalNode(new numberNode_1.NumberNode(i.a), new numberNode_1.NumberNode(i.b), i.closure));
|
|
110
|
-
const answer = intervalsNodes.length === 1
|
|
111
|
-
? `S=\\ ${intervalsNodes[0].toTex()}`
|
|
112
|
-
: `S=\\ ${new unionIntervalNode_1.UnionIntervalNode(intervalsNodes).toTex()}`;
|
|
138
|
+
const identifiers = {
|
|
139
|
+
yValue,
|
|
140
|
+
fSplinePoints,
|
|
141
|
+
gSplinePoints,
|
|
142
|
+
ineqSymbol: ineq.symbol,
|
|
143
|
+
intervals,
|
|
144
|
+
};
|
|
113
145
|
const question = {
|
|
114
|
-
answer,
|
|
115
|
-
instruction:
|
|
116
|
-
keys:
|
|
117
|
-
"S",
|
|
118
|
-
"equal",
|
|
119
|
-
"lbracket",
|
|
120
|
-
"semicolon",
|
|
121
|
-
"rbracket",
|
|
122
|
-
"cup",
|
|
123
|
-
"lbrace",
|
|
124
|
-
"rbrace",
|
|
125
|
-
"varnothing",
|
|
126
|
-
],
|
|
146
|
+
answer: getAnswer(identifiers),
|
|
147
|
+
instruction: getInstruction(identifiers),
|
|
148
|
+
keys: getKeys(identifiers),
|
|
127
149
|
answerFormat: "tex",
|
|
128
|
-
identifiers
|
|
129
|
-
|
|
130
|
-
fSplinePoints,
|
|
131
|
-
gSplinePoints,
|
|
132
|
-
ineqSymbol: ineq.symbol,
|
|
133
|
-
intervals,
|
|
134
|
-
},
|
|
135
|
-
ggbOptions: ggb.getOptions({
|
|
136
|
-
coords: ggb.getAdaptedCoords({ xMax, xMin, yMax, yMin }),
|
|
137
|
-
}),
|
|
150
|
+
identifiers,
|
|
151
|
+
ggbOptions: getGGBOptions(identifiers),
|
|
138
152
|
};
|
|
139
153
|
return question;
|
|
140
154
|
};
|
|
@@ -167,13 +181,15 @@ const getPropositions = (n, { answer, intervals, fSplinePoints, ineqSymbol }) =>
|
|
|
167
181
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
168
182
|
};
|
|
169
183
|
const isAnswerValid = (ans, { answer, fSplinePoints, yValue, intervals }) => {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
184
|
+
try {
|
|
185
|
+
const parsed = (0, unionIntervalParser_1.unionIntervalParser)(ans.replaceAll("S", "").replaceAll("=", ""));
|
|
186
|
+
if (!parsed)
|
|
187
|
+
return false;
|
|
188
|
+
return "S=\\ " + parsed.simplify().toTex() === answer;
|
|
189
|
+
}
|
|
190
|
+
catch (err) {
|
|
191
|
+
return false;
|
|
192
|
+
}
|
|
177
193
|
};
|
|
178
194
|
exports.twoFunctionsInequation = {
|
|
179
195
|
id: "twoFunctionsInequation",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exponentialsVariations.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/exponentials/exponentialsVariations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EACL,eAAe,EAEhB,MAAM,kCAAkC,CAAC;AAM1C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,eAAe,CAAC;IACnB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAiHF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"exponentialsVariations.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/exponentials/exponentialsVariations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EACL,eAAe,EAEhB,MAAM,kCAAkC,CAAC;AAM1C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,eAAe,CAAC;IACnB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAiHF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAmBxD,CAAC"}
|
|
@@ -5,7 +5,10 @@ type Identifiers = {
|
|
|
5
5
|
signs: number[];
|
|
6
6
|
isLog10: boolean;
|
|
7
7
|
};
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
type Options = {
|
|
9
|
+
isLog10: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare const log10SumSimplifying: Exercise<Identifiers, Options>;
|
|
12
|
+
export declare const logSumSimplifying: Exercise<Identifiers, Options>;
|
|
10
13
|
export {};
|
|
11
14
|
//# sourceMappingURL=log10Simplifying.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log10Simplifying.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/log10Simplifying.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAalC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;
|
|
1
|
+
{"version":3,"file":"log10Simplifying.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/log10Simplifying.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAalC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AA8FF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkB9D,CAAC;AACF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkB5D,CAAC"}
|
|
@@ -87,6 +87,7 @@ exports.log10SumSimplifying = {
|
|
|
87
87
|
getPropositions,
|
|
88
88
|
isAnswerValid,
|
|
89
89
|
subject: "Mathématiques",
|
|
90
|
+
getKeys,
|
|
90
91
|
};
|
|
91
92
|
exports.logSumSimplifying = {
|
|
92
93
|
id: "logSumSimplifying",
|
|
@@ -101,4 +102,5 @@ exports.logSumSimplifying = {
|
|
|
101
102
|
getPropositions,
|
|
102
103
|
isAnswerValid,
|
|
103
104
|
subject: "Mathématiques",
|
|
105
|
+
getKeys,
|
|
104
106
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/logEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAclC,cAAc;AACd,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA6EF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"logEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/logEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAclC,cAAc;AACd,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA6EF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAc7C,CAAC"}
|
|
@@ -6,7 +6,10 @@ type Identifiers = {
|
|
|
6
6
|
k: number;
|
|
7
7
|
isLog10: boolean;
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
type Options = {
|
|
10
|
+
isLog10: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare const logPowerEquation: Exercise<Identifiers, Options>;
|
|
13
|
+
export declare const log10PowerEquation: Exercise<Identifiers, Options>;
|
|
11
14
|
export {};
|
|
12
15
|
//# sourceMappingURL=logPowerEquation.d.ts.map
|
|
@@ -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;AAgBlC,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;
|
|
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;AAgBlC,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;AAwGF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgB3D,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAmB7D,CAAC"}
|
|
@@ -90,6 +90,7 @@ exports.logPowerEquation = {
|
|
|
90
90
|
getPropositions,
|
|
91
91
|
isAnswerValid,
|
|
92
92
|
subject: "Mathématiques",
|
|
93
|
+
getKeys,
|
|
93
94
|
};
|
|
94
95
|
exports.log10PowerEquation = {
|
|
95
96
|
id: "log10PowerEquation",
|
|
@@ -104,4 +105,5 @@ exports.log10PowerEquation = {
|
|
|
104
105
|
getPropositions,
|
|
105
106
|
isAnswerValid,
|
|
106
107
|
subject: "Mathématiques",
|
|
108
|
+
getKeys,
|
|
107
109
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logSimplifiying.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/logSimplifiying.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAqFF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"logSimplifiying.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/logSimplifiying.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAqFF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAcjD,CAAC"}
|
|
@@ -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;AAKrE,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"}
|
|
@@ -6,6 +6,7 @@ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQ
|
|
|
6
6
|
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
|
+
const intervalParser_1 = require("../../../../tree/parsers/intervalParser");
|
|
9
10
|
// a < x < b avec a > 0 ==> a^2 < x^2 < b^2
|
|
10
11
|
// a < x < b avec b < 0 ==> b^2 < x^2 < a^2
|
|
11
12
|
// a < x < b avec a<0 et b>0 ==> 0 < x^2 < max(|a|,|b|)^2
|
|
@@ -69,7 +70,9 @@ const getSquareImageIntervalQuestion = () => {
|
|
|
69
70
|
const answer = getAnswer(a, b, type, closure).toTex();
|
|
70
71
|
const question = {
|
|
71
72
|
answer,
|
|
72
|
-
instruction: `Soit $${instruction}$.
|
|
73
|
+
instruction: `Soit $${instruction}$.
|
|
74
|
+
|
|
75
|
+
À quel intervalle appartient $x^2$ ?`,
|
|
73
76
|
keys: ["lbracket", "semicolon", "rbracket"],
|
|
74
77
|
answerFormat: "tex",
|
|
75
78
|
identifiers: { a, b, closure, type },
|
|
@@ -91,9 +94,15 @@ const getPropositions = (n, { answer, a, b, type, closure }) => {
|
|
|
91
94
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
92
95
|
};
|
|
93
96
|
const isAnswerValid = (ans, { answer, a, b, closure, type }) => {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
+
try {
|
|
98
|
+
const parsed = (0, intervalParser_1.intervalParser)(ans);
|
|
99
|
+
if (!parsed)
|
|
100
|
+
return false;
|
|
101
|
+
return parsed.simplify().toTex() === answer;
|
|
102
|
+
}
|
|
103
|
+
catch (err) {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
97
106
|
};
|
|
98
107
|
exports.squareImageInterval = {
|
|
99
108
|
id: "squareImageInterval",
|
|
@@ -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;AAgB3C,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"}
|