math-exercises 1.2.5 → 1.2.6
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/package.json +1 -1
- package/src/exercises/calcul/addAndSub.ts +1 -1
- package/src/exercises/calcul/fractions/fractionAndIntegerDivision.ts +1 -1
- package/src/exercises/calcul/fractions/fractionAndIntegerProduct.ts +1 -1
- package/src/exercises/calcul/fractions/fractionAndIntegerSum.ts +1 -1
- package/src/exercises/calcul/fractions/fractionsDivision.ts +1 -1
- package/src/exercises/calcul/fractions/fractionsProduct.ts +1 -1
- package/src/exercises/calcul/fractions/fractionsSum.ts +1 -1
- package/src/exercises/calcul/fractions/simplifyFraction.ts +1 -1
- package/src/exercises/calcul/operationsPriorities.ts +1 -1
- package/src/exercises/calcul/rounding/roundToUnit.ts +1 -1
- package/src/exercises/calculLitteral/distributivity/doubleDistributivity.ts +1 -1
- package/src/exercises/calculLitteral/distributivity/firstIdentity.ts +1 -1
- package/src/exercises/calculLitteral/distributivity/secondIdentity.ts +1 -1
- package/src/exercises/calculLitteral/distributivity/simpleDistributivity.ts +1 -1
- package/src/exercises/calculLitteral/distributivity/thirdIdentity.ts +1 -1
- package/src/exercises/calculLitteral/equation/equationType1Exercise.ts +1 -1
- package/src/exercises/calculLitteral/equation/equationType2Exercise.ts +1 -1
- package/src/exercises/calculLitteral/equation/equationType3Exercise.ts +1 -1
- package/src/exercises/calculLitteral/equation/equationType4Exercise.ts +1 -1
- package/src/exercises/calculLitteral/factorisation/factoType1Exercise.ts +1 -1
- package/src/exercises/exercise.ts +1 -1
- package/src/exercises/exercises.ts +6 -0
- package/src/exercises/powers/powersDivision.ts +1 -1
- package/src/exercises/powers/powersOfTenToDecimal.ts +1 -1
- package/src/exercises/powers/powersPower.ts +1 -1
- package/src/exercises/powers/powersProduct.ts +1 -1
- package/src/exercises/powers/scientificToDecimal.ts +1 -1
- package/src/exercises/squareRoots/simpifySquareRoot.ts +1 -1
- package/src/exercises/utils/getDistinctQuestions.ts +2 -5
- package/src/index.ts +0 -1
package/package.json
CHANGED
|
@@ -32,7 +32,7 @@ export function getAddAndSubQuestions(): Question {
|
|
|
32
32
|
}
|
|
33
33
|
const answer = numbers.reduce((a, b) => a + b) + "";
|
|
34
34
|
const question: Question = {
|
|
35
|
-
|
|
35
|
+
startStatement: latexParser(statementTree),
|
|
36
36
|
answer: answer,
|
|
37
37
|
};
|
|
38
38
|
return question;
|
|
@@ -31,7 +31,7 @@ export function getFractionAndIntegerDivision(): Question {
|
|
|
31
31
|
|
|
32
32
|
const answerTree = integerFirst ? integer.divide(rational).toTree() : rational.divide(integer).toTree();
|
|
33
33
|
const question: Question = {
|
|
34
|
-
|
|
34
|
+
startStatement: latexParser(statementTree),
|
|
35
35
|
answer: latexParser(answerTree),
|
|
36
36
|
};
|
|
37
37
|
return question;
|
|
@@ -25,7 +25,7 @@ export function getFractionAndIntegerProduct(): Question {
|
|
|
25
25
|
|
|
26
26
|
const answerTree = rational.multiply(integer).toTree();
|
|
27
27
|
const question: Question = {
|
|
28
|
-
|
|
28
|
+
startStatement: latexParser(statementTree),
|
|
29
29
|
answer: latexParser(answerTree),
|
|
30
30
|
};
|
|
31
31
|
return question;
|
|
@@ -24,7 +24,7 @@ export function getFractionAndIntegerSum(): Question {
|
|
|
24
24
|
statementTree.shuffle();
|
|
25
25
|
const answerTree = rational.add(integer).toTree();
|
|
26
26
|
const question: Question = {
|
|
27
|
-
|
|
27
|
+
startStatement: latexParser(statementTree),
|
|
28
28
|
answer: latexParser(answerTree),
|
|
29
29
|
};
|
|
30
30
|
return question;
|
|
@@ -23,7 +23,7 @@ export function getFractionsDivision(): Question {
|
|
|
23
23
|
const statementTree = new DivideNode(rational.toTree(), rational2.toTree());
|
|
24
24
|
const answerTree = rational.divide(rational2).toTree();
|
|
25
25
|
const question: Question = {
|
|
26
|
-
|
|
26
|
+
startStatement: latexParser(statementTree),
|
|
27
27
|
answer: latexParser(answerTree),
|
|
28
28
|
};
|
|
29
29
|
return question;
|
|
@@ -22,7 +22,7 @@ export function getFractionsProduct(): Question {
|
|
|
22
22
|
const statementTree = new MultiplyNode(rational.toTree(), rational2.toTree());
|
|
23
23
|
const answerTree = rational.multiply(rational2).toTree();
|
|
24
24
|
const question: Question = {
|
|
25
|
-
|
|
25
|
+
startStatement: latexParser(statementTree),
|
|
26
26
|
answer: latexParser(answerTree),
|
|
27
27
|
};
|
|
28
28
|
return question;
|
|
@@ -21,7 +21,7 @@ export function getFractionsSum(): Question {
|
|
|
21
21
|
const statementTree = new AddNode(rational.toTree(), rational2.toTree());
|
|
22
22
|
const answerTree = rational.add(rational2).toTree();
|
|
23
23
|
const question: Question = {
|
|
24
|
-
|
|
24
|
+
startStatement: latexParser(statementTree),
|
|
25
25
|
answer: latexParser(answerTree),
|
|
26
26
|
};
|
|
27
27
|
return question;
|
|
@@ -17,7 +17,7 @@ export const simplifyFraction: Exercise = {
|
|
|
17
17
|
export function getSimplifyFraction(): Question {
|
|
18
18
|
const rational = RationalConstructor.randomSimplifiable(10);
|
|
19
19
|
const question: Question = {
|
|
20
|
-
|
|
20
|
+
startStatement: latexParser(rational.toTree()),
|
|
21
21
|
answer: latexParser(rational.simplify().toTree()),
|
|
22
22
|
};
|
|
23
23
|
return question;
|
|
@@ -61,7 +61,7 @@ export function getRoundQuestions(precisionAsked: number = 0): Question {
|
|
|
61
61
|
const precision = randint(precisionAsked + 1, precisionAsked + 5);
|
|
62
62
|
const dec = DecimalConstructor.random(0, 1000, precision);
|
|
63
63
|
const question: Question = {
|
|
64
|
-
|
|
64
|
+
startStatement: latexParser(dec.toTree()),
|
|
65
65
|
answer: latexParser(dec.round(precisionAsked).toTree()),
|
|
66
66
|
};
|
|
67
67
|
return question;
|
|
@@ -27,7 +27,7 @@ export function getDoubleDistributivityQuestion(): Question {
|
|
|
27
27
|
const answerTree = affines[0].multiply(affines[1]).toTree();
|
|
28
28
|
|
|
29
29
|
return {
|
|
30
|
-
|
|
30
|
+
startStatement: latexParser(statementTree),
|
|
31
31
|
answer: latexParser(answerTree),
|
|
32
32
|
};
|
|
33
33
|
}
|
|
@@ -27,7 +27,7 @@ export function getFirstIdentityQuestion(): Question {
|
|
|
27
27
|
const answerTree = affine.multiply(affine).toTree();
|
|
28
28
|
|
|
29
29
|
return {
|
|
30
|
-
|
|
30
|
+
startStatement: latexParser(statementTree),
|
|
31
31
|
answer: latexParser(answerTree),
|
|
32
32
|
};
|
|
33
33
|
}
|
|
@@ -29,7 +29,7 @@ export function getSecondIdentityQuestion(): Question {
|
|
|
29
29
|
const answerTree = affine.multiply(affine).toTree();
|
|
30
30
|
|
|
31
31
|
return {
|
|
32
|
-
|
|
32
|
+
startStatement: latexParser(statementTree),
|
|
33
33
|
answer: latexParser(answerTree),
|
|
34
34
|
};
|
|
35
35
|
}
|
|
@@ -27,7 +27,7 @@ export function getSimpleDistributivityQuestion(): Question {
|
|
|
27
27
|
const statementTree = new MultiplyNode(new NumberNode(coeff.value), affine.toTree());
|
|
28
28
|
const answerTree = affine.times(coeff.value).toTree();
|
|
29
29
|
return {
|
|
30
|
-
|
|
30
|
+
startStatement: latexParser(statementTree),
|
|
31
31
|
answer: latexParser(answerTree),
|
|
32
32
|
};
|
|
33
33
|
}
|
|
@@ -28,7 +28,7 @@ export function getThirdIdentityQuestion(): Question {
|
|
|
28
28
|
const answerTree = affine.multiply(affine2).toTree();
|
|
29
29
|
|
|
30
30
|
return {
|
|
31
|
-
|
|
31
|
+
startStatement: latexParser(statementTree),
|
|
32
32
|
answer: latexParser(answerTree),
|
|
33
33
|
};
|
|
34
34
|
}
|
|
@@ -31,7 +31,7 @@ export function getEquationType1ExerciseQuestion(): Question {
|
|
|
31
31
|
const tree = new EqualNode(affine, b.toTree());
|
|
32
32
|
|
|
33
33
|
const question: Question = {
|
|
34
|
-
|
|
34
|
+
startStatement: latexParser(tree),
|
|
35
35
|
answer: `x = ${solution}`,
|
|
36
36
|
};
|
|
37
37
|
return question;
|
|
@@ -34,7 +34,7 @@ export function getEquationType2ExerciseQuestion(): Question {
|
|
|
34
34
|
const tree = new EqualNode(affine, b.toTree());
|
|
35
35
|
const answer = new EqualNode(new VariableNode("x"), solution.toTree());
|
|
36
36
|
const question: Question = {
|
|
37
|
-
|
|
37
|
+
startStatement: latexParser(tree),
|
|
38
38
|
answer: latexParser(answer),
|
|
39
39
|
};
|
|
40
40
|
return question;
|
|
@@ -36,7 +36,7 @@ export function getEquationType3ExerciseQuestion(): Question {
|
|
|
36
36
|
const statementTree = new EqualNode(affine, c.toTree());
|
|
37
37
|
const answerTree = new EqualNode(new VariableNode("x"), solution.toTree());
|
|
38
38
|
const question: Question = {
|
|
39
|
-
|
|
39
|
+
startStatement: latexParser(statementTree),
|
|
40
40
|
answer: latexParser(answerTree),
|
|
41
41
|
};
|
|
42
42
|
return question;
|
|
@@ -39,7 +39,7 @@ export function getEquationType4ExerciseQuestion(): Question {
|
|
|
39
39
|
const statementTree = new EqualNode(affines[0].toTree(), affines[1].toTree());
|
|
40
40
|
const answerTree = new EqualNode(new VariableNode("x"), solution.toTree());
|
|
41
41
|
const question: Question = {
|
|
42
|
-
|
|
42
|
+
startStatement: latexParser(statementTree),
|
|
43
43
|
answer: latexParser(answerTree),
|
|
44
44
|
};
|
|
45
45
|
return question;
|
|
@@ -26,6 +26,12 @@ import { powersOfTenProduct, powersProduct } from "./powers/powersProduct";
|
|
|
26
26
|
import { scientificToDecimal } from "./powers/scientificToDecimal";
|
|
27
27
|
import { simplifySquareRoot } from "./squareRoots/simpifySquareRoot";
|
|
28
28
|
|
|
29
|
+
export const data = [
|
|
30
|
+
{
|
|
31
|
+
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
|
|
29
35
|
export const exercises = [
|
|
30
36
|
/**
|
|
31
37
|
* calcul litteral
|
|
@@ -44,7 +44,7 @@ export function getPowersDivisionQuestion(useOnlyPowersOfTen: boolean = false):
|
|
|
44
44
|
const answerTree = new Power(a, b - c).simplify();
|
|
45
45
|
|
|
46
46
|
const question: Question = {
|
|
47
|
-
|
|
47
|
+
startStatement: latexParser(statement),
|
|
48
48
|
answer: latexParser(answerTree),
|
|
49
49
|
};
|
|
50
50
|
return question;
|
|
@@ -30,7 +30,7 @@ export function getPowersOfTenDivisionQuestion(): Question {
|
|
|
30
30
|
const answerTree = new Power(10, randPower).toDecimalWriting().toTree();
|
|
31
31
|
|
|
32
32
|
const question: Question = {
|
|
33
|
-
|
|
33
|
+
startStatement: latexParser(statement),
|
|
34
34
|
answer: latexParser(answerTree),
|
|
35
35
|
};
|
|
36
36
|
return question;
|
|
@@ -48,7 +48,7 @@ export function getPowersPowerQuestion(useOnlyPowersOfTen: boolean = false): Que
|
|
|
48
48
|
let answerTree = new Power(a, b * c).simplify();
|
|
49
49
|
|
|
50
50
|
const question: Question = {
|
|
51
|
-
|
|
51
|
+
startStatement: latexParser(statement),
|
|
52
52
|
answer: latexParser(answerTree),
|
|
53
53
|
};
|
|
54
54
|
return question;
|
|
@@ -44,7 +44,7 @@ export function getPowersProductQuestion(useOnlyPowersOfTen: boolean = false): Q
|
|
|
44
44
|
const answerTree = new Power(a, b + c).simplify();
|
|
45
45
|
|
|
46
46
|
const question: Question = {
|
|
47
|
-
|
|
47
|
+
startStatement: latexParser(statement),
|
|
48
48
|
answer: latexParser(answerTree),
|
|
49
49
|
};
|
|
50
50
|
return question;
|
|
@@ -37,7 +37,7 @@ export function getScientificToDecimalQuestion(): Question {
|
|
|
37
37
|
const answerTree = randDecimal.multiplyByPowerOfTen(randPower).toTree();
|
|
38
38
|
|
|
39
39
|
const question: Question = {
|
|
40
|
-
|
|
40
|
+
startStatement: latexParser(statement),
|
|
41
41
|
answer: latexParser(answerTree),
|
|
42
42
|
};
|
|
43
43
|
return question;
|
|
@@ -20,7 +20,7 @@ export function getSimplifySquareRoot(): Question {
|
|
|
20
20
|
maxSquare: 11,
|
|
21
21
|
});
|
|
22
22
|
const question: Question = {
|
|
23
|
-
|
|
23
|
+
startStatement: latexParser(squareRoot.toTree()),
|
|
24
24
|
answer: latexParser(squareRoot.simplify().toTree()),
|
|
25
25
|
};
|
|
26
26
|
return question;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { Question } from "../exercise";
|
|
2
|
-
export const getDistinctQuestions = (
|
|
3
|
-
generator: Function,
|
|
4
|
-
nb: number
|
|
5
|
-
): Question[] => {
|
|
2
|
+
export const getDistinctQuestions = (generator: Function, nb: number): Question[] => {
|
|
6
3
|
const res: Question[] = [];
|
|
7
4
|
|
|
8
5
|
for (let i = 0; i < nb; i++) {
|
|
@@ -10,7 +7,7 @@ export const getDistinctQuestions = (
|
|
|
10
7
|
|
|
11
8
|
do {
|
|
12
9
|
question = generator();
|
|
13
|
-
} while (res.some((q) => q.
|
|
10
|
+
} while (res.some((q) => q.startStatement === question.startStatement));
|
|
14
11
|
res.push(question);
|
|
15
12
|
}
|
|
16
13
|
return res;
|