math-exercises 1.4.16 → 1.4.17
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/derivation/derivative/productDerivative.d.ts +4 -0
- package/lib/exercises/derivation/derivative/productDerivative.d.ts.map +1 -0
- package/lib/exercises/derivation/derivative/productDerivative.js +62 -0
- package/lib/exercises/derivation/derivative/quotientDerivative.d.ts +4 -0
- package/lib/exercises/derivation/derivative/quotientDerivative.d.ts.map +1 -0
- package/lib/exercises/derivation/derivative/quotientDerivative.js +65 -0
- package/lib/exercises/exercise.d.ts +1 -1
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/exercises.d.ts.map +1 -1
- package/lib/exercises/exercises.js +19 -0
- package/lib/exercises/functions/absolute/absoluteValueEquations.d.ts +4 -0
- package/lib/exercises/functions/absolute/absoluteValueEquations.d.ts.map +1 -0
- package/lib/exercises/functions/absolute/absoluteValueEquations.js +75 -0
- package/lib/exercises/functions/absolute/absoluteValueInequations.d.ts +4 -0
- package/lib/exercises/functions/absolute/absoluteValueInequations.d.ts.map +1 -0
- package/lib/exercises/functions/absolute/absoluteValueInequations.js +67 -0
- package/lib/exercises/geometry/vectors/vectorCoordinatesFromTwoPoints.d.ts +4 -0
- package/lib/exercises/geometry/vectors/vectorCoordinatesFromTwoPoints.d.ts.map +1 -0
- package/lib/exercises/geometry/vectors/vectorCoordinatesFromTwoPoints.js +68 -0
- package/lib/exercises/percent/evolutionToCM.d.ts +4 -0
- package/lib/exercises/percent/evolutionToCM.d.ts.map +1 -0
- package/lib/exercises/percent/evolutionToCM.js +74 -0
- package/lib/exercises/sequences/explicitFormulaUsage.d.ts +22 -0
- package/lib/exercises/sequences/explicitFormulaUsage.d.ts.map +1 -0
- package/lib/exercises/sequences/explicitFormulaUsage.js +82 -0
- package/lib/exercises/sequences/genericSequenceVariations.d.ts +4 -0
- package/lib/exercises/sequences/genericSequenceVariations.d.ts.map +1 -0
- package/lib/exercises/sequences/genericSequenceVariations.js +55 -0
- package/lib/exercises/sequences/recurrenceFormulaUsage.d.ts +4 -0
- package/lib/exercises/sequences/recurrenceFormulaUsage.d.ts.map +1 -0
- package/lib/exercises/sequences/recurrenceFormulaUsage.js +69 -0
- package/lib/math/geometry/point.d.ts +2 -0
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +8 -0
- package/lib/math/polynomials/polynomial.d.ts +7 -0
- package/lib/math/polynomials/polynomial.d.ts.map +1 -1
- package/lib/math/polynomials/polynomial.js +7 -0
- package/lib/math/sequences/sequence.d.ts +3 -1
- package/lib/math/sequences/sequence.d.ts.map +1 -1
- package/lib/math/sequences/sequence.js +2 -1
- package/lib/types/keyIds.d.ts +6 -4
- package/lib/types/keyIds.d.ts.map +1 -1
- package/lib/utils/randomLetter.d.ts +2 -0
- package/lib/utils/randomLetter.d.ts.map +1 -0
- package/lib/utils/randomLetter.js +9 -0
- package/package.json +1 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"productDerivative.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/productDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,YAAY,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAOhH,eAAO,MAAM,iBAAiB,EAAE,YAW/B,CAAC;AAEF,wBAAgB,4BAA4B,IAAI,QAAQ,CAkDvD"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getProductDerivativeQuestion = exports.productDerivative = 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 multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
|
|
8
|
+
const uuid_1 = require("uuid");
|
|
9
|
+
exports.productDerivative = {
|
|
10
|
+
id: 'productDerivative',
|
|
11
|
+
connector: '=',
|
|
12
|
+
instruction: '',
|
|
13
|
+
label: "Dérivée d'un produit de polynômes",
|
|
14
|
+
levels: ['1reSpé', 'MathComp'],
|
|
15
|
+
isSingleStep: true,
|
|
16
|
+
sections: ['Dérivation'],
|
|
17
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getProductDerivativeQuestion, nb),
|
|
18
|
+
qcmTimer: 60,
|
|
19
|
+
freeTimer: 60,
|
|
20
|
+
};
|
|
21
|
+
function getProductDerivativeQuestion() {
|
|
22
|
+
const poly1 = polynomial_1.PolynomialConstructor.randomWithLength(3, 2);
|
|
23
|
+
const poly2 = polynomial_1.PolynomialConstructor.randomWithLength(3, 2);
|
|
24
|
+
const answer = poly1.multiply(poly2).derivate().toTree().toTex();
|
|
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, poly1.derivate().multiply(poly2.derivate()).toTree().toTex());
|
|
34
|
+
(0, exercise_1.tryToAddWrongProp)(res, poly1.derivate().add(poly2.derivate()).toTree().toTex());
|
|
35
|
+
const missing = n - res.length;
|
|
36
|
+
for (let i = 0; i < missing; i++) {
|
|
37
|
+
let isDuplicate;
|
|
38
|
+
let proposition;
|
|
39
|
+
do {
|
|
40
|
+
const wrongAnswer = polynomial_1.PolynomialConstructor.random(3).toTree().toTex();
|
|
41
|
+
proposition = {
|
|
42
|
+
id: (0, uuid_1.v4)() + ``,
|
|
43
|
+
statement: wrongAnswer,
|
|
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, exercise_1.shuffleProps)(res, n);
|
|
52
|
+
};
|
|
53
|
+
const question = {
|
|
54
|
+
answer: answer,
|
|
55
|
+
instruction: `Déterminer la dérivée de la fonction $f$ définie par $f(x) = ${new multiplyNode_1.MultiplyNode(poly1.toTree(), poly2.toTree()).toTex()}$`,
|
|
56
|
+
keys: ['x', 'xsquare', 'xcube'],
|
|
57
|
+
getPropositions,
|
|
58
|
+
answerFormat: 'tex',
|
|
59
|
+
};
|
|
60
|
+
return question;
|
|
61
|
+
}
|
|
62
|
+
exports.getProductDerivativeQuestion = getProductDerivativeQuestion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quotientDerivative.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/quotientDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,YAAY,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAUhH,eAAO,MAAM,kBAAkB,EAAE,YAWhC,CAAC;AAEF,wBAAgB,4BAA4B,IAAI,QAAQ,CAoDvD"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getProductDerivativeQuestion = exports.quotientDerivative = 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 numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
8
|
+
const fractionNode_1 = require("../../../tree/nodes/operators/fractionNode");
|
|
9
|
+
const powerNode_1 = require("../../../tree/nodes/operators/powerNode");
|
|
10
|
+
const uuid_1 = require("uuid");
|
|
11
|
+
exports.quotientDerivative = {
|
|
12
|
+
id: 'quotientDerivative',
|
|
13
|
+
connector: '=',
|
|
14
|
+
instruction: '',
|
|
15
|
+
label: "Dérivée d'un quotient de polynômes",
|
|
16
|
+
levels: ['1reSpé', 'MathComp'],
|
|
17
|
+
isSingleStep: true,
|
|
18
|
+
sections: ['Dérivation'],
|
|
19
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getProductDerivativeQuestion, nb),
|
|
20
|
+
qcmTimer: 60,
|
|
21
|
+
freeTimer: 60,
|
|
22
|
+
};
|
|
23
|
+
function getProductDerivativeQuestion() {
|
|
24
|
+
const poly1 = polynomial_1.PolynomialConstructor.randomWithLength(2, 2);
|
|
25
|
+
const poly2 = polynomial_1.PolynomialConstructor.randomWithLength(2, 2);
|
|
26
|
+
const answerNum = poly1.derivate().multiply(poly2).add(poly1.opposite().multiply(poly2.derivate())).toTree().toTex();
|
|
27
|
+
const answerDenum = new powerNode_1.PowerNode(poly2.toTree(), new numberNode_1.NumberNode(2)).toTex();
|
|
28
|
+
const answer = `\\frac{${answerNum}}{${answerDenum}}`;
|
|
29
|
+
const getPropositions = (n) => {
|
|
30
|
+
const res = [];
|
|
31
|
+
res.push({
|
|
32
|
+
id: (0, uuid_1.v4)(),
|
|
33
|
+
statement: answer,
|
|
34
|
+
isRightAnswer: true,
|
|
35
|
+
format: 'tex',
|
|
36
|
+
});
|
|
37
|
+
(0, exercise_1.tryToAddWrongProp)(res, `\\frac{${poly1.derivate().toTree().toTex()}}{${poly2.derivate().toTree().toTex()}}`);
|
|
38
|
+
const missing = n - res.length;
|
|
39
|
+
for (let i = 0; i < missing; i++) {
|
|
40
|
+
let isDuplicate;
|
|
41
|
+
let proposition;
|
|
42
|
+
do {
|
|
43
|
+
const wrongAnswer = `\\frac{${polynomial_1.PolynomialConstructor.random(2).toTree().toTex()}}{${answerDenum}}`;
|
|
44
|
+
proposition = {
|
|
45
|
+
id: (0, uuid_1.v4)() + ``,
|
|
46
|
+
statement: wrongAnswer,
|
|
47
|
+
isRightAnswer: false,
|
|
48
|
+
format: 'tex',
|
|
49
|
+
};
|
|
50
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
51
|
+
} while (isDuplicate);
|
|
52
|
+
res.push(proposition);
|
|
53
|
+
}
|
|
54
|
+
return (0, exercise_1.shuffleProps)(res, n);
|
|
55
|
+
};
|
|
56
|
+
const question = {
|
|
57
|
+
answer,
|
|
58
|
+
instruction: `Déterminer la dérivée de la fonction $f$ définie par $f(x) = ${new fractionNode_1.FractionNode(poly1.toTree(), poly2.toTree()).toTex()}$`,
|
|
59
|
+
keys: ['x', 'xsquare', 'xcube'],
|
|
60
|
+
getPropositions,
|
|
61
|
+
answerFormat: 'tex',
|
|
62
|
+
};
|
|
63
|
+
return question;
|
|
64
|
+
}
|
|
65
|
+
exports.getProductDerivativeQuestion = getProductDerivativeQuestion;
|
|
@@ -36,5 +36,5 @@ export interface MathExercise {
|
|
|
36
36
|
freeTimer: number;
|
|
37
37
|
}
|
|
38
38
|
export type MathLevel = '6ème' | '5ème' | '4ème' | '3ème' | '2nde' | '1reTech' | '1reESM' | '1reSpé' | 'TermSpé' | 'TermTech' | 'MathExp' | 'MathComp' | 'CAP' | '2ndPro' | '1rePro' | 'TermPro';
|
|
39
|
-
export type MathSection = 'Arithmétique' | 'Calcul littéral' | 'Calculs' | 'Combinatoire et dénombrement' | 'Conversions' | 'Dérivation' | 'Droites' | 'Ensembles et intervalles' | 'Équations' | 'Équations différentielles' | 'Exponentielle' | 'Fonction cube' | 'Fonction inverse' | 'Fonctions' | 'Fonctions affines' | 'Fonctions de référence' | 'Fractions' | 'Géométrie cartésienne' | 'Géométrie euclidienne' | 'Inéquations' | 'Intégration' | 'Limites' | 'Logarithme népérien' | 'Nombres complexes' | 'Pourcentages' | 'Primitives' | 'Probabilités' | 'Proportionnalité' | 'Puissances' | 'Racines carrées' | 'Second degré' | 'Statistiques' | 'Suites' | 'Trigonométrie' | 'Vecteurs';
|
|
39
|
+
export type MathSection = 'Arithmétique' | 'Calcul littéral' | 'Calculs' | 'Combinatoire et dénombrement' | 'Conversions' | 'Dérivation' | 'Droites' | 'Ensembles et intervalles' | 'Équations' | 'Équations différentielles' | 'Exponentielle' | 'Fonction cube' | 'Fonction inverse' | 'Fonctions' | 'Fonctions affines' | 'Fonctions de référence' | 'Fractions' | 'Géométrie cartésienne' | 'Géométrie euclidienne' | 'Inéquations' | 'Intégration' | 'Limites' | 'Logarithme népérien' | 'Nombres complexes' | 'Pourcentages' | 'Primitives' | 'Probabilités' | 'Proportionnalité' | 'Puissances' | 'Racines carrées' | 'Second degré' | 'Statistiques' | 'Suites' | 'Trigonométrie' | 'Valeur absolue' | 'Vecteurs';
|
|
40
40
|
//# sourceMappingURL=exercise.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,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;AAEF,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,MAA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@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exercises.d.ts","sourceRoot":"","sources":["../../src/exercises/exercises.ts"],"names":[],"mappings":"AAkLA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"exercises.d.ts","sourceRoot":"","sources":["../../src/exercises/exercises.ts"],"names":[],"mappings":"AAkLA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AA4B1C,eAAO,MAAM,SAAS,EAAE,YAAY,EAgSnC,CAAC"}
|
|
@@ -187,6 +187,15 @@ const anagrams_1 = require("./combinatory/anagrams");
|
|
|
187
187
|
const ballsCounting_1 = require("./combinatory/ballsCounting");
|
|
188
188
|
const diceCounting_1 = require("./combinatory/diceCounting");
|
|
189
189
|
const paritySumsAndProducts_1 = require("./calcul/arithmetics/paritySumsAndProducts");
|
|
190
|
+
const recurrenceFormulaUsage_1 = require("./sequences/recurrenceFormulaUsage");
|
|
191
|
+
const explicitFormulaUsage_1 = require("./sequences/explicitFormulaUsage");
|
|
192
|
+
const genericSequenceVariations_1 = require("./sequences/genericSequenceVariations");
|
|
193
|
+
const vectorCoordinatesFromTwoPoints_1 = require("./geometry/vectors/vectorCoordinatesFromTwoPoints");
|
|
194
|
+
const evolutionToCM_1 = require("./percent/evolutionToCM");
|
|
195
|
+
const absoluteValueEquations_1 = require("./functions/absolute/absoluteValueEquations");
|
|
196
|
+
const absoluteValueInequations_1 = require("./functions/absolute/absoluteValueInequations");
|
|
197
|
+
const productDerivative_1 = require("./derivation/derivative/productDerivative");
|
|
198
|
+
const quotientDerivative_1 = require("./derivation/derivative/quotientDerivative");
|
|
190
199
|
exports.exercises = [
|
|
191
200
|
/**
|
|
192
201
|
* calcul litteral
|
|
@@ -260,6 +269,7 @@ exports.exercises = [
|
|
|
260
269
|
globalPercent_1.globalPercent,
|
|
261
270
|
reciprocalPercentage_1.reciprocalPercentage,
|
|
262
271
|
averageEvolutionRate_1.averageEvolutionRate,
|
|
272
|
+
evolutionToCM_1.evolutionToCM,
|
|
263
273
|
/**
|
|
264
274
|
* geometry
|
|
265
275
|
*/
|
|
@@ -291,6 +301,7 @@ exports.exercises = [
|
|
|
291
301
|
determinant_1.determinant,
|
|
292
302
|
chasles_1.chasles,
|
|
293
303
|
coordinatesReading_1.coordinatesReading,
|
|
304
|
+
vectorCoordinatesFromTwoPoints_1.vectorCoordinatesFromTwoPoints,
|
|
294
305
|
/**
|
|
295
306
|
* puissances
|
|
296
307
|
*/
|
|
@@ -322,6 +333,9 @@ exports.exercises = [
|
|
|
322
333
|
arithmeticThresholdFind_1.arithmeticThresholdFind,
|
|
323
334
|
firstIntegersSum_1.firstIntegersSum,
|
|
324
335
|
geometricFirstTermsSum_1.geometricFirstTermsSum,
|
|
336
|
+
recurrenceFormulaUsage_1.recurrenceFormulaUsage,
|
|
337
|
+
explicitFormulaUsage_1.explicitFormulaUsage,
|
|
338
|
+
genericSequenceVariations_1.genericSequenceVariations,
|
|
325
339
|
/**
|
|
326
340
|
* fonctions
|
|
327
341
|
*/
|
|
@@ -348,6 +362,8 @@ exports.exercises = [
|
|
|
348
362
|
expDerivativeOne_1.expDerivativeOne,
|
|
349
363
|
expDerivativeTwo_1.expDerivativeTwo,
|
|
350
364
|
expDerivativeThree_1.expDerivativeThree,
|
|
365
|
+
productDerivative_1.productDerivative,
|
|
366
|
+
quotientDerivative_1.quotientDerivative,
|
|
351
367
|
/**
|
|
352
368
|
* primitive and equa diff
|
|
353
369
|
*/
|
|
@@ -443,4 +459,7 @@ exports.exercises = [
|
|
|
443
459
|
anagrams_1.anagrams,
|
|
444
460
|
ballsCounting_1.ballsCounting,
|
|
445
461
|
diceCounting_1.diceCounting,
|
|
462
|
+
/**valeur absolue */
|
|
463
|
+
absoluteValueEquations_1.absoluteValueEquations,
|
|
464
|
+
absoluteValueInequations_1.absoluteValueInequations,
|
|
446
465
|
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"absoluteValueEquations.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/absolute/absoluteValueEquations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,YAAY,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAShH,eAAO,MAAM,sBAAsB,EAAE,YAWpC,CAAC;AAEF,wBAAgB,iCAAiC,IAAI,QAAQ,CAwD5D"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAbsoluteValueEquationsQuestion = exports.absoluteValueEquations = 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 probaFlip_1 = require("../../../utils/probaFlip");
|
|
10
|
+
const uuid_1 = require("uuid");
|
|
11
|
+
exports.absoluteValueEquations = {
|
|
12
|
+
id: 'absoluteValueEquation',
|
|
13
|
+
connector: '\\iff',
|
|
14
|
+
instruction: '',
|
|
15
|
+
label: 'Résoudre une équation avec valeur absolue',
|
|
16
|
+
levels: ['2nde', '1reESM'],
|
|
17
|
+
isSingleStep: true,
|
|
18
|
+
sections: ['Valeur absolue', 'Équations'],
|
|
19
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getAbsoluteValueEquationsQuestion, nb),
|
|
20
|
+
qcmTimer: 60,
|
|
21
|
+
freeTimer: 60,
|
|
22
|
+
};
|
|
23
|
+
function getAbsoluteValueEquationsQuestion() {
|
|
24
|
+
const poly = new polynomial_1.Polynomial([(0, randint_1.randint)(-9, 10, [0]), 1]);
|
|
25
|
+
const a = (0, probaFlip_1.probaFlip)(0.9) ? (0, randint_1.randint)(1, 10) : (0, coinFlip_1.coinFlip)() ? 0 : (0, randint_1.randint)(-9, 0);
|
|
26
|
+
//|x-b| = a
|
|
27
|
+
const b = -poly.coefficients[0];
|
|
28
|
+
const answer = a === 0 ? `S=\\left\\{${b}\\right\\}` : a < 0 ? `S=\\emptyset` : `S=\\left\\{${b - a};${b + a}\\right\\}`;
|
|
29
|
+
const getPropositions = (n) => {
|
|
30
|
+
const res = [];
|
|
31
|
+
res.push({
|
|
32
|
+
id: (0, uuid_1.v4)(),
|
|
33
|
+
statement: answer,
|
|
34
|
+
isRightAnswer: true,
|
|
35
|
+
format: 'tex',
|
|
36
|
+
});
|
|
37
|
+
if (a < 0) {
|
|
38
|
+
(0, exercise_1.tryToAddWrongProp)(res, `S=\\left\\{${b - a};${b + a}\\right\\}`);
|
|
39
|
+
(0, exercise_1.tryToAddWrongProp)(res, `S=\\left\\{${b + a}\\right\\}`);
|
|
40
|
+
}
|
|
41
|
+
else if (a === 0) {
|
|
42
|
+
(0, exercise_1.tryToAddWrongProp)(res, `S=\\emptyset`);
|
|
43
|
+
}
|
|
44
|
+
else if (a > 0) {
|
|
45
|
+
(0, exercise_1.tryToAddWrongProp)(res, `S=\\left\\{${b + a}\\right\\}`);
|
|
46
|
+
(0, exercise_1.tryToAddWrongProp)(res, `S=\\left\\{${-b - a};${-b + a}\\right\\}`);
|
|
47
|
+
}
|
|
48
|
+
const missing = n - res.length;
|
|
49
|
+
for (let i = 0; i < missing; i++) {
|
|
50
|
+
let isDuplicate;
|
|
51
|
+
let proposition;
|
|
52
|
+
do {
|
|
53
|
+
const wrongAnswer = `S=\\left\\{${(0, randint_1.randint)(-9, 0)};${(0, randint_1.randint)(0, 10)}\\right\\}`;
|
|
54
|
+
proposition = {
|
|
55
|
+
id: (0, uuid_1.v4)() + ``,
|
|
56
|
+
statement: wrongAnswer,
|
|
57
|
+
isRightAnswer: false,
|
|
58
|
+
format: 'tex',
|
|
59
|
+
};
|
|
60
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
61
|
+
} while (isDuplicate);
|
|
62
|
+
res.push(proposition);
|
|
63
|
+
}
|
|
64
|
+
return (0, exercise_1.shuffleProps)(res, n);
|
|
65
|
+
};
|
|
66
|
+
const question = {
|
|
67
|
+
answer: answer,
|
|
68
|
+
instruction: `Résoudre l'équation $|${poly.toTree().toTex()}| = ${a}$.`,
|
|
69
|
+
keys: ['S', 'equal', 'emptyset', 'lbrace', 'semicolon', 'rbrace'],
|
|
70
|
+
getPropositions,
|
|
71
|
+
answerFormat: 'tex',
|
|
72
|
+
};
|
|
73
|
+
return question;
|
|
74
|
+
}
|
|
75
|
+
exports.getAbsoluteValueEquationsQuestion = getAbsoluteValueEquationsQuestion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"absoluteValueInequations.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/absolute/absoluteValueInequations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,YAAY,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAOhH,eAAO,MAAM,wBAAwB,EAAE,YAWtC,CAAC;AAEF,wBAAgB,mCAAmC,IAAI,QAAQ,CAoD9D"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAbsoluteValueInequationsQuestion = exports.absoluteValueInequations = 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 uuid_1 = require("uuid");
|
|
10
|
+
exports.absoluteValueInequations = {
|
|
11
|
+
id: 'absoluteValueInequations',
|
|
12
|
+
connector: '\\iff',
|
|
13
|
+
instruction: '',
|
|
14
|
+
label: 'Résoudre une inéquation avec valeur absolue',
|
|
15
|
+
levels: ['2nde', '1reESM'],
|
|
16
|
+
isSingleStep: true,
|
|
17
|
+
sections: ['Valeur absolue', 'Inéquations', 'Ensembles et intervalles'],
|
|
18
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getAbsoluteValueInequationsQuestion, nb),
|
|
19
|
+
qcmTimer: 60,
|
|
20
|
+
freeTimer: 60,
|
|
21
|
+
};
|
|
22
|
+
function getAbsoluteValueInequationsQuestion() {
|
|
23
|
+
const poly = new polynomial_1.Polynomial([(0, randint_1.randint)(-9, 10, [0]), 1]);
|
|
24
|
+
const a = (0, randint_1.randint)(1, 10);
|
|
25
|
+
//|x-b| <= a
|
|
26
|
+
const b = -poly.coefficients[0];
|
|
27
|
+
const isStrict = (0, coinFlip_1.coinFlip)();
|
|
28
|
+
const answer = isStrict ? `S=]${b - a};${b + a}[` : `S=[${b - a};${b + a}]`;
|
|
29
|
+
const getPropositions = (n) => {
|
|
30
|
+
const res = [];
|
|
31
|
+
res.push({
|
|
32
|
+
id: (0, uuid_1.v4)(),
|
|
33
|
+
statement: answer,
|
|
34
|
+
isRightAnswer: true,
|
|
35
|
+
format: 'tex',
|
|
36
|
+
});
|
|
37
|
+
(0, exercise_1.tryToAddWrongProp)(res, `S=]${b - a};${b + a}[`);
|
|
38
|
+
(0, exercise_1.tryToAddWrongProp)(res, `S=[${b - a};${b + a}]`);
|
|
39
|
+
(0, exercise_1.tryToAddWrongProp)(res, `S=\\left\\{${b - a};${b + a}\\right\\}`);
|
|
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 = `S=[${(0, randint_1.randint)(-9, 0)};${(0, randint_1.randint)(0, 10)}]`;
|
|
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, exercise_1.shuffleProps)(res, n);
|
|
57
|
+
};
|
|
58
|
+
const question = {
|
|
59
|
+
answer,
|
|
60
|
+
instruction: `Résoudre l'inéquation $|${poly.toTree().toTex()}|${isStrict ? '<' : '\\le'}${a}$.`,
|
|
61
|
+
keys: ['S', 'equal', 'lbracket', 'semicolon', 'rbracket', 'emptyset'],
|
|
62
|
+
getPropositions,
|
|
63
|
+
answerFormat: 'tex',
|
|
64
|
+
};
|
|
65
|
+
return question;
|
|
66
|
+
}
|
|
67
|
+
exports.getAbsoluteValueInequationsQuestion = getAbsoluteValueInequationsQuestion;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { MathExercise, Question } from '../../../exercises/exercise';
|
|
2
|
+
export declare const vectorCoordinatesFromTwoPoints: MathExercise;
|
|
3
|
+
export declare function getVectorCoordinatesFromTwoPointsQuestion(): Question;
|
|
4
|
+
//# sourceMappingURL=vectorCoordinatesFromTwoPoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vectorCoordinatesFromTwoPoints.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/vectors/vectorCoordinatesFromTwoPoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,YAAY,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAQhH,eAAO,MAAM,8BAA8B,EAAE,YAW5C,CAAC;AAEF,wBAAgB,yCAAyC,IAAI,QAAQ,CAuDpE"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getVectorCoordinatesFromTwoPointsQuestion = exports.vectorCoordinatesFromTwoPoints = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
|
+
const randomLetter_1 = require("../../../utils/randomLetter");
|
|
8
|
+
const uuid_1 = require("uuid");
|
|
9
|
+
exports.vectorCoordinatesFromTwoPoints = {
|
|
10
|
+
id: 'vectorCoordinatesFromTwoPoints',
|
|
11
|
+
connector: '=',
|
|
12
|
+
instruction: '',
|
|
13
|
+
label: "Déterminer les coordonnées d'un vecteur à partir de deux points",
|
|
14
|
+
levels: ['2nde'],
|
|
15
|
+
isSingleStep: true,
|
|
16
|
+
sections: ['Vecteurs'],
|
|
17
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getVectorCoordinatesFromTwoPointsQuestion, nb),
|
|
18
|
+
qcmTimer: 60,
|
|
19
|
+
freeTimer: 60,
|
|
20
|
+
};
|
|
21
|
+
function getVectorCoordinatesFromTwoPointsQuestion() {
|
|
22
|
+
const A = [(0, randint_1.randint)(-9, 9), (0, randint_1.randint)(-9, 9)];
|
|
23
|
+
const B = [(0, randint_1.randint)(-9, 9), (0, randint_1.randint)(-9, 9)];
|
|
24
|
+
const startLetter = (0, randomLetter_1.randomLetter)(true);
|
|
25
|
+
let endLetter = '';
|
|
26
|
+
do {
|
|
27
|
+
endLetter = (0, randomLetter_1.randomLetter)(true);
|
|
28
|
+
} while (endLetter === startLetter);
|
|
29
|
+
const answer = `\\left(${B[0] - A[0]};${B[1] - A[1]}\\right)`;
|
|
30
|
+
const getPropositions = (n) => {
|
|
31
|
+
const res = [];
|
|
32
|
+
res.push({
|
|
33
|
+
id: (0, uuid_1.v4)(),
|
|
34
|
+
statement: answer,
|
|
35
|
+
isRightAnswer: true,
|
|
36
|
+
format: 'tex',
|
|
37
|
+
});
|
|
38
|
+
(0, exercise_1.tryToAddWrongProp)(res, `\\left(${A[0] - B[0]};${A[1] - B[1]}\\right)`);
|
|
39
|
+
(0, exercise_1.tryToAddWrongProp)(res, `\\left(${A[1] - A[0]};${B[1] - B[0]}\\right)`);
|
|
40
|
+
(0, exercise_1.tryToAddWrongProp)(res, `\\left(${B[1] - B[0]};${A[1] - A[0]}\\right)`);
|
|
41
|
+
const missing = n - res.length;
|
|
42
|
+
for (let i = 0; i < missing; i++) {
|
|
43
|
+
let isDuplicate;
|
|
44
|
+
let proposition;
|
|
45
|
+
do {
|
|
46
|
+
const wrongAnswer = `\\left(${(0, randint_1.randint)(-10, 10)};${(0, randint_1.randint)(-10, 10)}\\right)`;
|
|
47
|
+
proposition = {
|
|
48
|
+
id: (0, uuid_1.v4)() + ``,
|
|
49
|
+
statement: wrongAnswer,
|
|
50
|
+
isRightAnswer: false,
|
|
51
|
+
format: 'tex',
|
|
52
|
+
};
|
|
53
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
54
|
+
} while (isDuplicate);
|
|
55
|
+
res.push(proposition);
|
|
56
|
+
}
|
|
57
|
+
return (0, exercise_1.shuffleProps)(res, n);
|
|
58
|
+
};
|
|
59
|
+
const question = {
|
|
60
|
+
answer,
|
|
61
|
+
instruction: `Soit $${startLetter}\\left(${A[0]};${A[1]}\\right)$ et $${endLetter}\\left(${B[0]};${B[1]}\\right)$. Quelles sont les coordonnées du vecteur $\\overrightarrow{${startLetter}${endLetter}}$ ?`,
|
|
62
|
+
keys: ['semicolon'],
|
|
63
|
+
getPropositions,
|
|
64
|
+
answerFormat: 'tex',
|
|
65
|
+
};
|
|
66
|
+
return question;
|
|
67
|
+
}
|
|
68
|
+
exports.getVectorCoordinatesFromTwoPointsQuestion = getVectorCoordinatesFromTwoPointsQuestion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evolutionToCM.d.ts","sourceRoot":"","sources":["../../../src/exercises/percent/evolutionToCM.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,YAAY,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAOhH,eAAO,MAAM,aAAa,EAAE,YAW3B,CAAC;AAEF,wBAAgB,wBAAwB,IAAI,QAAQ,CA2DnD"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getEvolutionToCmQuestion = exports.evolutionToCM = void 0;
|
|
4
|
+
const exercise_1 = require("../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const randint_1 = require("../../math/utils/random/randint");
|
|
7
|
+
const round_1 = require("../../math/utils/round");
|
|
8
|
+
const coinFlip_1 = require("../../utils/coinFlip");
|
|
9
|
+
const uuid_1 = require("uuid");
|
|
10
|
+
exports.evolutionToCM = {
|
|
11
|
+
id: 'evolutionToCM',
|
|
12
|
+
connector: '=',
|
|
13
|
+
instruction: '',
|
|
14
|
+
label: "Passer d'évolution en pourcentage au coefficient multiplicateur",
|
|
15
|
+
levels: ['2ndPro', '2nde', '1rePro', '1reTech', '1reESM'],
|
|
16
|
+
isSingleStep: true,
|
|
17
|
+
sections: ['Pourcentages'],
|
|
18
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getEvolutionToCmQuestion, nb),
|
|
19
|
+
qcmTimer: 60,
|
|
20
|
+
freeTimer: 60,
|
|
21
|
+
};
|
|
22
|
+
function getEvolutionToCmQuestion() {
|
|
23
|
+
const isFromEvolutionToCM = (0, coinFlip_1.coinFlip)();
|
|
24
|
+
const evolution = (0, randint_1.randint)(-99, 101, [0]);
|
|
25
|
+
const isHausse = evolution > 0;
|
|
26
|
+
const CM = ((0, round_1.round)(1 + evolution / 100, 2) + '').replaceAll('.', ',');
|
|
27
|
+
const answer = isFromEvolutionToCM ? CM : (isHausse ? '+' : '') + evolution + '\\%';
|
|
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
|
+
if (isFromEvolutionToCM) {
|
|
37
|
+
(0, exercise_1.tryToAddWrongProp)(res, ((0, round_1.round)(evolution / 100, 2) + '').replaceAll('.', ','));
|
|
38
|
+
(0, exercise_1.tryToAddWrongProp)(res, evolution + '');
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
(0, exercise_1.tryToAddWrongProp)(res, '+' + ((0, round_1.round)(1 + evolution / 100, 2) * 100 + '\\%').replaceAll('.', ','));
|
|
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 = isFromEvolutionToCM
|
|
49
|
+
? ((0, round_1.round)((0, randint_1.randint)(1, 200) / 100, 2) + '').replaceAll('.', ',')
|
|
50
|
+
: ((0, coinFlip_1.coinFlip)() ? '+' : '-') + (0, randint_1.randint)(1, 100) + '\\%';
|
|
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, exercise_1.shuffleProps)(res, n);
|
|
62
|
+
};
|
|
63
|
+
const question = {
|
|
64
|
+
answer: answer,
|
|
65
|
+
instruction: isFromEvolutionToCM
|
|
66
|
+
? `Quel est le coefficient multiplicateur associé à une ${isHausse ? 'hausse' : 'baisse'} de $${isHausse ? evolution : evolution.toString().slice(1)}\\%$ ?`
|
|
67
|
+
: `Quelle est l'évolution en pourcentage associée à un coefficient multiplicateur de $${CM}$ ?`,
|
|
68
|
+
keys: ['percent'],
|
|
69
|
+
getPropositions,
|
|
70
|
+
answerFormat: 'tex',
|
|
71
|
+
};
|
|
72
|
+
return question;
|
|
73
|
+
}
|
|
74
|
+
exports.getEvolutionToCmQuestion = getEvolutionToCmQuestion;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { MathExercise, Question } from '../../exercises/exercise';
|
|
2
|
+
export declare const explicitFormulaUsage: MathExercise;
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* expres alg possibles :
|
|
6
|
+
* poly: deg1, deg2
|
|
7
|
+
* trigo
|
|
8
|
+
* inverse
|
|
9
|
+
* frac ratio
|
|
10
|
+
* sqrt
|
|
11
|
+
* exp ln
|
|
12
|
+
* powers
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* soit un = ...
|
|
17
|
+
* calculer u3
|
|
18
|
+
* donc il faut le tex de la suite + la valeur en 3
|
|
19
|
+
* deg2, frac rac
|
|
20
|
+
*/
|
|
21
|
+
export declare function getExplicitFormulaUsageQuestion(): Question;
|
|
22
|
+
//# sourceMappingURL=explicitFormulaUsage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"explicitFormulaUsage.d.ts","sourceRoot":"","sources":["../../../src/exercises/sequences/explicitFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,YAAY,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAOhH,eAAO,MAAM,oBAAoB,EAAE,YAWlC,CAAC;AAEF;;;;;;;;;;GAUG;AACH;;;;;;GAMG;AACH,wBAAgB,+BAA+B,IAAI,QAAQ,CAiD1D"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getExplicitFormulaUsageQuestion = exports.explicitFormulaUsage = 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 uuid_1 = require("uuid");
|
|
9
|
+
exports.explicitFormulaUsage = {
|
|
10
|
+
id: 'explicitFormulaUsage',
|
|
11
|
+
connector: '=',
|
|
12
|
+
instruction: '',
|
|
13
|
+
label: "Utiliser la formule explicite d'une suite",
|
|
14
|
+
levels: ['1reESM', '1reSpé', '1reTech'],
|
|
15
|
+
isSingleStep: true,
|
|
16
|
+
sections: ['Suites'],
|
|
17
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getExplicitFormulaUsageQuestion, nb),
|
|
18
|
+
qcmTimer: 60,
|
|
19
|
+
freeTimer: 60,
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* expres alg possibles :
|
|
24
|
+
* poly: deg1, deg2
|
|
25
|
+
* trigo
|
|
26
|
+
* inverse
|
|
27
|
+
* frac ratio
|
|
28
|
+
* sqrt
|
|
29
|
+
* exp ln
|
|
30
|
+
* powers
|
|
31
|
+
*/
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* soit un = ...
|
|
35
|
+
* calculer u3
|
|
36
|
+
* donc il faut le tex de la suite + la valeur en 3
|
|
37
|
+
* deg2, frac rac
|
|
38
|
+
*/
|
|
39
|
+
function getExplicitFormulaUsageQuestion() {
|
|
40
|
+
const u = polynomial_1.PolynomialConstructor.randomWithOrder(2, 'n');
|
|
41
|
+
const rank = (0, randint_1.randint)(0, 4);
|
|
42
|
+
const answer = u.calculate(rank);
|
|
43
|
+
const getPropositions = (n) => {
|
|
44
|
+
const res = [];
|
|
45
|
+
res.push({
|
|
46
|
+
id: (0, uuid_1.v4)(),
|
|
47
|
+
statement: answer + '',
|
|
48
|
+
isRightAnswer: true,
|
|
49
|
+
format: 'tex',
|
|
50
|
+
});
|
|
51
|
+
(0, exercise_1.tryToAddWrongProp)(res, u.calculate(rank - 1) + '');
|
|
52
|
+
(0, exercise_1.tryToAddWrongProp)(res, u.calculate(rank + 1) + '');
|
|
53
|
+
const missing = n - res.length;
|
|
54
|
+
for (let i = 0; i < missing; i++) {
|
|
55
|
+
let isDuplicate;
|
|
56
|
+
let proposition;
|
|
57
|
+
do {
|
|
58
|
+
const wrongAnswer = (0, randint_1.randint)(-100, 100) + '';
|
|
59
|
+
proposition = {
|
|
60
|
+
id: (0, uuid_1.v4)() + ``,
|
|
61
|
+
statement: wrongAnswer,
|
|
62
|
+
isRightAnswer: false,
|
|
63
|
+
format: 'tex',
|
|
64
|
+
};
|
|
65
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
66
|
+
} while (isDuplicate);
|
|
67
|
+
res.push(proposition);
|
|
68
|
+
}
|
|
69
|
+
return (0, exercise_1.shuffleProps)(res, n);
|
|
70
|
+
};
|
|
71
|
+
const question = {
|
|
72
|
+
answer: answer + '',
|
|
73
|
+
instruction: `Soit $u$ la suite définie pour tout $n\\geq 0$ par $u_n = ${u
|
|
74
|
+
.toTree()
|
|
75
|
+
.toTex()}$. Calculer $u_${rank}$.`,
|
|
76
|
+
keys: [],
|
|
77
|
+
getPropositions,
|
|
78
|
+
answerFormat: 'tex',
|
|
79
|
+
};
|
|
80
|
+
return question;
|
|
81
|
+
}
|
|
82
|
+
exports.getExplicitFormulaUsageQuestion = getExplicitFormulaUsageQuestion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genericSequenceVariations.d.ts","sourceRoot":"","sources":["../../../src/exercises/sequences/genericSequenceVariations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,YAAY,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAOhH,eAAO,MAAM,yBAAyB,EAAE,YAYvC,CAAC;AAEF,wBAAgB,oCAAoC,IAAI,QAAQ,CAsC/D"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getGenericSequenceVariationsQuestion = exports.genericSequenceVariations = 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 uuid_1 = require("uuid");
|
|
9
|
+
exports.genericSequenceVariations = {
|
|
10
|
+
id: 'genericSequenceVariations',
|
|
11
|
+
connector: '=',
|
|
12
|
+
instruction: '',
|
|
13
|
+
label: "Déterminer le sens de variations d'une suite en étudiant la différence de deux termes",
|
|
14
|
+
levels: ['1reESM', '1rePro', '1reTech'],
|
|
15
|
+
isSingleStep: true,
|
|
16
|
+
sections: ['Suites'],
|
|
17
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getGenericSequenceVariationsQuestion, nb),
|
|
18
|
+
qcmTimer: 60,
|
|
19
|
+
freeTimer: 60,
|
|
20
|
+
answerType: 'QCM',
|
|
21
|
+
};
|
|
22
|
+
function getGenericSequenceVariationsQuestion() {
|
|
23
|
+
const u = polynomial_1.PolynomialConstructor.randomWithOrder(2, 'n');
|
|
24
|
+
const [b, a] = u.coefficients.slice(1);
|
|
25
|
+
const root = Math.ceil((-a - b) / (2 * a));
|
|
26
|
+
const answer = root <= 0
|
|
27
|
+
? a > 0
|
|
28
|
+
? 'Croissante'
|
|
29
|
+
: 'Décroissante'
|
|
30
|
+
: `${a > 0 ? 'Croissante' : 'Décroissante'} à partir du rang ${root}`;
|
|
31
|
+
const getPropositions = (n) => {
|
|
32
|
+
const res = [];
|
|
33
|
+
res.push({
|
|
34
|
+
id: (0, uuid_1.v4)(),
|
|
35
|
+
statement: answer,
|
|
36
|
+
isRightAnswer: true,
|
|
37
|
+
format: 'raw',
|
|
38
|
+
});
|
|
39
|
+
(0, exercise_1.tryToAddWrongProp)(res, 'Croissante', 'raw');
|
|
40
|
+
(0, exercise_1.tryToAddWrongProp)(res, 'Décroissante', 'raw');
|
|
41
|
+
let fakeRoot = root <= 0 ? (0, randint_1.randint)(1, 10) : root;
|
|
42
|
+
(0, exercise_1.tryToAddWrongProp)(res, `Croissante à partir du rang ${fakeRoot}`, 'raw');
|
|
43
|
+
(0, exercise_1.tryToAddWrongProp)(res, `Décroissante à partir du rang ${fakeRoot}`, 'raw');
|
|
44
|
+
return (0, exercise_1.shuffleProps)(res, n);
|
|
45
|
+
};
|
|
46
|
+
const question = {
|
|
47
|
+
answer,
|
|
48
|
+
instruction: `Soit $u$ la suite définie par $u_n = ${u.toTree().toTex()}$. Quel est le sens de variations de $u$ ?`,
|
|
49
|
+
keys: [],
|
|
50
|
+
getPropositions,
|
|
51
|
+
answerFormat: 'raw',
|
|
52
|
+
};
|
|
53
|
+
return question;
|
|
54
|
+
}
|
|
55
|
+
exports.getGenericSequenceVariationsQuestion = getGenericSequenceVariationsQuestion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recurrenceFormulaUsage.d.ts","sourceRoot":"","sources":["../../../src/exercises/sequences/recurrenceFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,YAAY,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAMhH,eAAO,MAAM,sBAAsB,EAAE,YAWpC,CAAC;AAEF,wBAAgB,iCAAiC,IAAI,QAAQ,CAsD5D"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRecurrenceFormulaUsageQuestion = exports.recurrenceFormulaUsage = 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 uuid_1 = require("uuid");
|
|
9
|
+
exports.recurrenceFormulaUsage = {
|
|
10
|
+
id: 'recurrenceFormulaUsage',
|
|
11
|
+
connector: '=',
|
|
12
|
+
instruction: '',
|
|
13
|
+
label: "Utiliser la formule de récurrence d'une suite",
|
|
14
|
+
levels: ['1reESM', '1reSpé', '1reTech'],
|
|
15
|
+
isSingleStep: true,
|
|
16
|
+
sections: ['Suites'],
|
|
17
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getRecurrenceFormulaUsageQuestion, nb),
|
|
18
|
+
qcmTimer: 60,
|
|
19
|
+
freeTimer: 60,
|
|
20
|
+
};
|
|
21
|
+
function getRecurrenceFormulaUsageQuestion() {
|
|
22
|
+
const coeffs = [(0, randint_1.randint)(-5, 6), (0, randint_1.randint)(-5, 6), (0, randint_1.randint)(-3, 4, [0])];
|
|
23
|
+
const u = new polynomial_1.Polynomial(coeffs, 'u_n');
|
|
24
|
+
const u0 = (0, randint_1.randint)(-2, 3, [0]);
|
|
25
|
+
const rank = (0, randint_1.randint)(1, 4);
|
|
26
|
+
let currentValue = u0;
|
|
27
|
+
for (let i = 0; i < rank; i++) {
|
|
28
|
+
currentValue = u.calculate(currentValue);
|
|
29
|
+
}
|
|
30
|
+
const answer = currentValue + '';
|
|
31
|
+
const getPropositions = (n) => {
|
|
32
|
+
const res = [];
|
|
33
|
+
res.push({
|
|
34
|
+
id: (0, uuid_1.v4)(),
|
|
35
|
+
statement: answer + '',
|
|
36
|
+
isRightAnswer: true,
|
|
37
|
+
format: 'tex',
|
|
38
|
+
});
|
|
39
|
+
(0, exercise_1.tryToAddWrongProp)(res, u.calculate(rank) + '');
|
|
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)(-100, 100) + '';
|
|
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, exercise_1.shuffleProps)(res, n);
|
|
57
|
+
};
|
|
58
|
+
const question = {
|
|
59
|
+
answer: answer + '',
|
|
60
|
+
instruction: `Soit $u$ la suite définie par $u_0 = ${u0}$ et pour tout $n\\geq 1$, $u_{n+1} = ${u
|
|
61
|
+
.toTree()
|
|
62
|
+
.toTex()}$. Calculer $u_${rank}$.`,
|
|
63
|
+
keys: [],
|
|
64
|
+
getPropositions,
|
|
65
|
+
answerFormat: 'tex',
|
|
66
|
+
};
|
|
67
|
+
return question;
|
|
68
|
+
}
|
|
69
|
+
exports.getRecurrenceFormulaUsageQuestion = getRecurrenceFormulaUsageQuestion;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"point.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/point.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"point.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/point.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAQ7C,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAG1C,8BAAsB,gBAAgB;IACpC,MAAM,CAAC,MAAM,CAAC,OAAO,GAAE,OAAqC,EAAE,OAAO,GAAE,OAAqC,GAAG,KAAK;CAOrH;AAED,qBAAa,KAAK;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,IAAI,CAAC;IACR,CAAC,EAAE,IAAI,CAAC;gBACI,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI;IAM1C,KAAK,IAAI,MAAM;IAIf,eAAe,IAAI,MAAM;IAIzB,UAAU,IAAI,MAAM;IAIpB,UAAU,IAAI,MAAM;IAIpB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,SAAM,GAAG,KAAK;IAQrC,UAAU,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM;IAM5B,cAAc,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI;IAO9B,OAAO,CAAC,CAAC,EAAE,KAAK,GAAG,OAAO;CAG3B;AAED;;;;;;;;;;;;GAYG"}
|
|
@@ -9,7 +9,15 @@ const powerNode_1 = require("../../tree/nodes/operators/powerNode");
|
|
|
9
9
|
const substractNode_1 = require("../../tree/nodes/operators/substractNode");
|
|
10
10
|
const simplify_1 = require("../../tree/parsers/simplify");
|
|
11
11
|
const mathjs_1 = require("mathjs");
|
|
12
|
+
const intervals_1 = require("../sets/intervals/intervals");
|
|
12
13
|
class PointConstructor {
|
|
14
|
+
static random(domainX = new intervals_1.Interval('[[-10; 10]]'), domainY = new intervals_1.Interval('[[-10; 10]]')) {
|
|
15
|
+
const x = domainX.getRandomElement();
|
|
16
|
+
const y = domainY.getRandomElement();
|
|
17
|
+
if (x === null || y === null)
|
|
18
|
+
throw Error("can't build point with thoses sets");
|
|
19
|
+
return new Point('A', new numberNode_1.NumberNode(x.value), new numberNode_1.NumberNode(y.value));
|
|
20
|
+
}
|
|
13
21
|
}
|
|
14
22
|
exports.PointConstructor = PointConstructor;
|
|
15
23
|
class Point {
|
|
@@ -2,6 +2,13 @@ import { Node } from '../../tree/nodes/node';
|
|
|
2
2
|
export declare abstract class PolynomialConstructor {
|
|
3
3
|
static randomWithOrder(order: number, variable?: string): Polynomial;
|
|
4
4
|
static random(maxOrder: number, variable?: string): Polynomial;
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @param maxOrder included
|
|
8
|
+
* @param length
|
|
9
|
+
* @param variable
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
5
12
|
static randomWithLength(maxOrder: number, length: number, variable?: string): Polynomial;
|
|
6
13
|
static randomWithLengthAndSameSigns(maxOrder: number, length: number, variable?: string): Polynomial;
|
|
7
14
|
static randomNoFI(maxOrder: number, to: '+\\infty' | '-\\infty', length?: number, variable?: string): Polynomial;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polynomial.d.ts","sourceRoot":"","sources":["../../../src/math/polynomials/polynomial.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAW7C,8BAAsB,qBAAqB;IACzC,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAY;IAa5D,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAY;IActD,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAY;IAmBhF,MAAM,CAAC,4BAA4B,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAY;IAmB5F,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,GAAG,UAAU,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAY;CAyBzG;AAED,qBAAa,UAAU;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,YAAY,EAAE,MAAM,EAAE,CAAC;IAEvB;;;;OAIG;gBACS,YAAY,EAAE,MAAM,EAAE,EAAE,QAAQ,GAAE,MAAY;IAS1D,MAAM,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;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,YAAY,EAAE,MAAM,EAAE,CAAC;IAEvB;;;;OAIG;gBACS,YAAY,EAAE,MAAM,EAAE,EAAE,QAAQ,GAAE,MAAY;IAS1D,MAAM,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO;IAG9B,QAAQ,IAAI,MAAM,EAAE;IAkCpB,GAAG,CAAC,CAAC,EAAE,UAAU,GAAG,UAAU;IAkB9B,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,UAAU;IAO7B,QAAQ,CAAC,CAAC,EAAE,UAAU,GAAG,UAAU;IAsBnC,QAAQ,IAAI,UAAU;IAOtB,QAAQ,IAAI,UAAU;IAQtB,SAAS,IAAI,UAAU;IAMvB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAM5B,QAAQ,CAAC,EAAE,EAAE,UAAU,GAAG,UAAU,GAAG,MAAM;IAiB7C,MAAM,IAAI,IAAI;IAmCd,KAAK,IAAI,MAAM;IAkBf,QAAQ,IAAI,MAAM;CAGnB"}
|
|
@@ -33,6 +33,13 @@ class PolynomialConstructor {
|
|
|
33
33
|
coefficients.push((0, randint_1.randint)(-9, 10, [0]));
|
|
34
34
|
return new Polynomial(coefficients, variable);
|
|
35
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @param maxOrder included
|
|
39
|
+
* @param length
|
|
40
|
+
* @param variable
|
|
41
|
+
* @returns
|
|
42
|
+
*/
|
|
36
43
|
static randomWithLength(maxOrder, length, variable = 'x') {
|
|
37
44
|
if (maxOrder < 0) {
|
|
38
45
|
throw Error('Order must be a non-negative integer');
|
|
@@ -11,12 +11,14 @@ export declare class Sequence {
|
|
|
11
11
|
firstTerm: Node;
|
|
12
12
|
recurrenceFormula?: string;
|
|
13
13
|
explicitFormula?: string;
|
|
14
|
-
|
|
14
|
+
recurrenceEvaluator?: (x: number) => number;
|
|
15
|
+
constructor({ type, recurrenceFormula, explicitFormula, firstRank, firstTerm, recurrenceEvaluator, }: {
|
|
15
16
|
type: SequenceType;
|
|
16
17
|
recurrenceFormula?: string;
|
|
17
18
|
explicitFormula?: string;
|
|
18
19
|
firstRank: Integer;
|
|
19
20
|
firstTerm: Node;
|
|
21
|
+
recurrenceEvaluator: (x: number) => number;
|
|
20
22
|
});
|
|
21
23
|
}
|
|
22
24
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequence.d.ts","sourceRoot":"","sources":["../../../src/math/sequences/sequence.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAErD,aAAK,YAAY;IACf,UAAU,IAAA;IACV,SAAS,IAAA;IACT,KAAK,IAAA;CACN;AAED,qBAAa,QAAQ;IACnB,IAAI,EAAE,YAAY,CAAC;IACnB,SAAS,EAAE,OAAO,CAAkB;IACpC,SAAS,EAAE,IAAI,CAAC;IAChB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"sequence.d.ts","sourceRoot":"","sources":["../../../src/math/sequences/sequence.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAErD,aAAK,YAAY;IACf,UAAU,IAAA;IACV,SAAS,IAAA;IACT,KAAK,IAAA;CACN;AAED,qBAAa,QAAQ;IACnB,IAAI,EAAE,YAAY,CAAC;IACnB,SAAS,EAAE,OAAO,CAAkB;IACpC,SAAS,EAAE,IAAI,CAAC;IAChB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;gBAChC,EACV,IAAI,EACJ,iBAAiB,EACjB,eAAe,EACf,SAAS,EACT,SAAS,EACT,mBAAmB,GACpB,EAAE;QACD,IAAI,EAAE,YAAY,CAAC;QACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,SAAS,EAAE,OAAO,CAAC;QACnB,SAAS,EAAE,IAAI,CAAC;QAChB,mBAAmB,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;KAC5C;CAQF"}
|
|
@@ -9,13 +9,14 @@ var SequenceType;
|
|
|
9
9
|
SequenceType[SequenceType["other"] = 2] = "other";
|
|
10
10
|
})(SequenceType || (SequenceType = {}));
|
|
11
11
|
class Sequence {
|
|
12
|
-
constructor({ type, recurrenceFormula, explicitFormula, firstRank, firstTerm, }) {
|
|
12
|
+
constructor({ type, recurrenceFormula, explicitFormula, firstRank, firstTerm, recurrenceEvaluator, }) {
|
|
13
13
|
this.firstRank = new integer_1.Integer(0);
|
|
14
14
|
this.type = type;
|
|
15
15
|
this.firstTerm = firstTerm;
|
|
16
16
|
this.recurrenceFormula = recurrenceFormula;
|
|
17
17
|
this.explicitFormula = explicitFormula;
|
|
18
18
|
this.firstRank = firstRank;
|
|
19
|
+
this.recurrenceEvaluator = recurrenceEvaluator;
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
22
|
exports.Sequence = Sequence;
|
package/lib/types/keyIds.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
export type KeyId =
|
|
2
2
|
/**units */
|
|
3
|
-
'cm' | 'cm2' | '
|
|
3
|
+
'cm' | 'cm2' | 'celsius' | 'Hz' | 'mol' | 'kJ' | 'mL'
|
|
4
4
|
/**utility */
|
|
5
|
-
| 'custom' | 'right' | 'left' | 'rightarrow' | '
|
|
5
|
+
| 'custom' | 'right' | 'left' | 'rightarrow' | 'del' | 'close' | 'switch' | 'ou' | 'et' | 'maj'
|
|
6
|
+
/**geometry */
|
|
7
|
+
| 'overrightarrow' | 'degree'
|
|
6
8
|
/**operations */
|
|
7
|
-
| 'plus' | 'minus' | 'times' | 'frac' | 'obelus' | 'sqrt' | 'sqrtCub' | 'square' | 'cube' | 'power' | 'percent' | 'leftParenthesis' | 'rightParenthesis' | 'equal' | 'comma' | 'semicolon' | 'dot' | 'sup' | 'inf' | 'geq' | 'leq' | 'approx'
|
|
9
|
+
| 'plus' | 'minus' | 'times' | 'frac' | 'obelus' | 'sqrt' | 'sqrtCub' | 'square' | 'cube' | 'power' | 'percent' | 'leftParenthesis' | 'rightParenthesis' | 'equal' | 'comma' | 'semicolon' | 'dot' | 'sup' | 'inf' | 'geq' | 'leq' | 'approx' | 'xsquare' | 'xcube'
|
|
8
10
|
/**sets */
|
|
9
|
-
| 'belongs' | 'notin' | 'cap' | 'cup' | 'lbrace' | 'rbrace' | 'lbracket' | 'rbracket' | 'emptyset' | 'naturals' | 'integers' | 'rationals' | 'decimals' | 'reals' | 'complex' | 'ast' | '
|
|
11
|
+
| 'belongs' | 'notin' | 'cap' | 'cup' | 'lbrace' | 'rbrace' | 'lbracket' | 'rbracket' | 'emptyset' | 'naturals' | 'integers' | 'rationals' | 'decimals' | 'reals' | 'complex' | 'ast' | 'del' | 'right' | 'left' | 'rightarrow' | 'overrightarrow' | 'infty'
|
|
10
12
|
/**fcts */
|
|
11
13
|
| 'log' | 'ln' | 'exp' | 'epower' | 'sin' | 'cos' | 'tan' | 'arccos' | 'arcsin' | 'arctan' | 'abs'
|
|
12
14
|
/**sequences */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyIds.d.ts","sourceRoot":"","sources":["../../src/types/keyIds.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK;AACf,WAAW;AACT,IAAI,GACJ,KAAK,GACL,
|
|
1
|
+
{"version":3,"file":"keyIds.d.ts","sourceRoot":"","sources":["../../src/types/keyIds.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK;AACf,WA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
|
+
{"version":3,"file":"randomLetter.d.ts","sourceRoot":"","sources":["../../src/utils/randomLetter.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,WAAW,OAAO,WAI1C,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.randomLetter = void 0;
|
|
4
|
+
const randomLetter = (isMaj = false) => {
|
|
5
|
+
if (isMaj)
|
|
6
|
+
return String.fromCharCode(65 + Math.floor(Math.random() * 26));
|
|
7
|
+
return String.fromCharCode(97 + Math.floor(Math.random() * 26));
|
|
8
|
+
};
|
|
9
|
+
exports.randomLetter = randomLetter;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "math-exercises",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.17",
|
|
4
4
|
"description": "Math exercises generator for middle school and high school",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"files": [
|
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
"jest": "^29.7.0",
|
|
32
32
|
"nodemon": "^2.0.20",
|
|
33
33
|
"prettier": "^2.8.4",
|
|
34
|
-
"react-math-keyboard": "^1.3.1",
|
|
35
34
|
"ts-jest": "^29.1.1",
|
|
36
35
|
"ts-node": "^10.9.1",
|
|
37
36
|
"ts-node-dev": "^2.0.0",
|