math-exercises 1.4.14 → 1.4.16
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/arithmetics/paritySumsAndProducts.d.ts +4 -0
- package/lib/exercises/calcul/arithmetics/paritySumsAndProducts.d.ts.map +1 -0
- package/lib/exercises/calcul/arithmetics/paritySumsAndProducts.js +113 -0
- package/lib/exercises/calcul/arithmetics/primeNumbers.js +1 -1
- package/lib/exercises/calcul/fractions/fractionToPercentToDecimal.js +1 -1
- package/lib/exercises/calcul/mentalCaluls.ts/mentalAddAndSub.js +1 -1
- package/lib/exercises/calcul/mentalCaluls.ts/mentalDivisions.js +1 -1
- package/lib/exercises/calcul/mentalCaluls.ts/mentalMultiplications.js +1 -1
- package/lib/exercises/calcul/mentalCaluls.ts/mentalPercentage.js +1 -1
- package/lib/exercises/calculLitteral/equation/equationSimpleSquare.js +1 -1
- package/lib/exercises/calculLitteral/equation/firstDegreeEquation.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/firstDegreeEquation.js +2 -1
- package/lib/exercises/calculLitteral/equation/fractionEquation.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/fractionEquation.js +2 -3
- package/lib/exercises/calculLitteral/equation/logEquation.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/logEquation.js +2 -1
- package/lib/exercises/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/multiplicationEquation.js +6 -2
- package/lib/exercises/combinatory/anagrams.d.ts +4 -0
- package/lib/exercises/combinatory/anagrams.d.ts.map +1 -0
- package/lib/exercises/combinatory/anagrams.js +128 -0
- package/lib/exercises/combinatory/ballsCounting.d.ts +4 -0
- package/lib/exercises/combinatory/ballsCounting.d.ts.map +1 -0
- package/lib/exercises/combinatory/ballsCounting.js +124 -0
- package/lib/exercises/combinatory/diceCounting.d.ts +4 -0
- package/lib/exercises/combinatory/diceCounting.d.ts.map +1 -0
- package/lib/exercises/combinatory/diceCounting.js +134 -0
- package/lib/exercises/conversion/aeraConversion.d.ts.map +1 -1
- package/lib/exercises/conversion/aeraConversion.js +1 -1
- package/lib/exercises/conversion/capacityConversion.d.ts.map +1 -1
- package/lib/exercises/conversion/capacityConversion.js +1 -1
- package/lib/exercises/conversion/lengthConversion.d.ts.map +1 -1
- package/lib/exercises/conversion/lengthConversion.js +1 -1
- package/lib/exercises/conversion/massConversion.d.ts.map +1 -1
- package/lib/exercises/conversion/massConversion.js +1 -1
- package/lib/exercises/conversion/volumeCapacityConversion.js +1 -1
- package/lib/exercises/conversion/volumeConversion.d.ts.map +1 -1
- package/lib/exercises/conversion/volumeConversion.js +1 -1
- package/lib/exercises/derivation/derivative/inverseFunctionDerivative.js +1 -1
- package/lib/exercises/derivation/derivative/rootFunctionDerivative.js +2 -2
- package/lib/exercises/derivation/derivative/secondDegreeDerivative.js +1 -1
- package/lib/exercises/derivation/derivative/thirdDegreeDerivative.js +3 -2
- package/lib/exercises/exercise.d.ts +1 -1
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/exercises.d.ts.map +1 -1
- package/lib/exercises/exercises.js +39 -26
- package/lib/exercises/functions/affines/leadingCoefficientCalculV1.d.ts.map +1 -1
- package/lib/exercises/functions/affines/leadingCoefficientCalculV1.js +2 -1
- package/lib/exercises/functions/affines/leadingCoefficientCalculV2.d.ts.map +1 -1
- package/lib/exercises/functions/affines/leadingCoefficientCalculV2.js +4 -2
- package/lib/exercises/functions/basics/inverseImageFunction.js +1 -1
- package/lib/exercises/functions/basics/inverseImageFunctionGeogebra.js +2 -2
- package/lib/exercises/functions/cube/cubicEquation.js +1 -1
- package/lib/exercises/geometry/cartesian/midpoint.js +1 -1
- package/lib/exercises/geometry/euclidean/circleArea.js +1 -1
- package/lib/exercises/geometry/euclidean/circleCircumference.js +1 -1
- package/lib/exercises/geometry/euclidean/rightTriangleArea.js +1 -1
- package/lib/exercises/geometry/euclidean/thales.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/thales.js +1 -3
- package/lib/exercises/geometry/euclidean/triangleArea.js +1 -1
- package/lib/exercises/geometry/euclidean/trigonometrySideCalcul.js +1 -1
- package/lib/exercises/geometry/vectors/coordinatesReading.d.ts +4 -0
- package/lib/exercises/geometry/vectors/coordinatesReading.d.ts.map +1 -0
- package/lib/exercises/geometry/vectors/coordinatesReading.js +81 -0
- package/lib/exercises/percent/applyPercent.js +8 -7
- package/lib/exercises/percent/averageEvolutionRate.js +1 -1
- package/lib/exercises/percent/globalPercent.js +1 -1
- package/lib/exercises/percent/reciprocalPercentage.js +1 -1
- package/lib/exercises/powers/powersOfTenToDecimal.js +1 -1
- package/lib/exercises/primitve/logarithmePrimitive.js +1 -1
- package/lib/exercises/primitve/polynomialPrimitive.d.ts.map +1 -1
- package/lib/exercises/primitve/polynomialPrimitive.js +12 -4
- package/lib/exercises/probaStat/averageWithTable.js +1 -1
- package/lib/exercises/probaStat/cardBasicProbas.d.ts.map +1 -1
- package/lib/exercises/probaStat/cardBasicProbas.js +0 -1
- package/lib/exercises/probaStat/conditionalProbability.js +1 -1
- package/lib/exercises/probaStat/median.js +1 -1
- package/lib/exercises/probaStat/medianList.js +1 -1
- package/lib/exercises/sets/setBelonging.js +1 -1
- package/lib/exercises/squareRoots/squareRootEquation.js +1 -1
- package/lib/exercises/utils/geogebra/getAdaptedCoords.d.ts +1 -0
- package/lib/exercises/utils/geogebra/getAdaptedCoords.d.ts.map +1 -0
- package/lib/exercises/utils/geogebra/getAdaptedCoords.js +1 -0
- package/lib/math/complex/complex.d.ts +1 -1
- package/lib/math/complex/complex.d.ts.map +1 -1
- package/lib/math/complex/complex.js +9 -0
- package/lib/tree/nodes/numbers/numberNode.js +3 -3
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paritySumsAndProducts.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calcul/arithmetics/paritySumsAndProducts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,YAAY,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAM7F,eAAO,MAAM,qBAAqB,EAAE,YAanC,CAAC;AAEF,wBAAgB,gCAAgC,IAAI,QAAQ,CA8F3D"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getParitySumsAndProductsQuestion = exports.paritySumsAndProducts = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
6
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
7
|
+
const uuid_1 = require("uuid");
|
|
8
|
+
exports.paritySumsAndProducts = {
|
|
9
|
+
id: 'paritySumsAndProducts',
|
|
10
|
+
connector: '=',
|
|
11
|
+
instruction: '',
|
|
12
|
+
label: 'Parité de sommes et de produits',
|
|
13
|
+
levels: ['2nde'],
|
|
14
|
+
isSingleStep: true,
|
|
15
|
+
sections: ['Arithmétique'],
|
|
16
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getParitySumsAndProductsQuestion, nb, 12),
|
|
17
|
+
qcmTimer: 60,
|
|
18
|
+
freeTimer: 60,
|
|
19
|
+
answerType: 'QCM',
|
|
20
|
+
maxAllowedQuestions: 12,
|
|
21
|
+
};
|
|
22
|
+
function getParitySumsAndProductsQuestion() {
|
|
23
|
+
const type = (0, randint_1.randint)(0, 12);
|
|
24
|
+
let instruction = '';
|
|
25
|
+
let answer;
|
|
26
|
+
switch (type) {
|
|
27
|
+
case 0:
|
|
28
|
+
instruction = 'La somme de deux nombres pairs est un nombre...';
|
|
29
|
+
answer = 'Pair';
|
|
30
|
+
break;
|
|
31
|
+
case 1:
|
|
32
|
+
instruction = 'La somme de deux nombres impairs est un nombre...';
|
|
33
|
+
answer = 'Pair';
|
|
34
|
+
break;
|
|
35
|
+
case 2:
|
|
36
|
+
instruction = "La somme d'un nombre pair et d'un nombre impair un nombre...";
|
|
37
|
+
answer = 'Impair';
|
|
38
|
+
break;
|
|
39
|
+
case 3:
|
|
40
|
+
instruction = 'La somme de trois nombres impairs est un nombre...';
|
|
41
|
+
answer = 'Impair';
|
|
42
|
+
break;
|
|
43
|
+
case 4:
|
|
44
|
+
instruction = 'La somme de trois nombres consécutifs est un nombre...';
|
|
45
|
+
answer = 'Parfois pair, parfois impair';
|
|
46
|
+
break;
|
|
47
|
+
case 5:
|
|
48
|
+
instruction = 'La somme de quatre nombres consécutifs est un nombre...';
|
|
49
|
+
answer = 'Pair';
|
|
50
|
+
break;
|
|
51
|
+
case 6:
|
|
52
|
+
instruction = 'Le produit de deux nombres pairs est un nombre...';
|
|
53
|
+
answer = 'Pair';
|
|
54
|
+
break;
|
|
55
|
+
case 7:
|
|
56
|
+
instruction = 'Le produit de deux nombres impairs est un nombre...';
|
|
57
|
+
answer = 'Impair';
|
|
58
|
+
break;
|
|
59
|
+
case 8:
|
|
60
|
+
instruction = "Le produit d'un nombre pair et d'un nombre impair est un nombre...";
|
|
61
|
+
answer = 'Pair';
|
|
62
|
+
break;
|
|
63
|
+
case 9:
|
|
64
|
+
instruction = 'Le produit de trois nombres consécutifs est un nombre...';
|
|
65
|
+
answer = 'Pair';
|
|
66
|
+
break;
|
|
67
|
+
case 10:
|
|
68
|
+
instruction = 'Le produit de trois nombres impairs est un nombre...';
|
|
69
|
+
answer = 'Impair';
|
|
70
|
+
break;
|
|
71
|
+
case 11:
|
|
72
|
+
instruction = 'Le produit de trois nombres pairs est un nombre...';
|
|
73
|
+
answer = 'Pair';
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
const getPropositions = (n) => {
|
|
77
|
+
const res = [];
|
|
78
|
+
res.push({
|
|
79
|
+
id: (0, uuid_1.v4)(),
|
|
80
|
+
statement: `Pair`,
|
|
81
|
+
isRightAnswer: answer === 'Pair',
|
|
82
|
+
format: 'raw',
|
|
83
|
+
});
|
|
84
|
+
res.push({
|
|
85
|
+
id: (0, uuid_1.v4)(),
|
|
86
|
+
statement: `Impair`,
|
|
87
|
+
isRightAnswer: answer === 'Impair',
|
|
88
|
+
format: 'raw',
|
|
89
|
+
});
|
|
90
|
+
res.push({
|
|
91
|
+
id: (0, uuid_1.v4)(),
|
|
92
|
+
statement: `Parfois pair, parfois impair`,
|
|
93
|
+
isRightAnswer: answer === 'Parfois pair, parfois impair',
|
|
94
|
+
format: 'raw',
|
|
95
|
+
});
|
|
96
|
+
res.push({
|
|
97
|
+
id: (0, uuid_1.v4)(),
|
|
98
|
+
statement: `Premier`,
|
|
99
|
+
isRightAnswer: answer === 'Premier',
|
|
100
|
+
format: 'raw',
|
|
101
|
+
});
|
|
102
|
+
return (0, shuffle_1.shuffle)(res);
|
|
103
|
+
};
|
|
104
|
+
const question = {
|
|
105
|
+
answer: answer,
|
|
106
|
+
instruction,
|
|
107
|
+
keys: [],
|
|
108
|
+
getPropositions,
|
|
109
|
+
answerFormat: 'raw',
|
|
110
|
+
};
|
|
111
|
+
return question;
|
|
112
|
+
}
|
|
113
|
+
exports.getParitySumsAndProductsQuestion = getParitySumsAndProductsQuestion;
|
|
@@ -42,7 +42,7 @@ function getPrimeNumbers() {
|
|
|
42
42
|
}
|
|
43
43
|
const prod = prodNumbers(choosenNumbers);
|
|
44
44
|
choosenNumbers = choosenNumbers.sort((a, b) => a - b);
|
|
45
|
-
let answer = `${
|
|
45
|
+
let answer = `${choosenNumbers[0]}`;
|
|
46
46
|
for (let i = 1; i < choosenNumbers.length; i++) {
|
|
47
47
|
answer += `\\times` + choosenNumbers[i];
|
|
48
48
|
}
|
|
@@ -72,7 +72,7 @@ function getMentalAddAndSub() {
|
|
|
72
72
|
const question = {
|
|
73
73
|
instruction: `Calculer : $${statementTree.toTex()}$`,
|
|
74
74
|
startStatement: statementTree.toTex(),
|
|
75
|
-
answer: (0, round_1.round)(sum, 2) + '',
|
|
75
|
+
answer: ((0, round_1.round)(sum, 2) + '').replace('.', ','),
|
|
76
76
|
keys: [],
|
|
77
77
|
getPropositions,
|
|
78
78
|
answerFormat: 'tex',
|
|
@@ -89,7 +89,7 @@ function getMentalDivisions() {
|
|
|
89
89
|
const question = {
|
|
90
90
|
instruction: `Calculer : $${statementTree.toTex()}$`,
|
|
91
91
|
startStatement: statementTree.toTex(),
|
|
92
|
-
answer: (0, round_1.round)(answer, 2) + '',
|
|
92
|
+
answer: ((0, round_1.round)(answer, 2) + '').replace('.', ','),
|
|
93
93
|
keys: [],
|
|
94
94
|
getPropositions,
|
|
95
95
|
answerFormat: 'tex',
|
|
@@ -73,7 +73,7 @@ function getMentalMultiplications() {
|
|
|
73
73
|
const question = {
|
|
74
74
|
instruction: `Calculer : $${statementTree.toTex()}$`,
|
|
75
75
|
startStatement: statementTree.toTex(),
|
|
76
|
-
answer: (0, round_1.round)(answer, 2) + '',
|
|
76
|
+
answer: ((0, round_1.round)(answer, 2) + '').replace('.', ','),
|
|
77
77
|
keys: [],
|
|
78
78
|
getPropositions,
|
|
79
79
|
answerFormat: 'tex',
|
|
@@ -127,7 +127,7 @@ function getMentalPercentage() {
|
|
|
127
127
|
};
|
|
128
128
|
const question = {
|
|
129
129
|
instruction: `Calculer : $${String(a).replace('.', ',')}\\%$ de $${b}$.`,
|
|
130
|
-
answer: (a * b) / 100 + '',
|
|
130
|
+
answer: ((a * b) / 100 + '').replace('.', ','),
|
|
131
131
|
keys: [],
|
|
132
132
|
getPropositions,
|
|
133
133
|
answerFormat: 'tex',
|
|
@@ -41,7 +41,7 @@ function getEquationSimpleSquare() {
|
|
|
41
41
|
const instruction = `Résoudre l'équation : $x^2 = ${randNbr}$`;
|
|
42
42
|
const ans = Math.sqrt(randNbr);
|
|
43
43
|
if (randNbr < 0)
|
|
44
|
-
answer = `S=\\
|
|
44
|
+
answer = `S=\\varnothing`;
|
|
45
45
|
else if (ans === Math.floor(ans))
|
|
46
46
|
answer = `S=\\left\\{-${ans};${ans}\\right\\}`;
|
|
47
47
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firstDegreeEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/equation/firstDegreeEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"firstDegreeEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/equation/firstDegreeEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAS/E,eAAO,MAAM,mBAAmB,EAAE,YAYjC,CAAC;AAEF,wBAAgB,sBAAsB,IAAI,QAAQ,CAoDjD"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getFirstDegreeEquation = exports.firstDegreeEquation = void 0;
|
|
4
4
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const rational_1 = require("../../../math/numbers/rationals/rational");
|
|
5
6
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
6
7
|
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
7
8
|
const simplify_1 = require("../../../tree/parsers/simplify");
|
|
@@ -56,7 +57,7 @@ function getFirstDegreeEquation() {
|
|
|
56
57
|
const question = {
|
|
57
58
|
instruction: `Résoudre l'équation suivante : $\\frac{${a}}{x} = ${b}$`,
|
|
58
59
|
startStatement: `x`,
|
|
59
|
-
answer: `x=${
|
|
60
|
+
answer: `x=${new rational_1.Rational(a, b).simplify().toTree().toTex()}`,
|
|
60
61
|
keys: ['x', 'S', 'equal', 'lbrace', 'rbrace', 'semicolon', 'emptyset'],
|
|
61
62
|
getPropositions,
|
|
62
63
|
answerFormat: 'tex',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fractionEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/equation/fractionEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"fractionEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/equation/fractionEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAW/E,eAAO,MAAM,gBAAgB,EAAE,YAY9B,CAAC;AAEF,wBAAgB,mBAAmB,IAAI,QAAQ,CAiE9C"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getFractionEquation = exports.fractionEquation = void 0;
|
|
4
4
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const rational_1 = require("../../../math/numbers/rationals/rational");
|
|
5
6
|
const polynomial_1 = require("../../../math/polynomials/polynomial");
|
|
6
7
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
8
|
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
@@ -30,9 +31,7 @@ function getFractionEquation() {
|
|
|
30
31
|
const d = (0, randint_1.randint)(-9, 10, [0]);
|
|
31
32
|
const polynome1 = new polynomial_1.Polynomial([b, a]);
|
|
32
33
|
const polynome2 = new polynomial_1.Polynomial([d, c]);
|
|
33
|
-
const answer = -d / c === -b / a
|
|
34
|
-
? `S=\\emptyset`
|
|
35
|
-
: `S=\\left\\{${(0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(-b), new numberNode_1.NumberNode(a))).toTex()}\\right\\}`;
|
|
34
|
+
const answer = -d / c === -b / a ? `S=\\emptyset` : `S=\\left\\{${new rational_1.Rational(-b, a).simplify().toTree().toTex()}\\right\\}`;
|
|
36
35
|
const getPropositions = (n) => {
|
|
37
36
|
const res = [];
|
|
38
37
|
res.push({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/equation/logEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"logEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/equation/logEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAe/E,eAAO,MAAM,WAAW,EAAE,YAYzB,CAAC;AAEF,wBAAgB,aAAa,IAAI,QAAQ,CAuDxC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getLnEquation = exports.logEquation = void 0;
|
|
4
4
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const rational_1 = require("../../../math/numbers/rationals/rational");
|
|
5
6
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
6
7
|
const expNode_1 = require("../../../tree/nodes/functions/expNode");
|
|
7
8
|
const logNode_1 = require("../../../tree/nodes/functions/logNode");
|
|
@@ -30,7 +31,7 @@ function getLnEquation() {
|
|
|
30
31
|
const a = (0, randint_1.randint)(-9, 20, [0]);
|
|
31
32
|
const k = (0, randint_1.randint)(-9, 20, [0]);
|
|
32
33
|
const equation = new equalNode_1.EqualNode((0, simplify_1.simplifyNode)(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a), new logNode_1.LogNode(new variableNode_1.VariableNode('x')))), new numberNode_1.NumberNode(k));
|
|
33
|
-
const answer = new expNode_1.ExpNode(
|
|
34
|
+
const answer = new expNode_1.ExpNode(new rational_1.Rational(k, a).simplify().toTree());
|
|
34
35
|
const getPropositions = (numOptions) => {
|
|
35
36
|
const propositions = [];
|
|
36
37
|
propositions.push({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiplicationEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/equation/multiplicationEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"multiplicationEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/equation/multiplicationEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAW/E,eAAO,MAAM,sBAAsB,EAAE,YAYpC,CAAC;AAEF,wBAAgB,yBAAyB,IAAI,QAAQ,CAyEpD"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getMultiplicationEquation = exports.multiplicationEquation = void 0;
|
|
4
4
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const rational_1 = require("../../../math/numbers/rationals/rational");
|
|
5
6
|
const polynomial_1 = require("../../../math/polynomials/polynomial");
|
|
6
7
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
8
|
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
@@ -33,7 +34,10 @@ function getMultiplicationEquation() {
|
|
|
33
34
|
} while (a / c === b / d);
|
|
34
35
|
const polynome1 = new polynomial_1.Polynomial([b, a]);
|
|
35
36
|
const polynome2 = new polynomial_1.Polynomial([d, c]);
|
|
36
|
-
const answer = `S=\\left\\{${
|
|
37
|
+
const answer = `S=\\left\\{${new rational_1.Rational(-b, a).simplify().toTree().toTex()};${new rational_1.Rational(-d, c)
|
|
38
|
+
.simplify()
|
|
39
|
+
.toTree()
|
|
40
|
+
.toTex()}\\right\\}`;
|
|
37
41
|
const getPropositions = (n) => {
|
|
38
42
|
const res = [];
|
|
39
43
|
res.push({
|
|
@@ -70,7 +74,7 @@ function getMultiplicationEquation() {
|
|
|
70
74
|
const question = {
|
|
71
75
|
instruction: `Résoudre : $(${polynome1.toTex()})(${polynome2.toTex()}) = 0$`,
|
|
72
76
|
startStatement: `(${polynome1.toTex()})(${polynome2.toTex()}) = 0`,
|
|
73
|
-
answer
|
|
77
|
+
answer,
|
|
74
78
|
keys: ['x', 'S', 'equal', 'lbrace', 'rbrace', 'semicolon', 'ou'],
|
|
75
79
|
getPropositions,
|
|
76
80
|
answerFormat: 'tex',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anagrams.d.ts","sourceRoot":"","sources":["../../../src/exercises/combinatory/anagrams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,YAAY,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAqEhH,eAAO,MAAM,QAAQ,EAAE,YAWtB,CAAC;AAEF,wBAAgB,mBAAmB,IAAI,QAAQ,CAoD9C"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAnagramsQuestion = exports.anagrams = void 0;
|
|
4
|
+
const exercise_1 = require("../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const randint_1 = require("../../math/utils/random/randint");
|
|
7
|
+
const random_1 = require("../../utils/random");
|
|
8
|
+
const uuid_1 = require("uuid");
|
|
9
|
+
const words = [
|
|
10
|
+
'angle',
|
|
11
|
+
'armoire',
|
|
12
|
+
'banc',
|
|
13
|
+
'bureau',
|
|
14
|
+
'cabinet',
|
|
15
|
+
'carreau',
|
|
16
|
+
'chaise',
|
|
17
|
+
'classe',
|
|
18
|
+
'clé',
|
|
19
|
+
'coin',
|
|
20
|
+
'couloir',
|
|
21
|
+
'dossier',
|
|
22
|
+
'eau',
|
|
23
|
+
'école',
|
|
24
|
+
'écriture',
|
|
25
|
+
'entrée',
|
|
26
|
+
'escalier',
|
|
27
|
+
'étagère',
|
|
28
|
+
'étude',
|
|
29
|
+
'extérieur',
|
|
30
|
+
'fenêtre',
|
|
31
|
+
'intérieur',
|
|
32
|
+
'lavabo',
|
|
33
|
+
'lecture',
|
|
34
|
+
'lit',
|
|
35
|
+
'marche',
|
|
36
|
+
'matelas',
|
|
37
|
+
'maternelle',
|
|
38
|
+
'meuble',
|
|
39
|
+
'mousse',
|
|
40
|
+
'mur',
|
|
41
|
+
'peluche',
|
|
42
|
+
'placard',
|
|
43
|
+
'plafond',
|
|
44
|
+
'porte',
|
|
45
|
+
'portemanteau',
|
|
46
|
+
'poubelle',
|
|
47
|
+
'radiateur',
|
|
48
|
+
'rampe',
|
|
49
|
+
'récréation',
|
|
50
|
+
'rentrée',
|
|
51
|
+
'rideau',
|
|
52
|
+
'robinet',
|
|
53
|
+
'salle',
|
|
54
|
+
'savon',
|
|
55
|
+
'serrure',
|
|
56
|
+
'serviette',
|
|
57
|
+
'siège',
|
|
58
|
+
'sieste',
|
|
59
|
+
'silence',
|
|
60
|
+
'sol',
|
|
61
|
+
'sommeil',
|
|
62
|
+
'sonnette',
|
|
63
|
+
'sortie',
|
|
64
|
+
'table',
|
|
65
|
+
'tableau',
|
|
66
|
+
'tabouret',
|
|
67
|
+
'tapis',
|
|
68
|
+
'tiroir',
|
|
69
|
+
'toilette',
|
|
70
|
+
'vitre',
|
|
71
|
+
];
|
|
72
|
+
exports.anagrams = {
|
|
73
|
+
id: 'anagrams',
|
|
74
|
+
connector: '=',
|
|
75
|
+
instruction: '',
|
|
76
|
+
label: "Compter le nombre d'anagrammes d'un mot",
|
|
77
|
+
levels: ['TermSpé'],
|
|
78
|
+
isSingleStep: true,
|
|
79
|
+
sections: ['Combinatoire et dénombrement'],
|
|
80
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getAnagramsQuestion, nb),
|
|
81
|
+
qcmTimer: 60,
|
|
82
|
+
freeTimer: 60,
|
|
83
|
+
};
|
|
84
|
+
function getAnagramsQuestion() {
|
|
85
|
+
const word = (0, random_1.random)(words);
|
|
86
|
+
const answer = word
|
|
87
|
+
.split('')
|
|
88
|
+
.map((el, index) => index + 1)
|
|
89
|
+
.reduce((acc, curr) => acc * curr, 1);
|
|
90
|
+
const getPropositions = (n) => {
|
|
91
|
+
const res = [];
|
|
92
|
+
res.push({
|
|
93
|
+
id: (0, uuid_1.v4)(),
|
|
94
|
+
statement: answer + ``,
|
|
95
|
+
isRightAnswer: true,
|
|
96
|
+
format: 'tex',
|
|
97
|
+
});
|
|
98
|
+
(0, exercise_1.tryToAddWrongProp)(res, Math.pow(word.length, word.length) + '');
|
|
99
|
+
(0, exercise_1.tryToAddWrongProp)(res, (word.length * (word.length + 1)) / 2 + '');
|
|
100
|
+
(0, exercise_1.tryToAddWrongProp)(res, word.length * word.length + '');
|
|
101
|
+
const missing = n - res.length;
|
|
102
|
+
for (let i = 0; i < missing; i++) {
|
|
103
|
+
let isDuplicate;
|
|
104
|
+
let proposition;
|
|
105
|
+
do {
|
|
106
|
+
const wrongAnswer = (0, randint_1.randint)(1000, 10000);
|
|
107
|
+
proposition = {
|
|
108
|
+
id: (0, uuid_1.v4)() + ``,
|
|
109
|
+
statement: wrongAnswer + '',
|
|
110
|
+
isRightAnswer: false,
|
|
111
|
+
format: 'tex',
|
|
112
|
+
};
|
|
113
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
114
|
+
} while (isDuplicate);
|
|
115
|
+
res.push(proposition);
|
|
116
|
+
}
|
|
117
|
+
return (0, exercise_1.shuffleProps)(res, n);
|
|
118
|
+
};
|
|
119
|
+
const question = {
|
|
120
|
+
answer: answer + '',
|
|
121
|
+
instruction: `Combien d'anagrammes mathématiques du mot ${word} sont possibles ? `,
|
|
122
|
+
keys: [],
|
|
123
|
+
getPropositions,
|
|
124
|
+
answerFormat: 'tex',
|
|
125
|
+
};
|
|
126
|
+
return question;
|
|
127
|
+
}
|
|
128
|
+
exports.getAnagramsQuestion = getAnagramsQuestion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ballsCounting.d.ts","sourceRoot":"","sources":["../../../src/exercises/combinatory/ballsCounting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,YAAY,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAKhH,eAAO,MAAM,aAAa,EAAE,YAW3B,CAAC;AAEF,wBAAgB,wBAAwB,IAAI,QAAQ,CA8GnD"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBallsCountingQuestion = exports.ballsCounting = void 0;
|
|
4
|
+
const exercise_1 = require("../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const randint_1 = require("../../math/utils/random/randint");
|
|
7
|
+
const uuid_1 = require("uuid");
|
|
8
|
+
exports.ballsCounting = {
|
|
9
|
+
id: 'ballsCounting',
|
|
10
|
+
connector: '=',
|
|
11
|
+
instruction: '',
|
|
12
|
+
label: 'Dénombrement avec des boules',
|
|
13
|
+
levels: ['TermSpé'],
|
|
14
|
+
isSingleStep: true,
|
|
15
|
+
sections: ['Combinatoire et dénombrement'],
|
|
16
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getBallsCountingQuestion, nb),
|
|
17
|
+
qcmTimer: 60,
|
|
18
|
+
freeTimer: 60,
|
|
19
|
+
};
|
|
20
|
+
function getBallsCountingQuestion() {
|
|
21
|
+
const type = (0, randint_1.randint)(0, 6);
|
|
22
|
+
let instruction = '';
|
|
23
|
+
let answer = '';
|
|
24
|
+
const blacks = (0, randint_1.randint)(2, 6);
|
|
25
|
+
const greens = (0, randint_1.randint)(2, 6);
|
|
26
|
+
const reds = (0, randint_1.randint)(3, 6);
|
|
27
|
+
const total = blacks + greens + reds;
|
|
28
|
+
switch (type) {
|
|
29
|
+
case 0:
|
|
30
|
+
instruction = ``;
|
|
31
|
+
answer = total * (total - 1) * (total - 2) + '';
|
|
32
|
+
break;
|
|
33
|
+
case 1:
|
|
34
|
+
instruction = `comportant trois boules rouges`;
|
|
35
|
+
answer = reds * (reds - 1) * (reds - 2) + '';
|
|
36
|
+
break;
|
|
37
|
+
case 2:
|
|
38
|
+
instruction = `ne comportant pas de boule noire`;
|
|
39
|
+
answer = (reds + greens) * (reds + greens - 1) * (reds + greens - 2) + '';
|
|
40
|
+
break;
|
|
41
|
+
case 3:
|
|
42
|
+
instruction = `comportant au moins une boule noire`;
|
|
43
|
+
answer = total * (total - 1) * (total - 2) - (reds + greens) * (reds + greens - 1) * (reds + greens - 2) + '';
|
|
44
|
+
break;
|
|
45
|
+
case 4:
|
|
46
|
+
instruction = `comportant trois boules de trois couleurs différentes`;
|
|
47
|
+
answer = 6 * (blacks * greens * reds) + '';
|
|
48
|
+
break;
|
|
49
|
+
case 5:
|
|
50
|
+
instruction = `comportant exactement une boule verte et deux boules noires`;
|
|
51
|
+
answer = 6 * (greens * blacks * (blacks - 1)) + '';
|
|
52
|
+
break;
|
|
53
|
+
case 6:
|
|
54
|
+
instruction = `comportant exactement une boule verte`;
|
|
55
|
+
answer = 6 * greens * (reds + blacks) * (reds + blacks - 1) + '';
|
|
56
|
+
}
|
|
57
|
+
const getPropositions = (n) => {
|
|
58
|
+
const res = [];
|
|
59
|
+
res.push({
|
|
60
|
+
id: (0, uuid_1.v4)(),
|
|
61
|
+
statement: answer,
|
|
62
|
+
isRightAnswer: true,
|
|
63
|
+
format: 'tex',
|
|
64
|
+
});
|
|
65
|
+
switch (type) {
|
|
66
|
+
case 0:
|
|
67
|
+
(0, exercise_1.tryToAddWrongProp)(res, total * total * total + '');
|
|
68
|
+
(0, exercise_1.tryToAddWrongProp)(res, 6 + '');
|
|
69
|
+
break;
|
|
70
|
+
case 1:
|
|
71
|
+
(0, exercise_1.tryToAddWrongProp)(res, reds * reds * reds + '');
|
|
72
|
+
(0, exercise_1.tryToAddWrongProp)(res, 1 + '');
|
|
73
|
+
break;
|
|
74
|
+
case 2:
|
|
75
|
+
(0, exercise_1.tryToAddWrongProp)(res, (reds + greens) * (reds + greens) * (reds + greens) + '');
|
|
76
|
+
(0, exercise_1.tryToAddWrongProp)(res, 6 * blacks * (reds + greens) * (reds + greens - 1) + '');
|
|
77
|
+
break;
|
|
78
|
+
case 3:
|
|
79
|
+
(0, exercise_1.tryToAddWrongProp)(res, (reds + greens) * (reds + greens) * (reds + greens) + '');
|
|
80
|
+
(0, exercise_1.tryToAddWrongProp)(res, 3 * (reds + greens) * (reds + greens - 1) + '');
|
|
81
|
+
break;
|
|
82
|
+
case 4:
|
|
83
|
+
(0, exercise_1.tryToAddWrongProp)(res, blacks * greens * reds + '');
|
|
84
|
+
(0, exercise_1.tryToAddWrongProp)(res, 6 + '');
|
|
85
|
+
break;
|
|
86
|
+
case 5:
|
|
87
|
+
(0, exercise_1.tryToAddWrongProp)(res, 6 * greens * blacks * blacks + '');
|
|
88
|
+
(0, exercise_1.tryToAddWrongProp)(res, 6 + '');
|
|
89
|
+
break;
|
|
90
|
+
case 6:
|
|
91
|
+
(0, exercise_1.tryToAddWrongProp)(res, 6 * (blacks * greens * reds) + '');
|
|
92
|
+
(0, exercise_1.tryToAddWrongProp)(res, greens * (reds + blacks) * (reds + blacks - 1) + '');
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
const missing = n - res.length;
|
|
96
|
+
for (let i = 0; i < missing; i++) {
|
|
97
|
+
let isDuplicate;
|
|
98
|
+
let proposition;
|
|
99
|
+
do {
|
|
100
|
+
const wrongAnswer = (0, randint_1.randint)(1, 100) + '';
|
|
101
|
+
proposition = {
|
|
102
|
+
id: (0, uuid_1.v4)() + ``,
|
|
103
|
+
statement: wrongAnswer,
|
|
104
|
+
isRightAnswer: false,
|
|
105
|
+
format: 'tex',
|
|
106
|
+
};
|
|
107
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
108
|
+
} while (isDuplicate);
|
|
109
|
+
res.push(proposition);
|
|
110
|
+
}
|
|
111
|
+
return (0, exercise_1.shuffleProps)(res, n);
|
|
112
|
+
};
|
|
113
|
+
const question = {
|
|
114
|
+
answer: answer,
|
|
115
|
+
instruction: `Une urne contient ${blacks} boules noires numérotées de 1 à ${blacks}, ${reds} boules rouges numérotées de 1 à ${reds} et ${greens} boules vertes numérotées de 1 à ${greens}.
|
|
116
|
+
On tire successivement et sans remise 3 boules dans l'urne.
|
|
117
|
+
Combien de tirages ${instruction} sont possibles ?`,
|
|
118
|
+
keys: [],
|
|
119
|
+
getPropositions,
|
|
120
|
+
answerFormat: 'tex',
|
|
121
|
+
};
|
|
122
|
+
return question;
|
|
123
|
+
}
|
|
124
|
+
exports.getBallsCountingQuestion = getBallsCountingQuestion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diceCounting.d.ts","sourceRoot":"","sources":["../../../src/exercises/combinatory/diceCounting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,YAAY,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAKhH,eAAO,MAAM,YAAY,EAAE,YAW1B,CAAC;AAEF,wBAAgB,uBAAuB,IAAI,QAAQ,CAwHlD"}
|