math-exercises 2.0.27 → 2.0.30
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/calculLitteral/distributivity/doubleDistributivity.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/distributivity/doubleDistributivity.js +6 -6
- package/lib/exercises/calculLitteral/distributivity/firstIdentity.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/distributivity/firstIdentity.js +10 -6
- package/lib/exercises/calculLitteral/distributivity/secondIdentity.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/distributivity/secondIdentity.js +14 -7
- package/lib/exercises/calculLitteral/distributivity/simpleDistributivity.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/distributivity/simpleDistributivity.js +11 -11
- package/lib/exercises/calculLitteral/distributivity/thirdIdentity.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/distributivity/thirdIdentity.js +4 -6
- package/lib/exercises/calculLitteral/equation/equationType2Exercise.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/equationType2Exercise.js +3 -5
- package/lib/exercises/calculLitteral/equation/equationType3Exercise.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/equationType3Exercise.js +0 -5
- package/lib/exercises/calculLitteral/equation/equationType4Exercise.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/equationType4Exercise.js +10 -16
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq1.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq1.js +3 -5
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq2.js +4 -6
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq3.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq3.js +4 -6
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType0.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType0.js +0 -2
- package/lib/exercises/complex/argumentFromAlgebraicComplex.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/thirdDegreeFunctionVariation.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/thirdDegreeFunctionVariation.js +33 -18
- package/lib/exercises/derivation/derivativeNumberReading.d.ts.map +1 -1
- package/lib/exercises/derivation/derivativeNumberReading.js +16 -3
- package/lib/exercises/exercise.d.ts +1 -1
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/functions/absolute/absoluteValueInequations.d.ts.map +1 -1
- package/lib/exercises/functions/absolute/absoluteValueInequations.js +8 -5
- package/lib/exercises/functions/affines/affineExpressionReading.d.ts.map +1 -1
- package/lib/exercises/functions/affines/affineExpressionReading.js +5 -1
- package/lib/exercises/functions/affines/interceptReading.d.ts.map +1 -1
- package/lib/exercises/functions/affines/interceptReading.js +6 -2
- package/lib/exercises/functions/affines/leadingCoefficient.d.ts.map +1 -1
- package/lib/exercises/functions/affines/leadingCoefficient.js +5 -1
- package/lib/exercises/functions/basics/graphicEquation.d.ts.map +1 -1
- package/lib/exercises/functions/basics/graphicEquation.js +2 -0
- package/lib/exercises/functions/basics/graphicInequation.d.ts.map +1 -1
- package/lib/exercises/functions/basics/graphicInequation.js +2 -0
- package/lib/exercises/functions/basics/imageFunctionGeogebra.d.ts.map +1 -1
- package/lib/exercises/functions/basics/imageFunctionGeogebra.js +6 -2
- package/lib/exercises/functions/basics/inverseImageFunctionGeogebra.d.ts.map +1 -1
- package/lib/exercises/functions/basics/inverseImageFunctionGeogebra.js +4 -2
- package/lib/exercises/functions/exponential/expSimplifiying.d.ts.map +1 -1
- package/lib/exercises/functions/trinoms/canonicalFromDevForm.d.ts.map +1 -1
- package/lib/exercises/functions/trinoms/canonicalFromDevForm.js +1 -3
- package/lib/exercises/functions/trinoms/secondDegreeInequation.d.ts.map +1 -1
- package/lib/exercises/functions/trinoms/secondDegreeInequation.js +0 -3
- package/lib/exercises/geometry/vectors/coordinatesReading.d.ts.map +1 -1
- package/lib/exercises/geometry/vectors/coordinatesReading.js +2 -0
- package/lib/exercises/index.d.ts +1 -0
- package/lib/exercises/index.d.ts.map +1 -1
- package/lib/exercises/index.js +1 -0
- package/lib/exercises/limits/limitReading.d.ts.map +1 -1
- package/lib/exercises/limits/limitReading.js +9 -1
- package/lib/exercises/limits/rationalFracForbiddenValueLimit.d.ts.map +1 -1
- package/lib/exercises/limits/rationalFracForbiddenValueLimit.js +1 -6
- package/lib/exercises/matrices/index.d.ts +2 -0
- package/lib/exercises/matrices/index.d.ts.map +1 -0
- package/lib/exercises/matrices/index.js +17 -0
- package/lib/exercises/matrices/matrixInversibilityDomain.d.ts +10 -0
- package/lib/exercises/matrices/matrixInversibilityDomain.d.ts.map +1 -0
- package/lib/exercises/matrices/matrixInversibilityDomain.js +93 -0
- package/lib/exercises/sets/intervals/inequalityToInterval.d.ts +4 -1
- package/lib/exercises/sets/intervals/inequalityToInterval.d.ts.map +1 -1
- package/lib/exercises/sets/intervals/inequalityToInterval.js +10 -7
- package/lib/exercises/sets/intervals/intervalsIntersection.d.ts +7 -2
- package/lib/exercises/sets/intervals/intervalsIntersection.d.ts.map +1 -1
- package/lib/exercises/sets/intervals/intervalsIntersection.js +11 -4
- package/lib/exercises/sets/intervals/intervalsUnion.d.ts +7 -2
- package/lib/exercises/sets/intervals/intervalsUnion.d.ts.map +1 -1
- package/lib/exercises/sets/intervals/intervalsUnion.js +11 -4
- package/lib/exercises/utils/keys/intervalKeys.d.ts +3 -0
- package/lib/exercises/utils/keys/intervalKeys.d.ts.map +1 -0
- package/lib/exercises/utils/keys/intervalKeys.js +10 -0
- package/lib/geogebra/colors.d.ts +25 -0
- package/lib/geogebra/colors.d.ts.map +1 -0
- package/lib/geogebra/colors.js +31 -0
- package/lib/geogebra/geogebraConstructor.js +4 -4
- package/lib/index.d.ts +124 -8
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +11 -0
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/matrices/matrix.d.ts +10 -0
- package/lib/math/matrices/matrix.d.ts.map +1 -0
- package/lib/math/matrices/matrix.js +24 -0
- package/lib/math/numbers/decimals/decimal.d.ts +1 -0
- package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
- package/lib/math/numbers/decimals/decimal.js +3 -0
- package/lib/math/numbers/integer/integer.d.ts +1 -0
- package/lib/math/numbers/integer/integer.d.ts.map +1 -1
- package/lib/math/numbers/integer/integer.js +3 -0
- package/lib/math/numbers/integer/power.d.ts +1 -0
- package/lib/math/numbers/integer/power.d.ts.map +1 -1
- package/lib/math/numbers/integer/power.js +3 -0
- package/lib/math/numbers/logarithms/ln.d.ts +1 -0
- package/lib/math/numbers/logarithms/ln.d.ts.map +1 -1
- package/lib/math/numbers/logarithms/ln.js +3 -0
- package/lib/math/numbers/nombre.d.ts +5 -2
- package/lib/math/numbers/nombre.d.ts.map +1 -1
- package/lib/math/numbers/nombre.js +22 -7
- package/lib/math/numbers/rationals/rational.d.ts +1 -0
- package/lib/math/numbers/rationals/rational.d.ts.map +1 -1
- package/lib/math/numbers/rationals/rational.js +4 -3
- package/lib/math/numbers/reals/real.d.ts +1 -0
- package/lib/math/numbers/reals/real.d.ts.map +1 -1
- package/lib/math/numbers/reals/real.js +3 -0
- package/lib/math/polynomials/affine.d.ts +20 -5
- package/lib/math/polynomials/affine.d.ts.map +1 -1
- package/lib/math/polynomials/affine.js +8 -12
- package/lib/math/polynomials/trinom.d.ts +40 -4
- package/lib/math/polynomials/trinom.d.ts.map +1 -1
- package/lib/math/polynomials/trinom.js +23 -28
- package/lib/math/sets/intervals/intervals.d.ts +9 -12
- package/lib/math/sets/intervals/intervals.d.ts.map +1 -1
- package/lib/math/sets/intervals/intervals.js +61 -135
- package/lib/math/utils/random/randint.d.ts.map +1 -1
- package/lib/math/utils/random/randint.js +2 -2
- package/lib/server.d.ts +6 -0
- package/lib/server.d.ts.map +1 -1
- package/lib/server.js +10 -0
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +40 -0
- package/lib/tree/nodes/sets/intervalNode.d.ts +1 -0
- package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/intervalNode.js +14 -2
- package/lib/tree/nodes/sets/majorSets.d.ts +1 -0
- package/lib/tree/nodes/sets/majorSets.d.ts.map +1 -0
- package/lib/tree/nodes/sets/majorSets.js +1 -0
- package/lib/tree/nodes/sets/unionIntervalNode.d.ts +4 -0
- package/lib/tree/nodes/sets/unionIntervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/unionIntervalNode.js +13 -2
- package/lib/types/numberType.d.ts +1 -0
- package/lib/types/numberType.d.ts.map +1 -0
- package/lib/types/numberType.js +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doubleDistributivity.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/distributivity/doubleDistributivity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;
|
|
1
|
+
{"version":3,"file":"doubleDistributivity.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/distributivity/doubleDistributivity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AA6EF,eAAO,MAAM,oBAAoB,EAAE,YAAY,CAAC,WAAW,CAa1D,CAAC"}
|
|
@@ -3,16 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.doubleDistributivity = void 0;
|
|
4
4
|
const exercise_1 = require("../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
-
const integer_1 = require("../../../math/numbers/integer/integer");
|
|
7
6
|
const affine_1 = require("../../../math/polynomials/affine");
|
|
8
|
-
const discreteSet_1 = require("../../../math/sets/discreteSet");
|
|
9
|
-
const intervals_1 = require("../../../math/sets/intervals/intervals");
|
|
10
7
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
11
8
|
const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
|
|
12
9
|
const shuffle_1 = require("../../../utils/shuffle");
|
|
13
|
-
const interval = new intervals_1.Interval("[[-10; 10]]").difference(new discreteSet_1.DiscreteSet([new integer_1.Integer(0)]));
|
|
14
10
|
const getDoubleDistributivityQuestion = () => {
|
|
15
|
-
const affines = affine_1.AffineConstructor.differentRandoms(2,
|
|
11
|
+
const affines = affine_1.AffineConstructor.differentRandoms(2, undefined, {
|
|
12
|
+
excludes: [0],
|
|
13
|
+
});
|
|
16
14
|
const statementTree = new multiplyNode_1.MultiplyNode(affines[0].toTree(), affines[1].toTree());
|
|
17
15
|
const answer = affines[0].multiply(affines[1]).toTree().toTex();
|
|
18
16
|
const question = {
|
|
@@ -44,7 +42,9 @@ const getPropositions = (n, { answer, affine1Coeffs, affine2Coeffs }) => {
|
|
|
44
42
|
.toTree()
|
|
45
43
|
.toTex());
|
|
46
44
|
while (propositions.length < n) {
|
|
47
|
-
const affinesTemps = affine_1.AffineConstructor.differentRandoms(2,
|
|
45
|
+
const affinesTemps = affine_1.AffineConstructor.differentRandoms(2, undefined, {
|
|
46
|
+
excludes: [0],
|
|
47
|
+
});
|
|
48
48
|
const wrongAnswer = affinesTemps[0].multiply(affinesTemps[1]).toTree();
|
|
49
49
|
(0, exercise_1.tryToAddWrongProp)(propositions, wrongAnswer.toTex());
|
|
50
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firstIdentity.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/distributivity/firstIdentity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAEZ,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAGJ,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;
|
|
1
|
+
{"version":3,"file":"firstIdentity.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/distributivity/firstIdentity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAEZ,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAGJ,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,iBAAiB,CAAC,WAAW,CAsBnE,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,YAAY,CAAC,WAAW,CAkClE,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,GAAG,CAAC,WAAW,CAKvD,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,YAAY,CAAC,WAAW,CAYnD,CAAC"}
|
|
@@ -3,17 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.firstIdentity = exports.isFirstIdentityAnswerValid = exports.getFirstIdentityPropositions = exports.getFirstIdentityQuestion = void 0;
|
|
4
4
|
const exercise_1 = require("../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
-
const integer_1 = require("../../../math/numbers/integer/integer");
|
|
7
6
|
const affine_1 = require("../../../math/polynomials/affine");
|
|
8
7
|
const polynomial_1 = require("../../../math/polynomials/polynomial");
|
|
9
|
-
const discreteSet_1 = require("../../../math/sets/discreteSet");
|
|
10
|
-
const intervals_1 = require("../../../math/sets/intervals/intervals");
|
|
11
8
|
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
12
9
|
const powerNode_1 = require("../../../tree/nodes/operators/powerNode");
|
|
13
10
|
const shuffle_1 = require("../../../utils/shuffle");
|
|
14
|
-
const interval = new intervals_1.Interval("[[1; 10]]").difference(new discreteSet_1.DiscreteSet([new integer_1.Integer(0)]));
|
|
15
11
|
const getFirstIdentityQuestion = () => {
|
|
16
|
-
const affine = affine_1.AffineConstructor.random(
|
|
12
|
+
const affine = affine_1.AffineConstructor.random({
|
|
13
|
+
excludes: [0],
|
|
14
|
+
}, {
|
|
15
|
+
excludes: [0],
|
|
16
|
+
});
|
|
17
17
|
const statementTree = new powerNode_1.PowerNode(affine.toTree(), new numberNode_1.NumberNode(2));
|
|
18
18
|
const answer = affine.multiply(affine).toTree().toTex();
|
|
19
19
|
const question = {
|
|
@@ -35,7 +35,11 @@ const getFirstIdentityPropositions = (n, { answer, a, b }) => {
|
|
|
35
35
|
(0, exercise_1.tryToAddWrongProp)(propositions, new polynomial_1.Polynomial([b ** 2, a ** 2 + b ** 2, a ** 2]).toTree().toTex());
|
|
36
36
|
const affine = new affine_1.Affine(a, b);
|
|
37
37
|
while (propositions.length < n) {
|
|
38
|
-
const affineTemp = affine_1.AffineConstructor.random(
|
|
38
|
+
const affineTemp = affine_1.AffineConstructor.random({
|
|
39
|
+
excludes: [0],
|
|
40
|
+
}, {
|
|
41
|
+
excludes: [0],
|
|
42
|
+
});
|
|
39
43
|
const wrongAnswer = affine.multiply(affineTemp).toTree();
|
|
40
44
|
(0, exercise_1.tryToAddWrongProp)(propositions, wrongAnswer.toTex());
|
|
41
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secondIdentity.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/distributivity/secondIdentity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAEZ,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAGJ,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;
|
|
1
|
+
{"version":3,"file":"secondIdentity.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/distributivity/secondIdentity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAEZ,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAGJ,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,iBAAiB,CAAC,WAAW,CAwBpE,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,YAAY,CAAC,WAAW,CAqCnE,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,GAAG,CAAC,WAAW,CAQxD,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,YAAY,CAAC,WAAW,CAapD,CAAC"}
|
|
@@ -3,18 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.secondIdentity = exports.isSecondIdentityAnswerValid = exports.getSecondIdentityPropositions = exports.getSecondIdentityQuestion = void 0;
|
|
4
4
|
const exercise_1 = require("../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
-
const integer_1 = require("../../../math/numbers/integer/integer");
|
|
7
6
|
const affine_1 = require("../../../math/polynomials/affine");
|
|
8
7
|
const polynomial_1 = require("../../../math/polynomials/polynomial");
|
|
9
|
-
const discreteSet_1 = require("../../../math/sets/discreteSet");
|
|
10
|
-
const intervals_1 = require("../../../math/sets/intervals/intervals");
|
|
11
8
|
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
12
9
|
const powerNode_1 = require("../../../tree/nodes/operators/powerNode");
|
|
13
10
|
const shuffle_1 = require("../../../utils/shuffle");
|
|
14
|
-
const intervalA = new intervals_1.Interval("[[0; 10]]").difference(new discreteSet_1.DiscreteSet([new integer_1.Integer(0)]));
|
|
15
|
-
const intervalB = new intervals_1.Interval("[[-10; 0]]").difference(new discreteSet_1.DiscreteSet([new integer_1.Integer(0)]));
|
|
16
11
|
const getSecondIdentityQuestion = () => {
|
|
17
|
-
const affine = affine_1.AffineConstructor.random(
|
|
12
|
+
const affine = affine_1.AffineConstructor.random({
|
|
13
|
+
min: 1,
|
|
14
|
+
max: 11,
|
|
15
|
+
}, {
|
|
16
|
+
min: -10,
|
|
17
|
+
max: 0,
|
|
18
|
+
});
|
|
18
19
|
const statementTree = new powerNode_1.PowerNode(affine.toTree(), new numberNode_1.NumberNode(2));
|
|
19
20
|
const answer = affine.multiply(affine).toTree().toTex();
|
|
20
21
|
const question = {
|
|
@@ -36,7 +37,13 @@ const getSecondIdentityPropositions = (n, { answer, a, b }) => {
|
|
|
36
37
|
(0, exercise_1.tryToAddWrongProp)(propositions, new polynomial_1.Polynomial([-(b ** 2), -(a ** 2 + b ** 2), a ** 2]).toTree().toTex());
|
|
37
38
|
const affine = new affine_1.Affine(a, b);
|
|
38
39
|
while (propositions.length < n) {
|
|
39
|
-
const affineTemp = affine_1.AffineConstructor.random(
|
|
40
|
+
const affineTemp = affine_1.AffineConstructor.random({
|
|
41
|
+
min: 1,
|
|
42
|
+
max: 11,
|
|
43
|
+
}, {
|
|
44
|
+
min: -10,
|
|
45
|
+
max: 0,
|
|
46
|
+
});
|
|
40
47
|
const wrongAnswer = affine.multiply(affineTemp).toTree();
|
|
41
48
|
(0, exercise_1.tryToAddWrongProp)(propositions, wrongAnswer.toTex());
|
|
42
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simpleDistributivity.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/distributivity/simpleDistributivity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"simpleDistributivity.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/distributivity/simpleDistributivity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAWlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAmDF,eAAO,MAAM,oBAAoB,EAAE,YAAY,CAAC,WAAW,CAa1D,CAAC"}
|
|
@@ -3,27 +3,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.simpleDistributivity = void 0;
|
|
4
4
|
const exercise_1 = require("../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
-
const integer_1 = require("../../../math/numbers/integer/integer");
|
|
7
6
|
const affine_1 = require("../../../math/polynomials/affine");
|
|
8
|
-
const
|
|
9
|
-
const intervals_1 = require("../../../math/sets/intervals/intervals");
|
|
7
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
10
8
|
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
11
9
|
const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
|
|
12
10
|
const shuffle_1 = require("../../../utils/shuffle");
|
|
13
|
-
const excludeNbrs = [new integer_1.Integer(-1), new integer_1.Integer(0), new integer_1.Integer(1)];
|
|
14
|
-
const interval = new intervals_1.Interval("[[-10; 10]]").difference(new discreteSet_1.DiscreteSet(excludeNbrs));
|
|
15
11
|
const getSimpleDistributivityQuestion = () => {
|
|
16
|
-
const affine = affine_1.AffineConstructor.random(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const
|
|
12
|
+
const affine = affine_1.AffineConstructor.random(undefined, {
|
|
13
|
+
excludes: [0],
|
|
14
|
+
});
|
|
15
|
+
const coeff = (0, randint_1.randint)(-10, 11, [-1, 0, 1]);
|
|
16
|
+
const statementTree = new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(coeff), affine.toTree());
|
|
17
|
+
const answer = affine.times(coeff).toTree().toTex();
|
|
20
18
|
const question = {
|
|
21
19
|
instruction: `Développer et réduire : $${statementTree.toTex()}$`,
|
|
22
20
|
startStatement: statementTree.toTex(),
|
|
23
21
|
answer,
|
|
24
22
|
keys: ["x"],
|
|
25
23
|
answerFormat: "tex",
|
|
26
|
-
identifiers: { a: affine.a, b: affine.b, coeff: coeff
|
|
24
|
+
identifiers: { a: affine.a, b: affine.b, coeff: coeff },
|
|
27
25
|
};
|
|
28
26
|
return question;
|
|
29
27
|
};
|
|
@@ -35,7 +33,9 @@ const getPropositions = (n, { answer, a, b, coeff }) => {
|
|
|
35
33
|
(0, exercise_1.tryToAddWrongProp)(propositions, new affine_1.Affine(a, coeff * b).toTree().toTex());
|
|
36
34
|
(0, exercise_1.tryToAddWrongProp)(propositions, affine.times(-coeff).toTree().toTex());
|
|
37
35
|
while (propositions.length < n) {
|
|
38
|
-
const wrongAnswer = affine_1.AffineConstructor.random(
|
|
36
|
+
const wrongAnswer = affine_1.AffineConstructor.random(undefined, {
|
|
37
|
+
excludes: [0],
|
|
38
|
+
}).toTree();
|
|
39
39
|
(0, exercise_1.tryToAddWrongProp)(propositions, wrongAnswer.toTex());
|
|
40
40
|
}
|
|
41
41
|
return (0, shuffle_1.shuffle)(propositions);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thirdIdentity.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/distributivity/thirdIdentity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAEZ,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAGJ,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;
|
|
1
|
+
{"version":3,"file":"thirdIdentity.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/distributivity/thirdIdentity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAEZ,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAGJ,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,iBAAiB,CAAC,WAAW,CAkBnE,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,YAAY,CAAC,WAAW,CA2BlE,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,GAAG,CAAC,WAAW,CAUvD,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,YAAY,CAAC,WAAW,CAYnD,CAAC"}
|
|
@@ -3,15 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.thirdIdentity = exports.isThirdIdentityAnswerValid = exports.getThirdIdentityPropositions = exports.getThirdIdentityQuestion = void 0;
|
|
4
4
|
const exercise_1 = require("../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
-
const integer_1 = require("../../../math/numbers/integer/integer");
|
|
7
6
|
const affine_1 = require("../../../math/polynomials/affine");
|
|
8
|
-
const discreteSet_1 = require("../../../math/sets/discreteSet");
|
|
9
|
-
const intervals_1 = require("../../../math/sets/intervals/intervals");
|
|
10
7
|
const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
|
|
11
8
|
const shuffle_1 = require("../../../utils/shuffle");
|
|
12
|
-
const interval = new intervals_1.Interval("[[-10; 10]]").difference(new discreteSet_1.DiscreteSet([new integer_1.Integer(0)]));
|
|
13
9
|
const getThirdIdentityQuestion = () => {
|
|
14
|
-
const affine = affine_1.AffineConstructor.random(
|
|
10
|
+
const affine = affine_1.AffineConstructor.random(undefined, { excludes: [0] });
|
|
15
11
|
const affine2 = new affine_1.Affine(affine.a, -affine.b);
|
|
16
12
|
const statementTree = new multiplyNode_1.MultiplyNode(affine.toTree(), affine2.toTree());
|
|
17
13
|
const answer = affine.multiply(affine2).toTree().toTex();
|
|
@@ -38,7 +34,9 @@ const getThirdIdentityPropositions = (n, { answer, affine1Coeffs, affine2Coeffs
|
|
|
38
34
|
(0, exercise_1.tryToAddWrongProp)(propositions, affine.multiply(affine).toTree().toTex());
|
|
39
35
|
(0, exercise_1.tryToAddWrongProp)(propositions, affine2.multiply(affine2.opposite()).toTree().toTex());
|
|
40
36
|
while (propositions.length < n) {
|
|
41
|
-
const affineTemp = affine_1.AffineConstructor.random(
|
|
37
|
+
const affineTemp = affine_1.AffineConstructor.random(undefined, {
|
|
38
|
+
excludes: [0],
|
|
39
|
+
});
|
|
42
40
|
const affineTemp2 = new affine_1.Affine(affineTemp.a, -affineTemp.b);
|
|
43
41
|
const wrongAnswer = affineTemp.multiply(affineTemp2).toTree();
|
|
44
42
|
(0, exercise_1.tryToAddWrongProp)(propositions, wrongAnswer.toTex());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equationType2Exercise.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/equation/equationType2Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAgBlC;;GAEG;AACH,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;
|
|
1
|
+
{"version":3,"file":"equationType2Exercise.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/equation/equationType2Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAgBlC;;GAEG;AACH,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAqDF,eAAO,MAAM,qBAAqB,EAAE,YAAY,CAAC,WAAW,CAa3D,CAAC"}
|
|
@@ -6,7 +6,6 @@ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQues
|
|
|
6
6
|
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
|
-
const intervals_1 = require("../../../math/sets/intervals/intervals");
|
|
10
9
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
11
10
|
const equationSolutionNode_1 = require("../../../tree/nodes/equations/equationSolutionNode");
|
|
12
11
|
const equalNode_1 = require("../../../tree/nodes/equations/equalNode");
|
|
@@ -14,10 +13,9 @@ const discreteSetNode_1 = require("../../../tree/nodes/sets/discreteSetNode");
|
|
|
14
13
|
const variableNode_1 = require("../../../tree/nodes/variables/variableNode");
|
|
15
14
|
const shuffle_1 = require("../../../utils/shuffle");
|
|
16
15
|
const getEquationType2ExerciseQuestion = () => {
|
|
17
|
-
const
|
|
18
|
-
const b = interval.getRandomElement();
|
|
16
|
+
const b = (0, randint_1.randint)(-10, 11);
|
|
19
17
|
const a = (0, randint_1.randint)(-9, 10, [0, 1]);
|
|
20
|
-
const solution = new rational_1.Rational(b
|
|
18
|
+
const solution = new rational_1.Rational(b, a).simplify();
|
|
21
19
|
const affine = new affine_1.Affine(a, 0).toTree();
|
|
22
20
|
const tree = new equalNode_1.EqualNode(affine, b.toTree());
|
|
23
21
|
const answer = new equalNode_1.EqualNode(new variableNode_1.VariableNode("x"), solution.toTree()).toTex();
|
|
@@ -27,7 +25,7 @@ const getEquationType2ExerciseQuestion = () => {
|
|
|
27
25
|
answer,
|
|
28
26
|
keys: equationKeys_1.equationKeys,
|
|
29
27
|
answerFormat: "tex",
|
|
30
|
-
identifiers: { a, b: b
|
|
28
|
+
identifiers: { a, b: b },
|
|
31
29
|
};
|
|
32
30
|
return question;
|
|
33
31
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equationType3Exercise.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/equation/equationType3Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAiBlC;;GAEG;AACH,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;
|
|
1
|
+
{"version":3,"file":"equationType3Exercise.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/equation/equationType3Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAiBlC;;GAEG;AACH,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAkDF,eAAO,MAAM,qBAAqB,EAAE,YAAY,CAAC,WAAW,CAc3D,CAAC"}
|
|
@@ -4,11 +4,8 @@ exports.equationType3Exercise = void 0;
|
|
|
4
4
|
const exercise_1 = require("../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
6
|
const equationKeys_1 = require("../../../exercises/utils/keys/equationKeys");
|
|
7
|
-
const integer_1 = require("../../../math/numbers/integer/integer");
|
|
8
7
|
const rational_1 = require("../../../math/numbers/rationals/rational");
|
|
9
8
|
const affine_1 = require("../../../math/polynomials/affine");
|
|
10
|
-
const discreteSet_1 = require("../../../math/sets/discreteSet");
|
|
11
|
-
const intervals_1 = require("../../../math/sets/intervals/intervals");
|
|
12
9
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
13
10
|
const equationSolutionNode_1 = require("../../../tree/nodes/equations/equationSolutionNode");
|
|
14
11
|
const equalNode_1 = require("../../../tree/nodes/equations/equalNode");
|
|
@@ -17,8 +14,6 @@ const variableNode_1 = require("../../../tree/nodes/variables/variableNode");
|
|
|
17
14
|
const shuffle_1 = require("../../../utils/shuffle");
|
|
18
15
|
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
19
16
|
const getEquationType3ExerciseQuestion = () => {
|
|
20
|
-
const interval = new intervals_1.Interval("[[-10; 10]]");
|
|
21
|
-
const intervalStar = new intervals_1.Interval("[[-10; 10]]").difference(new discreteSet_1.DiscreteSet([new integer_1.Integer(0)]));
|
|
22
17
|
const b = (0, randint_1.randint)(-10, 11, [0]);
|
|
23
18
|
const a = (0, randint_1.randint)(-10, 11, [0, 1]);
|
|
24
19
|
const c = (0, randint_1.randint)(-10, 11);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equationType4Exercise.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/equation/equationType4Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAelC;;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;
|
|
1
|
+
{"version":3,"file":"equationType4Exercise.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/equation/equationType4Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAelC;;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;AA2DF,eAAO,MAAM,qBAAqB,EAAE,YAAY,CAAC,WAAW,CAc3D,CAAC"}
|
|
@@ -4,11 +4,8 @@ exports.equationType4Exercise = void 0;
|
|
|
4
4
|
const exercise_1 = require("../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
6
|
const equationKeys_1 = require("../../../exercises/utils/keys/equationKeys");
|
|
7
|
-
const integer_1 = require("../../../math/numbers/integer/integer");
|
|
8
7
|
const rational_1 = require("../../../math/numbers/rationals/rational");
|
|
9
8
|
const affine_1 = require("../../../math/polynomials/affine");
|
|
10
|
-
const discreteSet_1 = require("../../../math/sets/discreteSet");
|
|
11
|
-
const intervals_1 = require("../../../math/sets/intervals/intervals");
|
|
12
9
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
13
10
|
const equationSolutionNode_1 = require("../../../tree/nodes/equations/equationSolutionNode");
|
|
14
11
|
const equalNode_1 = require("../../../tree/nodes/equations/equalNode");
|
|
@@ -16,15 +13,12 @@ const discreteSetNode_1 = require("../../../tree/nodes/sets/discreteSetNode");
|
|
|
16
13
|
const variableNode_1 = require("../../../tree/nodes/variables/variableNode");
|
|
17
14
|
const shuffle_1 = require("../../../utils/shuffle");
|
|
18
15
|
const getEquationType4ExerciseQuestion = () => {
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const d = interval.getRandomElement();
|
|
26
|
-
const affines = [new affine_1.Affine(a.value, b.value), new affine_1.Affine(c.value, d.value)];
|
|
27
|
-
const solution = new rational_1.Rational(d.value - b.value, a.value - c.value).simplify();
|
|
16
|
+
const a = (0, randint_1.randint)(-10, 11, [0]);
|
|
17
|
+
const b = (0, randint_1.randint)(-10, 11);
|
|
18
|
+
const c = (0, randint_1.randint)(-10, 11, [0, a]);
|
|
19
|
+
const d = (0, randint_1.randint)(-10, 11);
|
|
20
|
+
const affines = [new affine_1.Affine(a, b), new affine_1.Affine(c, d)];
|
|
21
|
+
const solution = new rational_1.Rational(d - b, a - c).simplify();
|
|
28
22
|
const statementTree = new equalNode_1.EqualNode(affines[0].toTree(), affines[1].toTree());
|
|
29
23
|
const answerTree = new equalNode_1.EqualNode(new variableNode_1.VariableNode("x"), solution.toTree());
|
|
30
24
|
const answer = answerTree.toTex();
|
|
@@ -35,10 +29,10 @@ const getEquationType4ExerciseQuestion = () => {
|
|
|
35
29
|
keys: equationKeys_1.equationKeys,
|
|
36
30
|
answerFormat: "tex",
|
|
37
31
|
identifiers: {
|
|
38
|
-
a: a
|
|
39
|
-
b: b
|
|
40
|
-
c: c
|
|
41
|
-
d: d
|
|
32
|
+
a: a,
|
|
33
|
+
b: b,
|
|
34
|
+
c: c,
|
|
35
|
+
d: d,
|
|
42
36
|
},
|
|
43
37
|
};
|
|
44
38
|
return question;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factoIdRmq1.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/factorisation/factoIdRmq1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;
|
|
1
|
+
{"version":3,"file":"factoIdRmq1.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/factorisation/factoIdRmq1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAgDF,eAAO,MAAM,WAAW,EAAE,YAAY,CAAC,WAAW,CAYjD,CAAC"}
|
|
@@ -3,17 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.factoIdRmq1 = void 0;
|
|
4
4
|
const exercise_1 = require("../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
-
const integer_1 = require("../../../math/numbers/integer/integer");
|
|
7
6
|
const affine_1 = require("../../../math/polynomials/affine");
|
|
8
|
-
const discreteSet_1 = require("../../../math/sets/discreteSet");
|
|
9
|
-
const intervals_1 = require("../../../math/sets/intervals/intervals");
|
|
10
7
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
11
8
|
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
12
9
|
const powerNode_1 = require("../../../tree/nodes/operators/powerNode");
|
|
13
10
|
const shuffle_1 = require("../../../utils/shuffle");
|
|
14
11
|
const getFactoType1Question = () => {
|
|
15
|
-
const
|
|
16
|
-
|
|
12
|
+
const affine = affine_1.AffineConstructor.random(undefined, {
|
|
13
|
+
excludes: [0],
|
|
14
|
+
});
|
|
17
15
|
const statementTree = affine.multiply(affine).toTree();
|
|
18
16
|
const answerTree = new powerNode_1.PowerNode(affine.toTree(), new numberNode_1.NumberNode(2));
|
|
19
17
|
const answer = answerTree.toTex();
|
|
@@ -3,18 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.factoIdRmq2 = void 0;
|
|
4
4
|
const exercise_1 = require("../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
-
const integer_1 = require("../../../math/numbers/integer/integer");
|
|
7
6
|
const affine_1 = require("../../../math/polynomials/affine");
|
|
8
|
-
const discreteSet_1 = require("../../../math/sets/discreteSet");
|
|
9
|
-
const intervals_1 = require("../../../math/sets/intervals/intervals");
|
|
10
7
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
11
8
|
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
12
9
|
const powerNode_1 = require("../../../tree/nodes/operators/powerNode");
|
|
13
10
|
const shuffle_1 = require("../../../utils/shuffle");
|
|
14
11
|
const getFactoType1Question = () => {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
const affine = affine_1.AffineConstructor.random({
|
|
13
|
+
min: 0,
|
|
14
|
+
max: 11,
|
|
15
|
+
}, { min: -10, max: 0 });
|
|
18
16
|
const statementTree = affine.multiply(affine).toTree();
|
|
19
17
|
const answerTree = new powerNode_1.PowerNode(affine.toTree(), new numberNode_1.NumberNode(2));
|
|
20
18
|
const answer = answerTree.toTex();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factoIdRmq3.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/factorisation/factoIdRmq3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;
|
|
1
|
+
{"version":3,"file":"factoIdRmq3.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/factorisation/factoIdRmq3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAgFF,eAAO,MAAM,WAAW,EAAE,YAAY,CAAC,WAAW,CAYjD,CAAC"}
|
|
@@ -3,16 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.factoIdRmq3 = void 0;
|
|
4
4
|
const exercise_1 = require("../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
-
const integer_1 = require("../../../math/numbers/integer/integer");
|
|
7
6
|
const affine_1 = require("../../../math/polynomials/affine");
|
|
8
|
-
const discreteSet_1 = require("../../../math/sets/discreteSet");
|
|
9
|
-
const intervals_1 = require("../../../math/sets/intervals/intervals");
|
|
10
7
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
11
8
|
const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
|
|
12
9
|
const getFactoType1Question = () => {
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
const affine = affine_1.AffineConstructor.random({
|
|
11
|
+
min: 1,
|
|
12
|
+
max: 11,
|
|
13
|
+
}, { excludes: [0] });
|
|
16
14
|
const affine2 = new affine_1.Affine(affine.a, -affine.b);
|
|
17
15
|
const statementTree = affine.multiply(affine2).toTree();
|
|
18
16
|
const answerTree = new multiplyNode_1.MultiplyNode(affine.toTree(), affine2.toTree());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firstDegreeInequationsType0.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/inequations/firstDegreeInequationsType0.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAW3C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,gBAAgB,CAAC;CAC5B,CAAC;
|
|
1
|
+
{"version":3,"file":"firstDegreeInequationsType0.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/inequations/firstDegreeInequationsType0.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAW3C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,gBAAgB,CAAC;CAC5B,CAAC;AA4DF,eAAO,MAAM,2BAA2B,EAAE,YAAY,CAAC,WAAW,CAajE,CAAC"}
|
|
@@ -45,10 +45,8 @@ const getPropositions = (n, { answer, ineqType, b, c }) => {
|
|
|
45
45
|
const isAnswerValid = (ans, { answer, ineqType, b, c }) => {
|
|
46
46
|
const result = c - b;
|
|
47
47
|
const ineq = new inequationNode_1.InequationNode([new variableNode_1.VariableNode("x"), new numberNode_1.NumberNode(result)], ineqType);
|
|
48
|
-
console.log(answer);
|
|
49
48
|
const tree = new inequationSolutionNode_1.InequationSolutionNode(ineq.toInterval());
|
|
50
49
|
const texs = tree.toAllValidTexs();
|
|
51
|
-
console.log(texs);
|
|
52
50
|
return texs.includes(ans);
|
|
53
51
|
};
|
|
54
52
|
exports.firstDegreeInequationsType0 = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"argumentFromAlgebraicComplex.d.ts","sourceRoot":"","sources":["../../../src/exercises/complex/argumentFromAlgebraicComplex.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"argumentFromAlgebraicComplex.d.ts","sourceRoot":"","sources":["../../../src/exercises/complex/argumentFromAlgebraicComplex.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAalC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AA4CF,eAAO,MAAM,4BAA4B,EAAE,YAAY,CAAC,WAAW,CAalE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thirdDegreeFunctionVariation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/thirdDegreeFunctionVariation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"thirdDegreeFunctionVariation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/thirdDegreeFunctionVariation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAiBlC,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;AAwHF,eAAO,MAAM,4BAA4B,EAAE,YAAY,CAAC,WAAW,CAsBlE,CAAC"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.thirdDegreeFunctionVariation = void 0;
|
|
4
4
|
const exercise_1 = require("../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const colors_1 = require("../../../geogebra/colors");
|
|
6
7
|
const geogebraConstructor_1 = require("../../../geogebra/geogebraConstructor");
|
|
7
8
|
const polynomial_1 = require("../../../math/polynomials/polynomial");
|
|
8
9
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
@@ -27,12 +28,24 @@ const getThirdDegreeFunctionVariation = () => {
|
|
|
27
28
|
const coin = (0, coinFlip_1.coinFlip)() ? -1 : 1;
|
|
28
29
|
const instruction = `Soit $f$ la fonction représentée ci-dessous. Sur quel intervalle la dérivée de $f$ est-elle ` +
|
|
29
30
|
(coin < 0 ? "négative ?" : "positive ?");
|
|
31
|
+
const racine1Tree = new numberNode_1.NumberNode(racine1);
|
|
32
|
+
const racine2Tree = new numberNode_1.NumberNode(racine2);
|
|
30
33
|
const answer = coin * a < 0
|
|
31
|
-
?
|
|
32
|
-
:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
? new intervalNode_1.IntervalNode(racine1Tree, racine2Tree, intervalNode_1.ClosureType.FF).toTex()
|
|
35
|
+
: new unionIntervalNode_1.UnionIntervalNode([
|
|
36
|
+
new intervalNode_1.IntervalNode(infiniteNode_1.MinusInfinityNode, racine1Tree, intervalNode_1.ClosureType.OF),
|
|
37
|
+
new intervalNode_1.IntervalNode(racine2Tree, infiniteNode_1.PlusInfinityNode, intervalNode_1.ClosureType.FO),
|
|
38
|
+
]).toTex();
|
|
39
|
+
const commands = [
|
|
40
|
+
`f(x) = ${polynome.toString()}`,
|
|
41
|
+
`SetColor(f, "${(0, colors_1.randomColor)()}")`,
|
|
42
|
+
];
|
|
43
|
+
const y1 = polynome.calculate(racine1);
|
|
44
|
+
const y2 = polynome.calculate(racine2);
|
|
45
|
+
const yMax = Math.max(y1, y2);
|
|
46
|
+
const yMin = Math.min(y1, y2);
|
|
47
|
+
const xMax = Math.max(racine1, racine2);
|
|
48
|
+
const xMin = Math.min(racine1, racine2);
|
|
36
49
|
const ggb = new geogebraConstructor_1.GeogebraConstructor(commands, {
|
|
37
50
|
isAxesRatioFixed: false,
|
|
38
51
|
isGridSimple: true,
|
|
@@ -42,14 +55,9 @@ const getThirdDegreeFunctionVariation = () => {
|
|
|
42
55
|
instruction,
|
|
43
56
|
startStatement: "S",
|
|
44
57
|
answer,
|
|
45
|
-
keys: ["lbracket", "rbracket", "semicolon", "infty"],
|
|
58
|
+
keys: ["lbracket", "rbracket", "semicolon", "infty", "cup"],
|
|
46
59
|
answerFormat: "tex",
|
|
47
|
-
coords:
|
|
48
|
-
Math.min(racine1 - ((0, randint_1.randint)(7, 20) / 10) * (racine2 - racine1), -1),
|
|
49
|
-
Math.max(racine2 + ((0, randint_1.randint)(7, 20) / 10) * (racine2 - racine1), 1),
|
|
50
|
-
Math.min(ymin - ((ymax - ymin) * (0, randint_1.randint)(7, 20)) / 10, -1),
|
|
51
|
-
Math.max(ymax + ((ymax - ymin) * (0, randint_1.randint)(7, 20)) / 10, 1),
|
|
52
|
-
],
|
|
60
|
+
coords: ggb.getAdaptedCoords({ xMin, xMax, yMin, yMax }),
|
|
53
61
|
commands: ggb.commands,
|
|
54
62
|
options: ggb.getOptions(),
|
|
55
63
|
identifiers: { racine1, racine2, coin, a },
|
|
@@ -57,15 +65,22 @@ const getThirdDegreeFunctionVariation = () => {
|
|
|
57
65
|
return question;
|
|
58
66
|
};
|
|
59
67
|
const getPropositions = (n, { answer, racine1, racine2 }) => {
|
|
68
|
+
const racine1Tree = new numberNode_1.NumberNode(racine1);
|
|
69
|
+
const racine2Tree = new numberNode_1.NumberNode(racine2);
|
|
60
70
|
const propositions = [];
|
|
61
71
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
62
|
-
(0, exercise_1.tryToAddWrongProp)(propositions,
|
|
63
|
-
(0, exercise_1.tryToAddWrongProp)(propositions,
|
|
64
|
-
(0, exercise_1.tryToAddWrongProp)(propositions,
|
|
72
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new intervalNode_1.IntervalNode(racine2Tree, infiniteNode_1.PlusInfinityNode, intervalNode_1.ClosureType.FO).toTex());
|
|
73
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new intervalNode_1.IntervalNode(infiniteNode_1.MinusInfinityNode, racine1Tree, intervalNode_1.ClosureType.OF).toTex());
|
|
74
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new unionIntervalNode_1.UnionIntervalNode([
|
|
75
|
+
new intervalNode_1.IntervalNode(infiniteNode_1.MinusInfinityNode, racine1Tree, intervalNode_1.ClosureType.OF),
|
|
76
|
+
new intervalNode_1.IntervalNode(racine2Tree, infiniteNode_1.PlusInfinityNode, intervalNode_1.ClosureType.FO),
|
|
77
|
+
]).toTex());
|
|
65
78
|
while (propositions.length < n) {
|
|
66
|
-
const
|
|
67
|
-
const
|
|
68
|
-
const
|
|
79
|
+
const root1 = (0, randint_1.randint)(-5, 4);
|
|
80
|
+
const root2 = (0, randint_1.randint)(root1 + 1, 6);
|
|
81
|
+
const root1Tree = new numberNode_1.NumberNode(racine1);
|
|
82
|
+
const root2Tree = new numberNode_1.NumberNode(racine2);
|
|
83
|
+
const wrongAnswer = new intervalNode_1.IntervalNode(root1Tree, root2Tree, intervalNode_1.ClosureType.FF).toTex();
|
|
69
84
|
(0, exercise_1.tryToAddWrongProp)(propositions, wrongAnswer);
|
|
70
85
|
}
|
|
71
86
|
return (0, shuffle_1.shuffle)(propositions);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"derivativeNumberReading.d.ts","sourceRoot":"","sources":["../../../src/exercises/derivation/derivativeNumberReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"derivativeNumberReading.d.ts","sourceRoot":"","sources":["../../../src/exercises/derivation/derivativeNumberReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAmBlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,CAAC,EAAE,MAAM,EAAE,CAAC;CACb,CAAC;AA4FF,eAAO,MAAM,uBAAuB,EAAE,YAAY,CAAC,WAAW,CAa7D,CAAC"}
|
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.derivativeNumberReading = void 0;
|
|
4
4
|
const exercise_1 = require("../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const colors_1 = require("../../geogebra/colors");
|
|
7
|
+
const geogebraConstructor_1 = require("../../geogebra/geogebraConstructor");
|
|
6
8
|
const integer_1 = require("../../math/numbers/integer/integer");
|
|
7
9
|
const rational_1 = require("../../math/numbers/rationals/rational");
|
|
8
10
|
const polynomial_1 = require("../../math/polynomials/polynomial");
|
|
@@ -35,19 +37,30 @@ const getDerivativeNumberReading = () => {
|
|
|
35
37
|
const instruction = `Ci-dessous sont tracées la courbe $\\mathcal C_f$ de la fonction $f$ et la tangente à cette courbe au point d'abscisse $${xA}$.$\\\\$ Déterminer $f'(${xA})$.`;
|
|
36
38
|
const commands = [
|
|
37
39
|
`f(x) = ${polynome.toString()}`,
|
|
40
|
+
`SetColor(f, "${colors_1.blueMain}")`,
|
|
38
41
|
`SetCaption(f, "$\\mathcal C_f$")`,
|
|
39
42
|
`ShowLabel(f, true)`,
|
|
40
43
|
`g(x) = (${penteString}) * x + (${originString})`,
|
|
44
|
+
`SetColor(g, "${colors_1.orange}")`,
|
|
41
45
|
`A = (${xA},${yA})`,
|
|
46
|
+
"SetFixed(A, true) ",
|
|
42
47
|
];
|
|
43
|
-
|
|
48
|
+
const xMin = Math.min(xA, xB);
|
|
49
|
+
const yMin = Math.min(yA, yB);
|
|
50
|
+
const xMax = Math.max(xA, xB);
|
|
51
|
+
const yMax = Math.max(yA, yB);
|
|
52
|
+
const ggb = new geogebraConstructor_1.GeogebraConstructor(commands, {
|
|
53
|
+
isGridSimple: true,
|
|
54
|
+
});
|
|
44
55
|
const answer = penteTree.toTex();
|
|
45
56
|
const question = {
|
|
46
57
|
instruction,
|
|
47
58
|
startStatement: "a",
|
|
48
59
|
answer,
|
|
49
|
-
commands,
|
|
50
|
-
coords:
|
|
60
|
+
commands: ggb.commands,
|
|
61
|
+
// coords: ggb.getAdaptedCoords({ xMax, xMin, yMax, yMin }),
|
|
62
|
+
coords: [xMin - 5, xMax + 5, yMin - 5, yMax + 5],
|
|
63
|
+
options: ggb.getOptions(),
|
|
51
64
|
answerFormat: "tex",
|
|
52
65
|
keys: [],
|
|
53
66
|
identifiers: { A: [xA, yA], B: [xB, yB] },
|
|
@@ -54,5 +54,5 @@ export interface MathExercise<TIdentifiers = {}> {
|
|
|
54
54
|
isAnswerValid?: VEA<TIdentifiers>;
|
|
55
55
|
}
|
|
56
56
|
export type MathLevel = "6ème" | "5ème" | "4ème" | "3ème" | "2nde" | "1reTech" | "1reESM" | "1reSpé" | "TermSpé" | "TermTech" | "MathExp" | "MathComp" | "CAP" | "2ndPro" | "1rePro" | "TermPro";
|
|
57
|
-
export type MathSection = "Aires" | "Arithmétique" | "Calcul littéral" | "Calculs" | "Combinatoire et dénombrement" | "Conversions" | "Dérivation" | "Droites" | "Ensembles et intervalles" | "Équations" | "Équations différentielles" | "Exponentielle" | "Fonction cube" | "Fonction inverse" | "Fonctions" | "Fonctions affines" | "Fonctions de référence" | "Fractions" | "Géométrie cartésienne" | "Géométrie euclidienne" | "Inéquations" | "Intégration" | "Limites" | "Logarithme népérien" | "Logarithme décimal" | "Nombres complexes" | "Périmètres" | "Pourcentages" | "Primitives" | "Probabilités" | "Produit scalaire" | "Proportionnalité" | "Puissances" | "Racines carrées" | "Second degré" | "Statistiques" | "Suites" | "Théorème de Pythagore" | "Théorème de Thalès" | "Trigonométrie" | "Valeur absolue" | "Vecteurs";
|
|
57
|
+
export type MathSection = "Aires" | "Arithmétique" | "Calcul littéral" | "Calculs" | "Combinatoire et dénombrement" | "Conversions" | "Dérivation" | "Droites" | "Ensembles et intervalles" | "Équations" | "Équations différentielles" | "Exponentielle" | "Fonction cube" | "Fonction inverse" | "Fonctions" | "Fonctions affines" | "Fonctions de référence" | "Fractions" | "Géométrie cartésienne" | "Géométrie euclidienne" | "Inéquations" | "Intégration" | "Limites" | "Logarithme népérien" | "Logarithme décimal" | "Matrices" | "Nombres complexes" | "Périmètres" | "Pourcentages" | "Primitives" | "Probabilités" | "Produit scalaire" | "Proportionnalité" | "Puissances" | "Racines carrées" | "Second degré" | "Statistiques" | "Suites" | "Théorème de Pythagore" | "Théorème de Thalès" | "Trigonométrie" | "Valeur absolue" | "Vecteurs";
|
|
58
58
|
//# sourceMappingURL=exercise.d.ts.map
|