math-exercises 1.3.57 → 1.3.59
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/calculLitteral/inequations/firstDegreeInequationsType0.d.ts +4 -0
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType0.d.ts.map +1 -0
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType0.js +69 -0
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType1.d.ts +4 -0
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType1.d.ts.map +1 -0
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType1.js +70 -0
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType2.d.ts +4 -0
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType2.d.ts.map +1 -0
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType2.js +70 -0
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType3.d.ts +4 -0
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType3.d.ts.map +1 -0
- package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType3.js +71 -0
- package/lib/exercises/exercise.d.ts +2 -1
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/exercises.d.ts.map +1 -1
- package/lib/exercises/exercises.js +71 -32
- package/lib/exercises/functions/cube/cubicEquation.d.ts +4 -0
- package/lib/exercises/functions/cube/cubicEquation.d.ts.map +1 -0
- package/lib/exercises/functions/cube/cubicEquation.js +65 -0
- package/lib/exercises/functions/trinoms/deltaTrinom.d.ts +4 -0
- package/lib/exercises/functions/trinoms/deltaTrinom.d.ts.map +1 -0
- package/lib/exercises/functions/trinoms/deltaTrinom.js +73 -0
- package/lib/exercises/functions/trinoms/extremumTypeFromAlgebricForm.d.ts.map +1 -1
- package/lib/exercises/functions/trinoms/extremumTypeFromAlgebricForm.js +1 -0
- package/lib/exercises/functions/trinoms/rootsFromDevForm.d.ts +4 -0
- package/lib/exercises/functions/trinoms/rootsFromDevForm.d.ts.map +1 -0
- package/lib/exercises/functions/trinoms/rootsFromDevForm.js +56 -0
- package/lib/exercises/functions/trinoms/rootsFromFactorizedForm.d.ts +4 -0
- package/lib/exercises/functions/trinoms/rootsFromFactorizedForm.d.ts.map +1 -0
- package/lib/exercises/functions/trinoms/rootsFromFactorizedForm.js +92 -0
- package/lib/exercises/geometry/vectors/chasles.d.ts +4 -0
- package/lib/exercises/geometry/vectors/chasles.d.ts.map +1 -0
- package/lib/exercises/geometry/vectors/chasles.js +72 -0
- package/lib/exercises/geometry/vectors/determinant.d.ts +4 -0
- package/lib/exercises/geometry/vectors/determinant.d.ts.map +1 -0
- package/lib/exercises/geometry/vectors/determinant.js +67 -0
- package/lib/exercises/sets/intervalsUnion.d.ts +4 -0
- package/lib/exercises/sets/intervalsUnion.d.ts.map +1 -0
- package/lib/exercises/sets/intervalsUnion.js +53 -0
- package/lib/exercises/squareRoots/squareRootEquation.d.ts +4 -0
- package/lib/exercises/squareRoots/squareRootEquation.d.ts.map +1 -0
- package/lib/exercises/squareRoots/squareRootEquation.js +70 -0
- package/lib/math/geometry/vector.d.ts +2 -0
- package/lib/math/geometry/vector.d.ts.map +1 -1
- package/lib/math/geometry/vector.js +8 -0
- package/lib/math/polynomials/trinom.d.ts +5 -0
- package/lib/math/polynomials/trinom.d.ts.map +1 -1
- package/lib/math/polynomials/trinom.js +45 -0
- package/lib/math/sets/intervals/intervals.d.ts.map +1 -1
- package/lib/tree/nodes/functions/oppositeNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/oppositeNode.js +3 -0
- package/lib/tree/nodes/functions/sqrtNode.js +1 -1
- package/lib/tree/parsers/simplify.js +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"firstDegreeInequationsType0.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/inequations/firstDegreeInequationsType0.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAY3E,eAAO,MAAM,2BAA2B,EAAE,QASzC,CAAC;AAEF,wBAAgB,iCAAiC,IAAI,QAAQ,CAyD5D"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFirstDegreeInequationsQuestion = exports.firstDegreeInequationsType0 = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const affine_1 = require("../../../math/polynomials/affine");
|
|
6
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
|
+
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
8
|
+
const random_1 = require("../../../utils/random");
|
|
9
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
10
|
+
const uuid_1 = require("uuid");
|
|
11
|
+
exports.firstDegreeInequationsType0 = {
|
|
12
|
+
id: 'firstDegreeInequationsType0',
|
|
13
|
+
connector: '\\iff',
|
|
14
|
+
instruction: '',
|
|
15
|
+
label: 'Résoudre une inéquation du type $x+b<c$',
|
|
16
|
+
levels: ['3ème', '2ndPro', '2nde', '1reESM', '1rePro', '1reTech'],
|
|
17
|
+
isSingleStep: true,
|
|
18
|
+
sections: ['Inéquations'],
|
|
19
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getFirstDegreeInequationsQuestion, nb),
|
|
20
|
+
};
|
|
21
|
+
function getFirstDegreeInequationsQuestion() {
|
|
22
|
+
const affine = new affine_1.Affine(1, (0, randint_1.randint)(-10, 11));
|
|
23
|
+
const c = (0, randint_1.randint)(-10, 11);
|
|
24
|
+
const result = c - affine.b;
|
|
25
|
+
const ineqType = (0, random_1.random)(['\\leq', '<', '\\geq', '>']);
|
|
26
|
+
const invIneqType = ineqType === '<' ? '>' : ineqType === '>' ? '<' : ineqType === '\\leq' ? '\\geq' : '\\leq';
|
|
27
|
+
const answer = `x ${ineqType} ${result}`;
|
|
28
|
+
const getPropositions = (n) => {
|
|
29
|
+
const res = [];
|
|
30
|
+
res.push({
|
|
31
|
+
id: (0, uuid_1.v4)(),
|
|
32
|
+
statement: answer,
|
|
33
|
+
isRightAnswer: true,
|
|
34
|
+
format: 'tex',
|
|
35
|
+
});
|
|
36
|
+
res.push({
|
|
37
|
+
id: (0, uuid_1.v4)(),
|
|
38
|
+
statement: `x ${affine.a < 0 ? ineqType : invIneqType} ${result}`,
|
|
39
|
+
isRightAnswer: false,
|
|
40
|
+
format: 'tex',
|
|
41
|
+
});
|
|
42
|
+
const missing = n - res.length;
|
|
43
|
+
for (let i = 0; i < missing; i++) {
|
|
44
|
+
let isDuplicate;
|
|
45
|
+
let proposition;
|
|
46
|
+
do {
|
|
47
|
+
const wrongAnswer = `x ${(0, coinFlip_1.coinFlip)() ? ineqType : invIneqType} ${(0, randint_1.randint)(-10, 11)}`;
|
|
48
|
+
proposition = {
|
|
49
|
+
id: (0, uuid_1.v4)() + ``,
|
|
50
|
+
statement: wrongAnswer,
|
|
51
|
+
isRightAnswer: false,
|
|
52
|
+
format: 'tex',
|
|
53
|
+
};
|
|
54
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
55
|
+
} while (isDuplicate);
|
|
56
|
+
res.push(proposition);
|
|
57
|
+
}
|
|
58
|
+
return (0, shuffle_1.shuffle)(res);
|
|
59
|
+
};
|
|
60
|
+
const question = {
|
|
61
|
+
answer: answer,
|
|
62
|
+
instruction: `Résoudre l'inéquation : $${affine.toTex()} ${ineqType} ${c}$ `,
|
|
63
|
+
keys: ['x', 'sup', 'inf', 'geq', 'leq'],
|
|
64
|
+
getPropositions,
|
|
65
|
+
answerFormat: 'tex',
|
|
66
|
+
};
|
|
67
|
+
return question;
|
|
68
|
+
}
|
|
69
|
+
exports.getFirstDegreeInequationsQuestion = getFirstDegreeInequationsQuestion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"firstDegreeInequationsType1.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/inequations/firstDegreeInequationsType1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAY3E,eAAO,MAAM,2BAA2B,EAAE,QASzC,CAAC;AAEF,wBAAgB,iCAAiC,IAAI,QAAQ,CAyD5D"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFirstDegreeInequationsQuestion = exports.firstDegreeInequationsType1 = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const rational_1 = require("../../../math/numbers/rationals/rational");
|
|
6
|
+
const affine_1 = require("../../../math/polynomials/affine");
|
|
7
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
|
+
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
9
|
+
const random_1 = require("../../../utils/random");
|
|
10
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
11
|
+
const uuid_1 = require("uuid");
|
|
12
|
+
exports.firstDegreeInequationsType1 = {
|
|
13
|
+
id: 'firstDegreeInequationsType1',
|
|
14
|
+
connector: '\\iff',
|
|
15
|
+
instruction: '',
|
|
16
|
+
label: 'Résoudre une inéquation du type $ax<b$',
|
|
17
|
+
levels: ['3ème', '2ndPro', '2nde', '1reESM', '1rePro', '1reTech'],
|
|
18
|
+
isSingleStep: true,
|
|
19
|
+
sections: ['Inéquations'],
|
|
20
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getFirstDegreeInequationsQuestion, nb),
|
|
21
|
+
};
|
|
22
|
+
function getFirstDegreeInequationsQuestion() {
|
|
23
|
+
const affine = new affine_1.Affine((0, randint_1.randint)(-10, 10, [0, 1]), 0);
|
|
24
|
+
const b = (0, randint_1.randint)(-10, 11);
|
|
25
|
+
const result = new rational_1.Rational(b, affine.a).simplify().toTree().toTex();
|
|
26
|
+
const ineqType = (0, random_1.random)(['\\leq', '<', '\\geq', '>']);
|
|
27
|
+
const invIneqType = ineqType === '<' ? '>' : ineqType === '>' ? '<' : ineqType === '\\leq' ? '\\geq' : '\\leq';
|
|
28
|
+
const answer = `x ${affine.a > 0 ? ineqType : invIneqType} ${result}`;
|
|
29
|
+
const getPropositions = (n) => {
|
|
30
|
+
const res = [];
|
|
31
|
+
res.push({
|
|
32
|
+
id: (0, uuid_1.v4)(),
|
|
33
|
+
statement: answer,
|
|
34
|
+
isRightAnswer: true,
|
|
35
|
+
format: 'tex',
|
|
36
|
+
});
|
|
37
|
+
res.push({
|
|
38
|
+
id: (0, uuid_1.v4)(),
|
|
39
|
+
statement: `x ${affine.a < 0 ? ineqType : invIneqType} ${result}`,
|
|
40
|
+
isRightAnswer: false,
|
|
41
|
+
format: 'tex',
|
|
42
|
+
});
|
|
43
|
+
const missing = n - res.length;
|
|
44
|
+
for (let i = 0; i < missing; i++) {
|
|
45
|
+
let isDuplicate;
|
|
46
|
+
let proposition;
|
|
47
|
+
do {
|
|
48
|
+
const wrongAnswer = `x ${(0, coinFlip_1.coinFlip)() ? ineqType : invIneqType} ${(0, randint_1.randint)(-10, 11)}`;
|
|
49
|
+
proposition = {
|
|
50
|
+
id: (0, uuid_1.v4)() + ``,
|
|
51
|
+
statement: wrongAnswer,
|
|
52
|
+
isRightAnswer: false,
|
|
53
|
+
format: 'tex',
|
|
54
|
+
};
|
|
55
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
56
|
+
} while (isDuplicate);
|
|
57
|
+
res.push(proposition);
|
|
58
|
+
}
|
|
59
|
+
return (0, shuffle_1.shuffle)(res);
|
|
60
|
+
};
|
|
61
|
+
const question = {
|
|
62
|
+
answer: answer,
|
|
63
|
+
instruction: `Résoudre l'inéquation : $${affine.toTex()} ${ineqType} ${b}$ `,
|
|
64
|
+
keys: ['x', 'sup', 'inf', 'geq', 'leq'],
|
|
65
|
+
getPropositions,
|
|
66
|
+
answerFormat: 'tex',
|
|
67
|
+
};
|
|
68
|
+
return question;
|
|
69
|
+
}
|
|
70
|
+
exports.getFirstDegreeInequationsQuestion = getFirstDegreeInequationsQuestion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"firstDegreeInequationsType2.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/inequations/firstDegreeInequationsType2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAY3E,eAAO,MAAM,2BAA2B,EAAE,QASzC,CAAC;AAEF,wBAAgB,iCAAiC,IAAI,QAAQ,CAyD5D"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFirstDegreeInequationsQuestion = exports.firstDegreeInequationsType2 = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const rational_1 = require("../../../math/numbers/rationals/rational");
|
|
6
|
+
const affine_1 = require("../../../math/polynomials/affine");
|
|
7
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
|
+
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
9
|
+
const random_1 = require("../../../utils/random");
|
|
10
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
11
|
+
const uuid_1 = require("uuid");
|
|
12
|
+
exports.firstDegreeInequationsType2 = {
|
|
13
|
+
id: 'firstDegreeInequationsType2',
|
|
14
|
+
connector: '\\iff',
|
|
15
|
+
instruction: '',
|
|
16
|
+
label: 'Résoudre une inéquation du type $ax+b<c$',
|
|
17
|
+
levels: ['3ème', '2ndPro', '2nde', '1reESM', '1rePro', '1reTech'],
|
|
18
|
+
isSingleStep: true,
|
|
19
|
+
sections: ['Inéquations'],
|
|
20
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getFirstDegreeInequationsQuestion, nb),
|
|
21
|
+
};
|
|
22
|
+
function getFirstDegreeInequationsQuestion() {
|
|
23
|
+
const affine = new affine_1.Affine((0, randint_1.randint)(-10, 10, [0, 1]), (0, randint_1.randint)(-10, 10, [0]));
|
|
24
|
+
const c = (0, randint_1.randint)(-10, 11);
|
|
25
|
+
const result = new rational_1.Rational(c - affine.b, affine.a).simplify().toTree().toTex();
|
|
26
|
+
const ineqType = (0, random_1.random)(['\\leq', '<', '\\geq', '>']);
|
|
27
|
+
const invIneqType = ineqType === '<' ? '>' : ineqType === '>' ? '<' : ineqType === '\\leq' ? '\\geq' : '\\leq';
|
|
28
|
+
const answer = `x ${affine.a > 0 ? ineqType : invIneqType} ${result}`;
|
|
29
|
+
const getPropositions = (n) => {
|
|
30
|
+
const res = [];
|
|
31
|
+
res.push({
|
|
32
|
+
id: (0, uuid_1.v4)(),
|
|
33
|
+
statement: answer,
|
|
34
|
+
isRightAnswer: true,
|
|
35
|
+
format: 'tex',
|
|
36
|
+
});
|
|
37
|
+
res.push({
|
|
38
|
+
id: (0, uuid_1.v4)(),
|
|
39
|
+
statement: `x ${affine.a < 0 ? ineqType : invIneqType} ${result}`,
|
|
40
|
+
isRightAnswer: false,
|
|
41
|
+
format: 'tex',
|
|
42
|
+
});
|
|
43
|
+
const missing = n - res.length;
|
|
44
|
+
for (let i = 0; i < missing; i++) {
|
|
45
|
+
let isDuplicate;
|
|
46
|
+
let proposition;
|
|
47
|
+
do {
|
|
48
|
+
const wrongAnswer = `x ${(0, coinFlip_1.coinFlip)() ? ineqType : invIneqType} ${(0, randint_1.randint)(-10, 11)}`;
|
|
49
|
+
proposition = {
|
|
50
|
+
id: (0, uuid_1.v4)() + ``,
|
|
51
|
+
statement: wrongAnswer,
|
|
52
|
+
isRightAnswer: false,
|
|
53
|
+
format: 'tex',
|
|
54
|
+
};
|
|
55
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
56
|
+
} while (isDuplicate);
|
|
57
|
+
res.push(proposition);
|
|
58
|
+
}
|
|
59
|
+
return (0, shuffle_1.shuffle)(res);
|
|
60
|
+
};
|
|
61
|
+
const question = {
|
|
62
|
+
answer: answer,
|
|
63
|
+
instruction: `Résoudre l'inéquation : $${affine.toTex()} ${ineqType} ${c}$ `,
|
|
64
|
+
keys: ['x', 'sup', 'inf', 'geq', 'leq'],
|
|
65
|
+
getPropositions,
|
|
66
|
+
answerFormat: 'tex',
|
|
67
|
+
};
|
|
68
|
+
return question;
|
|
69
|
+
}
|
|
70
|
+
exports.getFirstDegreeInequationsQuestion = getFirstDegreeInequationsQuestion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"firstDegreeInequationsType3.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/inequations/firstDegreeInequationsType3.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAY3E,eAAO,MAAM,2BAA2B,EAAE,QASzC,CAAC;AAEF,wBAAgB,iCAAiC,IAAI,QAAQ,CAyD5D"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFirstDegreeInequationsQuestion = exports.firstDegreeInequationsType3 = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const rational_1 = require("../../../math/numbers/rationals/rational");
|
|
6
|
+
const affine_1 = require("../../../math/polynomials/affine");
|
|
7
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
|
+
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
9
|
+
const random_1 = require("../../../utils/random");
|
|
10
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
11
|
+
const uuid_1 = require("uuid");
|
|
12
|
+
exports.firstDegreeInequationsType3 = {
|
|
13
|
+
id: 'firstDegreeInequationsType3',
|
|
14
|
+
connector: '\\iff',
|
|
15
|
+
instruction: '',
|
|
16
|
+
label: 'Résoudre une inéquation du type $ax+b<cx+d$',
|
|
17
|
+
levels: ['3ème', '2ndPro', '2nde', '1reESM', '1rePro', '1reTech'],
|
|
18
|
+
isSingleStep: true,
|
|
19
|
+
sections: ['Inéquations'],
|
|
20
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getFirstDegreeInequationsQuestion, nb),
|
|
21
|
+
};
|
|
22
|
+
function getFirstDegreeInequationsQuestion() {
|
|
23
|
+
const affine1 = new affine_1.Affine((0, randint_1.randint)(-10, 10, [0]), (0, randint_1.randint)(-10, 10));
|
|
24
|
+
const affine2 = new affine_1.Affine((0, randint_1.randint)(-10, 10, [0, affine1.a]), (0, randint_1.randint)(-10, 10));
|
|
25
|
+
const result = new rational_1.Rational(affine2.b - affine1.b, affine1.a - affine2.a).simplify().toTree().toTex();
|
|
26
|
+
const coeff = affine1.a - affine2.a;
|
|
27
|
+
const ineqType = (0, random_1.random)(['\\leq', '<', '\\geq', '>']);
|
|
28
|
+
const invIneqType = ineqType === '<' ? '>' : ineqType === '>' ? '<' : ineqType === '\\leq' ? '\\geq' : '\\leq';
|
|
29
|
+
const answer = `x ${coeff > 0 ? ineqType : invIneqType} ${result}`;
|
|
30
|
+
const getPropositions = (n) => {
|
|
31
|
+
const res = [];
|
|
32
|
+
res.push({
|
|
33
|
+
id: (0, uuid_1.v4)(),
|
|
34
|
+
statement: answer,
|
|
35
|
+
isRightAnswer: true,
|
|
36
|
+
format: 'tex',
|
|
37
|
+
});
|
|
38
|
+
res.push({
|
|
39
|
+
id: (0, uuid_1.v4)(),
|
|
40
|
+
statement: `x ${coeff < 0 ? ineqType : invIneqType} ${result}`,
|
|
41
|
+
isRightAnswer: false,
|
|
42
|
+
format: 'tex',
|
|
43
|
+
});
|
|
44
|
+
const missing = n - res.length;
|
|
45
|
+
for (let i = 0; i < missing; i++) {
|
|
46
|
+
let isDuplicate;
|
|
47
|
+
let proposition;
|
|
48
|
+
do {
|
|
49
|
+
const wrongAnswer = `x ${(0, coinFlip_1.coinFlip)() ? ineqType : invIneqType} ${(0, randint_1.randint)(-10, 11)}`;
|
|
50
|
+
proposition = {
|
|
51
|
+
id: (0, uuid_1.v4)() + ``,
|
|
52
|
+
statement: wrongAnswer,
|
|
53
|
+
isRightAnswer: false,
|
|
54
|
+
format: 'tex',
|
|
55
|
+
};
|
|
56
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
57
|
+
} while (isDuplicate);
|
|
58
|
+
res.push(proposition);
|
|
59
|
+
}
|
|
60
|
+
return (0, shuffle_1.shuffle)(res);
|
|
61
|
+
};
|
|
62
|
+
const question = {
|
|
63
|
+
answer: answer,
|
|
64
|
+
instruction: `Résoudre l'inéquation : $${affine1.toTex()} ${ineqType} ${affine2.toTex()}$ `,
|
|
65
|
+
keys: ['x', 'sup', 'inf', 'geq', 'leq'],
|
|
66
|
+
getPropositions,
|
|
67
|
+
answerFormat: 'tex',
|
|
68
|
+
};
|
|
69
|
+
return question;
|
|
70
|
+
}
|
|
71
|
+
exports.getFirstDegreeInequationsQuestion = getFirstDegreeInequationsQuestion;
|
|
@@ -28,7 +28,8 @@ export interface Exercise {
|
|
|
28
28
|
connector?: '=' | '\\iff' | '\\approx';
|
|
29
29
|
keys?: string[];
|
|
30
30
|
generator(nb: number, options?: GeneratorOptions): Question[];
|
|
31
|
+
answerType?: 'QCM' | 'free';
|
|
31
32
|
}
|
|
32
33
|
export type MathLevel = '6ème' | '5ème' | '4ème' | '3ème' | '2nde' | '1reTech' | '1reESM' | '1reSpé' | 'TermSpé' | 'TermTech' | 'MathExp' | 'MathComp' | 'CAP' | '2ndPro' | '1rePro' | 'TermPro';
|
|
33
|
-
export type MathSection = 'Calcul littéral' | '
|
|
34
|
+
export type MathSection = 'Arithmétique' | 'Calcul littéral' | 'Calculs' | 'Conversions' | 'Dérivation' | 'Droites' | 'Équations' | 'Équations différentielles' | 'Exponentielle' | 'Fonction cube' | 'Fonction inverse' | 'Fonctions' | 'Fonctions affines' | 'Fonctions de référence' | 'Fractions' | 'Géométrie cartésienne' | 'Géométrie euclidienne' | 'Inéquations' | 'Intégration' | 'Intervalles' | 'Limites' | 'Logarithme népérien' | 'Nombres complexes' | 'Pourcentages' | 'Primitives' | 'Probabilités' | 'Proportionnalité' | 'Puissances' | 'Racines carrées' | 'Second degré' | 'Statistiques' | 'Suites' | 'Trigonométrie' | 'Vecteurs';
|
|
34
35
|
//# sourceMappingURL=exercise.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,MAAM,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAElC,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;IACvB,MAAM,EAAE,KAAK,GAAG,KAAK,CAAC;CACvB,CAAC;AACF,MAAM,WAAW,QAAQ;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,KAAK,GAAG,KAAK,CAAC;IAC5B,YAAY,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAC9B,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,eAAe,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,WAAW,EAAE,CAAC;CAC/C;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,GAAG,GAAG,OAAO,GAAG,UAAU,CAAC;IACvC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,QAAQ,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,MAAM,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAElC,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;IACvB,MAAM,EAAE,KAAK,GAAG,KAAK,CAAC;CACvB,CAAC;AACF,MAAM,WAAW,QAAQ;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,KAAK,GAAG,KAAK,CAAC;IAC5B,YAAY,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAC9B,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,eAAe,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,WAAW,EAAE,CAAC;CAC/C;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,GAAG,GAAG,OAAO,GAAG,UAAU,CAAC;IACvC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,QAAQ,EAAE,CAAC;IAC9D,UAAU,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CAC7B;AAED,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,UAAU,GACV,SAAS,GACT,UAAU,GACV,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,MAAM,WAAW,GACnB,cAAc,GACd,iBAAiB,GACjB,SAAS,GACT,aAAa,GACb,YAAY,GACZ,SAAS,GACT,WAAW,GACX,2BAA2B,GAC3B,eAAe,GACf,eAAe,GACf,kBAAkB,GAClB,WAAW,GACX,mBAAmB,GACnB,wBAAwB,GACxB,WAAW,GACX,uBAAuB,GACvB,uBAAuB,GACvB,aAAa,GACb,aAAa,GACb,aAAa,GACb,SAAS,GACT,qBAAqB,GACrB,mBAAmB,GACnB,cAAc,GACd,YAAY,GACZ,cAAc,GACd,kBAAkB,GAClB,YAAY,GACZ,iBAAiB,GACjB,cAAc,GACd,cAAc,GACd,QAAQ,GACR,eAAe,GACf,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exercises.d.ts","sourceRoot":"","sources":["../../src/exercises/exercises.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"exercises.d.ts","sourceRoot":"","sources":["../../src/exercises/exercises.ts"],"names":[],"mappings":"AA2KA,eAAO,MAAM,SAAS,iCAwPrB,CAAC"}
|
|
@@ -151,6 +151,16 @@ const divideComplex_1 = require("./complex/divideComplex");
|
|
|
151
151
|
const conjugateDivideComplex_1 = require("./complex/conjugateDivideComplex");
|
|
152
152
|
const firstIntegersSum_1 = require("./sequences/arithmetic/firstIntegersSum");
|
|
153
153
|
const geometricFirstTermsSum_1 = require("./sequences/geometric/geometricFirstTermsSum");
|
|
154
|
+
const squareRootEquation_1 = require("./squareRoots/squareRootEquation");
|
|
155
|
+
const cubicEquation_1 = require("./functions/cube/cubicEquation");
|
|
156
|
+
const determinant_1 = require("./geometry/vectors/determinant");
|
|
157
|
+
const firstDegreeInequationsType1_1 = require("./calculLitteral/inequations/firstDegreeInequationsType1");
|
|
158
|
+
const firstDegreeInequationsType2_1 = require("./calculLitteral/inequations/firstDegreeInequationsType2");
|
|
159
|
+
const firstDegreeInequationsType3_1 = require("./calculLitteral/inequations/firstDegreeInequationsType3");
|
|
160
|
+
const firstDegreeInequationsType0_1 = require("./calculLitteral/inequations/firstDegreeInequationsType0");
|
|
161
|
+
const chasles_1 = require("./geometry/vectors/chasles");
|
|
162
|
+
const rootsFromFactorizedForm_1 = require("./functions/trinoms/rootsFromFactorizedForm");
|
|
163
|
+
const rootsFromDevForm_1 = require("./functions/trinoms/rootsFromDevForm");
|
|
154
164
|
exports.exercises = [
|
|
155
165
|
/**
|
|
156
166
|
* calcul litteral
|
|
@@ -174,10 +184,18 @@ exports.exercises = [
|
|
|
174
184
|
equationType4Exercise_1.equationType4Exercise,
|
|
175
185
|
firstDegreeEquation_1.firstDegreeEquation,
|
|
176
186
|
equationSimpleSquare_1.equationSimpleSquare,
|
|
187
|
+
/**
|
|
188
|
+
* inequations
|
|
189
|
+
*/
|
|
190
|
+
firstDegreeInequationsType0_1.firstDegreeInequationsType0,
|
|
191
|
+
firstDegreeInequationsType1_1.firstDegreeInequationsType1,
|
|
192
|
+
firstDegreeInequationsType2_1.firstDegreeInequationsType2,
|
|
193
|
+
firstDegreeInequationsType3_1.firstDegreeInequationsType3,
|
|
177
194
|
/**
|
|
178
195
|
* square roots
|
|
179
196
|
*/
|
|
180
197
|
simpifySquareRoot_1.simplifySquareRoot,
|
|
198
|
+
squareRootEquation_1.squareRootEquation,
|
|
181
199
|
/**
|
|
182
200
|
* fractions
|
|
183
201
|
*/
|
|
@@ -203,16 +221,34 @@ exports.exercises = [
|
|
|
203
221
|
rounding_1.roundToMillieme,
|
|
204
222
|
rounding_1.roundToUnit,
|
|
205
223
|
rounding_1.allRoundings,
|
|
224
|
+
/**
|
|
225
|
+
* pourcentages
|
|
226
|
+
*/
|
|
227
|
+
applyPercent_1.applyPercent,
|
|
228
|
+
globalPercent_1.globalPercent,
|
|
229
|
+
reciprocalPercentage_1.reciprocalPercentage,
|
|
230
|
+
averageEvolutionRate_1.averageEvolutionRate,
|
|
206
231
|
/**
|
|
207
232
|
* geometry
|
|
208
233
|
*/
|
|
209
234
|
midpoint_1.midpoint,
|
|
210
235
|
mainRemarkableValues_1.mainRemarkableValuesExercise,
|
|
211
236
|
remarkableValues_1.remarkableValuesExercise,
|
|
237
|
+
thales_1.thales,
|
|
238
|
+
thalesCalcul_1.thalesCalcul,
|
|
239
|
+
pythagore_1.pythagore,
|
|
240
|
+
pythagoreCalcul_1.pythagoreCalcul,
|
|
241
|
+
trigonometry_1.trigonometry,
|
|
242
|
+
trigonometryAngleCalcul_1.trigonometryAngleCalcul,
|
|
243
|
+
trigonometrySideCalcul_1.trigonometrySideCalcul,
|
|
244
|
+
rightTriangleArea_1.rightTriangleArea,
|
|
245
|
+
triangleArea_1.triangleArea,
|
|
212
246
|
/**
|
|
213
247
|
* vectors
|
|
214
248
|
*/
|
|
215
249
|
scalarProductViaCoords_1.scalarProductViaCoords,
|
|
250
|
+
determinant_1.determinant,
|
|
251
|
+
chasles_1.chasles,
|
|
216
252
|
/**
|
|
217
253
|
* puissances
|
|
218
254
|
*/
|
|
@@ -241,12 +277,16 @@ exports.exercises = [
|
|
|
241
277
|
firstIntegersSum_1.firstIntegersSum,
|
|
242
278
|
geometricFirstTermsSum_1.geometricFirstTermsSum,
|
|
243
279
|
/**
|
|
244
|
-
*
|
|
280
|
+
* fonctions
|
|
281
|
+
*/
|
|
282
|
+
cubicEquation_1.cubicEquation,
|
|
283
|
+
imageFunction_1.imageFunction,
|
|
284
|
+
inverseImageFunction_1.inverseImageFunction,
|
|
285
|
+
imageFunctionGeogebra_1.imageFunctionGeogebra,
|
|
286
|
+
inverseImageFunctionGeogebra_1.inverseImageFunctionGeogebra,
|
|
287
|
+
/**
|
|
288
|
+
* derivation
|
|
245
289
|
*/
|
|
246
|
-
applyPercent_1.applyPercent,
|
|
247
|
-
globalPercent_1.globalPercent,
|
|
248
|
-
reciprocalPercentage_1.reciprocalPercentage,
|
|
249
|
-
averageEvolutionRate_1.averageEvolutionRate,
|
|
250
290
|
usualderivative_1.usualDerivative,
|
|
251
291
|
constanteDerivative_1.constanteDerivative,
|
|
252
292
|
firstDegreeDerivative_1.firstDegreeDerivative,
|
|
@@ -255,25 +295,37 @@ exports.exercises = [
|
|
|
255
295
|
inverseFunctionDerivative_1.inverseFunctionDerivative,
|
|
256
296
|
rootFunctionDerivative_1.rootFunctionDerivative,
|
|
257
297
|
powerFunctionDerivative_1.powerFunctionDerivative,
|
|
258
|
-
conditionalProbability_1.conditionalProbability,
|
|
259
|
-
leadingCoefficient_1.leadingCoefficient,
|
|
260
298
|
derivativeNumberReading_1.derivativeNumberReading,
|
|
299
|
+
lnDerivativeOne_1.lnDerivativeOne,
|
|
300
|
+
lnDerivativeTwo_1.lnDerivativeTwo,
|
|
301
|
+
lnDerivativeThree_1.lnDerivativeThree,
|
|
302
|
+
expDerivativeOne_1.expDerivativeOne,
|
|
303
|
+
expDerivativeTwo_1.expDerivativeTwo,
|
|
304
|
+
expDerivativeThree_1.expDerivativeThree,
|
|
305
|
+
/**
|
|
306
|
+
* primitive
|
|
307
|
+
*/
|
|
308
|
+
constantPrimitive_1.constantPrimitive,
|
|
309
|
+
polynomialPrimitive_1.polynomialPrimitive,
|
|
310
|
+
sinCosPrimitive_1.sinCosPrimitive,
|
|
311
|
+
exponentialPrimitive_1.exponentialPrimitive,
|
|
312
|
+
logarithmePrimitive_1.logarithmePrimitive,
|
|
313
|
+
usualPrimitives_1.usualPrimitives,
|
|
314
|
+
/**
|
|
315
|
+
* probabilités
|
|
316
|
+
*/
|
|
261
317
|
probabilityTree_1.probabilityTree,
|
|
318
|
+
conditionalProbability_1.conditionalProbability,
|
|
319
|
+
/**
|
|
320
|
+
* islam
|
|
321
|
+
*/
|
|
322
|
+
leadingCoefficient_1.leadingCoefficient,
|
|
262
323
|
fractionToPercentToDecimal_1.fractionToPercentToDecimal,
|
|
263
324
|
marginalAndConditionalFrequency_1.marginalAndConditionalFrequency,
|
|
264
325
|
mentalAddAndSub_1.mentalAddAndSub,
|
|
265
326
|
mentalMultiplications_1.mentalMultiplications,
|
|
266
327
|
mentalDivisions_1.mentalDivisions,
|
|
267
328
|
mentalPercentage_1.mentalPercentage,
|
|
268
|
-
thales_1.thales,
|
|
269
|
-
thalesCalcul_1.thalesCalcul,
|
|
270
|
-
pythagore_1.pythagore,
|
|
271
|
-
pythagoreCalcul_1.pythagoreCalcul,
|
|
272
|
-
trigonometry_1.trigonometry,
|
|
273
|
-
trigonometryAngleCalcul_1.trigonometryAngleCalcul,
|
|
274
|
-
trigonometrySideCalcul_1.trigonometrySideCalcul,
|
|
275
|
-
rightTriangleArea_1.rightTriangleArea,
|
|
276
|
-
triangleArea_1.triangleArea,
|
|
277
329
|
/**
|
|
278
330
|
* nv generateurs
|
|
279
331
|
*/
|
|
@@ -300,30 +352,14 @@ exports.exercises = [
|
|
|
300
352
|
reduceExpression_1.reduceExpression,
|
|
301
353
|
evaluateExpression_1.evaluateExpression,
|
|
302
354
|
proportionalityTable_1.proportionalityTable,
|
|
303
|
-
imageFunction_1.imageFunction,
|
|
304
|
-
inverseImageFunction_1.inverseImageFunction,
|
|
305
|
-
lnDerivativeOne_1.lnDerivativeOne,
|
|
306
|
-
lnDerivativeTwo_1.lnDerivativeTwo,
|
|
307
|
-
lnDerivativeThree_1.lnDerivativeThree,
|
|
308
|
-
expDerivativeOne_1.expDerivativeOne,
|
|
309
|
-
expDerivativeTwo_1.expDerivativeTwo,
|
|
310
|
-
expDerivativeThree_1.expDerivativeThree,
|
|
311
355
|
logEquation_1.logEquation,
|
|
312
356
|
expEquation_1.expEquation,
|
|
313
357
|
expSimplifiying_1.expSimplifiying,
|
|
314
358
|
logSimplifiying_1.logSimplifiying,
|
|
315
|
-
imageFunctionGeogebra_1.imageFunctionGeogebra,
|
|
316
|
-
inverseImageFunctionGeogebra_1.inverseImageFunctionGeogebra,
|
|
317
359
|
euclideanDivision_1.euclideanDivision,
|
|
318
360
|
signFunction_1.signFunction,
|
|
319
361
|
thirdDegreeFunctionVariation_1.thirdDegreeFunctionVariation,
|
|
320
362
|
polynomeLimit_1.polynomeLimit,
|
|
321
|
-
constantPrimitive_1.constantPrimitive,
|
|
322
|
-
polynomialPrimitive_1.polynomialPrimitive,
|
|
323
|
-
sinCosPrimitive_1.sinCosPrimitive,
|
|
324
|
-
exponentialPrimitive_1.exponentialPrimitive,
|
|
325
|
-
logarithmePrimitive_1.logarithmePrimitive,
|
|
326
|
-
usualPrimitives_1.usualPrimitives,
|
|
327
363
|
equaDiffGeneralForme_1.exponentialDifferentialEquation,
|
|
328
364
|
equaDiffGeneralFormeWithIC_1.exponentialDifferentialEquationWithIC,
|
|
329
365
|
/**Stats */
|
|
@@ -339,6 +375,9 @@ exports.exercises = [
|
|
|
339
375
|
extremumFromCanonicalForm_1.extremumFromCanonicalForm,
|
|
340
376
|
extremumTypeFromAlgebricForm_1.extremumTypeFromAlgebricForm,
|
|
341
377
|
variationsFromAlgebricForm_1.variationsFromAlgebricForm,
|
|
378
|
+
// deltaTrinom,
|
|
379
|
+
rootsFromFactorizedForm_1.rootsFromFactorizedForm,
|
|
380
|
+
rootsFromDevForm_1.rootsFromDevForm,
|
|
342
381
|
/**Complexes */
|
|
343
382
|
mutiplyComplex_1.mutiplyComplex,
|
|
344
383
|
reAndIm_1.reAndIm,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cubicEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/cube/cubicEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAM3E,eAAO,MAAM,aAAa,EAAE,QAS3B,CAAC;AAEF,wBAAgB,wBAAwB,IAAI,QAAQ,CAwDnD"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCubicEquationQuestion = exports.cubicEquation = 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.cubicEquation = {
|
|
9
|
+
id: 'cubicEquation',
|
|
10
|
+
connector: '\\iff',
|
|
11
|
+
instruction: '',
|
|
12
|
+
label: 'Résoudre une équation du type $x^3 = k$',
|
|
13
|
+
levels: ['2nde', '1reESM', '1reSpé', '1reTech'],
|
|
14
|
+
isSingleStep: true,
|
|
15
|
+
sections: ['Fonctions de référence', 'Fonction cube', 'Équations'],
|
|
16
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getCubicEquationQuestion, nb),
|
|
17
|
+
};
|
|
18
|
+
function getCubicEquationQuestion() {
|
|
19
|
+
const x = (0, randint_1.randint)(-10, 11);
|
|
20
|
+
const k = x ** 3;
|
|
21
|
+
const answer = `S = \\lbrace ${x} \\rbrace`;
|
|
22
|
+
const getPropositions = (n) => {
|
|
23
|
+
const res = [];
|
|
24
|
+
res.push({
|
|
25
|
+
id: (0, uuid_1.v4)(),
|
|
26
|
+
statement: answer,
|
|
27
|
+
isRightAnswer: true,
|
|
28
|
+
format: 'tex',
|
|
29
|
+
});
|
|
30
|
+
if (x ** 3 !== k ** 3) {
|
|
31
|
+
res.push({
|
|
32
|
+
id: (0, uuid_1.v4)(),
|
|
33
|
+
statement: `S = \\lbrace ${k ** 3} \\rbrace`,
|
|
34
|
+
isRightAnswer: true,
|
|
35
|
+
format: 'tex',
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
const missing = n - res.length;
|
|
39
|
+
for (let i = 0; i < missing; i++) {
|
|
40
|
+
let isDuplicate;
|
|
41
|
+
let proposition;
|
|
42
|
+
do {
|
|
43
|
+
const wrongAnswer = (0, randint_1.randint)(-10, 11) + '';
|
|
44
|
+
proposition = {
|
|
45
|
+
id: (0, uuid_1.v4)() + ``,
|
|
46
|
+
statement: `S = \\lbrace ${wrongAnswer} \\rbrace`,
|
|
47
|
+
isRightAnswer: false,
|
|
48
|
+
format: 'tex',
|
|
49
|
+
};
|
|
50
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
51
|
+
} while (isDuplicate);
|
|
52
|
+
res.push(proposition);
|
|
53
|
+
}
|
|
54
|
+
return (0, shuffle_1.shuffle)(res);
|
|
55
|
+
};
|
|
56
|
+
const question = {
|
|
57
|
+
answer: answer,
|
|
58
|
+
instruction: `Résoudre l'équation suivante : $x^3 = ${k}$`,
|
|
59
|
+
keys: ['S', 'equal', 'lbrace', 'semicolon', 'rbrace', 'emptyset'],
|
|
60
|
+
getPropositions,
|
|
61
|
+
answerFormat: 'tex',
|
|
62
|
+
};
|
|
63
|
+
return question;
|
|
64
|
+
}
|
|
65
|
+
exports.getCubicEquationQuestion = getCubicEquationQuestion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deltaTrinom.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/trinoms/deltaTrinom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAO3E,eAAO,MAAM,WAAW,EAAE,QASzB,CAAC;AAEF,wBAAgB,sBAAsB,IAAI,QAAQ,CA4DjD"}
|