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