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,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDeltaTrinomQuestion = exports.deltaTrinom = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const trinom_1 = require("../../../math/polynomials/trinom");
|
|
6
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
8
|
+
const uuid_1 = require("uuid");
|
|
9
|
+
exports.deltaTrinom = {
|
|
10
|
+
id: 'deltaTrinom',
|
|
11
|
+
connector: '=',
|
|
12
|
+
instruction: '',
|
|
13
|
+
label: "Calculer le discriminant d'un trinôme",
|
|
14
|
+
levels: ['1reSpé', 'TermSpé', 'MathComp'],
|
|
15
|
+
isSingleStep: true,
|
|
16
|
+
sections: ['Second degré'],
|
|
17
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getDeltaTrinomQuestion, nb),
|
|
18
|
+
};
|
|
19
|
+
function getDeltaTrinomQuestion() {
|
|
20
|
+
const trinom = trinom_1.TrinomConstructor.random();
|
|
21
|
+
const answer = trinom.getDelta();
|
|
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
|
+
const bMinus4ac = trinom.b - 4 * trinom.a * trinom.c;
|
|
31
|
+
if (bMinus4ac !== answer)
|
|
32
|
+
res.push({
|
|
33
|
+
id: (0, uuid_1.v4)(),
|
|
34
|
+
statement: bMinus4ac + '',
|
|
35
|
+
isRightAnswer: false,
|
|
36
|
+
format: 'tex',
|
|
37
|
+
});
|
|
38
|
+
const bSquarePlus4ac = trinom.b ** 2 + trinom.a * trinom.c;
|
|
39
|
+
if (bSquarePlus4ac !== answer && bSquarePlus4ac !== bMinus4ac)
|
|
40
|
+
res.push({
|
|
41
|
+
id: (0, uuid_1.v4)(),
|
|
42
|
+
statement: bSquarePlus4ac + '',
|
|
43
|
+
isRightAnswer: false,
|
|
44
|
+
format: 'tex',
|
|
45
|
+
});
|
|
46
|
+
const missing = n - res.length;
|
|
47
|
+
for (let i = 0; i < missing; i++) {
|
|
48
|
+
let isDuplicate;
|
|
49
|
+
let proposition;
|
|
50
|
+
do {
|
|
51
|
+
const wrongAnswer = (0, randint_1.randint)(-100, 100) + '';
|
|
52
|
+
proposition = {
|
|
53
|
+
id: (0, uuid_1.v4)() + ``,
|
|
54
|
+
statement: wrongAnswer,
|
|
55
|
+
isRightAnswer: false,
|
|
56
|
+
format: 'tex',
|
|
57
|
+
};
|
|
58
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
59
|
+
} while (isDuplicate);
|
|
60
|
+
res.push(proposition);
|
|
61
|
+
}
|
|
62
|
+
return (0, shuffle_1.shuffle)(res);
|
|
63
|
+
};
|
|
64
|
+
const question = {
|
|
65
|
+
answer: answer + '',
|
|
66
|
+
instruction: `Soit $f(x) = ${trinom.toTree().toTex()}$. Calculer le discriminant $\\Delta$.`,
|
|
67
|
+
keys: [],
|
|
68
|
+
getPropositions,
|
|
69
|
+
answerFormat: 'tex',
|
|
70
|
+
};
|
|
71
|
+
return question;
|
|
72
|
+
}
|
|
73
|
+
exports.getDeltaTrinomQuestion = getDeltaTrinomQuestion;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extremumTypeFromAlgebricForm.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/trinoms/extremumTypeFromAlgebricForm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAO3E,eAAO,MAAM,4BAA4B,EAAE,
|
|
1
|
+
{"version":3,"file":"extremumTypeFromAlgebricForm.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/trinoms/extremumTypeFromAlgebricForm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAO3E,eAAO,MAAM,4BAA4B,EAAE,QAS1C,CAAC;AAEF,wBAAgB,uCAAuC,IAAI,QAAQ,CA6ClE"}
|
|
@@ -14,6 +14,7 @@ exports.extremumTypeFromAlgebricForm = {
|
|
|
14
14
|
isSingleStep: true,
|
|
15
15
|
sections: ['Second degré'],
|
|
16
16
|
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getExtremumTypeFromAlgebricFormQuestion, nb),
|
|
17
|
+
answerType: 'QCM',
|
|
17
18
|
};
|
|
18
19
|
function getExtremumTypeFromAlgebricFormQuestion() {
|
|
19
20
|
const isDevForm = (0, coinFlip_1.coinFlip)();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rootsFromDevForm.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/trinoms/rootsFromDevForm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAM3E,eAAO,MAAM,gBAAgB,EAAE,QAS9B,CAAC;AAEF,wBAAgB,2BAA2B,IAAI,QAAQ,CA6CtD"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRootsFromDevFormQuestion = exports.rootsFromDevForm = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const trinom_1 = require("../../../math/polynomials/trinom");
|
|
6
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
7
|
+
const uuid_1 = require("uuid");
|
|
8
|
+
exports.rootsFromDevForm = {
|
|
9
|
+
id: 'rootsFromDevForm',
|
|
10
|
+
connector: '\\iff',
|
|
11
|
+
instruction: '',
|
|
12
|
+
label: 'Résoudre une équation du second degré',
|
|
13
|
+
levels: ['1reSpé', 'TermSpé', 'MathComp'],
|
|
14
|
+
isSingleStep: true,
|
|
15
|
+
sections: [],
|
|
16
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getRootsFromDevFormQuestion, nb),
|
|
17
|
+
};
|
|
18
|
+
function getRootsFromDevFormQuestion() {
|
|
19
|
+
const trinom = trinom_1.TrinomConstructor.random();
|
|
20
|
+
const answer = trinom.getRootsEquationSolutionTex();
|
|
21
|
+
const getPropositions = (n) => {
|
|
22
|
+
const res = [];
|
|
23
|
+
res.push({
|
|
24
|
+
id: (0, uuid_1.v4)(),
|
|
25
|
+
statement: answer,
|
|
26
|
+
isRightAnswer: true,
|
|
27
|
+
format: 'tex',
|
|
28
|
+
});
|
|
29
|
+
const missing = n - res.length;
|
|
30
|
+
for (let i = 0; i < missing; i++) {
|
|
31
|
+
let isDuplicate;
|
|
32
|
+
let proposition;
|
|
33
|
+
do {
|
|
34
|
+
const wrongAnswer = '';
|
|
35
|
+
proposition = {
|
|
36
|
+
id: (0, uuid_1.v4)() + ``,
|
|
37
|
+
statement: wrongAnswer,
|
|
38
|
+
isRightAnswer: false,
|
|
39
|
+
format: 'tex',
|
|
40
|
+
};
|
|
41
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
42
|
+
} while (isDuplicate);
|
|
43
|
+
res.push(proposition);
|
|
44
|
+
}
|
|
45
|
+
return (0, shuffle_1.shuffle)(res);
|
|
46
|
+
};
|
|
47
|
+
const question = {
|
|
48
|
+
answer: answer,
|
|
49
|
+
instruction: `Soit $f(x) = ${trinom.toTree().toTex()}$. Résoudre l'équation $f(x) = 0$.`,
|
|
50
|
+
keys: [],
|
|
51
|
+
getPropositions,
|
|
52
|
+
answerFormat: 'tex',
|
|
53
|
+
};
|
|
54
|
+
return question;
|
|
55
|
+
}
|
|
56
|
+
exports.getRootsFromDevFormQuestion = getRootsFromDevFormQuestion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rootsFromFactorizedForm.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/trinoms/rootsFromFactorizedForm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAS3E,eAAO,MAAM,uBAAuB,EAAE,QASrC,CAAC;AAEF,wBAAgB,kCAAkC,IAAI,QAAQ,CAiF7D"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRootsFromFactorizedFormQuestion = exports.rootsFromFactorizedForm = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const trinom_1 = require("../../../math/polynomials/trinom");
|
|
6
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
|
+
const oppositeNode_1 = require("../../../tree/nodes/functions/oppositeNode");
|
|
8
|
+
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
9
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
10
|
+
const uuid_1 = require("uuid");
|
|
11
|
+
exports.rootsFromFactorizedForm = {
|
|
12
|
+
id: 'rootsFromFactorizedForm',
|
|
13
|
+
connector: '=',
|
|
14
|
+
instruction: '',
|
|
15
|
+
label: "Déterminer les racines d'un trinôme à partir de sa forme factorisée",
|
|
16
|
+
levels: ['1reSpé', 'TermSpé', 'MathComp'],
|
|
17
|
+
isSingleStep: true,
|
|
18
|
+
sections: ['Second degré'],
|
|
19
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getRootsFromFactorizedFormQuestion, nb),
|
|
20
|
+
};
|
|
21
|
+
function getRootsFromFactorizedFormQuestion() {
|
|
22
|
+
const trinom = trinom_1.TrinomConstructor.randomFactorized();
|
|
23
|
+
const answer = trinom.getRootsEquationSolutionTex();
|
|
24
|
+
const roots = trinom.getRoots();
|
|
25
|
+
const getPropositions = (n) => {
|
|
26
|
+
const res = [];
|
|
27
|
+
res.push({
|
|
28
|
+
id: (0, uuid_1.v4)(),
|
|
29
|
+
statement: answer,
|
|
30
|
+
isRightAnswer: true,
|
|
31
|
+
format: 'tex',
|
|
32
|
+
});
|
|
33
|
+
if (roots.length === 1 && roots[0] !== 0) {
|
|
34
|
+
res.push({
|
|
35
|
+
id: (0, uuid_1.v4)(),
|
|
36
|
+
statement: `S = \\lbrace ${new oppositeNode_1.OppositeNode(new numberNode_1.NumberNode(roots[0]))} \\rbrace`,
|
|
37
|
+
isRightAnswer: false,
|
|
38
|
+
format: 'tex',
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
if (roots.length === 2 && roots[0] !== 0) {
|
|
42
|
+
res.push({
|
|
43
|
+
id: (0, uuid_1.v4)(),
|
|
44
|
+
statement: `S = \\lbrace ${new oppositeNode_1.OppositeNode(new numberNode_1.NumberNode(roots[0])).toTex()} ; ${roots[1]} \\rbrace`,
|
|
45
|
+
isRightAnswer: false,
|
|
46
|
+
format: 'tex',
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
if (roots.length === 2 && roots[1] !== 0) {
|
|
50
|
+
res.push({
|
|
51
|
+
id: (0, uuid_1.v4)(),
|
|
52
|
+
statement: `S = \\lbrace ${roots[0]} ; ${new oppositeNode_1.OppositeNode(new numberNode_1.NumberNode(roots[1])).toTex()} \\rbrace`,
|
|
53
|
+
isRightAnswer: false,
|
|
54
|
+
format: 'tex',
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
if (roots.length === 2 && roots[0] !== 0 && roots[1] !== 0) {
|
|
58
|
+
res.push({
|
|
59
|
+
id: (0, uuid_1.v4)(),
|
|
60
|
+
statement: `S = \\lbrace ${new oppositeNode_1.OppositeNode(new numberNode_1.NumberNode(roots[0])).toTex()} ; ${new oppositeNode_1.OppositeNode(new numberNode_1.NumberNode(roots[1])).toTex()} \\rbrace`,
|
|
61
|
+
isRightAnswer: false,
|
|
62
|
+
format: 'tex',
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
const missing = n - res.length;
|
|
66
|
+
for (let i = 0; i < missing; i++) {
|
|
67
|
+
let isDuplicate;
|
|
68
|
+
let proposition;
|
|
69
|
+
do {
|
|
70
|
+
const wrongAnswer = `S = \\lbrace ${(0, randint_1.randint)(-10, 11)}; ${(0, randint_1.randint)(-10, 11)} \\rbrace`;
|
|
71
|
+
proposition = {
|
|
72
|
+
id: (0, uuid_1.v4)() + ``,
|
|
73
|
+
statement: wrongAnswer,
|
|
74
|
+
isRightAnswer: false,
|
|
75
|
+
format: 'tex',
|
|
76
|
+
};
|
|
77
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
78
|
+
} while (isDuplicate);
|
|
79
|
+
res.push(proposition);
|
|
80
|
+
}
|
|
81
|
+
return (0, shuffle_1.shuffle)(res);
|
|
82
|
+
};
|
|
83
|
+
const question = {
|
|
84
|
+
answer: answer,
|
|
85
|
+
instruction: `Soit $f(x) = ${trinom.getFactorizedForm().toTex()}$. Résoudre l'équation $f(x) = 0$.`,
|
|
86
|
+
keys: ['S', 'equal', 'lbrace', 'semicolon', 'rbrace', 'emptyset'],
|
|
87
|
+
getPropositions,
|
|
88
|
+
answerFormat: 'tex',
|
|
89
|
+
};
|
|
90
|
+
return question;
|
|
91
|
+
}
|
|
92
|
+
exports.getRootsFromFactorizedFormQuestion = getRootsFromFactorizedFormQuestion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chasles.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/vectors/chasles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAO3E,eAAO,MAAM,OAAO,EAAE,QASrB,CAAC;AAIF,wBAAgB,kBAAkB,IAAI,QAAQ,CA0D7C"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getChaslesQuestion = exports.chasles = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
6
|
+
const random_1 = require("../../../utils/random");
|
|
7
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
8
|
+
const uuid_1 = require("uuid");
|
|
9
|
+
exports.chasles = {
|
|
10
|
+
id: 'chasles',
|
|
11
|
+
connector: '=',
|
|
12
|
+
instruction: '',
|
|
13
|
+
label: 'Relation de Chasles pour les vecteurs',
|
|
14
|
+
levels: ['2nde', '1reESM', '1reSpé'],
|
|
15
|
+
isSingleStep: true,
|
|
16
|
+
sections: ['Vecteurs'],
|
|
17
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getChaslesQuestion, nb),
|
|
18
|
+
};
|
|
19
|
+
const letters = 'ABCDEFGHIJKLMNPQRSTUVWXYZ';
|
|
20
|
+
function getChaslesQuestion() {
|
|
21
|
+
const nbOfVectors = (0, randint_1.randint)(2, 5);
|
|
22
|
+
const randLetters = (0, shuffle_1.shuffle)(letters.split('')).slice(0, nbOfVectors + 2);
|
|
23
|
+
let vectors = [];
|
|
24
|
+
for (let i = 0; i < nbOfVectors; i++) {
|
|
25
|
+
vectors.push(`${randLetters[i]}${randLetters[i + 1]}`);
|
|
26
|
+
}
|
|
27
|
+
const answer = `\\overrightarrow{${randLetters[0]}${randLetters[nbOfVectors]}}`;
|
|
28
|
+
const invVec = (vec) => {
|
|
29
|
+
return `\\overrightarrow{${vec[1]}${vec[0]}}`;
|
|
30
|
+
};
|
|
31
|
+
vectors = (0, shuffle_1.shuffle)(vectors).map((vec) => (Math.random() < 0.4 ? '-' + invVec(vec) : `+\\overrightarrow{${vec}}`));
|
|
32
|
+
let statement = vectors.join('');
|
|
33
|
+
if (statement[0] === '+')
|
|
34
|
+
statement = statement.slice(1, statement.length);
|
|
35
|
+
const getPropositions = (n) => {
|
|
36
|
+
const res = [];
|
|
37
|
+
res.push({
|
|
38
|
+
id: (0, uuid_1.v4)(),
|
|
39
|
+
statement: answer,
|
|
40
|
+
isRightAnswer: true,
|
|
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 a = (0, random_1.random)(randLetters);
|
|
49
|
+
const b = (0, random_1.random)(randLetters);
|
|
50
|
+
const wrongAnswer = `\\overrightarrow{${a}${b}}`;
|
|
51
|
+
proposition = {
|
|
52
|
+
id: (0, uuid_1.v4)() + ``,
|
|
53
|
+
statement: wrongAnswer,
|
|
54
|
+
isRightAnswer: false,
|
|
55
|
+
format: 'tex',
|
|
56
|
+
};
|
|
57
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
58
|
+
} while (isDuplicate);
|
|
59
|
+
res.push(proposition);
|
|
60
|
+
}
|
|
61
|
+
return (0, shuffle_1.shuffle)(res);
|
|
62
|
+
};
|
|
63
|
+
const question = {
|
|
64
|
+
answer: answer,
|
|
65
|
+
instruction: `Simplifier : $${statement}$`,
|
|
66
|
+
keys: ['overrightarrow', ...randLetters.sort((a, b) => a.localeCompare(b))],
|
|
67
|
+
getPropositions,
|
|
68
|
+
answerFormat: 'tex',
|
|
69
|
+
};
|
|
70
|
+
return question;
|
|
71
|
+
}
|
|
72
|
+
exports.getChaslesQuestion = getChaslesQuestion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"determinant.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/vectors/determinant.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,CAuDjD"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDeterminantQuestion = exports.determinant = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const vector_1 = require("../../../math/geometry/vector");
|
|
6
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
8
|
+
const uuid_1 = require("uuid");
|
|
9
|
+
exports.determinant = {
|
|
10
|
+
id: 'determinant',
|
|
11
|
+
connector: '=',
|
|
12
|
+
instruction: '',
|
|
13
|
+
label: 'Calculer le déterminant de deux vecteurs',
|
|
14
|
+
levels: ['2nde', '1reESM', '1reSpé'],
|
|
15
|
+
isSingleStep: true,
|
|
16
|
+
sections: ['Vecteurs'],
|
|
17
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getDeterminantQuestion, nb),
|
|
18
|
+
};
|
|
19
|
+
function getDeterminantQuestion() {
|
|
20
|
+
const u = vector_1.VectorConstructor.random('u');
|
|
21
|
+
const v = vector_1.VectorConstructor.random('v');
|
|
22
|
+
const answer = u.determinant(v);
|
|
23
|
+
const getPropositions = (n) => {
|
|
24
|
+
const res = [];
|
|
25
|
+
res.push({
|
|
26
|
+
id: (0, uuid_1.v4)(),
|
|
27
|
+
statement: answer.toTex(),
|
|
28
|
+
isRightAnswer: true,
|
|
29
|
+
format: 'tex',
|
|
30
|
+
});
|
|
31
|
+
const ps = u.scalarProduct(v);
|
|
32
|
+
if (ps.toTex() !== answer.toTex()) {
|
|
33
|
+
res.push({
|
|
34
|
+
id: (0, uuid_1.v4)(),
|
|
35
|
+
statement: ps.toTex(),
|
|
36
|
+
isRightAnswer: false,
|
|
37
|
+
format: 'tex',
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
const missing = n - res.length;
|
|
41
|
+
for (let i = 0; i < missing; i++) {
|
|
42
|
+
let isDuplicate;
|
|
43
|
+
let proposition;
|
|
44
|
+
do {
|
|
45
|
+
const wrongAnswer = (0, randint_1.randint)(-20, 20) + '';
|
|
46
|
+
proposition = {
|
|
47
|
+
id: (0, uuid_1.v4)() + ``,
|
|
48
|
+
statement: wrongAnswer,
|
|
49
|
+
isRightAnswer: false,
|
|
50
|
+
format: 'tex',
|
|
51
|
+
};
|
|
52
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
53
|
+
} while (isDuplicate);
|
|
54
|
+
res.push(proposition);
|
|
55
|
+
}
|
|
56
|
+
return (0, shuffle_1.shuffle)(res);
|
|
57
|
+
};
|
|
58
|
+
const question = {
|
|
59
|
+
answer: answer.toTex(),
|
|
60
|
+
instruction: `Soient les vecteurs $${u.toTexWithCoords()}$ et $${v.toTexWithCoords()}$. Calculer le déterminant $\\det(\\overrightarrow u;\\overrightarrow v)$.`,
|
|
61
|
+
keys: [],
|
|
62
|
+
getPropositions,
|
|
63
|
+
answerFormat: 'tex',
|
|
64
|
+
};
|
|
65
|
+
return question;
|
|
66
|
+
}
|
|
67
|
+
exports.getDeterminantQuestion = getDeterminantQuestion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intervalsUnion.d.ts","sourceRoot":"","sources":["../../../src/exercises/sets/intervalsUnion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAK3E,eAAO,MAAM,cAAc,EAAE,QAS5B,CAAC;AAEF,wBAAgB,yBAAyB,IAAI,QAAQ,CA2CpD"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getIntervalsUnionQuestion = exports.intervalsUnion = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const shuffle_1 = require("../../utils/shuffle");
|
|
6
|
+
const uuid_1 = require("uuid");
|
|
7
|
+
exports.intervalsUnion = {
|
|
8
|
+
id: 'intervalsUnion',
|
|
9
|
+
connector: '=',
|
|
10
|
+
instruction: '',
|
|
11
|
+
label: "Déterminer l'union de deux intervalles",
|
|
12
|
+
levels: ['2nde', '2ndPro', '1reTech', 'CAP'],
|
|
13
|
+
isSingleStep: true,
|
|
14
|
+
sections: ['Intervalles'],
|
|
15
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getIntervalsUnionQuestion, nb),
|
|
16
|
+
};
|
|
17
|
+
function getIntervalsUnionQuestion() {
|
|
18
|
+
const getPropositions = (n) => {
|
|
19
|
+
const res = [];
|
|
20
|
+
res.push({
|
|
21
|
+
id: (0, uuid_1.v4)(),
|
|
22
|
+
statement: ``,
|
|
23
|
+
isRightAnswer: true,
|
|
24
|
+
format: 'tex',
|
|
25
|
+
});
|
|
26
|
+
const missing = n - res.length;
|
|
27
|
+
for (let i = 0; i < missing; i++) {
|
|
28
|
+
let isDuplicate;
|
|
29
|
+
let proposition;
|
|
30
|
+
do {
|
|
31
|
+
const wrongAnswer = '';
|
|
32
|
+
proposition = {
|
|
33
|
+
id: (0, uuid_1.v4)() + ``,
|
|
34
|
+
statement: wrongAnswer,
|
|
35
|
+
isRightAnswer: false,
|
|
36
|
+
format: 'tex',
|
|
37
|
+
};
|
|
38
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
39
|
+
} while (isDuplicate);
|
|
40
|
+
res.push(proposition);
|
|
41
|
+
}
|
|
42
|
+
return (0, shuffle_1.shuffle)(res);
|
|
43
|
+
};
|
|
44
|
+
const question = {
|
|
45
|
+
answer: ``,
|
|
46
|
+
instruction: ``,
|
|
47
|
+
keys: [],
|
|
48
|
+
getPropositions,
|
|
49
|
+
answerFormat: 'tex',
|
|
50
|
+
};
|
|
51
|
+
return question;
|
|
52
|
+
}
|
|
53
|
+
exports.getIntervalsUnionQuestion = getIntervalsUnionQuestion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"squareRootEquation.d.ts","sourceRoot":"","sources":["../../../src/exercises/squareRoots/squareRootEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAM3E,eAAO,MAAM,kBAAkB,EAAE,QAShC,CAAC;AAEF,wBAAgB,6BAA6B,IAAI,QAAQ,CA2DxD"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSquareRootEquationQuestion = exports.squareRootEquation = 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.squareRootEquation = {
|
|
9
|
+
id: 'squareRootEquation',
|
|
10
|
+
connector: '\\iff',
|
|
11
|
+
instruction: '',
|
|
12
|
+
label: 'Résoudre une équation du type $\\sqrt x = k$',
|
|
13
|
+
levels: ['2nde', '1reESM', '1reSpé'],
|
|
14
|
+
isSingleStep: true,
|
|
15
|
+
sections: ['Racines carrées', 'Équations', 'Fonctions de référence'],
|
|
16
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getSquareRootEquationQuestion, nb),
|
|
17
|
+
};
|
|
18
|
+
function getSquareRootEquationQuestion() {
|
|
19
|
+
const k = Math.random() < 0.2 ? (0, randint_1.randint)(-20, 0) : (0, randint_1.randint)(0, 11);
|
|
20
|
+
const answer = k < 0 ? 'S = \\emptyset' : `S = \\lbrace ${k ** 2} \\rbrace`;
|
|
21
|
+
const getPropositions = (n) => {
|
|
22
|
+
const res = [];
|
|
23
|
+
res.push({
|
|
24
|
+
id: (0, uuid_1.v4)(),
|
|
25
|
+
statement: answer,
|
|
26
|
+
isRightAnswer: true,
|
|
27
|
+
format: 'tex',
|
|
28
|
+
});
|
|
29
|
+
if (k >= 0)
|
|
30
|
+
res.push({
|
|
31
|
+
id: (0, uuid_1.v4)(),
|
|
32
|
+
statement: 'S = \\emptyset',
|
|
33
|
+
isRightAnswer: false,
|
|
34
|
+
format: 'tex',
|
|
35
|
+
});
|
|
36
|
+
if (Math.sqrt(k) !== k ** 2)
|
|
37
|
+
res.push({
|
|
38
|
+
id: (0, uuid_1.v4)(),
|
|
39
|
+
statement: `S = \\lbrace \\sqrt{${k}} \\rbrace`,
|
|
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 = `S = \\lbrace ${(0, randint_1.randint)(1, 100)} \\rbrace`;
|
|
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'équation suivante : $\\sqrt x = ${k}$`,
|
|
64
|
+
keys: ['S', 'equal', 'lbrace', 'semicolon', 'rbrace', 'emptyset'],
|
|
65
|
+
getPropositions,
|
|
66
|
+
answerFormat: 'tex',
|
|
67
|
+
};
|
|
68
|
+
return question;
|
|
69
|
+
}
|
|
70
|
+
exports.getSquareRootEquationQuestion = getSquareRootEquationQuestion;
|
|
@@ -2,6 +2,7 @@ import { Node } from '../../tree/nodes/node';
|
|
|
2
2
|
import { Point } from './point';
|
|
3
3
|
export declare abstract class VectorConstructor {
|
|
4
4
|
static fromPoints(origin: Point, end: Point): Vector;
|
|
5
|
+
static random(name: string): Vector;
|
|
5
6
|
}
|
|
6
7
|
export declare class Vector {
|
|
7
8
|
name: string;
|
|
@@ -11,6 +12,7 @@ export declare class Vector {
|
|
|
11
12
|
constructor(name: string, x: Node, y: Node);
|
|
12
13
|
toTex(): string;
|
|
13
14
|
toTexWithCoords(): string;
|
|
15
|
+
determinant(v: Vector): Node;
|
|
14
16
|
scalarProduct(v: Vector): Node;
|
|
15
17
|
}
|
|
16
18
|
//# sourceMappingURL=vector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vector.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/vector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"vector.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/vector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAO7C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,8BAAsB,iBAAiB;IACrC,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,GAAG,MAAM;IAOpD,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAGpC;AAED,qBAAa,MAAM;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,CAAC,EAAE,IAAI,CAAC;IACR,CAAC,EAAE,IAAI,CAAC;gBACI,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI;IAO1C,KAAK,IAAI,MAAM;IAIf,eAAe,IAAI,MAAM;IAIzB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAG5B,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;CAG/B"}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Vector = exports.VectorConstructor = void 0;
|
|
4
|
+
const numberNode_1 = require("../../tree/nodes/numbers/numberNode");
|
|
4
5
|
const addNode_1 = require("../../tree/nodes/operators/addNode");
|
|
5
6
|
const multiplyNode_1 = require("../../tree/nodes/operators/multiplyNode");
|
|
6
7
|
const substractNode_1 = require("../../tree/nodes/operators/substractNode");
|
|
7
8
|
const simplify_1 = require("../../tree/parsers/simplify");
|
|
9
|
+
const randint_1 = require("../utils/random/randint");
|
|
8
10
|
class VectorConstructor {
|
|
9
11
|
static fromPoints(origin, end) {
|
|
10
12
|
return new Vector(`${origin.name}${end.name}`, new substractNode_1.SubstractNode(end.x, origin.x), new substractNode_1.SubstractNode(end.y, origin.y));
|
|
11
13
|
}
|
|
14
|
+
static random(name) {
|
|
15
|
+
return new Vector(name, new numberNode_1.NumberNode((0, randint_1.randint)(-10, 11)), new numberNode_1.NumberNode((0, randint_1.randint)(-10, 11)));
|
|
16
|
+
}
|
|
12
17
|
}
|
|
13
18
|
exports.VectorConstructor = VectorConstructor;
|
|
14
19
|
class Vector {
|
|
@@ -24,6 +29,9 @@ class Vector {
|
|
|
24
29
|
toTexWithCoords() {
|
|
25
30
|
return `\\overrightarrow{${this.name}}\\begin{pmatrix}${this.x.toTex()} \\\\ ${this.y.toTex()} \\end{pmatrix}`;
|
|
26
31
|
}
|
|
32
|
+
determinant(v) {
|
|
33
|
+
return (0, simplify_1.simplifyNode)(new substractNode_1.SubstractNode(new multiplyNode_1.MultiplyNode(this.x, v.y), new multiplyNode_1.MultiplyNode(this.y, v.x)));
|
|
34
|
+
}
|
|
27
35
|
scalarProduct(v) {
|
|
28
36
|
return (0, simplify_1.simplifyNode)(new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(this.x, v.x), new multiplyNode_1.MultiplyNode(this.y, v.y)));
|
|
29
37
|
}
|
|
@@ -5,6 +5,7 @@ import { Polynomial } from './polynomial';
|
|
|
5
5
|
export declare abstract class TrinomConstructor {
|
|
6
6
|
static random(domainA?: MathSet, domainB?: MathSet, domainC?: MathSet): Trinom;
|
|
7
7
|
static randomCanonical(domainA?: MathSet, domainAlpha?: MathSet, domainBeta?: MathSet): Trinom;
|
|
8
|
+
static randomFactorized(domainA?: MathSet, domainX1?: MathSet, domainX2?: MathSet): Trinom;
|
|
8
9
|
}
|
|
9
10
|
export declare class Trinom extends Polynomial {
|
|
10
11
|
a: number;
|
|
@@ -14,10 +15,14 @@ export declare class Trinom extends Polynomial {
|
|
|
14
15
|
constructor(a: number, b: number, c: number, variable?: string);
|
|
15
16
|
getDelta(): number;
|
|
16
17
|
getDeltaNode(): NumberNode;
|
|
18
|
+
getRoots(): number[];
|
|
19
|
+
getRootsNode(): Node[];
|
|
20
|
+
getRootsEquationSolutionTex(): string;
|
|
17
21
|
getAlpha(): number;
|
|
18
22
|
getAlphaNode(): Node;
|
|
19
23
|
getBeta(): number;
|
|
20
24
|
getBetaNode(): Node;
|
|
25
|
+
getFactorizedForm(): Node;
|
|
21
26
|
getCanonicalForm(): Node;
|
|
22
27
|
getSommet(): string;
|
|
23
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trinom.d.ts","sourceRoot":"","sources":["../../../src/math/polynomials/trinom.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"trinom.d.ts","sourceRoot":"","sources":["../../../src/math/polynomials/trinom.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAejE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,8BAAsB,iBAAiB;IACrC,MAAM,CAAC,MAAM,CACX,OAAO,GAAE,OAAmF,EAC5F,OAAO,GAAE,OAAqC,EAC9C,OAAO,GAAE,OAAqC,GAC7C,MAAM;IAOT,MAAM,CAAC,eAAe,CACpB,OAAO,GAAE,OAAmF,EAC5F,WAAW,GAAE,OAAqC,EAClD,UAAU,GAAE,OAAqC,GAChD,MAAM;IAQT,MAAM,CAAC,gBAAgB,CACrB,OAAO,GAAE,OAAmF,EAC5F,QAAQ,GAAE,OAAqC,EAC/C,QAAQ,GAAE,OAAqC,GAC9C,MAAM;CAOV;AAED,qBAAa,MAAO,SAAQ,UAAU;IACpC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;gBACL,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAY;IAQnE,QAAQ;IAGR,YAAY,IAAI,UAAU;IAI1B,QAAQ;IAQR,YAAY,IAAI,IAAI,EAAE;IAoBtB,2BAA2B;IAO3B,QAAQ;IAGR,YAAY,IAAI,IAAI;IAIpB,OAAO;IAIP,WAAW,IAAI,IAAI;IAInB,iBAAiB,IAAI,IAAI;IAqBzB,gBAAgB,IAAI,IAAI;IAYxB,SAAS;CAGV"}
|