math-exercises 1.3.57 → 1.3.58

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.
Files changed (36) hide show
  1. package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType0.d.ts +4 -0
  2. package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType0.d.ts.map +1 -0
  3. package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType0.js +69 -0
  4. package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType1.d.ts +4 -0
  5. package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType1.d.ts.map +1 -0
  6. package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType1.js +70 -0
  7. package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType2.d.ts +4 -0
  8. package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType2.d.ts.map +1 -0
  9. package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType2.js +70 -0
  10. package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType3.d.ts +4 -0
  11. package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType3.d.ts.map +1 -0
  12. package/lib/exercises/calculLitteral/inequations/firstDegreeInequationsType3.js +71 -0
  13. package/lib/exercises/exercise.d.ts +1 -1
  14. package/lib/exercises/exercise.d.ts.map +1 -1
  15. package/lib/exercises/exercises.d.ts.map +1 -1
  16. package/lib/exercises/exercises.js +66 -32
  17. package/lib/exercises/functions/cube/cubicEquation.d.ts +4 -0
  18. package/lib/exercises/functions/cube/cubicEquation.d.ts.map +1 -0
  19. package/lib/exercises/functions/cube/cubicEquation.js +65 -0
  20. package/lib/exercises/geometry/vectors/chasles.d.ts +4 -0
  21. package/lib/exercises/geometry/vectors/chasles.d.ts.map +1 -0
  22. package/lib/exercises/geometry/vectors/chasles.js +72 -0
  23. package/lib/exercises/geometry/vectors/determinant.d.ts +4 -0
  24. package/lib/exercises/geometry/vectors/determinant.d.ts.map +1 -0
  25. package/lib/exercises/geometry/vectors/determinant.js +67 -0
  26. package/lib/exercises/sets/intervalsUnion.d.ts +4 -0
  27. package/lib/exercises/sets/intervalsUnion.d.ts.map +1 -0
  28. package/lib/exercises/sets/intervalsUnion.js +53 -0
  29. package/lib/exercises/squareRoots/squareRootEquation.d.ts +4 -0
  30. package/lib/exercises/squareRoots/squareRootEquation.d.ts.map +1 -0
  31. package/lib/exercises/squareRoots/squareRootEquation.js +70 -0
  32. package/lib/math/geometry/vector.d.ts +2 -0
  33. package/lib/math/geometry/vector.d.ts.map +1 -1
  34. package/lib/math/geometry/vector.js +8 -0
  35. package/lib/math/sets/intervals/intervals.d.ts.map +1 -1
  36. package/package.json +1 -1
@@ -0,0 +1,4 @@
1
+ import { Exercise, Question } from '../../../exercises/exercise';
2
+ export declare const firstDegreeInequationsType0: Exercise;
3
+ export declare function getFirstDegreeInequationsQuestion(): Question;
4
+ //# sourceMappingURL=firstDegreeInequationsType0.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"firstDegreeInequationsType0.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/inequations/firstDegreeInequationsType0.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAY3E,eAAO,MAAM,2BAA2B,EAAE,QASzC,CAAC;AAEF,wBAAgB,iCAAiC,IAAI,QAAQ,CAyD5D"}
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getFirstDegreeInequationsQuestion = exports.firstDegreeInequationsType0 = void 0;
4
+ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
5
+ const affine_1 = require("../../../math/polynomials/affine");
6
+ const randint_1 = require("../../../math/utils/random/randint");
7
+ const coinFlip_1 = require("../../../utils/coinFlip");
8
+ const random_1 = require("../../../utils/random");
9
+ const shuffle_1 = require("../../../utils/shuffle");
10
+ const uuid_1 = require("uuid");
11
+ exports.firstDegreeInequationsType0 = {
12
+ id: 'firstDegreeInequationsType0',
13
+ connector: '\\iff',
14
+ instruction: '',
15
+ label: 'Résoudre une inéquation du type $x+b<c$',
16
+ levels: ['3ème', '2ndPro', '2nde', '1reESM', '1rePro', '1reTech'],
17
+ isSingleStep: true,
18
+ sections: ['Inéquations'],
19
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getFirstDegreeInequationsQuestion, nb),
20
+ };
21
+ function getFirstDegreeInequationsQuestion() {
22
+ const affine = new affine_1.Affine(1, (0, randint_1.randint)(-10, 11));
23
+ const c = (0, randint_1.randint)(-10, 11);
24
+ const result = c - affine.b;
25
+ const ineqType = (0, random_1.random)(['\\leq', '<', '\\geq', '>']);
26
+ const invIneqType = ineqType === '<' ? '>' : ineqType === '>' ? '<' : ineqType === '\\leq' ? '\\geq' : '\\leq';
27
+ const answer = `x ${ineqType} ${result}`;
28
+ const getPropositions = (n) => {
29
+ const res = [];
30
+ res.push({
31
+ id: (0, uuid_1.v4)(),
32
+ statement: answer,
33
+ isRightAnswer: true,
34
+ format: 'tex',
35
+ });
36
+ res.push({
37
+ id: (0, uuid_1.v4)(),
38
+ statement: `x ${affine.a < 0 ? ineqType : invIneqType} ${result}`,
39
+ isRightAnswer: false,
40
+ format: 'tex',
41
+ });
42
+ const missing = n - res.length;
43
+ for (let i = 0; i < missing; i++) {
44
+ let isDuplicate;
45
+ let proposition;
46
+ do {
47
+ const wrongAnswer = `x ${(0, coinFlip_1.coinFlip)() ? ineqType : invIneqType} ${(0, randint_1.randint)(-10, 11)}`;
48
+ proposition = {
49
+ id: (0, uuid_1.v4)() + ``,
50
+ statement: wrongAnswer,
51
+ isRightAnswer: false,
52
+ format: 'tex',
53
+ };
54
+ isDuplicate = res.some((p) => p.statement === proposition.statement);
55
+ } while (isDuplicate);
56
+ res.push(proposition);
57
+ }
58
+ return (0, shuffle_1.shuffle)(res);
59
+ };
60
+ const question = {
61
+ answer: answer,
62
+ instruction: `Résoudre l'inéquation : $${affine.toTex()} ${ineqType} ${c}$ `,
63
+ keys: ['x', 'sup', 'inf', 'geq', 'leq'],
64
+ getPropositions,
65
+ answerFormat: 'tex',
66
+ };
67
+ return question;
68
+ }
69
+ exports.getFirstDegreeInequationsQuestion = getFirstDegreeInequationsQuestion;
@@ -0,0 +1,4 @@
1
+ import { Exercise, Question } from '../../../exercises/exercise';
2
+ export declare const firstDegreeInequationsType1: Exercise;
3
+ export declare function getFirstDegreeInequationsQuestion(): Question;
4
+ //# sourceMappingURL=firstDegreeInequationsType1.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"firstDegreeInequationsType1.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/inequations/firstDegreeInequationsType1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAY3E,eAAO,MAAM,2BAA2B,EAAE,QASzC,CAAC;AAEF,wBAAgB,iCAAiC,IAAI,QAAQ,CAyD5D"}
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getFirstDegreeInequationsQuestion = exports.firstDegreeInequationsType1 = void 0;
4
+ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
5
+ const rational_1 = require("../../../math/numbers/rationals/rational");
6
+ const affine_1 = require("../../../math/polynomials/affine");
7
+ const randint_1 = require("../../../math/utils/random/randint");
8
+ const coinFlip_1 = require("../../../utils/coinFlip");
9
+ const random_1 = require("../../../utils/random");
10
+ const shuffle_1 = require("../../../utils/shuffle");
11
+ const uuid_1 = require("uuid");
12
+ exports.firstDegreeInequationsType1 = {
13
+ id: 'firstDegreeInequationsType1',
14
+ connector: '\\iff',
15
+ instruction: '',
16
+ label: 'Résoudre une inéquation du type $ax<b$',
17
+ levels: ['3ème', '2ndPro', '2nde', '1reESM', '1rePro', '1reTech'],
18
+ isSingleStep: true,
19
+ sections: ['Inéquations'],
20
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getFirstDegreeInequationsQuestion, nb),
21
+ };
22
+ function getFirstDegreeInequationsQuestion() {
23
+ const affine = new affine_1.Affine((0, randint_1.randint)(-10, 10, [0, 1]), 0);
24
+ const b = (0, randint_1.randint)(-10, 11);
25
+ const result = new rational_1.Rational(b, affine.a).simplify().toTree().toTex();
26
+ const ineqType = (0, random_1.random)(['\\leq', '<', '\\geq', '>']);
27
+ const invIneqType = ineqType === '<' ? '>' : ineqType === '>' ? '<' : ineqType === '\\leq' ? '\\geq' : '\\leq';
28
+ const answer = `x ${affine.a > 0 ? ineqType : invIneqType} ${result}`;
29
+ const getPropositions = (n) => {
30
+ const res = [];
31
+ res.push({
32
+ id: (0, uuid_1.v4)(),
33
+ statement: answer,
34
+ isRightAnswer: true,
35
+ format: 'tex',
36
+ });
37
+ res.push({
38
+ id: (0, uuid_1.v4)(),
39
+ statement: `x ${affine.a < 0 ? ineqType : invIneqType} ${result}`,
40
+ isRightAnswer: false,
41
+ format: 'tex',
42
+ });
43
+ const missing = n - res.length;
44
+ for (let i = 0; i < missing; i++) {
45
+ let isDuplicate;
46
+ let proposition;
47
+ do {
48
+ const wrongAnswer = `x ${(0, coinFlip_1.coinFlip)() ? ineqType : invIneqType} ${(0, randint_1.randint)(-10, 11)}`;
49
+ proposition = {
50
+ id: (0, uuid_1.v4)() + ``,
51
+ statement: wrongAnswer,
52
+ isRightAnswer: false,
53
+ format: 'tex',
54
+ };
55
+ isDuplicate = res.some((p) => p.statement === proposition.statement);
56
+ } while (isDuplicate);
57
+ res.push(proposition);
58
+ }
59
+ return (0, shuffle_1.shuffle)(res);
60
+ };
61
+ const question = {
62
+ answer: answer,
63
+ instruction: `Résoudre l'inéquation : $${affine.toTex()} ${ineqType} ${b}$ `,
64
+ keys: ['x', 'sup', 'inf', 'geq', 'leq'],
65
+ getPropositions,
66
+ answerFormat: 'tex',
67
+ };
68
+ return question;
69
+ }
70
+ exports.getFirstDegreeInequationsQuestion = getFirstDegreeInequationsQuestion;
@@ -0,0 +1,4 @@
1
+ import { Exercise, Question } from '../../../exercises/exercise';
2
+ export declare const firstDegreeInequationsType2: Exercise;
3
+ export declare function getFirstDegreeInequationsQuestion(): Question;
4
+ //# sourceMappingURL=firstDegreeInequationsType2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"firstDegreeInequationsType2.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/inequations/firstDegreeInequationsType2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAY3E,eAAO,MAAM,2BAA2B,EAAE,QASzC,CAAC;AAEF,wBAAgB,iCAAiC,IAAI,QAAQ,CAyD5D"}
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getFirstDegreeInequationsQuestion = exports.firstDegreeInequationsType2 = void 0;
4
+ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
5
+ const rational_1 = require("../../../math/numbers/rationals/rational");
6
+ const affine_1 = require("../../../math/polynomials/affine");
7
+ const randint_1 = require("../../../math/utils/random/randint");
8
+ const coinFlip_1 = require("../../../utils/coinFlip");
9
+ const random_1 = require("../../../utils/random");
10
+ const shuffle_1 = require("../../../utils/shuffle");
11
+ const uuid_1 = require("uuid");
12
+ exports.firstDegreeInequationsType2 = {
13
+ id: 'firstDegreeInequationsType2',
14
+ connector: '\\iff',
15
+ instruction: '',
16
+ label: 'Résoudre une inéquation du type $ax+b<c$',
17
+ levels: ['3ème', '2ndPro', '2nde', '1reESM', '1rePro', '1reTech'],
18
+ isSingleStep: true,
19
+ sections: ['Inéquations'],
20
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getFirstDegreeInequationsQuestion, nb),
21
+ };
22
+ function getFirstDegreeInequationsQuestion() {
23
+ const affine = new affine_1.Affine((0, randint_1.randint)(-10, 10, [0, 1]), (0, randint_1.randint)(-10, 10, [0]));
24
+ const c = (0, randint_1.randint)(-10, 11);
25
+ const result = new rational_1.Rational(c - affine.b, affine.a).simplify().toTree().toTex();
26
+ const ineqType = (0, random_1.random)(['\\leq', '<', '\\geq', '>']);
27
+ const invIneqType = ineqType === '<' ? '>' : ineqType === '>' ? '<' : ineqType === '\\leq' ? '\\geq' : '\\leq';
28
+ const answer = `x ${affine.a > 0 ? ineqType : invIneqType} ${result}`;
29
+ const getPropositions = (n) => {
30
+ const res = [];
31
+ res.push({
32
+ id: (0, uuid_1.v4)(),
33
+ statement: answer,
34
+ isRightAnswer: true,
35
+ format: 'tex',
36
+ });
37
+ res.push({
38
+ id: (0, uuid_1.v4)(),
39
+ statement: `x ${affine.a < 0 ? ineqType : invIneqType} ${result}`,
40
+ isRightAnswer: false,
41
+ format: 'tex',
42
+ });
43
+ const missing = n - res.length;
44
+ for (let i = 0; i < missing; i++) {
45
+ let isDuplicate;
46
+ let proposition;
47
+ do {
48
+ const wrongAnswer = `x ${(0, coinFlip_1.coinFlip)() ? ineqType : invIneqType} ${(0, randint_1.randint)(-10, 11)}`;
49
+ proposition = {
50
+ id: (0, uuid_1.v4)() + ``,
51
+ statement: wrongAnswer,
52
+ isRightAnswer: false,
53
+ format: 'tex',
54
+ };
55
+ isDuplicate = res.some((p) => p.statement === proposition.statement);
56
+ } while (isDuplicate);
57
+ res.push(proposition);
58
+ }
59
+ return (0, shuffle_1.shuffle)(res);
60
+ };
61
+ const question = {
62
+ answer: answer,
63
+ instruction: `Résoudre l'inéquation : $${affine.toTex()} ${ineqType} ${c}$ `,
64
+ keys: ['x', 'sup', 'inf', 'geq', 'leq'],
65
+ getPropositions,
66
+ answerFormat: 'tex',
67
+ };
68
+ return question;
69
+ }
70
+ exports.getFirstDegreeInequationsQuestion = getFirstDegreeInequationsQuestion;
@@ -0,0 +1,4 @@
1
+ import { Exercise, Question } from '../../../exercises/exercise';
2
+ export declare const firstDegreeInequationsType3: Exercise;
3
+ export declare function getFirstDegreeInequationsQuestion(): Question;
4
+ //# sourceMappingURL=firstDegreeInequationsType3.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"firstDegreeInequationsType3.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/inequations/firstDegreeInequationsType3.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAY3E,eAAO,MAAM,2BAA2B,EAAE,QASzC,CAAC;AAEF,wBAAgB,iCAAiC,IAAI,QAAQ,CAyD5D"}
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getFirstDegreeInequationsQuestion = exports.firstDegreeInequationsType3 = void 0;
4
+ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
5
+ const rational_1 = require("../../../math/numbers/rationals/rational");
6
+ const affine_1 = require("../../../math/polynomials/affine");
7
+ const randint_1 = require("../../../math/utils/random/randint");
8
+ const coinFlip_1 = require("../../../utils/coinFlip");
9
+ const random_1 = require("../../../utils/random");
10
+ const shuffle_1 = require("../../../utils/shuffle");
11
+ const uuid_1 = require("uuid");
12
+ exports.firstDegreeInequationsType3 = {
13
+ id: 'firstDegreeInequationsType3',
14
+ connector: '\\iff',
15
+ instruction: '',
16
+ label: 'Résoudre une inéquation du type $ax+b<cx+d$',
17
+ levels: ['3ème', '2ndPro', '2nde', '1reESM', '1rePro', '1reTech'],
18
+ isSingleStep: true,
19
+ sections: ['Inéquations'],
20
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getFirstDegreeInequationsQuestion, nb),
21
+ };
22
+ function getFirstDegreeInequationsQuestion() {
23
+ const affine1 = new affine_1.Affine((0, randint_1.randint)(-10, 10, [0]), (0, randint_1.randint)(-10, 10));
24
+ const affine2 = new affine_1.Affine((0, randint_1.randint)(-10, 10, [0, affine1.a]), (0, randint_1.randint)(-10, 10));
25
+ const result = new rational_1.Rational(affine2.b - affine1.b, affine1.a - affine2.a).simplify().toTree().toTex();
26
+ const coeff = affine1.a - affine2.a;
27
+ const ineqType = (0, random_1.random)(['\\leq', '<', '\\geq', '>']);
28
+ const invIneqType = ineqType === '<' ? '>' : ineqType === '>' ? '<' : ineqType === '\\leq' ? '\\geq' : '\\leq';
29
+ const answer = `x ${coeff > 0 ? ineqType : invIneqType} ${result}`;
30
+ const getPropositions = (n) => {
31
+ const res = [];
32
+ res.push({
33
+ id: (0, uuid_1.v4)(),
34
+ statement: answer,
35
+ isRightAnswer: true,
36
+ format: 'tex',
37
+ });
38
+ res.push({
39
+ id: (0, uuid_1.v4)(),
40
+ statement: `x ${coeff < 0 ? ineqType : invIneqType} ${result}`,
41
+ isRightAnswer: false,
42
+ format: 'tex',
43
+ });
44
+ const missing = n - res.length;
45
+ for (let i = 0; i < missing; i++) {
46
+ let isDuplicate;
47
+ let proposition;
48
+ do {
49
+ const wrongAnswer = `x ${(0, coinFlip_1.coinFlip)() ? ineqType : invIneqType} ${(0, randint_1.randint)(-10, 11)}`;
50
+ proposition = {
51
+ id: (0, uuid_1.v4)() + ``,
52
+ statement: wrongAnswer,
53
+ isRightAnswer: false,
54
+ format: 'tex',
55
+ };
56
+ isDuplicate = res.some((p) => p.statement === proposition.statement);
57
+ } while (isDuplicate);
58
+ res.push(proposition);
59
+ }
60
+ return (0, shuffle_1.shuffle)(res);
61
+ };
62
+ const question = {
63
+ answer: answer,
64
+ instruction: `Résoudre l'inéquation : $${affine1.toTex()} ${ineqType} ${affine2.toTex()}$ `,
65
+ keys: ['x', 'sup', 'inf', 'geq', 'leq'],
66
+ getPropositions,
67
+ answerFormat: 'tex',
68
+ };
69
+ return question;
70
+ }
71
+ exports.getFirstDegreeInequationsQuestion = getFirstDegreeInequationsQuestion;
@@ -30,5 +30,5 @@ export interface Exercise {
30
30
  generator(nb: number, options?: GeneratorOptions): Question[];
31
31
  }
32
32
  export type MathLevel = '6ème' | '5ème' | '4ème' | '3ème' | '2nde' | '1reTech' | '1reESM' | '1reSpé' | 'TermSpé' | 'TermTech' | 'MathExp' | 'MathComp' | 'CAP' | '2ndPro' | '1rePro' | 'TermPro';
33
- export type MathSection = 'Calcul littéral' | 'É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' | 'Fonction inverse';
33
+ export type MathSection = 'Arithmétique' | 'Calcul littéral' | 'Calculs' | 'Conversions' | 'Dérivation' | 'Droites' | 'Équations' | 'Équations différentielles' | 'Exponentielle' | 'Fonction cube' | 'Fonction inverse' | 'Fonctions' | 'Fonctions affines' | 'Fonctions de référence' | 'Fractions' | 'Géométrie cartésienne' | 'Géométrie euclidienne' | 'Inéquations' | 'Intégration' | 'Intervalles' | 'Limites' | 'Logarithme népérien' | 'Nombres complexes' | 'Pourcentages' | 'Primitives' | 'Probabilités' | 'Proportionnalité' | 'Puissances' | 'Racines carrées' | 'Second degré' | 'Statistiques' | 'Suites' | 'Trigonométrie' | 'Vecteurs';
34
34
  //# sourceMappingURL=exercise.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,MAAM,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAElC,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;IACvB,MAAM,EAAE,KAAK,GAAG,KAAK,CAAC;CACvB,CAAC;AACF,MAAM,WAAW,QAAQ;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,KAAK,GAAG,KAAK,CAAC;IAC5B,YAAY,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAC9B,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,eAAe,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,WAAW,EAAE,CAAC;CAC/C;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,GAAG,GAAG,OAAO,GAAG,UAAU,CAAC;IACvC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,QAAQ,EAAE,CAAC;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,GACV,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,SAAS,CAAC;AAEd,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,GACnB,kBAAkB,CAAC"}
1
+ {"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,MAAM,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAElC,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;IACvB,MAAM,EAAE,KAAK,GAAG,KAAK,CAAC;CACvB,CAAC;AACF,MAAM,WAAW,QAAQ;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,KAAK,GAAG,KAAK,CAAC;IAC5B,YAAY,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAC9B,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,eAAe,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,WAAW,EAAE,CAAC;CAC/C;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,GAAG,GAAG,OAAO,GAAG,UAAU,CAAC;IACvC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,QAAQ,EAAE,CAAC;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,GACV,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,MAAM,WAAW,GACnB,cAAc,GACd,iBAAiB,GACjB,SAAS,GACT,aAAa,GACb,YAAY,GACZ,SAAS,GACT,WAAW,GACX,2BAA2B,GAC3B,eAAe,GACf,eAAe,GACf,kBAAkB,GAClB,WAAW,GACX,mBAAmB,GACnB,wBAAwB,GACxB,WAAW,GACX,uBAAuB,GACvB,uBAAuB,GACvB,aAAa,GACb,aAAa,GACb,aAAa,GACb,SAAS,GACT,qBAAqB,GACrB,mBAAmB,GACnB,cAAc,GACd,YAAY,GACZ,cAAc,GACd,kBAAkB,GAClB,YAAY,GACZ,iBAAiB,GACjB,cAAc,GACd,cAAc,GACd,QAAQ,GACR,eAAe,GACf,UAAU,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"exercises.d.ts","sourceRoot":"","sources":["../../src/exercises/exercises.ts"],"names":[],"mappings":"AAgKA,eAAO,MAAM,SAAS,iCAoNrB,CAAC"}
1
+ {"version":3,"file":"exercises.d.ts","sourceRoot":"","sources":["../../src/exercises/exercises.ts"],"names":[],"mappings":"AAwKA,eAAO,MAAM,SAAS,iCAqPrB,CAAC"}
@@ -151,6 +151,14 @@ const divideComplex_1 = require("./complex/divideComplex");
151
151
  const conjugateDivideComplex_1 = require("./complex/conjugateDivideComplex");
152
152
  const firstIntegersSum_1 = require("./sequences/arithmetic/firstIntegersSum");
153
153
  const geometricFirstTermsSum_1 = require("./sequences/geometric/geometricFirstTermsSum");
154
+ const squareRootEquation_1 = require("./squareRoots/squareRootEquation");
155
+ const cubicEquation_1 = require("./functions/cube/cubicEquation");
156
+ const determinant_1 = require("./geometry/vectors/determinant");
157
+ const firstDegreeInequationsType1_1 = require("./calculLitteral/inequations/firstDegreeInequationsType1");
158
+ const firstDegreeInequationsType2_1 = require("./calculLitteral/inequations/firstDegreeInequationsType2");
159
+ const firstDegreeInequationsType3_1 = require("./calculLitteral/inequations/firstDegreeInequationsType3");
160
+ const firstDegreeInequationsType0_1 = require("./calculLitteral/inequations/firstDegreeInequationsType0");
161
+ const chasles_1 = require("./geometry/vectors/chasles");
154
162
  exports.exercises = [
155
163
  /**
156
164
  * calcul litteral
@@ -174,10 +182,18 @@ exports.exercises = [
174
182
  equationType4Exercise_1.equationType4Exercise,
175
183
  firstDegreeEquation_1.firstDegreeEquation,
176
184
  equationSimpleSquare_1.equationSimpleSquare,
185
+ /**
186
+ * inequations
187
+ */
188
+ firstDegreeInequationsType0_1.firstDegreeInequationsType0,
189
+ firstDegreeInequationsType1_1.firstDegreeInequationsType1,
190
+ firstDegreeInequationsType2_1.firstDegreeInequationsType2,
191
+ firstDegreeInequationsType3_1.firstDegreeInequationsType3,
177
192
  /**
178
193
  * square roots
179
194
  */
180
195
  simpifySquareRoot_1.simplifySquareRoot,
196
+ squareRootEquation_1.squareRootEquation,
181
197
  /**
182
198
  * fractions
183
199
  */
@@ -203,16 +219,34 @@ exports.exercises = [
203
219
  rounding_1.roundToMillieme,
204
220
  rounding_1.roundToUnit,
205
221
  rounding_1.allRoundings,
222
+ /**
223
+ * pourcentages
224
+ */
225
+ applyPercent_1.applyPercent,
226
+ globalPercent_1.globalPercent,
227
+ reciprocalPercentage_1.reciprocalPercentage,
228
+ averageEvolutionRate_1.averageEvolutionRate,
206
229
  /**
207
230
  * geometry
208
231
  */
209
232
  midpoint_1.midpoint,
210
233
  mainRemarkableValues_1.mainRemarkableValuesExercise,
211
234
  remarkableValues_1.remarkableValuesExercise,
235
+ thales_1.thales,
236
+ thalesCalcul_1.thalesCalcul,
237
+ pythagore_1.pythagore,
238
+ pythagoreCalcul_1.pythagoreCalcul,
239
+ trigonometry_1.trigonometry,
240
+ trigonometryAngleCalcul_1.trigonometryAngleCalcul,
241
+ trigonometrySideCalcul_1.trigonometrySideCalcul,
242
+ rightTriangleArea_1.rightTriangleArea,
243
+ triangleArea_1.triangleArea,
212
244
  /**
213
245
  * vectors
214
246
  */
215
247
  scalarProductViaCoords_1.scalarProductViaCoords,
248
+ determinant_1.determinant,
249
+ chasles_1.chasles,
216
250
  /**
217
251
  * puissances
218
252
  */
@@ -241,12 +275,16 @@ exports.exercises = [
241
275
  firstIntegersSum_1.firstIntegersSum,
242
276
  geometricFirstTermsSum_1.geometricFirstTermsSum,
243
277
  /**
244
- * islam
278
+ * fonctions
279
+ */
280
+ cubicEquation_1.cubicEquation,
281
+ imageFunction_1.imageFunction,
282
+ inverseImageFunction_1.inverseImageFunction,
283
+ imageFunctionGeogebra_1.imageFunctionGeogebra,
284
+ inverseImageFunctionGeogebra_1.inverseImageFunctionGeogebra,
285
+ /**
286
+ * derivation
245
287
  */
246
- applyPercent_1.applyPercent,
247
- globalPercent_1.globalPercent,
248
- reciprocalPercentage_1.reciprocalPercentage,
249
- averageEvolutionRate_1.averageEvolutionRate,
250
288
  usualderivative_1.usualDerivative,
251
289
  constanteDerivative_1.constanteDerivative,
252
290
  firstDegreeDerivative_1.firstDegreeDerivative,
@@ -255,25 +293,37 @@ exports.exercises = [
255
293
  inverseFunctionDerivative_1.inverseFunctionDerivative,
256
294
  rootFunctionDerivative_1.rootFunctionDerivative,
257
295
  powerFunctionDerivative_1.powerFunctionDerivative,
258
- conditionalProbability_1.conditionalProbability,
259
- leadingCoefficient_1.leadingCoefficient,
260
296
  derivativeNumberReading_1.derivativeNumberReading,
297
+ lnDerivativeOne_1.lnDerivativeOne,
298
+ lnDerivativeTwo_1.lnDerivativeTwo,
299
+ lnDerivativeThree_1.lnDerivativeThree,
300
+ expDerivativeOne_1.expDerivativeOne,
301
+ expDerivativeTwo_1.expDerivativeTwo,
302
+ expDerivativeThree_1.expDerivativeThree,
303
+ /**
304
+ * primitive
305
+ */
306
+ constantPrimitive_1.constantPrimitive,
307
+ polynomialPrimitive_1.polynomialPrimitive,
308
+ sinCosPrimitive_1.sinCosPrimitive,
309
+ exponentialPrimitive_1.exponentialPrimitive,
310
+ logarithmePrimitive_1.logarithmePrimitive,
311
+ usualPrimitives_1.usualPrimitives,
312
+ /**
313
+ * probabilités
314
+ */
261
315
  probabilityTree_1.probabilityTree,
316
+ conditionalProbability_1.conditionalProbability,
317
+ /**
318
+ * islam
319
+ */
320
+ leadingCoefficient_1.leadingCoefficient,
262
321
  fractionToPercentToDecimal_1.fractionToPercentToDecimal,
263
322
  marginalAndConditionalFrequency_1.marginalAndConditionalFrequency,
264
323
  mentalAddAndSub_1.mentalAddAndSub,
265
324
  mentalMultiplications_1.mentalMultiplications,
266
325
  mentalDivisions_1.mentalDivisions,
267
326
  mentalPercentage_1.mentalPercentage,
268
- thales_1.thales,
269
- thalesCalcul_1.thalesCalcul,
270
- pythagore_1.pythagore,
271
- pythagoreCalcul_1.pythagoreCalcul,
272
- trigonometry_1.trigonometry,
273
- trigonometryAngleCalcul_1.trigonometryAngleCalcul,
274
- trigonometrySideCalcul_1.trigonometrySideCalcul,
275
- rightTriangleArea_1.rightTriangleArea,
276
- triangleArea_1.triangleArea,
277
327
  /**
278
328
  * nv generateurs
279
329
  */
@@ -300,30 +350,14 @@ exports.exercises = [
300
350
  reduceExpression_1.reduceExpression,
301
351
  evaluateExpression_1.evaluateExpression,
302
352
  proportionalityTable_1.proportionalityTable,
303
- imageFunction_1.imageFunction,
304
- inverseImageFunction_1.inverseImageFunction,
305
- lnDerivativeOne_1.lnDerivativeOne,
306
- lnDerivativeTwo_1.lnDerivativeTwo,
307
- lnDerivativeThree_1.lnDerivativeThree,
308
- expDerivativeOne_1.expDerivativeOne,
309
- expDerivativeTwo_1.expDerivativeTwo,
310
- expDerivativeThree_1.expDerivativeThree,
311
353
  logEquation_1.logEquation,
312
354
  expEquation_1.expEquation,
313
355
  expSimplifiying_1.expSimplifiying,
314
356
  logSimplifiying_1.logSimplifiying,
315
- imageFunctionGeogebra_1.imageFunctionGeogebra,
316
- inverseImageFunctionGeogebra_1.inverseImageFunctionGeogebra,
317
357
  euclideanDivision_1.euclideanDivision,
318
358
  signFunction_1.signFunction,
319
359
  thirdDegreeFunctionVariation_1.thirdDegreeFunctionVariation,
320
360
  polynomeLimit_1.polynomeLimit,
321
- constantPrimitive_1.constantPrimitive,
322
- polynomialPrimitive_1.polynomialPrimitive,
323
- sinCosPrimitive_1.sinCosPrimitive,
324
- exponentialPrimitive_1.exponentialPrimitive,
325
- logarithmePrimitive_1.logarithmePrimitive,
326
- usualPrimitives_1.usualPrimitives,
327
361
  equaDiffGeneralForme_1.exponentialDifferentialEquation,
328
362
  equaDiffGeneralFormeWithIC_1.exponentialDifferentialEquationWithIC,
329
363
  /**Stats */
@@ -0,0 +1,4 @@
1
+ import { Exercise, Question } from '../../../exercises/exercise';
2
+ export declare const cubicEquation: Exercise;
3
+ export declare function getCubicEquationQuestion(): Question;
4
+ //# sourceMappingURL=cubicEquation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cubicEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/cube/cubicEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAM3E,eAAO,MAAM,aAAa,EAAE,QAS3B,CAAC;AAEF,wBAAgB,wBAAwB,IAAI,QAAQ,CAwDnD"}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCubicEquationQuestion = exports.cubicEquation = void 0;
4
+ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
5
+ const randint_1 = require("../../../math/utils/random/randint");
6
+ const shuffle_1 = require("../../../utils/shuffle");
7
+ const uuid_1 = require("uuid");
8
+ exports.cubicEquation = {
9
+ id: 'cubicEquation',
10
+ connector: '\\iff',
11
+ instruction: '',
12
+ label: 'Résoudre une équation du type $x^3 = k$',
13
+ levels: ['2nde', '1reESM', '1reSpé', '1reTech'],
14
+ isSingleStep: true,
15
+ sections: ['Fonctions de référence', 'Fonction cube', 'Équations'],
16
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getCubicEquationQuestion, nb),
17
+ };
18
+ function getCubicEquationQuestion() {
19
+ const x = (0, randint_1.randint)(-10, 11);
20
+ const k = x ** 3;
21
+ const answer = `S = \\lbrace ${x} \\rbrace`;
22
+ const getPropositions = (n) => {
23
+ const res = [];
24
+ res.push({
25
+ id: (0, uuid_1.v4)(),
26
+ statement: answer,
27
+ isRightAnswer: true,
28
+ format: 'tex',
29
+ });
30
+ if (x ** 3 !== k ** 3) {
31
+ res.push({
32
+ id: (0, uuid_1.v4)(),
33
+ statement: `S = \\lbrace ${k ** 3} \\rbrace`,
34
+ isRightAnswer: true,
35
+ format: 'tex',
36
+ });
37
+ }
38
+ const missing = n - res.length;
39
+ for (let i = 0; i < missing; i++) {
40
+ let isDuplicate;
41
+ let proposition;
42
+ do {
43
+ const wrongAnswer = (0, randint_1.randint)(-10, 11) + '';
44
+ proposition = {
45
+ id: (0, uuid_1.v4)() + ``,
46
+ statement: `S = \\lbrace ${wrongAnswer} \\rbrace`,
47
+ isRightAnswer: false,
48
+ format: 'tex',
49
+ };
50
+ isDuplicate = res.some((p) => p.statement === proposition.statement);
51
+ } while (isDuplicate);
52
+ res.push(proposition);
53
+ }
54
+ return (0, shuffle_1.shuffle)(res);
55
+ };
56
+ const question = {
57
+ answer: answer,
58
+ instruction: `Résoudre l'équation suivante : $x^3 = ${k}$`,
59
+ keys: ['S', 'equal', 'lbrace', 'semicolon', 'rbrace', 'emptyset'],
60
+ getPropositions,
61
+ answerFormat: 'tex',
62
+ };
63
+ return question;
64
+ }
65
+ exports.getCubicEquationQuestion = getCubicEquationQuestion;
@@ -0,0 +1,4 @@
1
+ import { Exercise, Question } from '../../../exercises/exercise';
2
+ export declare const chasles: Exercise;
3
+ export declare function getChaslesQuestion(): Question;
4
+ //# sourceMappingURL=chasles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chasles.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/vectors/chasles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAO3E,eAAO,MAAM,OAAO,EAAE,QASrB,CAAC;AAIF,wBAAgB,kBAAkB,IAAI,QAAQ,CA0D7C"}
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getChaslesQuestion = exports.chasles = void 0;
4
+ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
5
+ const randint_1 = require("../../../math/utils/random/randint");
6
+ const random_1 = require("../../../utils/random");
7
+ const shuffle_1 = require("../../../utils/shuffle");
8
+ const uuid_1 = require("uuid");
9
+ exports.chasles = {
10
+ id: 'chasles',
11
+ connector: '=',
12
+ instruction: '',
13
+ label: 'Relation de Chasles pour les vecteurs',
14
+ levels: ['2nde', '1reESM', '1reSpé'],
15
+ isSingleStep: true,
16
+ sections: ['Vecteurs'],
17
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getChaslesQuestion, nb),
18
+ };
19
+ const letters = 'ABCDEFGHIJKLMNPQRSTUVWXYZ';
20
+ function getChaslesQuestion() {
21
+ const nbOfVectors = (0, randint_1.randint)(2, 5);
22
+ const randLetters = (0, shuffle_1.shuffle)(letters.split('')).slice(0, nbOfVectors + 2);
23
+ let vectors = [];
24
+ for (let i = 0; i < nbOfVectors; i++) {
25
+ vectors.push(`${randLetters[i]}${randLetters[i + 1]}`);
26
+ }
27
+ const answer = `\\overrightarrow{${randLetters[0]}${randLetters[nbOfVectors]}}`;
28
+ const invVec = (vec) => {
29
+ return `\\overrightarrow{${vec[1]}${vec[0]}}`;
30
+ };
31
+ vectors = (0, shuffle_1.shuffle)(vectors).map((vec) => (Math.random() < 0.4 ? '-' + invVec(vec) : `+\\overrightarrow{${vec}}`));
32
+ let statement = vectors.join('');
33
+ if (statement[0] === '+')
34
+ statement = statement.slice(1, statement.length);
35
+ const getPropositions = (n) => {
36
+ const res = [];
37
+ res.push({
38
+ id: (0, uuid_1.v4)(),
39
+ statement: answer,
40
+ isRightAnswer: true,
41
+ format: 'tex',
42
+ });
43
+ const missing = n - res.length;
44
+ for (let i = 0; i < missing; i++) {
45
+ let isDuplicate;
46
+ let proposition;
47
+ do {
48
+ const a = (0, random_1.random)(randLetters);
49
+ const b = (0, random_1.random)(randLetters);
50
+ const wrongAnswer = `\\overrightarrow{${a}${b}}`;
51
+ proposition = {
52
+ id: (0, uuid_1.v4)() + ``,
53
+ statement: wrongAnswer,
54
+ isRightAnswer: false,
55
+ format: 'tex',
56
+ };
57
+ isDuplicate = res.some((p) => p.statement === proposition.statement);
58
+ } while (isDuplicate);
59
+ res.push(proposition);
60
+ }
61
+ return (0, shuffle_1.shuffle)(res);
62
+ };
63
+ const question = {
64
+ answer: answer,
65
+ instruction: `Simplifier : $${statement}$`,
66
+ keys: ['overrightarrow', ...randLetters.sort((a, b) => a.localeCompare(b))],
67
+ getPropositions,
68
+ answerFormat: 'tex',
69
+ };
70
+ return question;
71
+ }
72
+ exports.getChaslesQuestion = getChaslesQuestion;
@@ -0,0 +1,4 @@
1
+ import { Exercise, Question } from '../../../exercises/exercise';
2
+ export declare const determinant: Exercise;
3
+ export declare function getDeterminantQuestion(): Question;
4
+ //# sourceMappingURL=determinant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"determinant.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/vectors/determinant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAO3E,eAAO,MAAM,WAAW,EAAE,QASzB,CAAC;AAEF,wBAAgB,sBAAsB,IAAI,QAAQ,CAuDjD"}
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDeterminantQuestion = exports.determinant = void 0;
4
+ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
5
+ const vector_1 = require("../../../math/geometry/vector");
6
+ const randint_1 = require("../../../math/utils/random/randint");
7
+ const shuffle_1 = require("../../../utils/shuffle");
8
+ const uuid_1 = require("uuid");
9
+ exports.determinant = {
10
+ id: 'determinant',
11
+ connector: '=',
12
+ instruction: '',
13
+ label: 'Calculer le déterminant de deux vecteurs',
14
+ levels: ['2nde', '1reESM', '1reSpé'],
15
+ isSingleStep: true,
16
+ sections: ['Vecteurs'],
17
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getDeterminantQuestion, nb),
18
+ };
19
+ function getDeterminantQuestion() {
20
+ const u = vector_1.VectorConstructor.random('u');
21
+ const v = vector_1.VectorConstructor.random('v');
22
+ const answer = u.determinant(v);
23
+ const getPropositions = (n) => {
24
+ const res = [];
25
+ res.push({
26
+ id: (0, uuid_1.v4)(),
27
+ statement: answer.toTex(),
28
+ isRightAnswer: true,
29
+ format: 'tex',
30
+ });
31
+ const ps = u.scalarProduct(v);
32
+ if (ps.toTex() !== answer.toTex()) {
33
+ res.push({
34
+ id: (0, uuid_1.v4)(),
35
+ statement: ps.toTex(),
36
+ isRightAnswer: false,
37
+ format: 'tex',
38
+ });
39
+ }
40
+ const missing = n - res.length;
41
+ for (let i = 0; i < missing; i++) {
42
+ let isDuplicate;
43
+ let proposition;
44
+ do {
45
+ const wrongAnswer = (0, randint_1.randint)(-20, 20) + '';
46
+ proposition = {
47
+ id: (0, uuid_1.v4)() + ``,
48
+ statement: wrongAnswer,
49
+ isRightAnswer: false,
50
+ format: 'tex',
51
+ };
52
+ isDuplicate = res.some((p) => p.statement === proposition.statement);
53
+ } while (isDuplicate);
54
+ res.push(proposition);
55
+ }
56
+ return (0, shuffle_1.shuffle)(res);
57
+ };
58
+ const question = {
59
+ answer: answer.toTex(),
60
+ instruction: `Soient les vecteurs $${u.toTexWithCoords()}$ et $${v.toTexWithCoords()}$. Calculer le déterminant $\\det(\\overrightarrow u;\\overrightarrow v)$.`,
61
+ keys: [],
62
+ getPropositions,
63
+ answerFormat: 'tex',
64
+ };
65
+ return question;
66
+ }
67
+ exports.getDeterminantQuestion = getDeterminantQuestion;
@@ -0,0 +1,4 @@
1
+ import { Exercise, Question } from '../../exercises/exercise';
2
+ export declare const intervalsUnion: Exercise;
3
+ export declare function getIntervalsUnionQuestion(): Question;
4
+ //# sourceMappingURL=intervalsUnion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intervalsUnion.d.ts","sourceRoot":"","sources":["../../../src/exercises/sets/intervalsUnion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAK3E,eAAO,MAAM,cAAc,EAAE,QAS5B,CAAC;AAEF,wBAAgB,yBAAyB,IAAI,QAAQ,CA2CpD"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getIntervalsUnionQuestion = exports.intervalsUnion = void 0;
4
+ const getDistinctQuestions_1 = require("../../exercises/utils/getDistinctQuestions");
5
+ const shuffle_1 = require("../../utils/shuffle");
6
+ const uuid_1 = require("uuid");
7
+ exports.intervalsUnion = {
8
+ id: 'intervalsUnion',
9
+ connector: '=',
10
+ instruction: '',
11
+ label: "Déterminer l'union de deux intervalles",
12
+ levels: ['2nde', '2ndPro', '1reTech', 'CAP'],
13
+ isSingleStep: true,
14
+ sections: ['Intervalles'],
15
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getIntervalsUnionQuestion, nb),
16
+ };
17
+ function getIntervalsUnionQuestion() {
18
+ const getPropositions = (n) => {
19
+ const res = [];
20
+ res.push({
21
+ id: (0, uuid_1.v4)(),
22
+ statement: ``,
23
+ isRightAnswer: true,
24
+ format: 'tex',
25
+ });
26
+ const missing = n - res.length;
27
+ for (let i = 0; i < missing; i++) {
28
+ let isDuplicate;
29
+ let proposition;
30
+ do {
31
+ const wrongAnswer = '';
32
+ proposition = {
33
+ id: (0, uuid_1.v4)() + ``,
34
+ statement: wrongAnswer,
35
+ isRightAnswer: false,
36
+ format: 'tex',
37
+ };
38
+ isDuplicate = res.some((p) => p.statement === proposition.statement);
39
+ } while (isDuplicate);
40
+ res.push(proposition);
41
+ }
42
+ return (0, shuffle_1.shuffle)(res);
43
+ };
44
+ const question = {
45
+ answer: ``,
46
+ instruction: ``,
47
+ keys: [],
48
+ getPropositions,
49
+ answerFormat: 'tex',
50
+ };
51
+ return question;
52
+ }
53
+ exports.getIntervalsUnionQuestion = getIntervalsUnionQuestion;
@@ -0,0 +1,4 @@
1
+ import { Exercise, Question } from '../../exercises/exercise';
2
+ export declare const squareRootEquation: Exercise;
3
+ export declare function getSquareRootEquationQuestion(): Question;
4
+ //# sourceMappingURL=squareRootEquation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"squareRootEquation.d.ts","sourceRoot":"","sources":["../../../src/exercises/squareRoots/squareRootEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAM3E,eAAO,MAAM,kBAAkB,EAAE,QAShC,CAAC;AAEF,wBAAgB,6BAA6B,IAAI,QAAQ,CA2DxD"}
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSquareRootEquationQuestion = exports.squareRootEquation = void 0;
4
+ const getDistinctQuestions_1 = require("../../exercises/utils/getDistinctQuestions");
5
+ const randint_1 = require("../../math/utils/random/randint");
6
+ const shuffle_1 = require("../../utils/shuffle");
7
+ const uuid_1 = require("uuid");
8
+ exports.squareRootEquation = {
9
+ id: 'squareRootEquation',
10
+ connector: '\\iff',
11
+ instruction: '',
12
+ label: 'Résoudre une équation du type $\\sqrt x = k$',
13
+ levels: ['2nde', '1reESM', '1reSpé'],
14
+ isSingleStep: true,
15
+ sections: ['Racines carrées', 'Équations', 'Fonctions de référence'],
16
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getSquareRootEquationQuestion, nb),
17
+ };
18
+ function getSquareRootEquationQuestion() {
19
+ const k = Math.random() < 0.2 ? (0, randint_1.randint)(-20, 0) : (0, randint_1.randint)(0, 11);
20
+ const answer = k < 0 ? 'S = \\emptyset' : `S = \\lbrace ${k ** 2} \\rbrace`;
21
+ const getPropositions = (n) => {
22
+ const res = [];
23
+ res.push({
24
+ id: (0, uuid_1.v4)(),
25
+ statement: answer,
26
+ isRightAnswer: true,
27
+ format: 'tex',
28
+ });
29
+ if (k >= 0)
30
+ res.push({
31
+ id: (0, uuid_1.v4)(),
32
+ statement: 'S = \\emptyset',
33
+ isRightAnswer: false,
34
+ format: 'tex',
35
+ });
36
+ if (Math.sqrt(k) !== k ** 2)
37
+ res.push({
38
+ id: (0, uuid_1.v4)(),
39
+ statement: `S = \\lbrace \\sqrt{${k}} \\rbrace`,
40
+ isRightAnswer: false,
41
+ format: 'tex',
42
+ });
43
+ const missing = n - res.length;
44
+ for (let i = 0; i < missing; i++) {
45
+ let isDuplicate;
46
+ let proposition;
47
+ do {
48
+ const wrongAnswer = `S = \\lbrace ${(0, randint_1.randint)(1, 100)} \\rbrace`;
49
+ proposition = {
50
+ id: (0, uuid_1.v4)() + ``,
51
+ statement: wrongAnswer,
52
+ isRightAnswer: false,
53
+ format: 'tex',
54
+ };
55
+ isDuplicate = res.some((p) => p.statement === proposition.statement);
56
+ } while (isDuplicate);
57
+ res.push(proposition);
58
+ }
59
+ return (0, shuffle_1.shuffle)(res);
60
+ };
61
+ const question = {
62
+ answer: answer,
63
+ instruction: `Résoudre l'équation suivante : $\\sqrt x = ${k}$`,
64
+ keys: ['S', 'equal', 'lbrace', 'semicolon', 'rbrace', 'emptyset'],
65
+ getPropositions,
66
+ answerFormat: 'tex',
67
+ };
68
+ return question;
69
+ }
70
+ exports.getSquareRootEquationQuestion = getSquareRootEquationQuestion;
@@ -2,6 +2,7 @@ import { Node } from '../../tree/nodes/node';
2
2
  import { Point } from './point';
3
3
  export declare abstract class VectorConstructor {
4
4
  static fromPoints(origin: Point, end: Point): Vector;
5
+ static random(name: string): Vector;
5
6
  }
6
7
  export declare class Vector {
7
8
  name: string;
@@ -11,6 +12,7 @@ export declare class Vector {
11
12
  constructor(name: string, x: Node, y: Node);
12
13
  toTex(): string;
13
14
  toTexWithCoords(): string;
15
+ determinant(v: Vector): Node;
14
16
  scalarProduct(v: Vector): Node;
15
17
  }
16
18
  //# sourceMappingURL=vector.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"vector.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/vector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAK7C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,8BAAsB,iBAAiB;IACrC,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,GAAG,MAAM;CAOrD;AAED,qBAAa,MAAM;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,CAAC,EAAE,IAAI,CAAC;IACR,CAAC,EAAE,IAAI,CAAC;gBACI,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI;IAO1C,KAAK,IAAI,MAAM;IAIf,eAAe,IAAI,MAAM;IAIzB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;CAG/B"}
1
+ {"version":3,"file":"vector.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/vector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAO7C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,8BAAsB,iBAAiB;IACrC,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,GAAG,MAAM;IAOpD,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAGpC;AAED,qBAAa,MAAM;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,CAAC,EAAE,IAAI,CAAC;IACR,CAAC,EAAE,IAAI,CAAC;gBACI,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI;IAO1C,KAAK,IAAI,MAAM;IAIf,eAAe,IAAI,MAAM;IAIzB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAG5B,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;CAG/B"}
@@ -1,14 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Vector = exports.VectorConstructor = void 0;
4
+ const numberNode_1 = require("../../tree/nodes/numbers/numberNode");
4
5
  const addNode_1 = require("../../tree/nodes/operators/addNode");
5
6
  const multiplyNode_1 = require("../../tree/nodes/operators/multiplyNode");
6
7
  const substractNode_1 = require("../../tree/nodes/operators/substractNode");
7
8
  const simplify_1 = require("../../tree/parsers/simplify");
9
+ const randint_1 = require("../utils/random/randint");
8
10
  class VectorConstructor {
9
11
  static fromPoints(origin, end) {
10
12
  return new Vector(`${origin.name}${end.name}`, new substractNode_1.SubstractNode(end.x, origin.x), new substractNode_1.SubstractNode(end.y, origin.y));
11
13
  }
14
+ static random(name) {
15
+ return new Vector(name, new numberNode_1.NumberNode((0, randint_1.randint)(-10, 11)), new numberNode_1.NumberNode((0, randint_1.randint)(-10, 11)));
16
+ }
12
17
  }
13
18
  exports.VectorConstructor = VectorConstructor;
14
19
  class Vector {
@@ -24,6 +29,9 @@ class Vector {
24
29
  toTexWithCoords() {
25
30
  return `\\overrightarrow{${this.name}}\\begin{pmatrix}${this.x.toTex()} \\\\ ${this.y.toTex()} \\end{pmatrix}`;
26
31
  }
32
+ determinant(v) {
33
+ return (0, simplify_1.simplifyNode)(new substractNode_1.SubstractNode(new multiplyNode_1.MultiplyNode(this.x, v.y), new multiplyNode_1.MultiplyNode(this.y, v.x)));
34
+ }
27
35
  scalarProduct(v) {
28
36
  return (0, simplify_1.simplifyNode)(new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(this.x, v.x), new multiplyNode_1.MultiplyNode(this.y, v.y)));
29
37
  }
@@ -1 +1 @@
1
- {"version":3,"file":"intervals.d.ts","sourceRoot":"","sources":["../../../../src/math/sets/intervals/intervals.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAG/D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,aAAK,SAAS;IACZ,EAAE,UAAU;IACZ,EAAE,UAAU;IACZ,EAAE,UAAU;IACZ,EAAE,UAAU;CACb;AAED,qBAAa,QAAS,YAAW,gBAAgB;IAC/C,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,SAAS,CAAC;IACrB,IAAI,EAAE,UAAU,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;gBACS,GAAG,SAAc;IA+C7B,OAAO,CAAC,EAAE,EAAE,MAAM;IAWlB,UAAU,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO;IAYrC,KAAK,IAAI,MAAM;IAIf,gBAAgB,CAAC,SAAS,GAAE,MAAiD,GAAG,MAAM;CAYvF"}
1
+ {"version":3,"file":"intervals.d.ts","sourceRoot":"","sources":["../../../../src/math/sets/intervals/intervals.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAI/D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,aAAK,SAAS;IACZ,EAAE,UAAU;IACZ,EAAE,UAAU;IACZ,EAAE,UAAU;IACZ,EAAE,UAAU;CACb;AAED,qBAAa,QAAS,YAAW,gBAAgB;IAC/C,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,SAAS,CAAC;IACrB,IAAI,EAAE,UAAU,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;gBACS,GAAG,SAAc;IA+C7B,OAAO,CAAC,EAAE,EAAE,MAAM;IAWlB,UAAU,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO;IAYrC,KAAK,IAAI,MAAM;IAIf,gBAAgB,CAAC,SAAS,GAAE,MAAiD,GAAG,MAAM;CAYvF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "math-exercises",
3
- "version": "1.3.57",
3
+ "version": "1.3.58",
4
4
  "description": "Math exercises generator for middle school and high school",
5
5
  "main": "lib/index.js",
6
6
  "files": [