math-exercises 1.4.4 → 1.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/exercises/calcul/fractions/fractionToPercentToDecimal.js +1 -1
- package/lib/exercises/calcul/proportionality/proportionalityTable.d.ts.map +1 -1
- package/lib/exercises/calcul/proportionality/proportionalityTable.js +8 -7
- package/lib/exercises/derivation/derivative/expDerivativeOne.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/expDerivativeOne.js +4 -2
- package/lib/exercises/derivation/derivative/thirdDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/thirdDegreeDerivative.js +5 -4
- package/lib/exercises/exercise.d.ts +2 -2
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/exercises.d.ts +2 -1
- package/lib/exercises/exercises.d.ts.map +1 -1
- package/lib/exercises/exercises.js +20 -3
- package/lib/exercises/functions/affines/leadingCoefficient.d.ts.map +1 -1
- package/lib/exercises/functions/affines/leadingCoefficient.js +2 -1
- package/lib/exercises/functions/trinoms/niceRootsFromDevForm.d.ts +4 -0
- package/lib/exercises/functions/trinoms/niceRootsFromDevForm.d.ts.map +1 -0
- package/lib/exercises/functions/trinoms/niceRootsFromDevForm.js +63 -0
- package/lib/exercises/functions/trinoms/rootsFromDevForm.d.ts.map +1 -1
- package/lib/exercises/functions/trinoms/rootsFromDevForm.js +8 -3
- package/lib/exercises/geometry/cartesian/distanceBetweenTwoPoints.d.ts.map +1 -1
- package/lib/exercises/geometry/cartesian/distanceBetweenTwoPoints.js +7 -36
- package/lib/exercises/geometry/euclidean/pythagore.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/pythagore.js +2 -1
- package/lib/exercises/limits/polynomLimit.d.ts +4 -0
- package/lib/exercises/limits/polynomLimit.d.ts.map +1 -0
- package/lib/exercises/limits/polynomLimit.js +66 -0
- package/lib/exercises/limits/polynomLimitNoFI.d.ts +4 -0
- package/lib/exercises/limits/polynomLimitNoFI.d.ts.map +1 -0
- package/lib/exercises/limits/polynomLimitNoFI.js +67 -0
- package/lib/exercises/limits/rationalFracForbiddenValueLimit.d.ts +4 -0
- package/lib/exercises/limits/rationalFracForbiddenValueLimit.d.ts.map +1 -0
- package/lib/exercises/limits/rationalFracForbiddenValueLimit.js +82 -0
- package/lib/exercises/limits/rationalFracLimit.d.ts +4 -0
- package/lib/exercises/limits/rationalFracLimit.d.ts.map +1 -0
- package/lib/exercises/limits/rationalFracLimit.js +84 -0
- package/lib/exercises/powers/calculateNegativePower.d.ts +4 -0
- package/lib/exercises/powers/calculateNegativePower.d.ts.map +1 -0
- package/lib/exercises/powers/calculateNegativePower.js +76 -0
- package/lib/exercises/powers/calculatePower.d.ts +4 -0
- package/lib/exercises/powers/calculatePower.d.ts.map +1 -0
- package/lib/exercises/powers/calculatePower.js +80 -0
- package/lib/exercises/powers/decimalToScientific.d.ts +4 -0
- package/lib/exercises/powers/decimalToScientific.d.ts.map +1 -0
- package/lib/exercises/powers/decimalToScientific.js +89 -0
- package/lib/exercises/powers/powerDefinition.d.ts +4 -0
- package/lib/exercises/powers/powerDefinition.d.ts.map +1 -0
- package/lib/exercises/powers/powerDefinition.js +69 -0
- package/lib/exercises/powers/powersOfTenToDecimal.d.ts.map +1 -1
- package/lib/exercises/powers/powersOfTenToDecimal.js +0 -1
- package/lib/exercises/powers/powersPower.js +1 -1
- package/lib/exercises/powers/scientificToDecimal.d.ts.map +1 -1
- package/lib/exercises/powers/scientificToDecimal.js +13 -14
- package/lib/exercises/probaStat/medianList.d.ts.map +1 -1
- package/lib/exercises/probaStat/medianList.js +1 -2
- package/lib/exercises/probaStat/quartilesList.d.ts.map +1 -1
- package/lib/exercises/probaStat/quartilesList.js +1 -3
- package/lib/index.d.ts +8 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +8 -0
- package/lib/math/numbers/decimals/decimal.d.ts +4 -1
- package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
- package/lib/math/numbers/decimals/decimal.js +45 -2
- package/lib/math/numbers/integer/integer.d.ts +1 -0
- package/lib/math/numbers/integer/integer.d.ts.map +1 -1
- package/lib/math/numbers/integer/integer.js +12 -1
- package/lib/math/numbers/rationals/rational.d.ts.map +1 -1
- package/lib/math/numbers/rationals/rational.js +5 -2
- package/lib/math/numbers/reals/extendedRingElement.d.ts +13 -0
- package/lib/math/numbers/reals/extendedRingElement.d.ts.map +1 -0
- package/lib/math/numbers/reals/extendedRingElement.js +41 -0
- package/lib/math/numbers/reals/real.d.ts +1 -0
- package/lib/math/numbers/reals/real.d.ts.map +1 -1
- package/lib/math/numbers/reals/real.js +5 -1
- package/lib/math/polynomials/polynomial.d.ts +1 -0
- package/lib/math/polynomials/polynomial.d.ts.map +1 -1
- package/lib/math/polynomials/polynomial.js +51 -7
- package/lib/math/polynomials/trinom.d.ts.map +1 -1
- package/lib/math/polynomials/trinom.js +28 -5
- package/lib/utils/probaFlip.d.ts +2 -0
- package/lib/utils/probaFlip.d.ts.map +1 -0
- package/lib/utils/probaFlip.js +7 -0
- package/package.json +1 -1
|
@@ -28,7 +28,7 @@ function getFractionToPercentToDecimal() {
|
|
|
28
28
|
const decimal = numerator / denominator;
|
|
29
29
|
const percent = (0, round_1.round)((numerator / denominator) * 100, 2);
|
|
30
30
|
const rand = (0, randint_1.randint)(1, 7);
|
|
31
|
-
let instruction;
|
|
31
|
+
let instruction = '';
|
|
32
32
|
let answer = '';
|
|
33
33
|
switch (rand) {
|
|
34
34
|
case 1: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proportionalityTable.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calcul/proportionality/proportionalityTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"proportionalityTable.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calcul/proportionality/proportionalityTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAO/E,eAAO,MAAM,oBAAoB,EAAE,YAYlC,CAAC;AAEF,wBAAgB,uBAAuB,IAAI,QAAQ,CAyElD"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getProportionalityTable = exports.proportionalityTable = void 0;
|
|
4
4
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const integer_1 = require("../../../math/numbers/integer/integer");
|
|
5
6
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
6
7
|
const shuffle_1 = require("../../../utils/shuffle");
|
|
7
8
|
const uuid_1 = require("uuid");
|
|
@@ -20,25 +21,25 @@ exports.proportionalityTable = {
|
|
|
20
21
|
};
|
|
21
22
|
function getProportionalityTable() {
|
|
22
23
|
const fact = (0, randint_1.randint)(2, 10);
|
|
23
|
-
let [x1, x2] =
|
|
24
|
+
let [x1, x2] = integer_1.IntegerConstructor.randomDifferents(1, 100 / fact, 2);
|
|
24
25
|
let [x3, x4] = [x1 * fact, x2 * fact];
|
|
25
|
-
let answer;
|
|
26
|
+
let answer = '';
|
|
26
27
|
const randQuation = (0, randint_1.randint)(0, 4);
|
|
27
28
|
switch (randQuation) {
|
|
28
29
|
case 0:
|
|
29
|
-
answer = x1;
|
|
30
|
+
answer = x1 + '';
|
|
30
31
|
x1 = '?';
|
|
31
32
|
break;
|
|
32
33
|
case 1:
|
|
33
|
-
answer = x2;
|
|
34
|
+
answer = +x2 + '';
|
|
34
35
|
x2 = '?';
|
|
35
36
|
break;
|
|
36
37
|
case 2:
|
|
37
|
-
answer = x3;
|
|
38
|
+
answer = x3 + '';
|
|
38
39
|
x3 = '?';
|
|
39
40
|
break;
|
|
40
41
|
case 3:
|
|
41
|
-
answer = x4;
|
|
42
|
+
answer = x4 + '';
|
|
42
43
|
x4 = '?';
|
|
43
44
|
break;
|
|
44
45
|
}
|
|
@@ -75,7 +76,7 @@ function getProportionalityTable() {
|
|
|
75
76
|
|${x2}|${x4}|
|
|
76
77
|
|
|
77
78
|
Déterminer le nombre manquant.`,
|
|
78
|
-
answer: answer
|
|
79
|
+
answer: answer,
|
|
79
80
|
keys: [],
|
|
80
81
|
getPropositions,
|
|
81
82
|
answerFormat: 'tex',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expDerivativeOne.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/expDerivativeOne.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAmC,MAAM,0BAA0B,CAAC;AAWhH,eAAO,MAAM,gBAAgB,EAAE,YAY9B,CAAC;AAEF,wBAAgB,gBAAgB,IAAI,QAAQ,
|
|
1
|
+
{"version":3,"file":"expDerivativeOne.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/expDerivativeOne.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAmC,MAAM,0BAA0B,CAAC;AAWhH,eAAO,MAAM,gBAAgB,EAAE,YAY9B,CAAC;AAEF,wBAAgB,gBAAgB,IAAI,QAAQ,CAwC3C"}
|
|
@@ -39,8 +39,10 @@ function getExpDerivative() {
|
|
|
39
39
|
});
|
|
40
40
|
(0, exercise_1.tryToAddWrongProp)(propositions, myfunction.toTex());
|
|
41
41
|
(0, exercise_1.tryToAddWrongProp)(propositions, (0, simplify_1.simplifyNode)(new multiplyNode_1.MultiplyNode(affine.toTree(), myfunction)).toTex());
|
|
42
|
-
(0, exercise_1.tryToAddWrongProp)(propositions, new expNode_1.ExpNode(new numberNode_1.NumberNode(
|
|
43
|
-
(0, exercise_1.tryToAddWrongProp)(propositions, (0, simplify_1.simplifyNode)(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(
|
|
42
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new expNode_1.ExpNode(new numberNode_1.NumberNode(a)).toTex());
|
|
43
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, simplify_1.simplifyNode)(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(b), myfunction)).toTex());
|
|
44
|
+
while (propositions.length < numOptions)
|
|
45
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, simplify_1.simplifyNode)(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode((0, randint_1.randint)(-9, 10)), myfunction)).toTex());
|
|
44
46
|
return (0, exercise_1.shuffleProps)(propositions, numOptions);
|
|
45
47
|
};
|
|
46
48
|
const question = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thirdDegreeDerivative.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/thirdDegreeDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,QAAQ,
|
|
1
|
+
{"version":3,"file":"thirdDegreeDerivative.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/thirdDegreeDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAmC,MAAM,0BAA0B,CAAC;AAOhH,eAAO,MAAM,qBAAqB,EAAE,YAYnC,CAAC;AAEF,wBAAgB,wBAAwB,IAAI,QAAQ,CAmEnD"}
|
|
@@ -5,7 +5,6 @@ const exercise_1 = require("../../../exercises/exercise");
|
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
6
|
const polynomial_1 = require("../../../math/polynomials/polynomial");
|
|
7
7
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
|
-
const shuffle_1 = require("../../../utils/shuffle");
|
|
9
8
|
const uuid_1 = require("uuid");
|
|
10
9
|
exports.thirdDegreeDerivative = {
|
|
11
10
|
id: 'thirdDegreeDerivative',
|
|
@@ -35,8 +34,10 @@ function getThirdDegreeDerivative() {
|
|
|
35
34
|
isRightAnswer: true,
|
|
36
35
|
format: 'tex',
|
|
37
36
|
});
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
if (coefficients[2] !== 0)
|
|
38
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new polynomial_1.Polynomial([coefficients[0], coefficients[1], coefficients[2]]).toTree().toTex());
|
|
39
|
+
if (coefficients[2] !== 0)
|
|
40
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new polynomial_1.Polynomial([coefficients[0] + coefficients[1], coefficients[1], coefficients[2]]).toTree().toTex());
|
|
40
41
|
const missing = numOptions - propositions.length;
|
|
41
42
|
for (let i = 0; i < missing; i++) {
|
|
42
43
|
let isDuplicate;
|
|
@@ -57,7 +58,7 @@ function getThirdDegreeDerivative() {
|
|
|
57
58
|
} while (isDuplicate);
|
|
58
59
|
propositions.push(proposition);
|
|
59
60
|
}
|
|
60
|
-
return (0,
|
|
61
|
+
return (0, exercise_1.shuffleProps)(propositions, numOptions);
|
|
61
62
|
};
|
|
62
63
|
const question = {
|
|
63
64
|
instruction: `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par $f(x) = ${polynomial.toString()}$.`,
|
|
@@ -9,7 +9,7 @@ export type Proposition = {
|
|
|
9
9
|
format: 'tex' | 'raw';
|
|
10
10
|
};
|
|
11
11
|
export interface Question {
|
|
12
|
-
instruction
|
|
12
|
+
instruction: string;
|
|
13
13
|
startStatement?: string;
|
|
14
14
|
answer: string;
|
|
15
15
|
answerFormat: 'tex' | 'raw';
|
|
@@ -22,7 +22,7 @@ export interface Question {
|
|
|
22
22
|
}
|
|
23
23
|
export interface MathExercise {
|
|
24
24
|
id: string;
|
|
25
|
-
instruction
|
|
25
|
+
instruction?: string;
|
|
26
26
|
isSingleStep: boolean;
|
|
27
27
|
label: string;
|
|
28
28
|
sections: MathSection[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAI3C,eAAO,MAAM,iBAAiB,UAAW,WAAW,EAAE,aAAa,MAAM,WAAU,KAAK,GAAG,KAAK,SAS/F,CAAC;AAEF,eAAO,MAAM,YAAY,UAAW,WAAW,EAAE,KAAK,MAAM,kBAE3D,CAAC;AACF,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,
|
|
1
|
+
{"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAI3C,eAAO,MAAM,iBAAiB,UAAW,WAAW,EAAE,aAAa,MAAM,WAAU,KAAK,GAAG,KAAK,SAS/F,CAAC;AAEF,eAAO,MAAM,YAAY,UAAW,WAAW,EAAE,KAAK,MAAM,kBAE3D,CAAC;AACF,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,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,KAAK,GAAG,KAAK,CAAC;IAC5B,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,cAAc,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAC;IACvC,eAAe,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,WAAW,EAAE,CAAC;CAC/C;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,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,KAAK,EAAE,CAAC;IACf,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,QAAQ,EAAE,CAAC;IAC9D,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;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,0BAA0B,GAC1B,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,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":"AAkLA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAW1C,eAAO,MAAM,SAAS,EAAE,YAAY,EA6QnC,CAAC"}
|
|
@@ -115,7 +115,7 @@ const quartiles_1 = require("../exercises/probaStat/quartiles");
|
|
|
115
115
|
const quartilesList_1 = require("../exercises/probaStat/quartilesList");
|
|
116
116
|
const euclideanDivision_1 = require("../exercises/calcul/arithmetics/euclideanDivision");
|
|
117
117
|
const thirdDegreeFunctionVariation_1 = require("../exercises/derivation/derivative/thirdDegreeFunctionVariation");
|
|
118
|
-
const
|
|
118
|
+
const polynomLimit_1 = require("../exercises/limits/polynomLimit");
|
|
119
119
|
const constantPrimitive_1 = require("../exercises/primitve/constantPrimitive");
|
|
120
120
|
const polynomialPrimitive_1 = require("../exercises/primitve/polynomialPrimitive");
|
|
121
121
|
const sinCosPrimitive_1 = require("../exercises/primitve/sinCosPrimitive");
|
|
@@ -159,6 +159,7 @@ const firstDegreeInequationsType2_1 = require("./calculLitteral/inequations/firs
|
|
|
159
159
|
const firstDegreeInequationsType3_1 = require("./calculLitteral/inequations/firstDegreeInequationsType3");
|
|
160
160
|
const firstDegreeInequationsType0_1 = require("./calculLitteral/inequations/firstDegreeInequationsType0");
|
|
161
161
|
const chasles_1 = require("./geometry/vectors/chasles");
|
|
162
|
+
const deltaTrinom_1 = require("./functions/trinoms/deltaTrinom");
|
|
162
163
|
const rootsFromFactorizedForm_1 = require("./functions/trinoms/rootsFromFactorizedForm");
|
|
163
164
|
const rootsFromDevForm_1 = require("./functions/trinoms/rootsFromDevForm");
|
|
164
165
|
const inequalityToInterval_1 = require("./sets/intervals/inequalityToInterval");
|
|
@@ -169,7 +170,15 @@ const sequencePolynomLimit_1 = require("./limits/sequencePolynomLimit");
|
|
|
169
170
|
const sequenceRationalFracLimit_1 = require("./limits/sequenceRationalFracLimit");
|
|
170
171
|
const sequencePolynomProductLimit_1 = require("./limits/sequencePolynomProductLimit");
|
|
171
172
|
const sequencePolynomNoFILimit_1 = require("./limits/sequencePolynomNoFILimit");
|
|
173
|
+
const polynomLimitNoFI_1 = require("./limits/polynomLimitNoFI");
|
|
174
|
+
const rationalFracLimit_1 = require("./limits/rationalFracLimit");
|
|
175
|
+
const rationalFracForbiddenValueLimit_1 = require("./limits/rationalFracForbiddenValueLimit");
|
|
172
176
|
const sequenceGeometricLimit_1 = require("./limits/sequenceGeometricLimit");
|
|
177
|
+
const calculatePower_1 = require("./powers/calculatePower");
|
|
178
|
+
const calculateNegativePower_1 = require("./powers/calculateNegativePower");
|
|
179
|
+
const decimalToScientific_1 = require("./powers/decimalToScientific");
|
|
180
|
+
const powerDefinition_1 = require("./powers/powerDefinition");
|
|
181
|
+
const niceRootsFromDevForm_1 = require("./functions/trinoms/niceRootsFromDevForm");
|
|
173
182
|
exports.exercises = [
|
|
174
183
|
/**
|
|
175
184
|
* calcul litteral
|
|
@@ -268,7 +277,11 @@ exports.exercises = [
|
|
|
268
277
|
powersPower_1.powersOfTenPower,
|
|
269
278
|
powersProduct_1.powersOfTenProduct,
|
|
270
279
|
scientificToDecimal_1.scientificToDecimal,
|
|
280
|
+
decimalToScientific_1.decimalToScientific,
|
|
271
281
|
powersOfTenToDecimal_1.powersOfTenToDecimal,
|
|
282
|
+
calculatePower_1.calculatePower,
|
|
283
|
+
calculateNegativePower_1.calculateNegativePower,
|
|
284
|
+
powerDefinition_1.powerDefinition,
|
|
272
285
|
/**
|
|
273
286
|
* suites
|
|
274
287
|
*/
|
|
@@ -383,9 +396,10 @@ exports.exercises = [
|
|
|
383
396
|
extremumFromCanonicalForm_1.extremumFromCanonicalForm,
|
|
384
397
|
extremumTypeFromAlgebricForm_1.extremumTypeFromAlgebricForm,
|
|
385
398
|
variationsFromAlgebricForm_1.variationsFromAlgebricForm,
|
|
386
|
-
|
|
399
|
+
deltaTrinom_1.deltaTrinom,
|
|
387
400
|
rootsFromFactorizedForm_1.rootsFromFactorizedForm,
|
|
388
401
|
rootsFromDevForm_1.rootsFromDevForm,
|
|
402
|
+
niceRootsFromDevForm_1.niceRootsFromDevForm,
|
|
389
403
|
/**Complexes */
|
|
390
404
|
mutiplyComplex_1.mutiplyComplex,
|
|
391
405
|
reAndIm_1.reAndIm,
|
|
@@ -401,7 +415,10 @@ exports.exercises = [
|
|
|
401
415
|
intervalsUnion_1.intervalsUnion,
|
|
402
416
|
intervalsIntersection_1.intervalsIntersection,
|
|
403
417
|
/**limites */
|
|
404
|
-
|
|
418
|
+
polynomLimit_1.polynomLimit,
|
|
419
|
+
polynomLimitNoFI_1.polynomLimitNoFI,
|
|
420
|
+
rationalFracLimit_1.rationalFracLimit,
|
|
421
|
+
rationalFracForbiddenValueLimit_1.rationalFracForbiddenValueLimit,
|
|
405
422
|
sequencePolynomLimit_1.sequencePolynomLimit,
|
|
406
423
|
sequencePolynomNoFILimit_1.sequencePolynomNoFILimit,
|
|
407
424
|
sequenceRationalFracLimit_1.sequenceRationalFracLimit,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leadingCoefficient.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/affines/leadingCoefficient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAY/E,eAAO,MAAM,kBAAkB,EAAE,YAWhC,CAAC;AAEF,wBAAgB,6BAA6B,IAAI,QAAQ,
|
|
1
|
+
{"version":3,"file":"leadingCoefficient.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/affines/leadingCoefficient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAY/E,eAAO,MAAM,kBAAkB,EAAE,YAWhC,CAAC;AAEF,wBAAgB,6BAA6B,IAAI,QAAQ,CAkFxD"}
|
|
@@ -14,7 +14,7 @@ const uuid_1 = require("uuid");
|
|
|
14
14
|
exports.leadingCoefficient = {
|
|
15
15
|
id: 'leadingCoefficient',
|
|
16
16
|
connector: '=',
|
|
17
|
-
instruction: '
|
|
17
|
+
instruction: '',
|
|
18
18
|
label: 'Lire le coefficient directeur',
|
|
19
19
|
levels: ['3ème', '2nde', '1reESM', '2ndPro', '1rePro', '1reTech'],
|
|
20
20
|
isSingleStep: false,
|
|
@@ -83,6 +83,7 @@ function getLeadingCoefficientQuestion() {
|
|
|
83
83
|
return (0, shuffle_1.shuffle)(res);
|
|
84
84
|
};
|
|
85
85
|
const question = {
|
|
86
|
+
instruction: 'Déterminer le coefficient directeur de la droite représentée ci-dessous : ',
|
|
86
87
|
answer: droite.getLeadingCoefficient(),
|
|
87
88
|
keys: [],
|
|
88
89
|
commands: [`f(x) = (${a}) * x + (${b})`],
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"niceRootsFromDevForm.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/trinoms/niceRootsFromDevForm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAOlG,eAAO,MAAM,oBAAoB,EAAE,YAWlC,CAAC;AAEF,wBAAgB,2BAA2B,IAAI,QAAQ,CAgDtD"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRootsFromDevFormQuestion = exports.niceRootsFromDevForm = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const trinom_1 = require("../../../math/polynomials/trinom");
|
|
7
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
9
|
+
const uuid_1 = require("uuid");
|
|
10
|
+
exports.niceRootsFromDevForm = {
|
|
11
|
+
id: 'niceRootsFromDevForm',
|
|
12
|
+
connector: '\\iff',
|
|
13
|
+
instruction: '',
|
|
14
|
+
label: 'Résoudre une équation du second degré (solutions entières)',
|
|
15
|
+
levels: ['1reSpé', 'TermSpé', 'MathComp'],
|
|
16
|
+
isSingleStep: true,
|
|
17
|
+
sections: ['Second degré'],
|
|
18
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getRootsFromDevFormQuestion, nb),
|
|
19
|
+
qcmTimer: 60,
|
|
20
|
+
freeTimer: 60,
|
|
21
|
+
};
|
|
22
|
+
function getRootsFromDevFormQuestion() {
|
|
23
|
+
const trinom = trinom_1.TrinomConstructor.randomFactorized();
|
|
24
|
+
const answer = trinom.getRootsEquationSolutionTex();
|
|
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
|
+
(0, exercise_1.tryToAddWrongProp)(res, 'S=\\emptyset');
|
|
34
|
+
const missing = n - res.length;
|
|
35
|
+
for (let i = 0; i < missing; i++) {
|
|
36
|
+
let isDuplicate;
|
|
37
|
+
let proposition;
|
|
38
|
+
do {
|
|
39
|
+
let wrongX1 = (0, randint_1.randint)(-19, 0);
|
|
40
|
+
let wrongX2 = (0, randint_1.randint)(0, 20);
|
|
41
|
+
const wrongAnswer = `S=\\left\\{${wrongX1};${wrongX2}\\right\\}`;
|
|
42
|
+
proposition = {
|
|
43
|
+
id: (0, uuid_1.v4)() + ``,
|
|
44
|
+
statement: wrongAnswer,
|
|
45
|
+
isRightAnswer: false,
|
|
46
|
+
format: 'tex',
|
|
47
|
+
};
|
|
48
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
49
|
+
} while (isDuplicate);
|
|
50
|
+
res.push(proposition);
|
|
51
|
+
}
|
|
52
|
+
return (0, shuffle_1.shuffle)(res);
|
|
53
|
+
};
|
|
54
|
+
const question = {
|
|
55
|
+
answer: answer,
|
|
56
|
+
instruction: `Soit $f(x) = ${trinom.toTree().toTex()}$. Résoudre l'équation $f(x) = 0$.`,
|
|
57
|
+
keys: ['S', 'equal', 'lbrace', 'semicolon', 'rbrace', 'emptyset'],
|
|
58
|
+
getPropositions,
|
|
59
|
+
answerFormat: 'tex',
|
|
60
|
+
};
|
|
61
|
+
return question;
|
|
62
|
+
}
|
|
63
|
+
exports.getRootsFromDevFormQuestion = getRootsFromDevFormQuestion;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rootsFromDevForm.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/trinoms/rootsFromDevForm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,QAAQ,
|
|
1
|
+
{"version":3,"file":"rootsFromDevForm.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/trinoms/rootsFromDevForm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAOlG,eAAO,MAAM,gBAAgB,EAAE,YAW9B,CAAC;AAEF,wBAAgB,2BAA2B,IAAI,QAAQ,CA+CtD"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getRootsFromDevFormQuestion = exports.rootsFromDevForm = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
4
5
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
6
|
const trinom_1 = require("../../../math/polynomials/trinom");
|
|
7
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
6
8
|
const shuffle_1 = require("../../../utils/shuffle");
|
|
7
9
|
const uuid_1 = require("uuid");
|
|
8
10
|
exports.rootsFromDevForm = {
|
|
@@ -12,7 +14,7 @@ exports.rootsFromDevForm = {
|
|
|
12
14
|
label: 'Résoudre une équation du second degré',
|
|
13
15
|
levels: ['1reSpé', 'TermSpé', 'MathComp'],
|
|
14
16
|
isSingleStep: true,
|
|
15
|
-
sections: [],
|
|
17
|
+
sections: ['Second degré'],
|
|
16
18
|
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getRootsFromDevFormQuestion, nb),
|
|
17
19
|
qcmTimer: 60,
|
|
18
20
|
freeTimer: 60,
|
|
@@ -28,12 +30,15 @@ function getRootsFromDevFormQuestion() {
|
|
|
28
30
|
isRightAnswer: true,
|
|
29
31
|
format: 'tex',
|
|
30
32
|
});
|
|
33
|
+
(0, exercise_1.tryToAddWrongProp)(res, 'S=\\emptyset');
|
|
31
34
|
const missing = n - res.length;
|
|
32
35
|
for (let i = 0; i < missing; i++) {
|
|
33
36
|
let isDuplicate;
|
|
34
37
|
let proposition;
|
|
35
38
|
do {
|
|
36
|
-
|
|
39
|
+
let wrongX1 = (0, randint_1.randint)(-19, 0);
|
|
40
|
+
let wrongX2 = (0, randint_1.randint)(0, 20);
|
|
41
|
+
const wrongAnswer = `S=\\left\\{${wrongX1};${wrongX2}\\right\\}`;
|
|
37
42
|
proposition = {
|
|
38
43
|
id: (0, uuid_1.v4)() + ``,
|
|
39
44
|
statement: wrongAnswer,
|
|
@@ -49,7 +54,7 @@ function getRootsFromDevFormQuestion() {
|
|
|
49
54
|
const question = {
|
|
50
55
|
answer: answer,
|
|
51
56
|
instruction: `Soit $f(x) = ${trinom.toTree().toTex()}$. Résoudre l'équation $f(x) = 0$.`,
|
|
52
|
-
keys: [],
|
|
57
|
+
keys: ['S', 'equal', 'lbrace', 'semicolon', 'rbrace', 'emptyset'],
|
|
53
58
|
getPropositions,
|
|
54
59
|
answerFormat: 'tex',
|
|
55
60
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"distanceBetweenTwoPoints.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/cartesian/distanceBetweenTwoPoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,QAAQ,
|
|
1
|
+
{"version":3,"file":"distanceBetweenTwoPoints.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/cartesian/distanceBetweenTwoPoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAmC,MAAM,0BAA0B,CAAC;AAUhH,eAAO,MAAM,wBAAwB,EAAE,YAYtC,CAAC;AAEF,wBAAgB,2BAA2B,IAAI,QAAQ,CAkEtD"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getDistanceBetweenTwoPoints = exports.distanceBetweenTwoPoints = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
4
5
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
6
|
const point_1 = require("../../../math/geometry/point");
|
|
6
7
|
const real_1 = require("../../../math/numbers/reals/real");
|
|
7
8
|
const randTupleInt_1 = require("../../../math/utils/random/randTupleInt");
|
|
8
9
|
const round_1 = require("../../../math/utils/round");
|
|
9
10
|
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
10
|
-
const shuffle_1 = require("../../../utils/shuffle");
|
|
11
11
|
const uuid_1 = require("uuid");
|
|
12
12
|
exports.distanceBetweenTwoPoints = {
|
|
13
13
|
id: 'distanceBetweenTwoPoints',
|
|
@@ -30,54 +30,26 @@ function getDistanceBetweenTwoPoints() {
|
|
|
30
30
|
const getPropositions = (n) => {
|
|
31
31
|
const res = [];
|
|
32
32
|
let isDuplicate;
|
|
33
|
-
let temp = n;
|
|
34
33
|
res.push({
|
|
35
34
|
id: (0, uuid_1.v4)() + '',
|
|
36
35
|
statement: answer,
|
|
37
36
|
isRightAnswer: true,
|
|
38
37
|
format: 'tex',
|
|
39
38
|
});
|
|
40
|
-
temp--;
|
|
41
39
|
A = new point_1.Point('A', new numberNode_1.NumberNode(coords1[0]), new numberNode_1.NumberNode(coords1[1]));
|
|
42
40
|
B = new point_1.Point('B', new numberNode_1.NumberNode(-coords2[0]), new numberNode_1.NumberNode(-coords2[1]));
|
|
43
41
|
let wrongStatement = new real_1.SquareRoot((0, round_1.round)(A.distanceTo(B) ** 2, 0)).simplify().toTree().toTex();
|
|
44
|
-
|
|
45
|
-
if (!isDuplicate) {
|
|
46
|
-
res.push({
|
|
47
|
-
id: (0, uuid_1.v4)() + '',
|
|
48
|
-
statement: wrongStatement,
|
|
49
|
-
isRightAnswer: false,
|
|
50
|
-
format: 'tex',
|
|
51
|
-
});
|
|
52
|
-
temp--;
|
|
53
|
-
}
|
|
42
|
+
(0, exercise_1.tryToAddWrongProp)(res, wrongStatement);
|
|
54
43
|
A = new point_1.Point('A', new numberNode_1.NumberNode(coords1[1]), new numberNode_1.NumberNode(coords1[0]));
|
|
55
44
|
B = new point_1.Point('B', new numberNode_1.NumberNode(coords2[0]), new numberNode_1.NumberNode(coords2[1]));
|
|
56
45
|
wrongStatement = new real_1.SquareRoot((0, round_1.round)(A.distanceTo(B) ** 2, 0)).simplify().toTree().toTex();
|
|
57
|
-
|
|
58
|
-
if (n > 0 && !isDuplicate) {
|
|
59
|
-
res.push({
|
|
60
|
-
id: (0, uuid_1.v4)() + '',
|
|
61
|
-
statement: wrongStatement,
|
|
62
|
-
isRightAnswer: false,
|
|
63
|
-
format: 'tex',
|
|
64
|
-
});
|
|
65
|
-
temp--;
|
|
66
|
-
}
|
|
46
|
+
(0, exercise_1.tryToAddWrongProp)(res, wrongStatement);
|
|
67
47
|
A = new point_1.Point('A', new numberNode_1.NumberNode(coords1[0]), new numberNode_1.NumberNode(coords2[0]));
|
|
68
48
|
B = new point_1.Point('B', new numberNode_1.NumberNode(coords1[1]), new numberNode_1.NumberNode(coords2[1]));
|
|
69
49
|
wrongStatement = new real_1.SquareRoot((0, round_1.round)(A.distanceTo(B) ** 2, 0)).simplify().toTree().toTex();
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
id: (0, uuid_1.v4)() + '',
|
|
74
|
-
statement: wrongStatement,
|
|
75
|
-
isRightAnswer: false,
|
|
76
|
-
format: 'tex',
|
|
77
|
-
});
|
|
78
|
-
temp--;
|
|
79
|
-
}
|
|
80
|
-
for (let i = 0; i < temp; i++) {
|
|
50
|
+
(0, exercise_1.tryToAddWrongProp)(res, wrongStatement);
|
|
51
|
+
const missing = n - res.length;
|
|
52
|
+
for (let i = 0; i < missing; i++) {
|
|
81
53
|
let proposition;
|
|
82
54
|
do {
|
|
83
55
|
const [tempCoords1, tempsCoords2] = (0, randTupleInt_1.distinctRandTupleInt)(2, 2, { from: -9, to: 10 });
|
|
@@ -92,9 +64,8 @@ function getDistanceBetweenTwoPoints() {
|
|
|
92
64
|
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
93
65
|
} while (isDuplicate);
|
|
94
66
|
res.push(proposition);
|
|
95
|
-
temp--;
|
|
96
67
|
}
|
|
97
|
-
return (0,
|
|
68
|
+
return (0, exercise_1.shuffleProps)(res, n);
|
|
98
69
|
};
|
|
99
70
|
const question = {
|
|
100
71
|
instruction: `Soit $${A.toTexWithCoords()}$ et $${B.toTexWithCoords()}$. Calculer la distance $AB$.`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pythagore.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/euclidean/pythagore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAQ/E,eAAO,MAAM,SAAS,EAAE,YAWvB,CAAC;AAEF,wBAAgB,YAAY,IAAI,QAAQ,
|
|
1
|
+
{"version":3,"file":"pythagore.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/euclidean/pythagore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAQ/E,eAAO,MAAM,SAAS,EAAE,YAWvB,CAAC;AAEF,wBAAgB,YAAY,IAAI,QAAQ,CA8EvC"}
|
|
@@ -9,7 +9,7 @@ const uuid_1 = require("uuid");
|
|
|
9
9
|
exports.pythagore = {
|
|
10
10
|
id: 'pythagore',
|
|
11
11
|
connector: '=',
|
|
12
|
-
instruction:
|
|
12
|
+
instruction: '',
|
|
13
13
|
label: "Écrire l'égalité de Pythagore",
|
|
14
14
|
levels: ['4ème', '3ème', '2nde'],
|
|
15
15
|
isSingleStep: false,
|
|
@@ -76,6 +76,7 @@ function getPythagore() {
|
|
|
76
76
|
return (0, shuffle_1.shuffle)(res);
|
|
77
77
|
};
|
|
78
78
|
const question = {
|
|
79
|
+
instruction: "Écrire l'égalité de Pythagore pour la figure suivante : ",
|
|
79
80
|
answer: `${triangle.getSideAName()}^2=${triangle.getSideBName()}^2+${triangle.getSideCName()}^2`,
|
|
80
81
|
keys: [...vertices, 'equal'],
|
|
81
82
|
commands: triangle.generateCommands({}),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polynomLimit.d.ts","sourceRoot":"","sources":["../../../src/exercises/limits/polynomLimit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAQlG,eAAO,MAAM,YAAY,EAAE,YAW1B,CAAC;AAEF,wBAAgB,uBAAuB,IAAI,QAAQ,CAkDlD"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPolynomLimitQuestion = exports.polynomLimit = void 0;
|
|
4
|
+
const exercise_1 = require("../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const polynomial_1 = require("../../math/polynomials/polynomial");
|
|
7
|
+
const randint_1 = require("../../math/utils/random/randint");
|
|
8
|
+
const coinFlip_1 = require("../../utils/coinFlip");
|
|
9
|
+
const shuffle_1 = require("../../utils/shuffle");
|
|
10
|
+
const uuid_1 = require("uuid");
|
|
11
|
+
exports.polynomLimit = {
|
|
12
|
+
id: 'polynomLimit',
|
|
13
|
+
connector: '=',
|
|
14
|
+
instruction: '',
|
|
15
|
+
label: "Limite d'une fonction polynomiale",
|
|
16
|
+
levels: ['TermSpé', 'MathComp'],
|
|
17
|
+
isSingleStep: true,
|
|
18
|
+
sections: ['Limites'],
|
|
19
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getPolynomLimitQuestion, nb),
|
|
20
|
+
qcmTimer: 60,
|
|
21
|
+
freeTimer: 60,
|
|
22
|
+
};
|
|
23
|
+
function getPolynomLimitQuestion() {
|
|
24
|
+
const poly = polynomial_1.PolynomialConstructor.random(4);
|
|
25
|
+
const to = (0, coinFlip_1.coinFlip)() ? '+\\infty' : '-\\infty';
|
|
26
|
+
const answer = poly.getLimit(to);
|
|
27
|
+
const getPropositions = (n) => {
|
|
28
|
+
const res = [];
|
|
29
|
+
res.push({
|
|
30
|
+
id: (0, uuid_1.v4)(),
|
|
31
|
+
statement: answer,
|
|
32
|
+
isRightAnswer: true,
|
|
33
|
+
format: 'tex',
|
|
34
|
+
});
|
|
35
|
+
(0, exercise_1.tryToAddWrongProp)(res, '+\\infty');
|
|
36
|
+
(0, exercise_1.tryToAddWrongProp)(res, '-\\infty');
|
|
37
|
+
(0, exercise_1.tryToAddWrongProp)(res, '0');
|
|
38
|
+
(0, exercise_1.tryToAddWrongProp)(res, poly.coefficients[poly.degree] + '');
|
|
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 = (0, randint_1.randint)(-10, 10) + '';
|
|
45
|
+
proposition = {
|
|
46
|
+
id: (0, uuid_1.v4)() + ``,
|
|
47
|
+
statement: wrongAnswer,
|
|
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,
|
|
59
|
+
instruction: `Déterminer la limite en $${to}$ de la fonction $f$ définie par : $f(x) = ${poly.toTree().toTex()}$.`,
|
|
60
|
+
keys: ['infty'],
|
|
61
|
+
getPropositions,
|
|
62
|
+
answerFormat: 'tex',
|
|
63
|
+
};
|
|
64
|
+
return question;
|
|
65
|
+
}
|
|
66
|
+
exports.getPolynomLimitQuestion = getPolynomLimitQuestion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polynomLimitNoFI.d.ts","sourceRoot":"","sources":["../../../src/exercises/limits/polynomLimitNoFI.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAQlG,eAAO,MAAM,gBAAgB,EAAE,YAW9B,CAAC;AAEF,wBAAgB,mCAAmC,IAAI,QAAQ,CAoD9D"}
|