math-exercises 1.3.1 → 1.3.3
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/README.md +71 -71
- package/lib/exercises/calcul/addAndSub.js +40 -39
- package/lib/exercises/calcul/fractions/fractionAndIntegerDivision.js +35 -34
- package/lib/exercises/calcul/fractions/fractionAndIntegerProduct.js +31 -31
- package/lib/exercises/calcul/fractions/fractionAndIntegerSum.js +32 -31
- package/lib/exercises/calcul/fractions/fractionsDivision.js +29 -28
- package/lib/exercises/calcul/fractions/fractionsProduct.js +29 -28
- package/lib/exercises/calcul/fractions/fractionsSum.js +29 -28
- package/lib/exercises/calcul/fractions/simplifyFraction.js +25 -24
- package/lib/exercises/calcul/operationsPriorities.js +88 -88
- package/lib/exercises/calcul/rounding/rounding.js +86 -85
- package/lib/exercises/calculLitteral/distributivity/allIdentities.js +27 -27
- package/lib/exercises/calculLitteral/distributivity/doubleDistributivity.js +31 -30
- package/lib/exercises/calculLitteral/distributivity/firstIdentity.js +32 -31
- package/lib/exercises/calculLitteral/distributivity/secondIdentity.js +33 -32
- package/lib/exercises/calculLitteral/distributivity/simpleDistributivity.js +33 -32
- package/lib/exercises/calculLitteral/distributivity/thirdIdentity.js +32 -31
- package/lib/exercises/calculLitteral/equation/equationType1Exercise.js +38 -37
- package/lib/exercises/calculLitteral/equation/equationType2Exercise.js +41 -40
- package/lib/exercises/calculLitteral/equation/equationType3Exercise.js +42 -41
- package/lib/exercises/calculLitteral/equation/equationType4Exercise.js +44 -43
- package/lib/exercises/calculLitteral/factorisation/factoType1Exercise.js +39 -38
- package/lib/exercises/exercise.js +7 -7
- package/lib/exercises/exercises.js +85 -95
- package/lib/exercises/powers/powersDivision.js +45 -44
- package/lib/exercises/powers/powersOfTenToDecimal.js +33 -32
- package/lib/exercises/powers/powersPower.js +44 -43
- package/lib/exercises/powers/powersProduct.js +45 -44
- package/lib/exercises/powers/scientificToDecimal.js +38 -37
- package/lib/exercises/squareRoots/simpifySquareRoot.js +28 -27
- package/lib/exercises/utils/getDistinctQuestions.js +15 -15
- package/lib/geometry/point.js +1 -27
- package/lib/index.js +5 -9
- package/lib/mathutils/arithmetic/coprimesOf.js +13 -13
- package/lib/mathutils/arithmetic/dividersOf.js +12 -12
- package/lib/mathutils/arithmetic/gcd.js +7 -7
- package/lib/mathutils/arithmetic/isSquare.js +7 -7
- package/lib/mathutils/arithmetic/lcd.js +12 -12
- package/lib/mathutils/arithmetic/nonCoprimesOf.js +13 -13
- package/lib/mathutils/arithmetic/nonDividersOf.js +14 -14
- package/lib/mathutils/arithmetic/primeFactors.js +22 -22
- package/lib/mathutils/decimals/decimalPartLengthOf.js +14 -14
- package/lib/mathutils/random/randint.js +18 -18
- package/lib/mathutils/round.js +8 -8
- package/lib/numbers/decimals/decimal.js +140 -140
- package/lib/numbers/epsilon.js +10 -10
- package/lib/numbers/integer/integer.js +68 -68
- package/lib/numbers/integer/power.js +52 -52
- package/lib/numbers/nombre.js +10 -10
- package/lib/numbers/rationals/rational.js +113 -113
- package/lib/numbers/reals/real.js +16 -16
- package/lib/numbers/reals/squareRoot.js +63 -63
- package/lib/polynomials/affine.js +42 -42
- package/lib/polynomials/polynomial.js +125 -125
- package/lib/sets/discreteSet.js +28 -28
- package/lib/sets/emptySet.js +6 -6
- package/lib/sets/intervals/intervals.js +108 -108
- package/lib/sets/intervals/union.js +1 -1
- package/lib/sets/mathSet.js +10 -10
- package/lib/sets/mathSetInterface.js +2 -2
- package/lib/tree/nodes/functions/functionNode.js +18 -18
- package/lib/tree/nodes/functions/oppositeNode.js +13 -26
- package/lib/tree/nodes/functions/sqrtNode.js +15 -18
- package/lib/tree/nodes/node.js +10 -10
- package/lib/tree/nodes/numbers/numberNode.js +15 -18
- package/lib/tree/nodes/operators/addNode.js +15 -19
- package/lib/tree/nodes/operators/divideNode.js +17 -34
- package/lib/tree/nodes/operators/equalNode.js +13 -16
- package/lib/tree/nodes/operators/fractionNode.js +17 -20
- package/lib/tree/nodes/operators/multiplyNode.js +13 -36
- package/lib/tree/nodes/operators/operatorNode.js +35 -35
- package/lib/tree/nodes/operators/powerNode.js +13 -33
- package/lib/tree/nodes/operators/substractNode.js +13 -24
- package/lib/tree/nodes/variables/variableNode.js +16 -19
- package/lib/tree/parsers/derivateParser.js +60 -62
- package/lib/tree/parsers/latexParser.js +117 -110
- package/lib/utils/coin.js +7 -7
- package/lib/utils/random.js +7 -7
- package/lib/utils/shuffle.js +15 -15
- package/package.json +41 -38
- package/lib/exercises/calcul/operations/operationsPriorities.js +0 -98
- package/lib/exercises/calcul/operations/operationsPrioritiesWithoutRelative.js +0 -111
- package/lib/exercises/geometry/cartesian/midpoint.js +0 -29
- package/lib/exercises/geometry/vectors/scalarProductViaCoords.js +0 -28
- package/lib/exercises/geometry/vectors/scalarProductViaNorms.js +0 -27
- package/lib/geometry/vector.js +0 -31
- package/lib/mathutils/random/randTupleInt.js +0 -30
- package/lib/tree/parsers/simplify.js +0 -51
- package/lib/utils/arrayEqual.js +0 -13
|
@@ -1,38 +1,39 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getFactoType1Question = exports.factoType1Exercise = void 0;
|
|
4
|
-
const affine_1 = require("../../../polynomials/affine");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFactoType1Question = exports.factoType1Exercise = void 0;
|
|
4
|
+
const affine_1 = require("../../../polynomials/affine");
|
|
5
|
+
const latexParser_1 = require("../../../tree/parsers/latexParser");
|
|
6
|
+
const addNode_1 = require("../../../tree/nodes/operators/addNode");
|
|
7
|
+
const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
|
|
8
|
+
const substractNode_1 = require("../../../tree/nodes/operators/substractNode");
|
|
9
|
+
const random_1 = require("../../../utils/random");
|
|
10
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
11
|
+
const getDistinctQuestions_1 = require("../../utils/getDistinctQuestions");
|
|
12
|
+
/**
|
|
13
|
+
* type (ax+b)(cx+d) ± (ax+b)(ex+f)
|
|
14
|
+
*/
|
|
15
|
+
exports.factoType1Exercise = {
|
|
16
|
+
id: "facto1",
|
|
17
|
+
connector: "=",
|
|
18
|
+
instruction: "Factoriser :",
|
|
19
|
+
isSingleStep: false,
|
|
20
|
+
label: "Factorisation du type $(ax+b)(cx+d) \\pm (ax+b)(ex+f)$",
|
|
21
|
+
levels: ["3", "2"],
|
|
22
|
+
section: "Calcul littéral",
|
|
23
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getFactoType1Question, nb),
|
|
24
|
+
};
|
|
25
|
+
function getFactoType1Question() {
|
|
26
|
+
const affines = affine_1.AffineConstructor.differentRandoms(3);
|
|
27
|
+
const permut = [(0, shuffle_1.shuffle)([affines[0], affines[1]]), (0, shuffle_1.shuffle)([affines[0], affines[2]])];
|
|
28
|
+
const operation = (0, random_1.random)(["add", "substract"]);
|
|
29
|
+
const statementTree = operation === "add"
|
|
30
|
+
? new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(permut[0][0].toTree(), permut[0][1].toTree()), new multiplyNode_1.MultiplyNode(permut[1][0].toTree(), permut[1][1].toTree()))
|
|
31
|
+
: new substractNode_1.SubstractNode(new multiplyNode_1.MultiplyNode(permut[0][0].toTree(), permut[0][1].toTree()), new multiplyNode_1.MultiplyNode(permut[1][0].toTree(), permut[1][1].toTree()));
|
|
32
|
+
const answerTree = new multiplyNode_1.MultiplyNode(affines[0].toTree(), affines[1].add(operation === "add" ? affines[2] : affines[2].opposite()).toTree());
|
|
33
|
+
const question = {
|
|
34
|
+
startStatement: (0, latexParser_1.latexParser)(statementTree),
|
|
35
|
+
answer: (0, latexParser_1.latexParser)(answerTree),
|
|
36
|
+
};
|
|
37
|
+
return question;
|
|
38
|
+
}
|
|
39
|
+
exports.getFactoType1Question = getFactoType1Question;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// export enum Connector {
|
|
3
|
-
// equal = "=",
|
|
4
|
-
// equiv = "\\iff",
|
|
5
|
-
// implies = "\\Rightarrow",
|
|
6
|
-
// }
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
// export enum Connector {
|
|
3
|
+
// equal = "=",
|
|
4
|
+
// equiv = "\\iff",
|
|
5
|
+
// implies = "\\Rightarrow",
|
|
6
|
+
// }
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,95 +1,85 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.exercises = exports.data = void 0;
|
|
4
|
-
const addAndSub_1 = require("./calcul/addAndSub");
|
|
5
|
-
const fractionAndIntegerDivision_1 = require("./calcul/fractions/fractionAndIntegerDivision");
|
|
6
|
-
const fractionAndIntegerProduct_1 = require("./calcul/fractions/fractionAndIntegerProduct");
|
|
7
|
-
const fractionAndIntegerSum_1 = require("./calcul/fractions/fractionAndIntegerSum");
|
|
8
|
-
const fractionsDivision_1 = require("./calcul/fractions/fractionsDivision");
|
|
9
|
-
const fractionsProduct_1 = require("./calcul/fractions/fractionsProduct");
|
|
10
|
-
const fractionsSum_1 = require("./calcul/fractions/fractionsSum");
|
|
11
|
-
const simplifyFraction_1 = require("./calcul/fractions/simplifyFraction");
|
|
12
|
-
const operationsPriorities_1 = require("./calcul/
|
|
13
|
-
const rounding_1 = require("./calcul/rounding/rounding");
|
|
14
|
-
const allIdentities_1 = require("./calculLitteral/distributivity/allIdentities");
|
|
15
|
-
const doubleDistributivity_1 = require("./calculLitteral/distributivity/doubleDistributivity");
|
|
16
|
-
const firstIdentity_1 = require("./calculLitteral/distributivity/firstIdentity");
|
|
17
|
-
const secondIdentity_1 = require("./calculLitteral/distributivity/secondIdentity");
|
|
18
|
-
const simpleDistributivity_1 = require("./calculLitteral/distributivity/simpleDistributivity");
|
|
19
|
-
const thirdIdentity_1 = require("./calculLitteral/distributivity/thirdIdentity");
|
|
20
|
-
const equationType1Exercise_1 = require("./calculLitteral/equation/equationType1Exercise");
|
|
21
|
-
const equationType2Exercise_1 = require("./calculLitteral/equation/equationType2Exercise");
|
|
22
|
-
const equationType3Exercise_1 = require("./calculLitteral/equation/equationType3Exercise");
|
|
23
|
-
const equationType4Exercise_1 = require("./calculLitteral/equation/equationType4Exercise");
|
|
24
|
-
const factoType1Exercise_1 = require("./calculLitteral/factorisation/factoType1Exercise");
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
rounding_1.
|
|
72
|
-
rounding_1.
|
|
73
|
-
rounding_1.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
*/
|
|
87
|
-
powersDivision_1.powersDivision,
|
|
88
|
-
powersPower_1.powersPower,
|
|
89
|
-
powersProduct_1.powersProduct,
|
|
90
|
-
powersDivision_1.powersOfTenDivision,
|
|
91
|
-
powersPower_1.powersOfTenPower,
|
|
92
|
-
powersProduct_1.powersOfTenProduct,
|
|
93
|
-
scientificToDecimal_1.scientificToDecimal,
|
|
94
|
-
powersOfTenToDecimal_1.powersOfTenToDecimal,
|
|
95
|
-
];
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.exercises = exports.data = void 0;
|
|
4
|
+
const addAndSub_1 = require("./calcul/addAndSub");
|
|
5
|
+
const fractionAndIntegerDivision_1 = require("./calcul/fractions/fractionAndIntegerDivision");
|
|
6
|
+
const fractionAndIntegerProduct_1 = require("./calcul/fractions/fractionAndIntegerProduct");
|
|
7
|
+
const fractionAndIntegerSum_1 = require("./calcul/fractions/fractionAndIntegerSum");
|
|
8
|
+
const fractionsDivision_1 = require("./calcul/fractions/fractionsDivision");
|
|
9
|
+
const fractionsProduct_1 = require("./calcul/fractions/fractionsProduct");
|
|
10
|
+
const fractionsSum_1 = require("./calcul/fractions/fractionsSum");
|
|
11
|
+
const simplifyFraction_1 = require("./calcul/fractions/simplifyFraction");
|
|
12
|
+
const operationsPriorities_1 = require("./calcul/operationsPriorities");
|
|
13
|
+
const rounding_1 = require("./calcul/rounding/rounding");
|
|
14
|
+
const allIdentities_1 = require("./calculLitteral/distributivity/allIdentities");
|
|
15
|
+
const doubleDistributivity_1 = require("./calculLitteral/distributivity/doubleDistributivity");
|
|
16
|
+
const firstIdentity_1 = require("./calculLitteral/distributivity/firstIdentity");
|
|
17
|
+
const secondIdentity_1 = require("./calculLitteral/distributivity/secondIdentity");
|
|
18
|
+
const simpleDistributivity_1 = require("./calculLitteral/distributivity/simpleDistributivity");
|
|
19
|
+
const thirdIdentity_1 = require("./calculLitteral/distributivity/thirdIdentity");
|
|
20
|
+
const equationType1Exercise_1 = require("./calculLitteral/equation/equationType1Exercise");
|
|
21
|
+
const equationType2Exercise_1 = require("./calculLitteral/equation/equationType2Exercise");
|
|
22
|
+
const equationType3Exercise_1 = require("./calculLitteral/equation/equationType3Exercise");
|
|
23
|
+
const equationType4Exercise_1 = require("./calculLitteral/equation/equationType4Exercise");
|
|
24
|
+
const factoType1Exercise_1 = require("./calculLitteral/factorisation/factoType1Exercise");
|
|
25
|
+
const powersDivision_1 = require("./powers/powersDivision");
|
|
26
|
+
const powersOfTenToDecimal_1 = require("./powers/powersOfTenToDecimal");
|
|
27
|
+
const powersPower_1 = require("./powers/powersPower");
|
|
28
|
+
const powersProduct_1 = require("./powers/powersProduct");
|
|
29
|
+
const scientificToDecimal_1 = require("./powers/scientificToDecimal");
|
|
30
|
+
const simpifySquareRoot_1 = require("./squareRoots/simpifySquareRoot");
|
|
31
|
+
exports.data = [{}];
|
|
32
|
+
exports.exercises = [
|
|
33
|
+
/**
|
|
34
|
+
* calcul litteral
|
|
35
|
+
*/
|
|
36
|
+
factoType1Exercise_1.factoType1Exercise,
|
|
37
|
+
simpleDistributivity_1.simpleDistributivity,
|
|
38
|
+
doubleDistributivity_1.doubleDistributivity,
|
|
39
|
+
firstIdentity_1.firstIdentity,
|
|
40
|
+
secondIdentity_1.secondIdentity,
|
|
41
|
+
thirdIdentity_1.thirdIdentity,
|
|
42
|
+
allIdentities_1.allIdentities,
|
|
43
|
+
equationType1Exercise_1.equationType1Exercise,
|
|
44
|
+
equationType2Exercise_1.equationType2Exercise,
|
|
45
|
+
equationType3Exercise_1.equationType3Exercise,
|
|
46
|
+
equationType4Exercise_1.equationType4Exercise,
|
|
47
|
+
/**
|
|
48
|
+
* square roots
|
|
49
|
+
*/
|
|
50
|
+
simpifySquareRoot_1.simplifySquareRoot,
|
|
51
|
+
/**
|
|
52
|
+
* fractions
|
|
53
|
+
*/
|
|
54
|
+
fractionAndIntegerDivision_1.fractionAndIntegerDivision,
|
|
55
|
+
fractionAndIntegerProduct_1.fractionAndIntegerProduct,
|
|
56
|
+
fractionAndIntegerSum_1.fractionAndIntegerSum,
|
|
57
|
+
fractionsDivision_1.fractionsDivision,
|
|
58
|
+
fractionsProduct_1.fractionsProduct,
|
|
59
|
+
fractionsSum_1.fractionsSum,
|
|
60
|
+
simplifyFraction_1.simplifyFraction,
|
|
61
|
+
/**
|
|
62
|
+
* calcul
|
|
63
|
+
*/
|
|
64
|
+
operationsPriorities_1.operationsPriorities,
|
|
65
|
+
addAndSub_1.addAndSubExercise,
|
|
66
|
+
/**
|
|
67
|
+
* rounding
|
|
68
|
+
*/
|
|
69
|
+
rounding_1.roundToCentieme,
|
|
70
|
+
rounding_1.roundToDixieme,
|
|
71
|
+
rounding_1.roundToMillieme,
|
|
72
|
+
rounding_1.roundToUnit,
|
|
73
|
+
rounding_1.allRoundings,
|
|
74
|
+
/**
|
|
75
|
+
* puissances
|
|
76
|
+
*/
|
|
77
|
+
powersDivision_1.powersDivision,
|
|
78
|
+
powersPower_1.powersPower,
|
|
79
|
+
powersProduct_1.powersProduct,
|
|
80
|
+
powersDivision_1.powersOfTenDivision,
|
|
81
|
+
powersPower_1.powersOfTenPower,
|
|
82
|
+
powersProduct_1.powersOfTenProduct,
|
|
83
|
+
scientificToDecimal_1.scientificToDecimal,
|
|
84
|
+
powersOfTenToDecimal_1.powersOfTenToDecimal,
|
|
85
|
+
];
|
|
@@ -1,44 +1,45 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getPowersDivisionQuestion = exports.powersOfTenDivision = exports.powersDivision = void 0;
|
|
4
|
-
const randint_1 = require("../../mathutils/random/randint");
|
|
5
|
-
const power_1 = require("../../numbers/integer/power");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPowersDivisionQuestion = exports.powersOfTenDivision = exports.powersDivision = void 0;
|
|
4
|
+
const randint_1 = require("../../mathutils/random/randint");
|
|
5
|
+
const power_1 = require("../../numbers/integer/power");
|
|
6
|
+
const latexParser_1 = require("../../tree/parsers/latexParser");
|
|
7
|
+
const numberNode_1 = require("../../tree/nodes/numbers/numberNode");
|
|
8
|
+
const fractionNode_1 = require("../../tree/nodes/operators/fractionNode");
|
|
9
|
+
const powerNode_1 = require("../../tree/nodes/operators/powerNode");
|
|
10
|
+
const getDistinctQuestions_1 = require("../utils/getDistinctQuestions");
|
|
11
|
+
/**
|
|
12
|
+
* a^b/a^c
|
|
13
|
+
*/
|
|
14
|
+
exports.powersDivision = {
|
|
15
|
+
id: "powersDivision",
|
|
16
|
+
connector: "=",
|
|
17
|
+
instruction: "Calculer :",
|
|
18
|
+
label: "Division de puissances",
|
|
19
|
+
levels: ["4", "3", "2", "1"],
|
|
20
|
+
section: "Puissances",
|
|
21
|
+
isSingleStep: true,
|
|
22
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getPowersDivisionQuestion, nb),
|
|
23
|
+
};
|
|
24
|
+
exports.powersOfTenDivision = {
|
|
25
|
+
id: "powersOfTenDivision",
|
|
26
|
+
connector: "=",
|
|
27
|
+
instruction: "Calculer :",
|
|
28
|
+
label: "Division de puissances de 10",
|
|
29
|
+
levels: ["4", "3", "2", "1"],
|
|
30
|
+
section: "Puissances",
|
|
31
|
+
isSingleStep: true,
|
|
32
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getPowersDivisionQuestion(true), nb),
|
|
33
|
+
};
|
|
34
|
+
function getPowersDivisionQuestion(useOnlyPowersOfTen = false) {
|
|
35
|
+
const a = useOnlyPowersOfTen ? 10 : (0, randint_1.randint)(-11, 11);
|
|
36
|
+
const [b, c] = [1, 2].map((el) => (0, randint_1.randint)(-11, 11));
|
|
37
|
+
const statement = new fractionNode_1.FractionNode(new powerNode_1.PowerNode(new numberNode_1.NumberNode(a), new numberNode_1.NumberNode(b)), new powerNode_1.PowerNode(new numberNode_1.NumberNode(a), new numberNode_1.NumberNode(c)));
|
|
38
|
+
const answerTree = new power_1.Power(a, b - c).simplify();
|
|
39
|
+
const question = {
|
|
40
|
+
startStatement: (0, latexParser_1.latexParser)(statement),
|
|
41
|
+
answer: (0, latexParser_1.latexParser)(answerTree),
|
|
42
|
+
};
|
|
43
|
+
return question;
|
|
44
|
+
}
|
|
45
|
+
exports.getPowersDivisionQuestion = getPowersDivisionQuestion;
|
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getPowersOfTenDivisionQuestion = exports.powersOfTenToDecimal = void 0;
|
|
4
|
-
const randint_1 = require("../../mathutils/random/randint");
|
|
5
|
-
const power_1 = require("../../numbers/integer/power");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPowersOfTenDivisionQuestion = exports.powersOfTenToDecimal = void 0;
|
|
4
|
+
const randint_1 = require("../../mathutils/random/randint");
|
|
5
|
+
const power_1 = require("../../numbers/integer/power");
|
|
6
|
+
const latexParser_1 = require("../../tree/parsers/latexParser");
|
|
7
|
+
const numberNode_1 = require("../../tree/nodes/numbers/numberNode");
|
|
8
|
+
const powerNode_1 = require("../../tree/nodes/operators/powerNode");
|
|
9
|
+
const getDistinctQuestions_1 = require("../utils/getDistinctQuestions");
|
|
10
|
+
/**
|
|
11
|
+
* 10^(-x) into 0,0...1
|
|
12
|
+
*/
|
|
13
|
+
exports.powersOfTenToDecimal = {
|
|
14
|
+
id: "powersOfTenToDecimal",
|
|
15
|
+
connector: "=",
|
|
16
|
+
instruction: "Donner l'écriture décimale de :",
|
|
17
|
+
label: "Ecriture décimale d'une puissance de 10",
|
|
18
|
+
levels: ["5", "4", "3", "2"],
|
|
19
|
+
section: "Puissances",
|
|
20
|
+
isSingleStep: true,
|
|
21
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getPowersOfTenDivisionQuestion, nb),
|
|
22
|
+
};
|
|
23
|
+
function getPowersOfTenDivisionQuestion() {
|
|
24
|
+
const randPower = (0, randint_1.randint)(-6, 8);
|
|
25
|
+
const statement = new powerNode_1.PowerNode(new numberNode_1.NumberNode(10), new numberNode_1.NumberNode(randPower));
|
|
26
|
+
const answerTree = new power_1.Power(10, randPower).toDecimalWriting().toTree();
|
|
27
|
+
const question = {
|
|
28
|
+
startStatement: (0, latexParser_1.latexParser)(statement),
|
|
29
|
+
answer: (0, latexParser_1.latexParser)(answerTree),
|
|
30
|
+
};
|
|
31
|
+
return question;
|
|
32
|
+
}
|
|
33
|
+
exports.getPowersOfTenDivisionQuestion = getPowersOfTenDivisionQuestion;
|
|
@@ -1,43 +1,44 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getPowersPowerQuestion = exports.powersPower = exports.powersOfTenPower = void 0;
|
|
4
|
-
const randint_1 = require("../../mathutils/random/randint");
|
|
5
|
-
const power_1 = require("../../numbers/integer/power");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPowersPowerQuestion = exports.powersPower = exports.powersOfTenPower = void 0;
|
|
4
|
+
const randint_1 = require("../../mathutils/random/randint");
|
|
5
|
+
const power_1 = require("../../numbers/integer/power");
|
|
6
|
+
const latexParser_1 = require("../../tree/parsers/latexParser");
|
|
7
|
+
const numberNode_1 = require("../../tree/nodes/numbers/numberNode");
|
|
8
|
+
const powerNode_1 = require("../../tree/nodes/operators/powerNode");
|
|
9
|
+
const getDistinctQuestions_1 = require("../utils/getDistinctQuestions");
|
|
10
|
+
/**
|
|
11
|
+
* (a^b)^c
|
|
12
|
+
*/
|
|
13
|
+
exports.powersOfTenPower = {
|
|
14
|
+
id: "powersOfTenPower",
|
|
15
|
+
connector: "=",
|
|
16
|
+
instruction: "Calculer :",
|
|
17
|
+
label: "Puissance d'une puissance de 10 ",
|
|
18
|
+
levels: ["4", "3", "2", "1"],
|
|
19
|
+
section: "Puissances",
|
|
20
|
+
isSingleStep: true,
|
|
21
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getPowersPowerQuestion(true), nb),
|
|
22
|
+
};
|
|
23
|
+
exports.powersPower = {
|
|
24
|
+
id: "powersPower",
|
|
25
|
+
connector: "=",
|
|
26
|
+
instruction: "Calculer :",
|
|
27
|
+
label: "Puissance d'une puissance",
|
|
28
|
+
levels: ["4", "3", "2", "1"],
|
|
29
|
+
section: "Puissances",
|
|
30
|
+
isSingleStep: true,
|
|
31
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getPowersPowerQuestion, nb),
|
|
32
|
+
};
|
|
33
|
+
function getPowersPowerQuestion(useOnlyPowersOfTen = false) {
|
|
34
|
+
const a = useOnlyPowersOfTen ? 10 : (0, randint_1.randint)(-11, 11);
|
|
35
|
+
const [b, c] = [1, 2].map((el) => (0, randint_1.randint)(-11, 11));
|
|
36
|
+
const statement = new powerNode_1.PowerNode(new powerNode_1.PowerNode(new numberNode_1.NumberNode(a), new numberNode_1.NumberNode(b)), new numberNode_1.NumberNode(c));
|
|
37
|
+
let answerTree = new power_1.Power(a, b * c).simplify();
|
|
38
|
+
const question = {
|
|
39
|
+
startStatement: (0, latexParser_1.latexParser)(statement),
|
|
40
|
+
answer: (0, latexParser_1.latexParser)(answerTree),
|
|
41
|
+
};
|
|
42
|
+
return question;
|
|
43
|
+
}
|
|
44
|
+
exports.getPowersPowerQuestion = getPowersPowerQuestion;
|