math-exercises 1.3.40 → 1.3.41
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/primeNumbers.js +1 -1
- package/lib/exercises/calcul/proportionality/proportionalityTable.d.ts.map +1 -1
- package/lib/exercises/calcul/proportionality/proportionalityTable.js +11 -9
- package/lib/exercises/calculLitteral/equation/equationSimpleSquare.js +1 -1
- package/lib/exercises/calculLitteral/simplifying/evaluateExpression.d.ts +4 -0
- package/lib/exercises/calculLitteral/simplifying/evaluateExpression.d.ts.map +1 -0
- package/lib/exercises/calculLitteral/simplifying/evaluateExpression.js +61 -0
- package/lib/exercises/calculLitteral/simplifying/reduceExpression.js +1 -1
- package/lib/exercises/exercises.js +1 -1
- package/lib/exercises/geometry/cartesian/distanceBetweenTwoPoints.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proportionalityTable.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calcul/proportionality/proportionalityTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAM3E,eAAO,MAAM,oBAAoB,EAAE,QAUlC,CAAC;AAEF,wBAAgB,uBAAuB,IAAI,QAAQ,
|
|
1
|
+
{"version":3,"file":"proportionalityTable.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calcul/proportionality/proportionalityTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAM3E,eAAO,MAAM,oBAAoB,EAAE,QAUlC,CAAC;AAEF,wBAAgB,uBAAuB,IAAI,QAAQ,CAsElD"}
|
|
@@ -9,12 +9,12 @@ exports.proportionalityTable = {
|
|
|
9
9
|
id: 'proportionalityTable',
|
|
10
10
|
connector: '=',
|
|
11
11
|
instruction: '',
|
|
12
|
-
label: '
|
|
13
|
-
levels: ['
|
|
12
|
+
label: 'Calcul dans un tableau de proportionnalité',
|
|
13
|
+
levels: ['5', '4', '3'],
|
|
14
14
|
isSingleStep: false,
|
|
15
|
-
section: '
|
|
15
|
+
section: 'Proportionnalité',
|
|
16
16
|
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getProportionalityTable, nb),
|
|
17
|
-
keys: [
|
|
17
|
+
keys: [],
|
|
18
18
|
};
|
|
19
19
|
function getProportionalityTable() {
|
|
20
20
|
const fact = (0, randint_1.randint)(2, 10);
|
|
@@ -65,12 +65,14 @@ function getProportionalityTable() {
|
|
|
65
65
|
const question = {
|
|
66
66
|
instruction: `On considère le tableau de proportionnalité suivant :
|
|
67
67
|
|
|
68
|
-
| |
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
| | |
|
|
69
|
+
|-|-|
|
|
70
|
+
|${x1}|${x3}|
|
|
71
|
+
|${x2}|${x4}|
|
|
72
|
+
|
|
73
|
+
Déterminer le nombre manquant.`,
|
|
72
74
|
answer: answer + '',
|
|
73
|
-
keys: [
|
|
75
|
+
keys: [],
|
|
74
76
|
getPropositions,
|
|
75
77
|
};
|
|
76
78
|
return question;
|
|
@@ -10,7 +10,7 @@ exports.equationSimpleSquare = {
|
|
|
10
10
|
id: 'equationSimpleSquare',
|
|
11
11
|
connector: '=',
|
|
12
12
|
instruction: '',
|
|
13
|
-
label: 'Résoudre une équation du second degré du type x
|
|
13
|
+
label: 'Résoudre une équation du second degré du type $x^2 = a$',
|
|
14
14
|
levels: ['2', '1'],
|
|
15
15
|
section: 'Équations',
|
|
16
16
|
isSingleStep: false,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evaluateExpression.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/simplifying/evaluateExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAQ3E,eAAO,MAAM,kBAAkB,EAAE,QAUhC,CAAC;AAEF,wBAAgB,qBAAqB,IAAI,QAAQ,CAiDhD"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getEvaluateExpression = exports.evaluateExpression = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const polynomial_1 = require("../../../math/polynomials/polynomial");
|
|
6
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
|
+
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
8
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
9
|
+
const uuid_1 = require("uuid");
|
|
10
|
+
exports.evaluateExpression = {
|
|
11
|
+
id: 'evaluateExpression',
|
|
12
|
+
connector: '=',
|
|
13
|
+
instruction: '',
|
|
14
|
+
label: 'Evaluer une expression',
|
|
15
|
+
levels: ['4', '3', '2'],
|
|
16
|
+
section: 'Calcul littéral',
|
|
17
|
+
isSingleStep: true,
|
|
18
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getEvaluateExpression, nb),
|
|
19
|
+
keys: ['x'],
|
|
20
|
+
};
|
|
21
|
+
function getEvaluateExpression() {
|
|
22
|
+
const rand = (0, coinFlip_1.coinFlip)();
|
|
23
|
+
const polynome1 = new polynomial_1.Polynomial([(0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-5, 6, [0])]);
|
|
24
|
+
const polynome2 = new polynomial_1.Polynomial([(0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-4, 5, [0])]);
|
|
25
|
+
const xValue = (0, randint_1.randint)(-9, 10);
|
|
26
|
+
const statement = rand
|
|
27
|
+
? `Calculer $${polynome1.toTree().toTex()}$ pour $x = ${xValue}$`
|
|
28
|
+
: `Calculer $${polynome2.toTree().toTex()}$ pour $x = ${xValue}$`;
|
|
29
|
+
const answer = rand ? polynome1.calculate(xValue) : polynome2.calculate(xValue);
|
|
30
|
+
const getPropositions = (n) => {
|
|
31
|
+
const res = [];
|
|
32
|
+
res.push({
|
|
33
|
+
id: (0, uuid_1.v4)() + '',
|
|
34
|
+
statement: answer + '',
|
|
35
|
+
isRightAnswer: true,
|
|
36
|
+
});
|
|
37
|
+
for (let i = 0; i < n - 1; i++) {
|
|
38
|
+
let isDuplicate;
|
|
39
|
+
let proposition;
|
|
40
|
+
do {
|
|
41
|
+
const wrongAnswer = answer + (0, randint_1.randint)(-10, 11, [0]);
|
|
42
|
+
proposition = {
|
|
43
|
+
id: (0, uuid_1.v4)() + '',
|
|
44
|
+
statement: wrongAnswer + '',
|
|
45
|
+
isRightAnswer: false,
|
|
46
|
+
};
|
|
47
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
48
|
+
} while (isDuplicate);
|
|
49
|
+
res.push(proposition);
|
|
50
|
+
}
|
|
51
|
+
return (0, shuffle_1.shuffle)(res);
|
|
52
|
+
};
|
|
53
|
+
const question = {
|
|
54
|
+
instruction: statement,
|
|
55
|
+
answer: answer + '',
|
|
56
|
+
keys: ['x'],
|
|
57
|
+
getPropositions,
|
|
58
|
+
};
|
|
59
|
+
return question;
|
|
60
|
+
}
|
|
61
|
+
exports.getEvaluateExpression = getEvaluateExpression;
|
|
@@ -13,7 +13,7 @@ exports.reduceExpression = {
|
|
|
13
13
|
instruction: "Réduire l'expression suivante :",
|
|
14
14
|
isSingleStep: false,
|
|
15
15
|
label: 'Réduire une expression',
|
|
16
|
-
levels: ['3', '2'],
|
|
16
|
+
levels: ['4', '3', '2'],
|
|
17
17
|
section: 'Calcul littéral',
|
|
18
18
|
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getReduceExpression, nb),
|
|
19
19
|
keys: ['x'],
|
|
@@ -100,7 +100,7 @@ const circleCircumference_1 = require("./geometry/euclidean/circleCircumference"
|
|
|
100
100
|
const triangleArea_1 = require("./geometry/euclidean/triangleArea");
|
|
101
101
|
const distanceBetweenTwoPoints_1 = require("./geometry/cartesian/distanceBetweenTwoPoints");
|
|
102
102
|
const reduceExpression_1 = require("./calculLitteral/simplifying/reduceExpression");
|
|
103
|
-
const evaluateExpression_1 = require("./calculLitteral/
|
|
103
|
+
const evaluateExpression_1 = require("./calculLitteral/simplifying/evaluateExpression");
|
|
104
104
|
const proportionalityTable_1 = require("./calcul/proportionality/proportionalityTable");
|
|
105
105
|
exports.exercises = [
|
|
106
106
|
/**
|
|
@@ -90,7 +90,7 @@ function getDistanceBetweenTwoPoints() {
|
|
|
90
90
|
return (0, shuffle_1.shuffle)(res);
|
|
91
91
|
};
|
|
92
92
|
const question = {
|
|
93
|
-
instruction: `Soit $${A.toTexWithCoords()}$ et $${B.toTexWithCoords()}$. Calculer la distance AB
|
|
93
|
+
instruction: `Soit $${A.toTexWithCoords()}$ et $${B.toTexWithCoords()}$. Calculer la distance $AB$.`,
|
|
94
94
|
startStatement: 'AB',
|
|
95
95
|
answer,
|
|
96
96
|
keys: [],
|