math-exercises 1.3.47 → 1.3.52
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/equation/equationSimpleSquare.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/equationSimpleSquare.js +21 -21
- package/lib/exercises/calculLitteral/equation/equationType1Exercise.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/equationType1Exercise.js +13 -11
- package/lib/exercises/calculLitteral/equation/equationType2Exercise.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/equationType2Exercise.js +4 -7
- package/lib/exercises/calculLitteral/equation/firstDegreeEquation.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/firstDegreeEquation.js +10 -4
- package/lib/exercises/complex/addComplex.d.ts +4 -0
- package/lib/exercises/complex/addComplex.d.ts.map +1 -0
- package/lib/exercises/complex/addComplex.js +70 -0
- package/lib/exercises/complex/conjugateComplex.ts.d.ts +4 -0
- package/lib/exercises/complex/conjugateComplex.ts.d.ts.map +1 -0
- package/lib/exercises/complex/conjugateComplex.ts.js +73 -0
- package/lib/exercises/complex/conjugateDivideComplex.d.ts +4 -0
- package/lib/exercises/complex/conjugateDivideComplex.d.ts.map +1 -0
- package/lib/exercises/complex/conjugateDivideComplex.js +65 -0
- package/lib/exercises/complex/conjugateMultiplyComplex.d.ts +4 -0
- package/lib/exercises/complex/conjugateMultiplyComplex.d.ts.map +1 -0
- package/lib/exercises/complex/conjugateMultiplyComplex.js +69 -0
- package/lib/exercises/complex/divideComplex.d.ts +4 -0
- package/lib/exercises/complex/divideComplex.d.ts.map +1 -0
- package/lib/exercises/complex/divideComplex.js +61 -0
- package/lib/exercises/complex/inverseComplex.d.ts +4 -0
- package/lib/exercises/complex/inverseComplex.d.ts.map +1 -0
- package/lib/exercises/complex/inverseComplex.js +73 -0
- package/lib/exercises/complex/linearCombinaisonComplex.d.ts +4 -0
- package/lib/exercises/complex/linearCombinaisonComplex.d.ts.map +1 -0
- package/lib/exercises/complex/linearCombinaisonComplex.js +67 -0
- package/lib/exercises/complex/mutiplyComplex.d.ts +4 -0
- package/lib/exercises/complex/mutiplyComplex.d.ts.map +1 -0
- package/lib/exercises/complex/mutiplyComplex.js +67 -0
- package/lib/exercises/complex/reAndIm.d.ts +4 -0
- package/lib/exercises/complex/reAndIm.d.ts.map +1 -0
- package/lib/exercises/complex/reAndIm.js +79 -0
- package/lib/exercises/exercise.d.ts +3 -2
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/exercises.d.ts.map +1 -1
- package/lib/exercises/exercises.js +39 -8
- package/lib/exercises/functions/affines/template.d.ts +4 -0
- package/lib/exercises/functions/affines/template.d.ts.map +1 -0
- package/lib/exercises/functions/affines/template.js +51 -0
- package/lib/exercises/functions/basics/inverseImageFunctionGeogebra.js +2 -2
- package/lib/exercises/functions/trinoms/alphaBetaFromDevForm.d.ts +4 -0
- package/lib/exercises/functions/trinoms/alphaBetaFromDevForm.d.ts.map +1 -0
- package/lib/exercises/functions/trinoms/alphaBetaFromDevForm.js +63 -0
- package/lib/exercises/functions/trinoms/alphaBetaInCanonicalForm.d.ts +4 -0
- package/lib/exercises/functions/trinoms/alphaBetaInCanonicalForm.d.ts.map +1 -0
- package/lib/exercises/functions/trinoms/alphaBetaInCanonicalForm.js +91 -0
- package/lib/exercises/functions/trinoms/canonicalFromDevForm.d.ts +4 -0
- package/lib/exercises/functions/trinoms/canonicalFromDevForm.d.ts.map +1 -0
- package/lib/exercises/functions/trinoms/canonicalFromDevForm.js +58 -0
- package/lib/exercises/functions/trinoms/extremumFromCanonicalForm.d.ts +4 -0
- package/lib/exercises/functions/trinoms/extremumFromCanonicalForm.d.ts.map +1 -0
- package/lib/exercises/functions/trinoms/extremumFromCanonicalForm.js +84 -0
- package/lib/exercises/functions/trinoms/extremumTypeFromAlgebricForm.d.ts +4 -0
- package/lib/exercises/functions/trinoms/extremumTypeFromAlgebricForm.d.ts.map +1 -0
- package/lib/exercises/functions/trinoms/extremumTypeFromAlgebricForm.js +59 -0
- package/lib/exercises/functions/trinoms/variationsFromAlgebricForm.d.ts +4 -0
- package/lib/exercises/functions/trinoms/variationsFromAlgebricForm.d.ts.map +1 -0
- package/lib/exercises/functions/trinoms/variationsFromAlgebricForm.js +59 -0
- package/lib/exercises/probaStat/averageWithTable.d.ts +4 -0
- package/lib/exercises/probaStat/averageWithTable.d.ts.map +1 -0
- package/lib/exercises/probaStat/averageWithTable.js +76 -0
- package/lib/exercises/probaStat/median.d.ts +2 -2
- package/lib/exercises/probaStat/median.d.ts.map +1 -1
- package/lib/exercises/probaStat/median.js +7 -7
- package/lib/exercises/probaStat/medianList.d.ts +2 -2
- package/lib/exercises/probaStat/medianList.d.ts.map +1 -1
- package/lib/exercises/probaStat/medianList.js +7 -7
- package/lib/exercises/probaStat/probabilityTree.js +6 -6
- package/lib/exercises/probaStat/quartiles.js +1 -1
- package/lib/exercises/sequences/arithmetic/arithmeticSum.d.ts +1 -0
- package/lib/exercises/sequences/arithmetic/arithmeticSum.d.ts.map +1 -0
- package/lib/exercises/sequences/arithmetic/arithmeticSum.js +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/math/complex/complex.d.ts +19 -0
- package/lib/math/complex/complex.d.ts.map +1 -0
- package/lib/math/complex/complex.js +63 -0
- package/lib/math/polynomials/trinom.d.ts +24 -0
- package/lib/math/polynomials/trinom.d.ts.map +1 -0
- package/lib/math/polynomials/trinom.js +67 -0
- package/lib/tree/nodes/complex/complexNode.d.ts +15 -0
- package/lib/tree/nodes/complex/complexNode.d.ts.map +1 -0
- package/lib/tree/nodes/complex/complexNode.js +43 -0
- package/lib/tree/nodes/expression/expressionNode.d.ts +1 -0
- package/lib/tree/nodes/expression/expressionNode.d.ts.map +1 -0
- package/lib/tree/nodes/expression/expressionNode.js +1 -0
- package/lib/tree/nodes/functions/cosNode.d.ts +1 -0
- package/lib/tree/nodes/functions/cosNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/cosNode.js +4 -0
- package/lib/tree/nodes/functions/expNode.d.ts +1 -0
- package/lib/tree/nodes/functions/expNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/expNode.js +4 -0
- package/lib/tree/nodes/functions/logNode.d.ts +1 -0
- package/lib/tree/nodes/functions/logNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/logNode.js +4 -0
- package/lib/tree/nodes/functions/oppositeNode.d.ts +1 -0
- package/lib/tree/nodes/functions/oppositeNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/oppositeNode.js +4 -0
- package/lib/tree/nodes/functions/sinNode.d.ts +1 -0
- package/lib/tree/nodes/functions/sinNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sinNode.js +4 -0
- package/lib/tree/nodes/functions/sqrtNode.d.ts +1 -0
- package/lib/tree/nodes/functions/sqrtNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sqrtNode.js +4 -0
- package/lib/tree/nodes/node.d.ts +1 -0
- package/lib/tree/nodes/node.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/constantNode.d.ts +1 -0
- package/lib/tree/nodes/numbers/constantNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/constantNode.js +4 -0
- package/lib/tree/nodes/numbers/numberNode.d.ts +1 -0
- package/lib/tree/nodes/numbers/numberNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/numberNode.js +3 -0
- package/lib/tree/nodes/operators/addNode.d.ts +1 -0
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +4 -0
- package/lib/tree/nodes/operators/divideNode.d.ts +1 -0
- package/lib/tree/nodes/operators/divideNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/divideNode.js +4 -0
- package/lib/tree/nodes/operators/equalNode.d.ts +1 -0
- package/lib/tree/nodes/operators/equalNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/equalNode.js +4 -0
- package/lib/tree/nodes/operators/fractionNode.d.ts +1 -0
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +4 -0
- package/lib/tree/nodes/operators/multiplyNode.d.ts +1 -0
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +9 -0
- package/lib/tree/nodes/operators/powerNode.d.ts +1 -0
- package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/powerNode.js +4 -0
- package/lib/tree/nodes/operators/substractNode.d.ts +1 -0
- package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/substractNode.js +4 -0
- package/lib/tree/nodes/variables/variableNode.d.ts +1 -0
- package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
- package/lib/tree/nodes/variables/variableNode.js +3 -2
- package/lib/tree/parsers/simplify.d.ts +1 -0
- package/lib/tree/parsers/simplify.d.ts.map +1 -1
- package/lib/tree/parsers/simplify.js +10 -1
- package/lib/utils/diceFlip.d.ts +2 -0
- package/lib/utils/diceFlip.d.ts.map +1 -0
- package/lib/utils/diceFlip.js +12 -0
- package/package.json +1 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getInverseComplexQuestion = exports.inverseComplex = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const complex_1 = require("../../math/complex/complex");
|
|
6
|
+
const shuffle_1 = require("../../utils/shuffle");
|
|
7
|
+
const uuid_1 = require("uuid");
|
|
8
|
+
exports.inverseComplex = {
|
|
9
|
+
id: 'inverseComplex',
|
|
10
|
+
connector: '=',
|
|
11
|
+
instruction: '',
|
|
12
|
+
label: "Inverse d'un nombre complexe",
|
|
13
|
+
levels: ['MathExp'],
|
|
14
|
+
isSingleStep: true,
|
|
15
|
+
sections: ['Nombres complexes'],
|
|
16
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getInverseComplexQuestion, nb),
|
|
17
|
+
};
|
|
18
|
+
function getInverseComplexQuestion() {
|
|
19
|
+
const complex = complex_1.ComplexConstructor.randomNotReal();
|
|
20
|
+
const answer = complex.inverseNode().toTex();
|
|
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 opposite = complex.opposite().toTree().toTex();
|
|
30
|
+
if (opposite !== answer)
|
|
31
|
+
res.push({
|
|
32
|
+
id: (0, uuid_1.v4)(),
|
|
33
|
+
statement: opposite,
|
|
34
|
+
isRightAnswer: false,
|
|
35
|
+
format: 'tex',
|
|
36
|
+
});
|
|
37
|
+
const conj = complex.conjugate().toTree().toTex();
|
|
38
|
+
if (!res.some((prop) => prop.statement === conj))
|
|
39
|
+
res.push({
|
|
40
|
+
id: (0, uuid_1.v4)(),
|
|
41
|
+
statement: conj,
|
|
42
|
+
isRightAnswer: false,
|
|
43
|
+
format: 'tex',
|
|
44
|
+
});
|
|
45
|
+
const missing = n - res.length;
|
|
46
|
+
for (let i = 0; i < missing; i++) {
|
|
47
|
+
let isDuplicate;
|
|
48
|
+
let proposition;
|
|
49
|
+
do {
|
|
50
|
+
const wrongAnswer = complex_1.ComplexConstructor.random();
|
|
51
|
+
proposition = {
|
|
52
|
+
id: (0, uuid_1.v4)() + ``,
|
|
53
|
+
statement: wrongAnswer.toTree().toTex(),
|
|
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,
|
|
65
|
+
instruction: `Déterminer l'inverse de $z=${complex.toTree().toTex()}$.`,
|
|
66
|
+
keys: ['i'],
|
|
67
|
+
getPropositions,
|
|
68
|
+
answerFormat: 'tex',
|
|
69
|
+
startStatement: '\\frac{1}{z}',
|
|
70
|
+
};
|
|
71
|
+
return question;
|
|
72
|
+
}
|
|
73
|
+
exports.getInverseComplexQuestion = getInverseComplexQuestion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linearCombinaisonComplex.d.ts","sourceRoot":"","sources":["../../../src/exercises/complex/linearCombinaisonComplex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAc3E,eAAO,MAAM,wBAAwB,EAAE,QAStC,CAAC;AAEF,wBAAgB,mCAAmC,IAAI,QAAQ,CA0D9D"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLinearCombinaisonComplexQuestion = exports.linearCombinaisonComplex = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const complex_1 = require("../../math/complex/complex");
|
|
6
|
+
const randint_1 = require("../../math/utils/random/randint");
|
|
7
|
+
const numberNode_1 = require("../../tree/nodes/numbers/numberNode");
|
|
8
|
+
const addNode_1 = require("../../tree/nodes/operators/addNode");
|
|
9
|
+
const multiplyNode_1 = require("../../tree/nodes/operators/multiplyNode");
|
|
10
|
+
const variableNode_1 = require("../../tree/nodes/variables/variableNode");
|
|
11
|
+
const simplify_1 = require("../../tree/parsers/simplify");
|
|
12
|
+
const shuffle_1 = require("../../utils/shuffle");
|
|
13
|
+
const uuid_1 = require("uuid");
|
|
14
|
+
exports.linearCombinaisonComplex = {
|
|
15
|
+
id: 'linearCombinaisonComplex',
|
|
16
|
+
connector: '=',
|
|
17
|
+
instruction: '',
|
|
18
|
+
label: 'Combinaison linéaire de deux nombres complexes',
|
|
19
|
+
levels: ['MathExp'],
|
|
20
|
+
isSingleStep: true,
|
|
21
|
+
sections: ['Nombres complexes'],
|
|
22
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getLinearCombinaisonComplexQuestion, nb),
|
|
23
|
+
};
|
|
24
|
+
function getLinearCombinaisonComplexQuestion() {
|
|
25
|
+
const z1 = complex_1.ComplexConstructor.random();
|
|
26
|
+
const z2 = complex_1.ComplexConstructor.random();
|
|
27
|
+
const a = (0, randint_1.randint)(-10, 11, [0]);
|
|
28
|
+
const b = (0, randint_1.randint)(-10, 11, [0]);
|
|
29
|
+
const statement = (0, simplify_1.simplifyNode)(new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a), new variableNode_1.VariableNode('z_1')), new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(b), new variableNode_1.VariableNode('z_2'))));
|
|
30
|
+
// const statement = simplify(`${a}z+${b}z'`);
|
|
31
|
+
const answer = (0, simplify_1.simplifyComplex)(new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a), z1.toTree()), new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(b), z2.toTree())));
|
|
32
|
+
const getPropositions = (n) => {
|
|
33
|
+
const res = [];
|
|
34
|
+
res.push({
|
|
35
|
+
id: (0, uuid_1.v4)(),
|
|
36
|
+
statement: answer.toTex(),
|
|
37
|
+
isRightAnswer: true,
|
|
38
|
+
format: 'tex',
|
|
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 = complex_1.ComplexConstructor.random();
|
|
46
|
+
proposition = {
|
|
47
|
+
id: (0, uuid_1.v4)() + '',
|
|
48
|
+
statement: wrongAnswer.toTree().toTex(),
|
|
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: `Soit $z_1=${z1.toTree().toTex()}$ et $z_2=${z2.toTree().toTex()}$. Calculer $${statement.toTex()}$.`,
|
|
61
|
+
keys: ['i', 'z', 'quote'],
|
|
62
|
+
getPropositions,
|
|
63
|
+
answerFormat: 'tex',
|
|
64
|
+
};
|
|
65
|
+
return question;
|
|
66
|
+
}
|
|
67
|
+
exports.getLinearCombinaisonComplexQuestion = getLinearCombinaisonComplexQuestion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutiplyComplex.d.ts","sourceRoot":"","sources":["../../../src/exercises/complex/mutiplyComplex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAM3E,eAAO,MAAM,cAAc,EAAE,QAS5B,CAAC;AAEF,wBAAgB,yBAAyB,IAAI,QAAQ,CA0DpD"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMutiplyComplexQuestion = exports.mutiplyComplex = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const complex_1 = require("../../math/complex/complex");
|
|
6
|
+
const shuffle_1 = require("../../utils/shuffle");
|
|
7
|
+
const uuid_1 = require("uuid");
|
|
8
|
+
exports.mutiplyComplex = {
|
|
9
|
+
id: 'mutiplyComplex',
|
|
10
|
+
connector: '=',
|
|
11
|
+
instruction: '',
|
|
12
|
+
label: 'Multiplier deux nombres complexes',
|
|
13
|
+
levels: ['MathExp'],
|
|
14
|
+
isSingleStep: true,
|
|
15
|
+
sections: ['Nombres complexes'],
|
|
16
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getMutiplyComplexQuestion, nb),
|
|
17
|
+
};
|
|
18
|
+
function getMutiplyComplexQuestion() {
|
|
19
|
+
const z1 = complex_1.ComplexConstructor.random();
|
|
20
|
+
let z2;
|
|
21
|
+
do {
|
|
22
|
+
z2 = complex_1.ComplexConstructor.random();
|
|
23
|
+
} while (z1.im === 0 && z2.im === 0);
|
|
24
|
+
const answer = z1.multiply(z2).toTree();
|
|
25
|
+
const getPropositions = (n) => {
|
|
26
|
+
const res = [];
|
|
27
|
+
res.push({
|
|
28
|
+
id: (0, uuid_1.v4)(),
|
|
29
|
+
statement: answer.toTex(),
|
|
30
|
+
isRightAnswer: true,
|
|
31
|
+
format: 'tex',
|
|
32
|
+
});
|
|
33
|
+
res.push({
|
|
34
|
+
id: (0, uuid_1.v4)(),
|
|
35
|
+
statement: answer.toComplex().conjugate().toTree().toTex(),
|
|
36
|
+
isRightAnswer: true,
|
|
37
|
+
format: 'tex',
|
|
38
|
+
});
|
|
39
|
+
const missing = n - res.length;
|
|
40
|
+
for (let i = 0; i < missing; i++) {
|
|
41
|
+
let isDuplicate;
|
|
42
|
+
let proposition;
|
|
43
|
+
do {
|
|
44
|
+
const wrongAnswer = complex_1.ComplexConstructor.random();
|
|
45
|
+
proposition = {
|
|
46
|
+
id: (0, uuid_1.v4)() + '',
|
|
47
|
+
statement: wrongAnswer.toTree().toTex(),
|
|
48
|
+
isRightAnswer: false,
|
|
49
|
+
format: 'tex',
|
|
50
|
+
};
|
|
51
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
52
|
+
} while (isDuplicate);
|
|
53
|
+
res.push(proposition);
|
|
54
|
+
}
|
|
55
|
+
return (0, shuffle_1.shuffle)(res);
|
|
56
|
+
};
|
|
57
|
+
const question = {
|
|
58
|
+
answer: answer.toTex(),
|
|
59
|
+
instruction: `Soit $z=${z1.toTree().toTex()}$ et $z'=${z2.toTree().toTex()}$. Calculer $z\\times z'$.`,
|
|
60
|
+
keys: ['i', 'z', 'quote'],
|
|
61
|
+
getPropositions,
|
|
62
|
+
answerFormat: 'tex',
|
|
63
|
+
startStatement: "z\\times z'",
|
|
64
|
+
};
|
|
65
|
+
return question;
|
|
66
|
+
}
|
|
67
|
+
exports.getMutiplyComplexQuestion = getMutiplyComplexQuestion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reAndIm.d.ts","sourceRoot":"","sources":["../../../src/exercises/complex/reAndIm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAW3E,eAAO,MAAM,OAAO,EAAE,QASrB,CAAC;AAEF,wBAAgB,kBAAkB,IAAI,QAAQ,CAmE7C"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getReAndImQuestion = exports.reAndIm = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const complex_1 = require("../../math/complex/complex");
|
|
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.reAndIm = {
|
|
11
|
+
id: 'getReAndImQuestion',
|
|
12
|
+
connector: '=',
|
|
13
|
+
instruction: '',
|
|
14
|
+
label: 'Identifier partie réelle et partie imaginaire',
|
|
15
|
+
levels: ['MathExp'],
|
|
16
|
+
isSingleStep: true,
|
|
17
|
+
sections: ['Nombres complexes'],
|
|
18
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getReAndImQuestion, nb),
|
|
19
|
+
};
|
|
20
|
+
function getReAndImQuestion() {
|
|
21
|
+
const z1 = complex_1.ComplexConstructor.random();
|
|
22
|
+
const isRe = (0, coinFlip_1.coinFlip)();
|
|
23
|
+
const answer = isRe ? z1.re : z1.im;
|
|
24
|
+
const getPropositions = (n) => {
|
|
25
|
+
const res = [];
|
|
26
|
+
res.push({
|
|
27
|
+
id: (0, uuid_1.v4)() + '',
|
|
28
|
+
statement: answer.toString(),
|
|
29
|
+
isRightAnswer: true,
|
|
30
|
+
format: 'tex',
|
|
31
|
+
});
|
|
32
|
+
res.push({
|
|
33
|
+
id: (0, uuid_1.v4)() + '',
|
|
34
|
+
statement: z1.im + 'i',
|
|
35
|
+
isRightAnswer: false,
|
|
36
|
+
format: 'tex',
|
|
37
|
+
});
|
|
38
|
+
if (!res.some((prop) => prop.statement === (isRe ? z1.im.toString() : z1.re.toString())))
|
|
39
|
+
res.push({
|
|
40
|
+
id: (0, uuid_1.v4)() + '',
|
|
41
|
+
statement: isRe ? z1.im.toString() : z1.re.toString(),
|
|
42
|
+
isRightAnswer: false,
|
|
43
|
+
format: 'tex',
|
|
44
|
+
});
|
|
45
|
+
if (!res.some((prop) => prop.statement === (-z1.im).toString()))
|
|
46
|
+
res.push({
|
|
47
|
+
id: (0, uuid_1.v4)() + '',
|
|
48
|
+
statement: (-z1.im).toString(),
|
|
49
|
+
isRightAnswer: false,
|
|
50
|
+
format: 'tex',
|
|
51
|
+
});
|
|
52
|
+
const missing = n - res.length;
|
|
53
|
+
for (let i = 0; i < missing; i++) {
|
|
54
|
+
let isDuplicate;
|
|
55
|
+
let proposition;
|
|
56
|
+
do {
|
|
57
|
+
const wrongAnswer = (0, randint_1.randint)(-10, 11) + '';
|
|
58
|
+
proposition = {
|
|
59
|
+
id: (0, uuid_1.v4)() + '',
|
|
60
|
+
statement: wrongAnswer,
|
|
61
|
+
isRightAnswer: false,
|
|
62
|
+
format: 'tex',
|
|
63
|
+
};
|
|
64
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
65
|
+
} while (isDuplicate);
|
|
66
|
+
res.push(proposition);
|
|
67
|
+
}
|
|
68
|
+
return (0, shuffle_1.shuffle)(res);
|
|
69
|
+
};
|
|
70
|
+
const question = {
|
|
71
|
+
answer: answer.toString(),
|
|
72
|
+
instruction: `Soit $z=${z1.toTree().toTex()}$. Quelle est la partie ${isRe ? 'réelle' : 'imaginaire'} de $z$ ?`,
|
|
73
|
+
keys: ['i', 'z'],
|
|
74
|
+
getPropositions,
|
|
75
|
+
answerFormat: 'tex',
|
|
76
|
+
};
|
|
77
|
+
return question;
|
|
78
|
+
}
|
|
79
|
+
exports.getReAndImQuestion = getReAndImQuestion;
|
|
@@ -10,6 +10,7 @@ export interface Question {
|
|
|
10
10
|
startStatement?: string;
|
|
11
11
|
answer: string;
|
|
12
12
|
answerFormat: 'tex' | 'raw';
|
|
13
|
+
questionType?: 'QCM' | 'free';
|
|
13
14
|
keys?: string[];
|
|
14
15
|
commands?: string[];
|
|
15
16
|
coords?: number[];
|
|
@@ -23,10 +24,10 @@ export interface Exercise {
|
|
|
23
24
|
label: string;
|
|
24
25
|
sections: MathSection[];
|
|
25
26
|
levels: MathLevel[];
|
|
26
|
-
connector
|
|
27
|
+
connector?: '=' | '\\iff' | '\\approx';
|
|
27
28
|
keys?: string[];
|
|
28
29
|
generator(nb: number, options?: GeneratorOptions): Question[];
|
|
29
30
|
}
|
|
30
31
|
export type MathLevel = '6ème' | '5ème' | '4ème' | '3ème' | '2nde' | '1reTech' | '1reESM' | '1reSpé' | 'TermSpé' | 'TermTech' | 'MathExp' | 'MathComp';
|
|
31
|
-
export type MathSection = 'Calcul littéral' | 'Équations' | 'Racines carrées' | 'Fractions' | 'Calculs' | 'Géométrie cartésienne' | 'Vecteurs' | 'Puissances' | 'Suites' | 'Pourcentages' | 'Dérivation' | 'Probabilités' | 'Droites' | 'Géométrie euclidienne' | 'Conversions' | 'Arithmétique' | 'Fonctions affines' | 'Proportionnalité' | 'Logarithme népérien' | 'Exponentielle' | 'Fonctions' | 'Statistiques' | 'Limites' | 'Intégration' | 'Primitives' | 'Équations différentielles' | 'Trigonométrie';
|
|
32
|
+
export type MathSection = 'Calcul littéral' | 'Équations' | 'Racines carrées' | 'Fractions' | 'Calculs' | 'Géométrie cartésienne' | 'Vecteurs' | 'Puissances' | 'Suites' | 'Pourcentages' | 'Dérivation' | 'Probabilités' | 'Droites' | 'Géométrie euclidienne' | 'Conversions' | 'Arithmétique' | 'Fonctions affines' | 'Proportionnalité' | 'Logarithme népérien' | 'Exponentielle' | 'Fonctions' | 'Statistiques' | 'Limites' | 'Intégration' | 'Primitives' | 'Équations différentielles' | 'Trigonométrie' | 'Second degré' | 'Nombres complexes';
|
|
32
33
|
//# sourceMappingURL=exercise.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAAA,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,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,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,EAAE,GAAG,GAAG,OAAO,GAAG,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAAA,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,MAAM,EAAE,CAAC;IAChB,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;CAC/D;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,CAAC;AAEf,MAAM,MAAM,WAAW,GACnB,iBAAiB,GACjB,WAAW,GACX,iBAAiB,GACjB,WAAW,GACX,SAAS,GACT,uBAAuB,GACvB,UAAU,GACV,YAAY,GACZ,QAAQ,GACR,cAAc,GACd,YAAY,GACZ,cAAc,GACd,SAAS,GACT,uBAAuB,GACvB,aAAa,GACb,cAAc,GACd,mBAAmB,GACnB,kBAAkB,GAClB,qBAAqB,GACrB,eAAe,GACf,WAAW,GACX,cAAc,GACd,SAAS,GACT,aAAa,GACb,YAAY,GACZ,2BAA2B,GAC3B,eAAe,GACf,cAAc,GACd,mBAAmB,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":"AA8JA,eAAO,MAAM,SAAS,iCAmNrB,CAAC"}
|
|
@@ -111,10 +111,7 @@ const logEquation_1 = require("./calculLitteral/equation/logEquation");
|
|
|
111
111
|
const expEquation_1 = require("./calculLitteral/equation/expEquation");
|
|
112
112
|
const expSimplifiying_1 = require("./calculLitteral/simplifying/expSimplifiying");
|
|
113
113
|
const logSimplifiying_1 = require("./calculLitteral/simplifying/logSimplifiying");
|
|
114
|
-
const frequencyTable_1 = require("../exercises/probaStat/frequencyTable");
|
|
115
|
-
const median_1 = require("../exercises/probaStat/median");
|
|
116
114
|
const quartiles_1 = require("../exercises/probaStat/quartiles");
|
|
117
|
-
const medianList_1 = require("../exercises/probaStat/medianList");
|
|
118
115
|
const quartilesList_1 = require("../exercises/probaStat/quartilesList");
|
|
119
116
|
const euclideanDivision_1 = require("../exercises/calcul/arithmetics/euclideanDivision");
|
|
120
117
|
const thirdDegreeFunctionVariation_1 = require("../exercises/derivation/derivative/thirdDegreeFunctionVariation");
|
|
@@ -135,6 +132,23 @@ const inverseImageFunction_1 = require("./functions/basics/inverseImageFunction"
|
|
|
135
132
|
const imageFunctionGeogebra_1 = require("./functions/basics/imageFunctionGeogebra");
|
|
136
133
|
const inverseImageFunctionGeogebra_1 = require("./functions/basics/inverseImageFunctionGeogebra");
|
|
137
134
|
const signFunction_1 = require("./functions/affines/signFunction");
|
|
135
|
+
const alphaBetaInCanonicalForm_1 = require("./functions/trinoms/alphaBetaInCanonicalForm");
|
|
136
|
+
const canonicalFromDevForm_1 = require("./functions/trinoms/canonicalFromDevForm");
|
|
137
|
+
const alphaBetaFromDevForm_1 = require("./functions/trinoms/alphaBetaFromDevForm");
|
|
138
|
+
const extremumFromCanonicalForm_1 = require("./functions/trinoms/extremumFromCanonicalForm");
|
|
139
|
+
const extremumTypeFromAlgebricForm_1 = require("./functions/trinoms/extremumTypeFromAlgebricForm");
|
|
140
|
+
const variationsFromAlgebricForm_1 = require("./functions/trinoms/variationsFromAlgebricForm");
|
|
141
|
+
const mutiplyComplex_1 = require("./complex/mutiplyComplex");
|
|
142
|
+
const reAndIm_1 = require("./complex/reAndIm");
|
|
143
|
+
const addComplex_1 = require("./complex/addComplex");
|
|
144
|
+
const averageWithTable_1 = require("./probaStat/averageWithTable");
|
|
145
|
+
const medianList_1 = require("./probaStat/medianList");
|
|
146
|
+
const median_1 = require("./probaStat/median");
|
|
147
|
+
const conjugateComplex_ts_1 = require("./complex/conjugateComplex.ts");
|
|
148
|
+
const conjugateMultiplyComplex_1 = require("./complex/conjugateMultiplyComplex");
|
|
149
|
+
const inverseComplex_1 = require("./complex/inverseComplex");
|
|
150
|
+
const divideComplex_1 = require("./complex/divideComplex");
|
|
151
|
+
const conjugateDivideComplex_1 = require("./complex/conjugateDivideComplex");
|
|
138
152
|
exports.exercises = [
|
|
139
153
|
/**
|
|
140
154
|
* calcul litteral
|
|
@@ -296,11 +310,6 @@ exports.exercises = [
|
|
|
296
310
|
logSimplifiying_1.logSimplifiying,
|
|
297
311
|
imageFunctionGeogebra_1.imageFunctionGeogebra,
|
|
298
312
|
inverseImageFunctionGeogebra_1.inverseImageFunctionGeogebra,
|
|
299
|
-
frequencyTable_1.frequencyTable,
|
|
300
|
-
median_1.median,
|
|
301
|
-
quartiles_1.quartiles,
|
|
302
|
-
medianList_1.medianList,
|
|
303
|
-
quartilesList_1.quartilesList,
|
|
304
313
|
euclideanDivision_1.euclideanDivision,
|
|
305
314
|
signFunction_1.signFunction,
|
|
306
315
|
thirdDegreeFunctionVariation_1.thirdDegreeFunctionVariation,
|
|
@@ -313,4 +322,26 @@ exports.exercises = [
|
|
|
313
322
|
usualPrimitives_1.usualPrimitives,
|
|
314
323
|
equaDiffGeneralForme_1.exponentialDifferentialEquation,
|
|
315
324
|
equaDiffGeneralFormeWithIC_1.exponentialDifferentialEquationWithIC,
|
|
325
|
+
/**Stats */
|
|
326
|
+
averageWithTable_1.averageWithTable,
|
|
327
|
+
medianList_1.medianWithList,
|
|
328
|
+
quartiles_1.quartiles,
|
|
329
|
+
median_1.medianWithTable,
|
|
330
|
+
quartilesList_1.quartilesList,
|
|
331
|
+
/**Trinomes */
|
|
332
|
+
alphaBetaInCanonicalForm_1.alphaBetaInCanonicalForm,
|
|
333
|
+
canonicalFromDevForm_1.canonicalFromDevForm,
|
|
334
|
+
alphaBetaFromDevForm_1.alphaBetaFromDevForm,
|
|
335
|
+
extremumFromCanonicalForm_1.extremumFromCanonicalForm,
|
|
336
|
+
extremumTypeFromAlgebricForm_1.extremumTypeFromAlgebricForm,
|
|
337
|
+
variationsFromAlgebricForm_1.variationsFromAlgebricForm,
|
|
338
|
+
/**Complexes */
|
|
339
|
+
mutiplyComplex_1.mutiplyComplex,
|
|
340
|
+
reAndIm_1.reAndIm,
|
|
341
|
+
addComplex_1.addComplex,
|
|
342
|
+
conjugateComplex_ts_1.conjugateComplex,
|
|
343
|
+
conjugateMultiplyComplex_1.conjugateMultiplyComplex,
|
|
344
|
+
inverseComplex_1.inverseComplex,
|
|
345
|
+
divideComplex_1.divideComplex,
|
|
346
|
+
conjugateDivideComplex_1.conjugateDivideComplex,
|
|
316
347
|
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/affines/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAK3E,eAAO,MAAM,GAAG,EAAE,QASjB,CAAC;AAEF,wBAAgB,cAAc,IAAI,QAAQ,CAyCzC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getExoQuestion = exports.exo = 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.exo = {
|
|
8
|
+
id: 'name',
|
|
9
|
+
connector: '',
|
|
10
|
+
instruction: '',
|
|
11
|
+
label: '',
|
|
12
|
+
levels: [],
|
|
13
|
+
isSingleStep: true,
|
|
14
|
+
sections: [],
|
|
15
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getExoQuestion, nb),
|
|
16
|
+
};
|
|
17
|
+
function getExoQuestion() {
|
|
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
|
+
for (let i = 0; i < n - 1; i++) {
|
|
27
|
+
let isDuplicate;
|
|
28
|
+
let proposition;
|
|
29
|
+
do {
|
|
30
|
+
const wrongAnswer = '';
|
|
31
|
+
proposition = {
|
|
32
|
+
id: (0, uuid_1.v4)() + '',
|
|
33
|
+
statement: wrongAnswer,
|
|
34
|
+
isRightAnswer: false,
|
|
35
|
+
format: 'tex',
|
|
36
|
+
};
|
|
37
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
38
|
+
} while (isDuplicate);
|
|
39
|
+
res.push(proposition);
|
|
40
|
+
}
|
|
41
|
+
return (0, shuffle_1.shuffle)(res);
|
|
42
|
+
};
|
|
43
|
+
const question = {
|
|
44
|
+
answer: '',
|
|
45
|
+
keys: [],
|
|
46
|
+
getPropositions,
|
|
47
|
+
answerFormat: 'tex',
|
|
48
|
+
};
|
|
49
|
+
return question;
|
|
50
|
+
}
|
|
51
|
+
exports.getExoQuestion = getExoQuestion;
|
|
@@ -40,8 +40,8 @@ function getInverseImageFunctionGeogebra() {
|
|
|
40
40
|
roots = polynome2.getRoots();
|
|
41
41
|
}
|
|
42
42
|
const statement = rand
|
|
43
|
-
? `Déterminer le ou les antécédents de
|
|
44
|
-
: `Déterminer le ou les antécédents de
|
|
43
|
+
? `Déterminer le ou les antécédents de $${polynome1.calculate(xValue)}$ par la fonction $f$ représentée ci dessous.`
|
|
44
|
+
: `Déterminer le ou les antécédents de $${yValue}$ par la fonction $f$ représentée ci dessous.`;
|
|
45
45
|
const answer = rand
|
|
46
46
|
? xValue
|
|
47
47
|
: roots.length === 2
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alphaBetaFromDevForm.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/trinoms/alphaBetaFromDevForm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAU3E,eAAO,MAAM,oBAAoB,EAAE,QASlC,CAAC;AAEF,wBAAgB,+BAA+B,IAAI,QAAQ,CAmD1D"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAlphaBetaFromDevFormQuestion = exports.alphaBetaFromDevForm = 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 coinFlip_1 = require("../../../utils/coinFlip");
|
|
8
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
9
|
+
const uuid_1 = require("uuid");
|
|
10
|
+
exports.alphaBetaFromDevForm = {
|
|
11
|
+
id: 'alphaBetaFromDevForm',
|
|
12
|
+
connector: '=',
|
|
13
|
+
instruction: '',
|
|
14
|
+
label: 'Déterminer $\\alpha$ ou $\\beta$ à partir de la forme développée',
|
|
15
|
+
levels: ['1reSpé'],
|
|
16
|
+
isSingleStep: false,
|
|
17
|
+
sections: ['Second degré'],
|
|
18
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getAlphaBetaFromDevFormQuestion, nb),
|
|
19
|
+
};
|
|
20
|
+
function getAlphaBetaFromDevFormQuestion() {
|
|
21
|
+
const trinom = trinom_1.TrinomConstructor.randomCanonical();
|
|
22
|
+
const param = (0, coinFlip_1.coinFlip)() ? '\\alpha' : '\\beta';
|
|
23
|
+
const alpha = trinom.getAlpha();
|
|
24
|
+
const beta = trinom.getBeta();
|
|
25
|
+
const alphaTex = trinom.getAlphaNode().toTex();
|
|
26
|
+
const betaTex = trinom.getBetaNode().toTex();
|
|
27
|
+
const answer = param === '\\alpha' ? alphaTex : betaTex;
|
|
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
|
+
const missing = n - res.length;
|
|
37
|
+
for (let i = 0; i < missing; i++) {
|
|
38
|
+
let isDuplicate;
|
|
39
|
+
let proposition;
|
|
40
|
+
do {
|
|
41
|
+
proposition = {
|
|
42
|
+
id: (0, uuid_1.v4)() + '',
|
|
43
|
+
statement: (0, randint_1.randint)(-10, 11).toString(),
|
|
44
|
+
isRightAnswer: false,
|
|
45
|
+
format: 'tex',
|
|
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
|
+
answer: answer,
|
|
55
|
+
keys: ['x', '\\alpha', '\\beta'],
|
|
56
|
+
instruction: `Soit $f$ la fonction définie par $f(x) = ${trinom.toTree().toTex()}$. Que vaut $${param}$ ?`,
|
|
57
|
+
getPropositions,
|
|
58
|
+
answerFormat: 'tex',
|
|
59
|
+
startStatement: param,
|
|
60
|
+
};
|
|
61
|
+
return question;
|
|
62
|
+
}
|
|
63
|
+
exports.getAlphaBetaFromDevFormQuestion = getAlphaBetaFromDevFormQuestion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alphaBetaInCanonicalForm.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/trinoms/alphaBetaInCanonicalForm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAW3E,eAAO,MAAM,wBAAwB,EAAE,QAStC,CAAC;AAEF,wBAAgB,mCAAmC,IAAI,QAAQ,CA4E9D"}
|