math-exercises 2.2.69 → 2.2.70
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/divisorsList.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/divisorsList.js +2 -1
- package/lib/exercises/math/calcul/arithmetics/primeNumbers.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/primeNumbers.js +2 -1
- package/lib/exercises/math/calcul/fractions/fractionsOperations.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsOperations.js +1 -0
- package/lib/exercises/math/calculLitteral/equation/equationType1Exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType1Exercise.js +3 -6
- package/lib/exercises/math/calculLitteral/equation/equationType2Exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType2Exercise.js +3 -8
- package/lib/exercises/math/calculLitteral/equation/equationType3Exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType3Exercise.js +7 -9
- package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.js +6 -19
- package/lib/exercises/math/calculLitteral/factorisation/factoByX.d.ts +8 -0
- package/lib/exercises/math/calculLitteral/factorisation/factoByX.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/factorisation/factoByX.js +146 -0
- package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/index.js +1 -0
- package/lib/exercises/math/functions/absolute/absolueValueAffineEquation.d.ts.map +1 -1
- package/lib/exercises/math/functions/absolute/absolueValueAffineEquation.js +2 -5
- package/lib/exercises/math/functions/trinoms/coefficientsIdentification.js +3 -3
- package/lib/exercises/math/functions/trinoms/findSecondRoot.d.ts +2 -2
- package/lib/exercises/math/functions/trinoms/findSecondRoot.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/findSecondRoot.js +5 -5
- package/lib/exercises/math/functions/trinoms/rootsProduct.d.ts +2 -2
- package/lib/exercises/math/functions/trinoms/rootsProduct.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/rootsProduct.js +6 -6
- package/lib/exercises/math/functions/trinoms/rootsSum.d.ts +2 -2
- package/lib/exercises/math/functions/trinoms/rootsSum.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/rootsSum.js +7 -7
- package/lib/exercises/math/functions/trinoms/trinomSignFromRoots.js +6 -6
- package/lib/exercises/math/geometry/areas/rightTriangleArea.d.ts +3 -1
- package/lib/exercises/math/geometry/areas/rightTriangleArea.d.ts.map +1 -1
- package/lib/exercises/math/geometry/areas/rightTriangleArea.js +10 -22
- package/lib/exercises/math/geometry/areas/triangleArea.d.ts +6 -1
- package/lib/exercises/math/geometry/areas/triangleArea.d.ts.map +1 -1
- package/lib/exercises/math/geometry/areas/triangleArea.js +34 -48
- package/lib/exercises/math/geometry/index.d.ts +1 -0
- package/lib/exercises/math/geometry/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/index.js +1 -0
- package/lib/exercises/math/geometry/pythagore/isTriangleRight.d.ts.map +1 -1
- package/lib/exercises/math/geometry/pythagore/pythagore.d.ts +0 -3
- package/lib/exercises/math/geometry/pythagore/pythagore.d.ts.map +1 -1
- package/lib/exercises/math/geometry/pythagore/pythagore.js +19 -25
- package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts +1 -2
- package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts.map +1 -1
- package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.js +30 -65
- package/lib/exercises/math/geometry/quadrilaterals/index.d.ts +2 -0
- package/lib/exercises/math/geometry/quadrilaterals/index.d.ts.map +1 -0
- package/lib/exercises/math/geometry/quadrilaterals/index.js +17 -0
- package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.d.ts +14 -0
- package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.d.ts.map +1 -0
- package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.js +221 -0
- package/lib/exercises/math/geometry/thales/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/thales/index.js +0 -1
- package/lib/exercises/math/geometry/thales/thales.js +2 -2
- package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts +3 -4
- package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts.map +1 -1
- package/lib/exercises/math/geometry/thales/thalesCalcul.js +69 -78
- package/lib/exercises/math/geometry/volumes/parallelepipedVolume.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/parallelepipedVolume.js +4 -3
- package/lib/exercises/math/geometry/volumes/sphereVolume.js +1 -1
- package/lib/exercises/math/trigonometry/trigonometry.d.ts +2 -3
- package/lib/exercises/math/trigonometry/trigonometry.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/trigonometry.js +32 -31
- package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.d.ts +3 -2
- package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.js +18 -28
- package/lib/exercises/math/trigonometry/trigonometrySideCalcul.d.ts +5 -4
- package/lib/exercises/math/trigonometry/trigonometrySideCalcul.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/trigonometrySideCalcul.js +60 -56
- package/lib/exercises/pc/index.d.ts +0 -4
- package/lib/exercises/pc/index.d.ts.map +1 -1
- package/lib/exercises/pc/index.js +6 -4
- package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts +1 -0
- package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts.map +1 -1
- package/lib/exercises/vea/equationVEA.d.ts +2 -0
- package/lib/exercises/vea/equationVEA.d.ts.map +1 -0
- package/lib/exercises/vea/equationVEA.js +24 -0
- package/lib/exercises/vea/rationalVEA.d.ts.map +1 -1
- package/lib/exercises/vea/sqrtVEA.d.ts +6 -0
- package/lib/exercises/vea/sqrtVEA.d.ts.map +1 -0
- package/lib/exercises/vea/sqrtVEA.js +30 -0
- package/lib/geogebra/geogebraConstructor.d.ts +2 -0
- package/lib/geogebra/geogebraConstructor.d.ts.map +1 -1
- package/lib/geogebra/geogebraConstructor.js +7 -0
- package/lib/index.d.ts +28 -46
- package/lib/index.d.ts.map +1 -1
- package/lib/math/complex/complex.d.ts +1 -1
- package/lib/math/geometry/angle.d.ts +26 -0
- package/lib/math/geometry/angle.d.ts.map +1 -0
- package/lib/math/geometry/angle.js +73 -0
- package/lib/math/geometry/line.d.ts +5 -1
- package/lib/math/geometry/line.d.ts.map +1 -1
- package/lib/math/geometry/line.js +17 -0
- package/lib/math/geometry/parallelogram.d.ts +23 -0
- package/lib/math/geometry/parallelogram.d.ts.map +1 -0
- package/lib/math/geometry/parallelogram.js +70 -0
- package/lib/math/geometry/point.d.ts +3 -0
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +16 -0
- package/lib/math/geometry/quadrilateral.d.ts +15 -0
- package/lib/math/geometry/quadrilateral.d.ts.map +1 -0
- package/lib/math/geometry/quadrilateral.js +38 -0
- package/lib/math/geometry/rectangle.d.ts +24 -0
- package/lib/math/geometry/rectangle.d.ts.map +1 -0
- package/lib/math/geometry/rectangle.js +64 -0
- package/lib/math/geometry/rhombus.d.ts +19 -0
- package/lib/math/geometry/rhombus.d.ts.map +1 -0
- package/lib/math/geometry/rhombus.js +46 -0
- package/lib/math/geometry/rightTriangle.d.ts +31 -0
- package/lib/math/geometry/rightTriangle.d.ts.map +1 -0
- package/lib/math/geometry/rightTriangle.js +113 -0
- package/lib/math/geometry/segment.d.ts +24 -6
- package/lib/math/geometry/segment.d.ts.map +1 -1
- package/lib/math/geometry/segment.js +70 -4
- package/lib/math/geometry/square.d.ts +22 -0
- package/lib/math/geometry/square.d.ts.map +1 -0
- package/lib/math/geometry/square.js +43 -0
- package/lib/math/geometry/triangle.d.ts +45 -45
- package/lib/math/geometry/triangle.d.ts.map +1 -1
- package/lib/math/geometry/triangle.js +159 -186
- package/lib/math/geometry/vector.d.ts +2 -2
- package/lib/math/geometry/vector.d.ts.map +1 -1
- package/lib/math/geometry/vector.js +18 -9
- package/lib/math/numbers/rationals/rational.d.ts +1 -1
- package/lib/math/numbers/reals/extendedRingElement.d.ts +1 -1
- package/lib/math/numbers/reals/real.d.ts.map +1 -1
- package/lib/math/numbers/reals/real.js +3 -0
- package/lib/math/polynomials/generalAffine.d.ts.map +1 -1
- package/lib/math/polynomials/generalAffine.js +1 -1
- package/lib/math/polynomials/polynomial.d.ts +1 -1
- package/lib/math/polynomials/trinom.d.ts +2 -2
- package/lib/math/utils/geometry/pythagoricianTriplets.d.ts +1 -0
- package/lib/math/utils/geometry/pythagoricianTriplets.d.ts.map +1 -1
- package/lib/math/utils/geometry/pythagoricianTriplets.js +14 -1
- package/lib/math/utils/random/randfloat.d.ts +1 -1
- package/lib/math/utils/random/randfloat.d.ts.map +1 -1
- package/lib/math/utils/random/randfloat.js +8 -1
- package/lib/math/utils/random/randint.d.ts +8 -1
- package/lib/math/utils/random/randint.d.ts.map +1 -1
- package/lib/math/utils/random/randint.js +6 -1
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +1 -8
- package/lib/tree/nodes/functions/absNode.d.ts +1 -1
- package/lib/tree/nodes/functions/functionNode.d.ts +2 -2
- package/lib/tree/nodes/functions/functionNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/oppositeNode.d.ts +5 -5
- package/lib/tree/nodes/functions/oppositeNode.d.ts.map +1 -1
- package/lib/tree/nodes/node.d.ts +3 -1
- package/lib/tree/nodes/node.d.ts.map +1 -1
- package/lib/tree/nodes/node.js +1 -0
- package/lib/tree/nodes/nodeConstructor.d.ts.map +1 -1
- package/lib/tree/nodes/nodeConstructor.js +4 -0
- package/lib/tree/nodes/numbers/numberNode.d.ts +2 -0
- package/lib/tree/nodes/numbers/numberNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/numberNode.js +6 -1
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +2 -1
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +3 -3
- package/lib/tree/nodes/polynomials/trinomNode.d.ts +70 -0
- package/lib/tree/nodes/polynomials/trinomNode.d.ts.map +1 -0
- package/lib/tree/nodes/polynomials/trinomNode.js +156 -0
- package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
- package/lib/tree/nodes/variables/variableNode.js +1 -1
- package/lib/tree/parsers/affineParser.d.ts.map +1 -1
- package/lib/tree/parsers/affineParser.js +1 -0
- package/lib/tree/parsers/discreteSetParser.d.ts +3 -0
- package/lib/tree/parsers/discreteSetParser.d.ts.map +1 -0
- package/lib/tree/parsers/discreteSetParser.js +23 -0
- package/lib/tree/parsers/equationSolutionParser.d.ts +1 -1
- package/lib/tree/parsers/equationSolutionParser.d.ts.map +1 -1
- package/lib/tree/parsers/equationSolutionParser.js +15 -4
- package/lib/tree/parsers/latexParser.d.ts +5 -1
- package/lib/tree/parsers/latexParser.d.ts.map +1 -1
- package/lib/tree/parsers/latexParser.js +17 -3
- package/lib/tree/parsers/monomParser.js +2 -2
- package/lib/tree/parsers/powerParser.d.ts +1 -1
- package/lib/tree/parsers/rationalParser.d.ts +1 -1
- package/lib/tree/parsers/rationalParser.d.ts.map +1 -1
- package/lib/tree/parsers/rationalParser.js +28 -24
- package/lib/tree/parsers/sqrtParser.d.ts +9 -0
- package/lib/tree/parsers/sqrtParser.d.ts.map +1 -0
- package/lib/tree/parsers/sqrtParser.js +52 -0
- package/lib/tree/parsers/trinomParser.d.ts +1 -1
- package/lib/tree/parsers/trinomParser.d.ts.map +1 -1
- package/lib/tree/parsers/trinomParser.js +14 -2
- package/lib/tree/utilities/functionComposition.d.ts +1 -1
- package/lib/tree/utilities/functionComposition.d.ts.map +1 -1
- package/lib/utils/arrays/rotation.d.ts +8 -0
- package/lib/utils/arrays/rotation.d.ts.map +1 -0
- package/lib/utils/arrays/rotation.js +17 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"divisorsList.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/arithmetics/divisorsList.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAgDF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"divisorsList.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/arithmetics/divisorsList.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAgDF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAc9C,CAAC"}
|
|
@@ -51,10 +51,11 @@ exports.divisorsList = {
|
|
|
51
51
|
levels: ["2nde"],
|
|
52
52
|
isSingleStep: true,
|
|
53
53
|
sections: ["Arithmétique"],
|
|
54
|
-
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getDivisorsListQuestion, nb),
|
|
54
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getDivisorsListQuestion, nb, 30),
|
|
55
55
|
qcmTimer: 60,
|
|
56
56
|
freeTimer: 60,
|
|
57
57
|
getPropositions,
|
|
58
58
|
isAnswerValid,
|
|
59
59
|
subject: "Mathématiques",
|
|
60
|
+
maxAllowedQuestions: 30,
|
|
60
61
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primeNumbers.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/arithmetics/primeNumbers.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,QAAQ,EAST,MAAM,mBAAmB,CAAC;AAoD3B,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAsDF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"primeNumbers.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/arithmetics/primeNumbers.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,QAAQ,EAST,MAAM,mBAAmB,CAAC;AAoD3B,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAsDF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAc9C,CAAC"}
|
|
@@ -96,10 +96,11 @@ exports.primeNumbers = {
|
|
|
96
96
|
levels: ["5ème", "4ème", "3ème", "2nde"],
|
|
97
97
|
sections: ["Arithmétique"],
|
|
98
98
|
isSingleStep: false,
|
|
99
|
-
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getPrimeNumbers, nb),
|
|
99
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getPrimeNumbers, nb, 30),
|
|
100
100
|
qcmTimer: 60,
|
|
101
101
|
freeTimer: 60,
|
|
102
102
|
getPropositions,
|
|
103
103
|
isAnswerValid,
|
|
104
104
|
subject: "Mathématiques",
|
|
105
|
+
maxAllowedQuestions: 30,
|
|
105
106
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fractionsOperations.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EAEL,eAAe,EAChB,MAAM,kCAAkC,CAAC;AAS1C,KAAK,WAAW,GAAG;IACjB,oBAAoB,EAAE,eAAe,CAAC;CACvC,CAAC;
|
|
1
|
+
{"version":3,"file":"fractionsOperations.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EAEL,eAAe,EAChB,MAAM,kCAAkC,CAAC;AAS1C,KAAK,WAAW,GAAG;IACjB,oBAAoB,EAAE,eAAe,CAAC;CACvC,CAAC;AA8EF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAgBrD,CAAC"}
|
|
@@ -20,6 +20,7 @@ const getPropositions = (n, { answer }) => {
|
|
|
20
20
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
21
21
|
};
|
|
22
22
|
const getAnswer = (identifiers) => {
|
|
23
|
+
console.log(identifiers);
|
|
23
24
|
const statement = nodeConstructor_1.NodeConstructor.fromIdentifiers(identifiers.statementIdentifiers);
|
|
24
25
|
return statement.simplify().toTex();
|
|
25
26
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equationType1Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationType1Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"equationType1Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationType1Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAclC;;GAEG;AACH,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA4DF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAevD,CAAC"}
|
|
@@ -6,13 +6,12 @@ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQ
|
|
|
6
6
|
const equationKeys_1 = require("../../../../exercises/utils/keys/equationKeys");
|
|
7
7
|
const affine_1 = require("../../../../math/polynomials/affine");
|
|
8
8
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
9
|
-
const equationSolutionNode_1 = require("../../../../tree/nodes/equations/equationSolutionNode");
|
|
10
9
|
const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
|
|
11
10
|
const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
12
|
-
const discreteSetNode_1 = require("../../../../tree/nodes/sets/discreteSetNode");
|
|
13
11
|
const equalNode_1 = require("../../../../tree/nodes/equations/equalNode");
|
|
14
12
|
const alignTex_1 = require("../../../../utils/latex/alignTex");
|
|
15
13
|
const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
14
|
+
const equationVEA_1 = require("../../../../exercises/vea/equationVEA");
|
|
16
15
|
const getEquationType1ExerciseQuestion = () => {
|
|
17
16
|
const b = (0, randint_1.randint)(-10, 11);
|
|
18
17
|
const a = (0, randint_1.randint)(-10, 11, [0]);
|
|
@@ -55,10 +54,8 @@ const getPropositions = (n, { answer, a, b }) => {
|
|
|
55
54
|
return (0, shuffle_1.shuffle)(propositions);
|
|
56
55
|
};
|
|
57
56
|
const isAnswerValid = (ans, { a, b }) => {
|
|
58
|
-
const solution = b - a;
|
|
59
|
-
|
|
60
|
-
const validLatexs = answerTree.toAllValidTexs();
|
|
61
|
-
return validLatexs.includes(ans);
|
|
57
|
+
const solution = (b - a).toTree().toTex();
|
|
58
|
+
return (0, equationVEA_1.equationVEA)(ans, solution);
|
|
62
59
|
};
|
|
63
60
|
exports.equationType1Exercise = {
|
|
64
61
|
id: "equa1",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equationType2Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationType2Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,0BAA0B,CAAC;AAsBlC,OAAO,EAEL,eAAe,EAChB,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"equationType2Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationType2Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,0BAA0B,CAAC;AAsBlC,OAAO,EAEL,eAAe,EAChB,MAAM,kCAAkC,CAAC;AAM1C;;GAEG;AAGH,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,eAAe,CAAC;IACnB,CAAC,EAAE,eAAe,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AA2GF,KAAK,OAAO,GAAG;IACb,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAaF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAiBhE,CAAC"}
|
|
@@ -6,9 +6,7 @@ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQ
|
|
|
6
6
|
const equationKeys_1 = require("../../../../exercises/utils/keys/equationKeys");
|
|
7
7
|
const rational_1 = require("../../../../math/numbers/rationals/rational");
|
|
8
8
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
9
|
-
const equationSolutionNode_1 = require("../../../../tree/nodes/equations/equationSolutionNode");
|
|
10
9
|
const equalNode_1 = require("../../../../tree/nodes/equations/equalNode");
|
|
11
|
-
const discreteSetNode_1 = require("../../../../tree/nodes/sets/discreteSetNode");
|
|
12
10
|
const variableNode_1 = require("../../../../tree/nodes/variables/variableNode");
|
|
13
11
|
const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
14
12
|
const alignTex_1 = require("../../../../utils/latex/alignTex");
|
|
@@ -19,6 +17,7 @@ const generalAffine_1 = require("../../../../math/polynomials/generalAffine");
|
|
|
19
17
|
const nodeConstructor_1 = require("../../../../tree/nodes/nodeConstructor");
|
|
20
18
|
const substractNode_1 = require("../../../../tree/nodes/operators/substractNode");
|
|
21
19
|
const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
20
|
+
const equationVEA_1 = require("../../../../exercises/vea/equationVEA");
|
|
22
21
|
const rebuildIdentifiers = (oldIdentifiers) => {
|
|
23
22
|
if (!!oldIdentifiers.numberType)
|
|
24
23
|
return oldIdentifiers;
|
|
@@ -90,12 +89,8 @@ const getPropositions = (n, { answer, a, b }) => {
|
|
|
90
89
|
const isAnswerValid = (ans, { a, b }) => {
|
|
91
90
|
const aNode = nodeConstructor_1.NodeConstructor.fromIdentifiers(a);
|
|
92
91
|
const bNode = nodeConstructor_1.NodeConstructor.fromIdentifiers(b);
|
|
93
|
-
const solution = (0, fractionNode_1.frac)(bNode, aNode).simplify();
|
|
94
|
-
|
|
95
|
-
opts: { allowFractionToDecimal: true, allowRawRightChildAsSolution: true },
|
|
96
|
-
});
|
|
97
|
-
const validLatexs = answerTree.toAllValidTexs();
|
|
98
|
-
return validLatexs.includes(ans);
|
|
92
|
+
const solution = (0, fractionNode_1.frac)(bNode, aNode).simplify().toTex();
|
|
93
|
+
return (0, equationVEA_1.equationVEA)(ans, solution);
|
|
99
94
|
};
|
|
100
95
|
const options = [
|
|
101
96
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equationType3Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationType3Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"equationType3Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationType3Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAsBlC;;GAEG;AACH,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAiEF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAgBvD,CAAC"}
|
|
@@ -7,14 +7,14 @@ const equationKeys_1 = require("../../../../exercises/utils/keys/equationKeys");
|
|
|
7
7
|
const rational_1 = require("../../../../math/numbers/rationals/rational");
|
|
8
8
|
const affine_1 = require("../../../../math/polynomials/affine");
|
|
9
9
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
10
|
-
const equationSolutionNode_1 = require("../../../../tree/nodes/equations/equationSolutionNode");
|
|
11
10
|
const equalNode_1 = require("../../../../tree/nodes/equations/equalNode");
|
|
12
|
-
const discreteSetNode_1 = require("../../../../tree/nodes/sets/discreteSetNode");
|
|
13
11
|
const variableNode_1 = require("../../../../tree/nodes/variables/variableNode");
|
|
14
12
|
const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
15
13
|
const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
|
|
16
14
|
const alignTex_1 = require("../../../../utils/latex/alignTex");
|
|
17
15
|
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
16
|
+
const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
|
|
17
|
+
const equationVEA_1 = require("../../../../exercises/vea/equationVEA");
|
|
18
18
|
const getEquationType3ExerciseQuestion = () => {
|
|
19
19
|
const b = (0, randint_1.randint)(-10, 11, [0]);
|
|
20
20
|
const a = (0, randint_1.randint)(-10, 11, [0, 1]);
|
|
@@ -57,13 +57,11 @@ const getPropositions = (n, { answer, a, b, c }) => {
|
|
|
57
57
|
}
|
|
58
58
|
return (0, shuffle_1.shuffle)(propositions);
|
|
59
59
|
};
|
|
60
|
-
const isAnswerValid = (ans, { a, b, c }) => {
|
|
61
|
-
const solution =
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
const validLatexs = answerTree.toAllValidTexs();
|
|
66
|
-
return validLatexs.includes(ans);
|
|
60
|
+
const isAnswerValid = (ans, { answer, a, b, c }) => {
|
|
61
|
+
const solution = (0, fractionNode_1.frac)(c - b, a)
|
|
62
|
+
.simplify()
|
|
63
|
+
.toTex();
|
|
64
|
+
return (0, equationVEA_1.equationVEA)(ans, solution);
|
|
67
65
|
};
|
|
68
66
|
exports.equationType3Exercise = {
|
|
69
67
|
id: "equa3",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equationType4Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationType4Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"equationType4Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationType4Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAkBlC;;GAEG;AAEH,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;AA0EF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAcvD,CAAC"}
|
|
@@ -7,11 +7,11 @@ const equationKeys_1 = require("../../../../exercises/utils/keys/equationKeys");
|
|
|
7
7
|
const rational_1 = require("../../../../math/numbers/rationals/rational");
|
|
8
8
|
const affine_1 = require("../../../../math/polynomials/affine");
|
|
9
9
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
10
|
-
const equationSolutionNode_1 = require("../../../../tree/nodes/equations/equationSolutionNode");
|
|
11
10
|
const equalNode_1 = require("../../../../tree/nodes/equations/equalNode");
|
|
12
|
-
const discreteSetNode_1 = require("../../../../tree/nodes/sets/discreteSetNode");
|
|
13
11
|
const variableNode_1 = require("../../../../tree/nodes/variables/variableNode");
|
|
14
12
|
const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
13
|
+
const equationVEA_1 = require("../../../../exercises/vea/equationVEA");
|
|
14
|
+
const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
|
|
15
15
|
const getEquationType4ExerciseQuestion = () => {
|
|
16
16
|
const a = (0, randint_1.randint)(-10, 11, [0, 1]);
|
|
17
17
|
const b = (0, randint_1.randint)(-10, 11, [0]);
|
|
@@ -62,23 +62,10 @@ const getPropositions = (n, { answer, a, b, c, d }) => {
|
|
|
62
62
|
return (0, shuffle_1.shuffle)(propositions);
|
|
63
63
|
};
|
|
64
64
|
const isAnswerValid = (ans, { a, b, c, d }) => {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
// const solutionTex = solution.toTex();
|
|
70
|
-
// const decimal = round(solution.evaluate({}), 12).frenchify();
|
|
71
|
-
// const parsedSolution = parsed.simplify().toTex();
|
|
72
|
-
// return solutionTex === parsedSolution || decimal === parsedSolution;
|
|
73
|
-
// } catch (err) {
|
|
74
|
-
// return false;
|
|
75
|
-
// }
|
|
76
|
-
const solution = new rational_1.Rational(d - b, a - c).simplify().toTree();
|
|
77
|
-
const answerTree = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode([solution]), {
|
|
78
|
-
opts: { allowFractionToDecimal: true, allowRawRightChildAsSolution: true },
|
|
79
|
-
});
|
|
80
|
-
const validLatexs = answerTree.toAllValidTexs();
|
|
81
|
-
return validLatexs.includes(ans);
|
|
65
|
+
const solution = (0, fractionNode_1.frac)(d - b, a - c)
|
|
66
|
+
.simplify()
|
|
67
|
+
.toTex();
|
|
68
|
+
return (0, equationVEA_1.equationVEA)(ans, solution);
|
|
82
69
|
};
|
|
83
70
|
exports.equationType4Exercise = {
|
|
84
71
|
id: "equa4",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factoByX.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoByX.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAiBlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAqJF,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAiB1C,CAAC"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.factoByX = void 0;
|
|
4
|
+
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const affine_1 = require("../../../../math/polynomials/affine");
|
|
7
|
+
const gcd_1 = require("../../../../math/utils/arithmetic/gcd");
|
|
8
|
+
const randint_1 = require("../../../../math/utils/random/randint");
|
|
9
|
+
const oppositeNode_1 = require("../../../../tree/nodes/functions/oppositeNode");
|
|
10
|
+
const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
11
|
+
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
12
|
+
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
13
|
+
const latexParser_1 = require("../../../../tree/parsers/latexParser");
|
|
14
|
+
const alignTex_1 = require("../../../../utils/latex/alignTex");
|
|
15
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
16
|
+
const propositions = [];
|
|
17
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
18
|
+
const { a, b } = identifiers;
|
|
19
|
+
let pgcd = (0, gcd_1.gcd)(a, b);
|
|
20
|
+
if (a < 0 && b < 0)
|
|
21
|
+
pgcd = -pgcd;
|
|
22
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, multiplyNode_1.multiply)("x", (0, addNode_1.add)(a, b)).toTex());
|
|
23
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, multiplyNode_1.multiply)("x", (0, addNode_1.add)((0, multiplyNode_1.multiply)(a / pgcd, "x").simplify(), b / pgcd)).toTex());
|
|
24
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, multiplyNode_1.multiply)((0, multiplyNode_1.multiply)(pgcd, "x").simplify(), (0, addNode_1.add)((0, multiplyNode_1.multiply)(a, "x").simplify(), b / pgcd)).toTex());
|
|
25
|
+
while (propositions.length < n) {
|
|
26
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, multiplyNode_1.multiply)("x", affine_1.AffineConstructor.random().toTree()).toTex());
|
|
27
|
+
}
|
|
28
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
29
|
+
};
|
|
30
|
+
const getAnswer = (identifiers) => {
|
|
31
|
+
const { a, b } = identifiers;
|
|
32
|
+
let pgcd = (0, gcd_1.gcd)(a, b);
|
|
33
|
+
if (a < 0 && b < 0)
|
|
34
|
+
pgcd = -pgcd;
|
|
35
|
+
const affine = (0, addNode_1.add)((0, multiplyNode_1.multiply)(a / pgcd, "x"), b / pgcd);
|
|
36
|
+
return (0, multiplyNode_1.multiply)((0, multiplyNode_1.multiply)(pgcd, "x"), affine).toTex();
|
|
37
|
+
};
|
|
38
|
+
const getStatementNode = (identifiers) => {
|
|
39
|
+
return (0, addNode_1.add)((0, multiplyNode_1.multiply)(identifiers.a, (0, powerNode_1.square)("x")), (0, multiplyNode_1.multiply)(identifiers.b, "x").simplify());
|
|
40
|
+
};
|
|
41
|
+
const getInstruction = (identifiers) => {
|
|
42
|
+
const statement = getStatementNode(identifiers);
|
|
43
|
+
return `Factoriser :
|
|
44
|
+
|
|
45
|
+
$$
|
|
46
|
+
${statement.toTex()}
|
|
47
|
+
$$`;
|
|
48
|
+
};
|
|
49
|
+
const getHint = (identifiers) => {
|
|
50
|
+
const { a, b } = identifiers;
|
|
51
|
+
const aMonom = (0, multiplyNode_1.multiply)(a, (0, powerNode_1.square)("x")).toTex();
|
|
52
|
+
const bMonom = (0, multiplyNode_1.multiply)(b, "x").toTex();
|
|
53
|
+
return `Repère le facteur commun : c'est le terme qui apparaît à la fois dans $${aMonom}$ et dans $${bMonom}$.`;
|
|
54
|
+
};
|
|
55
|
+
const getCorrection = (identifiers) => {
|
|
56
|
+
const { a, b } = identifiers;
|
|
57
|
+
const answer = getAnswer(identifiers);
|
|
58
|
+
const aMonom = (0, multiplyNode_1.multiply)(a, (0, powerNode_1.square)("x"));
|
|
59
|
+
const bMonom = (0, multiplyNode_1.multiply)(b, "x");
|
|
60
|
+
const statement = (0, addNode_1.add)(aMonom, bMonom).toTex();
|
|
61
|
+
let pgcd = (0, gcd_1.gcd)(a, b);
|
|
62
|
+
if (a < 0 && b < 0)
|
|
63
|
+
pgcd = -pgcd;
|
|
64
|
+
// ne renvoit pas des négatifs : devrait ?
|
|
65
|
+
const xMonom = (0, multiplyNode_1.multiply)(pgcd, "x");
|
|
66
|
+
let common = pgcd === -1 ? (0, oppositeNode_1.opposite)("x") : "x".toTree();
|
|
67
|
+
let hasCommon = false;
|
|
68
|
+
if (Math.abs(a) === Math.abs(b)) {
|
|
69
|
+
hasCommon = true;
|
|
70
|
+
if (a === b)
|
|
71
|
+
common = (0, multiplyNode_1.multiply)(a, common);
|
|
72
|
+
else
|
|
73
|
+
common = (0, multiplyNode_1.multiply)(Math.abs(a), common);
|
|
74
|
+
}
|
|
75
|
+
const detailed = (0, addNode_1.add)((0, multiplyNode_1.multiply)(xMonom, (0, multiplyNode_1.multiply)(a / pgcd, "x").simplify(), {
|
|
76
|
+
toTexOptions: { forceTimesSign: true, noPropagation: true },
|
|
77
|
+
}), (0, multiplyNode_1.multiply)(xMonom, b / pgcd)).toTex();
|
|
78
|
+
return `Le terme $${common.toTex()}$ apparaît à la fois dans $${aMonom.toTex()}$ et dans $${bMonom.toTex()}$.
|
|
79
|
+
|
|
80
|
+
${!hasCommon && pgcd !== 1 && pgcd !== -1
|
|
81
|
+
? `D'autre part, on peut factoriser $${a}$ et $${b}$ par $${pgcd}$. En effet,
|
|
82
|
+
|
|
83
|
+
$${a} = ${a / pgcd}\\times ${pgcd}$ et $${b} = ${b / pgcd}\\times ${pgcd}$.`
|
|
84
|
+
: ""}
|
|
85
|
+
|
|
86
|
+
On peut donc factoriser l'expression par $${xMonom.toTex()}$ :
|
|
87
|
+
|
|
88
|
+
${(0, alignTex_1.alignTex)([
|
|
89
|
+
["", "", statement],
|
|
90
|
+
["", "=", detailed],
|
|
91
|
+
["", "=", answer],
|
|
92
|
+
])}
|
|
93
|
+
`;
|
|
94
|
+
};
|
|
95
|
+
const getKeys = (identifiers) => {
|
|
96
|
+
return ["x"];
|
|
97
|
+
};
|
|
98
|
+
const isAnswerValid = (ans, { answer, ...identifiers }) => {
|
|
99
|
+
try {
|
|
100
|
+
const statement = getStatementNode(identifiers);
|
|
101
|
+
const parsed = (0, latexParser_1.parseAlgebraic)(ans);
|
|
102
|
+
if (!parsed || !(0, multiplyNode_1.isMultiplyNode)(parsed))
|
|
103
|
+
return false;
|
|
104
|
+
return (parsed
|
|
105
|
+
.simplify({ forbidFactorize: true, towardsDistribute: true })
|
|
106
|
+
.toTex() === statement.toTex());
|
|
107
|
+
}
|
|
108
|
+
catch (err) {
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
const getFactoByXQuestion = (ops) => {
|
|
113
|
+
const a = (0, randint_1.randint)(-10, 10, [0], { favor: { value: 1, proba: 0.3 } });
|
|
114
|
+
const b = (0, randint_1.randint)(-10, 10, [0], a !== 1 ? { favor: { value: 1, proba: 0.3 } } : undefined);
|
|
115
|
+
const identifiers = {
|
|
116
|
+
a,
|
|
117
|
+
b,
|
|
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.factoByX = {
|
|
131
|
+
id: "factoByX",
|
|
132
|
+
connector: "=",
|
|
133
|
+
label: "Factorisation du type $ax^2 + bx$",
|
|
134
|
+
isSingleStep: false,
|
|
135
|
+
generator: (nb, opts) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getFactoByXQuestion(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
|
+
hasHintAndCorrection: true,
|
|
146
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
|
|
@@ -21,3 +21,4 @@ __exportStar(require("./factoType1Exercise"), exports);
|
|
|
21
21
|
__exportStar(require("./factorizeCanonicalForm"), exports);
|
|
22
22
|
__exportStar(require("./factorizeCanonicalFormWithSqrt"), exports);
|
|
23
23
|
__exportStar(require("./factoType2"), exports);
|
|
24
|
+
__exportStar(require("./factoByX"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"absolueValueAffineEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/absolute/absolueValueAffineEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EAGL,wBAAwB,EACzB,MAAM,sCAAsC,CAAC;AAM9C,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,wBAAwB,CAAC;IACtC,YAAY,EAAE,wBAAwB,CAAC;CACxC,CAAC;
|
|
1
|
+
{"version":3,"file":"absolueValueAffineEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/absolute/absolueValueAffineEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EAGL,wBAAwB,EACzB,MAAM,sCAAsC,CAAC;AAM9C,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,wBAAwB,CAAC;IACtC,YAAY,EAAE,wBAAwB,CAAC;CACxC,CAAC;AAyKF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAiB5D,CAAC"}
|
|
@@ -111,14 +111,11 @@ const getKeys = (identifiers) => {
|
|
|
111
111
|
};
|
|
112
112
|
const isAnswerValid = (ans, { answer, ...identifiers }) => {
|
|
113
113
|
const parsedOu = ans.split("\\text{ ou }");
|
|
114
|
-
console.log(parsedOu);
|
|
115
114
|
try {
|
|
116
115
|
const nodes = [];
|
|
117
116
|
parsedOu.forEach((item) => {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
.replaceAll("}", "")
|
|
121
|
-
.replaceAll(" ", "");
|
|
117
|
+
//un eleve qui efface le ou peut se retrouver avec un texte vide
|
|
118
|
+
let formated = item.replaceAll("\\text{ }", "");
|
|
122
119
|
const equalForm = formated.split("=");
|
|
123
120
|
if (equalForm.length > 1 && equalForm[0] !== "x")
|
|
124
121
|
throw Error("wrong answer");
|
|
@@ -4,7 +4,7 @@ exports.coefficientsIdentification = void 0;
|
|
|
4
4
|
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
6
|
const rational_1 = require("../../../../math/numbers/rationals/rational");
|
|
7
|
-
const
|
|
7
|
+
const trinomNode_1 = require("../../../../tree/nodes/polynomials/trinomNode");
|
|
8
8
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
9
9
|
const nodeConstructor_1 = require("../../../../tree/nodes/nodeConstructor");
|
|
10
10
|
const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
|
|
@@ -15,7 +15,7 @@ const random_1 = require("../../../../utils/alea/random");
|
|
|
15
15
|
const getPropositions = (n, { answer, aIdentifiers, bIdentifiers, cIdentifiers, isAsking }) => {
|
|
16
16
|
const propositions = [];
|
|
17
17
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
18
|
-
const trinom = new
|
|
18
|
+
const trinom = new trinomNode_1.TrinomNode(nodeConstructor_1.NodeConstructor.fromIdentifiers(aIdentifiers), nodeConstructor_1.NodeConstructor.fromIdentifiers(bIdentifiers), nodeConstructor_1.NodeConstructor.fromIdentifiers(cIdentifiers));
|
|
19
19
|
if (answer === "1") {
|
|
20
20
|
(0, exercise_1.tryToAddWrongProp)(propositions, "0");
|
|
21
21
|
}
|
|
@@ -50,7 +50,7 @@ const getAnswer = (identifiers) => {
|
|
|
50
50
|
: nodeConstructor_1.NodeConstructor.fromIdentifiers(cIdentifiers).toTex();
|
|
51
51
|
};
|
|
52
52
|
const getInstruction = (identifiers) => {
|
|
53
|
-
const trinom = new
|
|
53
|
+
const trinom = new trinomNode_1.TrinomNode(nodeConstructor_1.NodeConstructor.fromIdentifiers(identifiers.aIdentifiers), nodeConstructor_1.NodeConstructor.fromIdentifiers(identifiers.bIdentifiers), nodeConstructor_1.NodeConstructor.fromIdentifiers(identifiers.cIdentifiers));
|
|
54
54
|
return `Soit $f$ la fonction polynôme de degré $2$ définie sur $\\mathbb{R}$ par :
|
|
55
55
|
|
|
56
56
|
$$
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
-
import {
|
|
2
|
+
import { TrinomNodeIdentifiers } from "../../../../tree/nodes/polynomials/trinomNode";
|
|
3
3
|
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor";
|
|
4
4
|
type Identifiers = {
|
|
5
|
-
trinomIdentifiers:
|
|
5
|
+
trinomIdentifiers: TrinomNodeIdentifiers;
|
|
6
6
|
firstRootIdentifiers: NodeIdentifiers;
|
|
7
7
|
};
|
|
8
8
|
export declare const findSecondRoot: Exercise<Identifiers>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findSecondRoot.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/findSecondRoot.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EAGL,
|
|
1
|
+
{"version":3,"file":"findSecondRoot.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/findSecondRoot.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EAGL,qBAAqB,EACtB,MAAM,yCAAyC,CAAC;AAIjD,OAAO,EAEL,eAAe,EAChB,MAAM,kCAAkC,CAAC;AAO1C,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,qBAAqB,CAAC;IACzC,oBAAoB,EAAE,eAAe,CAAC;CACvC,CAAC;AAiHF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAiBhD,CAAC"}
|
|
@@ -4,7 +4,7 @@ exports.findSecondRoot = void 0;
|
|
|
4
4
|
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
6
|
const rationalVEA_1 = require("../../../../exercises/vea/rationalVEA");
|
|
7
|
-
const
|
|
7
|
+
const trinomNode_1 = require("../../../../tree/nodes/polynomials/trinomNode");
|
|
8
8
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
9
9
|
const oppositeNode_1 = require("../../../../tree/nodes/functions/oppositeNode");
|
|
10
10
|
const nodeConstructor_1 = require("../../../../tree/nodes/nodeConstructor");
|
|
@@ -21,7 +21,7 @@ const getPropositions = (n, { answer }) => {
|
|
|
21
21
|
};
|
|
22
22
|
const getAnswer = (identifiers) => {
|
|
23
23
|
const { trinomIdentifiers, firstRootIdentifiers } = identifiers;
|
|
24
|
-
const trinom =
|
|
24
|
+
const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
|
|
25
25
|
const firstRoot = nodeConstructor_1.NodeConstructor.fromIdentifiers(firstRootIdentifiers);
|
|
26
26
|
const firstRootTex = firstRoot.toTex();
|
|
27
27
|
const roots = trinom.getRoots().map((e) => e.toTex());
|
|
@@ -29,7 +29,7 @@ const getAnswer = (identifiers) => {
|
|
|
29
29
|
};
|
|
30
30
|
const getInstruction = (identifiers) => {
|
|
31
31
|
const { trinomIdentifiers, firstRootIdentifiers } = identifiers;
|
|
32
|
-
const trinom =
|
|
32
|
+
const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
|
|
33
33
|
const firstRoot = nodeConstructor_1.NodeConstructor.fromIdentifiers(firstRootIdentifiers);
|
|
34
34
|
const firstRootTex = firstRoot.toTex();
|
|
35
35
|
return `Soit $f$ la fonction polynôme du second degré définie sur $\\mathbb{R}$ par :
|
|
@@ -54,7 +54,7 @@ En remplaçant les valeurs par celles données dans l'énoncé, on peut détermi
|
|
|
54
54
|
};
|
|
55
55
|
const getCorrection = (identifiers) => {
|
|
56
56
|
const { trinomIdentifiers, firstRootIdentifiers } = identifiers;
|
|
57
|
-
const trinom =
|
|
57
|
+
const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
|
|
58
58
|
const firstRoot = nodeConstructor_1.NodeConstructor.fromIdentifiers(firstRootIdentifiers);
|
|
59
59
|
const cOverA = (0, fractionNode_1.frac)(trinom.c, trinom.a).simplify();
|
|
60
60
|
return `On sait que le produit des racines $x_1$ et $x_2$ de $f$ vaut :
|
|
@@ -95,7 +95,7 @@ const getFindSecondRootQuestion = (ops) => {
|
|
|
95
95
|
//first*second = c/a
|
|
96
96
|
const identifiers = {
|
|
97
97
|
firstRootIdentifiers: firstRoot.toTree().toIdentifiers(),
|
|
98
|
-
trinomIdentifiers: new
|
|
98
|
+
trinomIdentifiers: new trinomNode_1.TrinomNode(a, b, c).toIdentifiers(),
|
|
99
99
|
};
|
|
100
100
|
const question = {
|
|
101
101
|
answer: getAnswer(identifiers),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
-
import {
|
|
2
|
+
import { TrinomNodeIdentifiers } from "../../../../tree/nodes/polynomials/trinomNode";
|
|
3
3
|
type Identifiers = {
|
|
4
|
-
trinomIdentifiers:
|
|
4
|
+
trinomIdentifiers: TrinomNodeIdentifiers;
|
|
5
5
|
};
|
|
6
6
|
export declare const rootsProduct: Exercise<Identifiers>;
|
|
7
7
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rootsProduct.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/rootsProduct.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAGL,
|
|
1
|
+
{"version":3,"file":"rootsProduct.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/rootsProduct.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAGL,qBAAqB,EACtB,MAAM,yCAAyC,CAAC;AAOjD,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,qBAAqB,CAAC;CAC1C,CAAC;AA0GF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAiB9C,CAAC"}
|
|
@@ -4,7 +4,7 @@ exports.rootsProduct = void 0;
|
|
|
4
4
|
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
6
|
const rationalVEA_1 = require("../../../../exercises/vea/rationalVEA");
|
|
7
|
-
const
|
|
7
|
+
const trinomNode_1 = require("../../../../tree/nodes/polynomials/trinomNode");
|
|
8
8
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
9
9
|
const oppositeNode_1 = require("../../../../tree/nodes/functions/oppositeNode");
|
|
10
10
|
const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
|
|
@@ -12,7 +12,7 @@ const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
|
12
12
|
const getPropositions = (n, { answer, trinomIdentifiers }) => {
|
|
13
13
|
const propositions = [];
|
|
14
14
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
15
|
-
const trinom =
|
|
15
|
+
const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
|
|
16
16
|
(0, exercise_1.tryToAddWrongProp)(propositions, (0, fractionNode_1.frac)((0, oppositeNode_1.opposite)(trinom.b), trinom.a).simplify().toTex());
|
|
17
17
|
(0, exercise_1.tryToAddWrongProp)(propositions, (0, fractionNode_1.frac)((0, oppositeNode_1.opposite)(trinom.c), trinom.a).simplify().toTex());
|
|
18
18
|
(0, exercise_1.tryToAddWrongProp)(propositions, (0, fractionNode_1.frac)((0, oppositeNode_1.opposite)(trinom.b), (0, multiplyNode_1.multiply)(2, trinom.a)).simplify().toTex());
|
|
@@ -23,13 +23,13 @@ const getPropositions = (n, { answer, trinomIdentifiers }) => {
|
|
|
23
23
|
};
|
|
24
24
|
const getAnswer = (identifiers) => {
|
|
25
25
|
const { trinomIdentifiers } = identifiers;
|
|
26
|
-
const trinom =
|
|
26
|
+
const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
|
|
27
27
|
const ans = (0, fractionNode_1.frac)(trinom.c, trinom.a).simplify().toTex();
|
|
28
28
|
return ans;
|
|
29
29
|
};
|
|
30
30
|
const getInstruction = (identifiers) => {
|
|
31
31
|
const { trinomIdentifiers } = identifiers;
|
|
32
|
-
const trinom =
|
|
32
|
+
const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
|
|
33
33
|
return `Soit $f$ la fonction définie sur $\\mathbb{R}$ par :
|
|
34
34
|
|
|
35
35
|
$$
|
|
@@ -49,7 +49,7 @@ $$`;
|
|
|
49
49
|
};
|
|
50
50
|
const getCorrection = (identifiers) => {
|
|
51
51
|
const { trinomIdentifiers } = identifiers;
|
|
52
|
-
const trinom =
|
|
52
|
+
const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
|
|
53
53
|
const aTex = trinom.a.toTex();
|
|
54
54
|
const cTex = trinom.c.toTex();
|
|
55
55
|
const ans = (0, fractionNode_1.frac)(trinom.c, trinom.a);
|
|
@@ -78,7 +78,7 @@ const getRootsProductQuestion = (ops) => {
|
|
|
78
78
|
const a = (0, randint_1.randint)(-10, 10, [0]);
|
|
79
79
|
const b = (0, randint_1.randint)(-10, 10);
|
|
80
80
|
const c = (a / Math.abs(a)) * (0, randint_1.randint)(-10, 0, !b ? [0] : []);
|
|
81
|
-
const trinom = new
|
|
81
|
+
const trinom = new trinomNode_1.TrinomNode(a, b, c);
|
|
82
82
|
const identifiers = {
|
|
83
83
|
trinomIdentifiers: trinom.toIdentifiers(),
|
|
84
84
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
-
import {
|
|
2
|
+
import { TrinomNodeIdentifiers } from "../../../../tree/nodes/polynomials/trinomNode";
|
|
3
3
|
type Identifiers = {
|
|
4
|
-
trinomIdentifiers:
|
|
4
|
+
trinomIdentifiers: TrinomNodeIdentifiers;
|
|
5
5
|
};
|
|
6
6
|
export declare const rootsSum: Exercise<Identifiers>;
|
|
7
7
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rootsSum.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/rootsSum.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAGL,
|
|
1
|
+
{"version":3,"file":"rootsSum.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/rootsSum.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAGL,qBAAqB,EACtB,MAAM,yCAAyC,CAAC;AAOjD,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,qBAAqB,CAAC;CAC1C,CAAC;AAoGF,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAiB1C,CAAC"}
|