math-exercises 1.4.15 → 1.4.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/exercises/calcul/arithmetics/paritySumsAndProducts.d.ts +4 -0
- package/lib/exercises/calcul/arithmetics/paritySumsAndProducts.d.ts.map +1 -0
- package/lib/exercises/calcul/arithmetics/paritySumsAndProducts.js +113 -0
- package/lib/exercises/combinatory/anagrams.d.ts +4 -0
- package/lib/exercises/combinatory/anagrams.d.ts.map +1 -0
- package/lib/exercises/combinatory/anagrams.js +128 -0
- package/lib/exercises/combinatory/ballsCounting.d.ts +4 -0
- package/lib/exercises/combinatory/ballsCounting.d.ts.map +1 -0
- package/lib/exercises/combinatory/ballsCounting.js +124 -0
- package/lib/exercises/combinatory/diceCounting.d.ts +4 -0
- package/lib/exercises/combinatory/diceCounting.d.ts.map +1 -0
- package/lib/exercises/combinatory/diceCounting.js +134 -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 +39 -26
- package/lib/exercises/geometry/vectors/coordinatesReading.d.ts +4 -0
- package/lib/exercises/geometry/vectors/coordinatesReading.d.ts.map +1 -0
- package/lib/exercises/geometry/vectors/coordinatesReading.js +81 -0
- package/lib/exercises/utils/geogebra/getAdaptedCoords.d.ts +1 -0
- package/lib/exercises/utils/geogebra/getAdaptedCoords.d.ts.map +1 -0
- package/lib/exercises/utils/geogebra/getAdaptedCoords.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paritySumsAndProducts.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calcul/arithmetics/paritySumsAndProducts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,YAAY,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAM7F,eAAO,MAAM,qBAAqB,EAAE,YAanC,CAAC;AAEF,wBAAgB,gCAAgC,IAAI,QAAQ,CA8F3D"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getParitySumsAndProductsQuestion = exports.paritySumsAndProducts = 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.paritySumsAndProducts = {
|
|
9
|
+
id: 'paritySumsAndProducts',
|
|
10
|
+
connector: '=',
|
|
11
|
+
instruction: '',
|
|
12
|
+
label: 'Parité de sommes et de produits',
|
|
13
|
+
levels: ['2nde'],
|
|
14
|
+
isSingleStep: true,
|
|
15
|
+
sections: ['Arithmétique'],
|
|
16
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getParitySumsAndProductsQuestion, nb, 12),
|
|
17
|
+
qcmTimer: 60,
|
|
18
|
+
freeTimer: 60,
|
|
19
|
+
answerType: 'QCM',
|
|
20
|
+
maxAllowedQuestions: 12,
|
|
21
|
+
};
|
|
22
|
+
function getParitySumsAndProductsQuestion() {
|
|
23
|
+
const type = (0, randint_1.randint)(0, 12);
|
|
24
|
+
let instruction = '';
|
|
25
|
+
let answer;
|
|
26
|
+
switch (type) {
|
|
27
|
+
case 0:
|
|
28
|
+
instruction = 'La somme de deux nombres pairs est un nombre...';
|
|
29
|
+
answer = 'Pair';
|
|
30
|
+
break;
|
|
31
|
+
case 1:
|
|
32
|
+
instruction = 'La somme de deux nombres impairs est un nombre...';
|
|
33
|
+
answer = 'Pair';
|
|
34
|
+
break;
|
|
35
|
+
case 2:
|
|
36
|
+
instruction = "La somme d'un nombre pair et d'un nombre impair un nombre...";
|
|
37
|
+
answer = 'Impair';
|
|
38
|
+
break;
|
|
39
|
+
case 3:
|
|
40
|
+
instruction = 'La somme de trois nombres impairs est un nombre...';
|
|
41
|
+
answer = 'Impair';
|
|
42
|
+
break;
|
|
43
|
+
case 4:
|
|
44
|
+
instruction = 'La somme de trois nombres consécutifs est un nombre...';
|
|
45
|
+
answer = 'Parfois pair, parfois impair';
|
|
46
|
+
break;
|
|
47
|
+
case 5:
|
|
48
|
+
instruction = 'La somme de quatre nombres consécutifs est un nombre...';
|
|
49
|
+
answer = 'Pair';
|
|
50
|
+
break;
|
|
51
|
+
case 6:
|
|
52
|
+
instruction = 'Le produit de deux nombres pairs est un nombre...';
|
|
53
|
+
answer = 'Pair';
|
|
54
|
+
break;
|
|
55
|
+
case 7:
|
|
56
|
+
instruction = 'Le produit de deux nombres impairs est un nombre...';
|
|
57
|
+
answer = 'Impair';
|
|
58
|
+
break;
|
|
59
|
+
case 8:
|
|
60
|
+
instruction = "Le produit d'un nombre pair et d'un nombre impair est un nombre...";
|
|
61
|
+
answer = 'Pair';
|
|
62
|
+
break;
|
|
63
|
+
case 9:
|
|
64
|
+
instruction = 'Le produit de trois nombres consécutifs est un nombre...';
|
|
65
|
+
answer = 'Pair';
|
|
66
|
+
break;
|
|
67
|
+
case 10:
|
|
68
|
+
instruction = 'Le produit de trois nombres impairs est un nombre...';
|
|
69
|
+
answer = 'Impair';
|
|
70
|
+
break;
|
|
71
|
+
case 11:
|
|
72
|
+
instruction = 'Le produit de trois nombres pairs est un nombre...';
|
|
73
|
+
answer = 'Pair';
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
const getPropositions = (n) => {
|
|
77
|
+
const res = [];
|
|
78
|
+
res.push({
|
|
79
|
+
id: (0, uuid_1.v4)(),
|
|
80
|
+
statement: `Pair`,
|
|
81
|
+
isRightAnswer: answer === 'Pair',
|
|
82
|
+
format: 'raw',
|
|
83
|
+
});
|
|
84
|
+
res.push({
|
|
85
|
+
id: (0, uuid_1.v4)(),
|
|
86
|
+
statement: `Impair`,
|
|
87
|
+
isRightAnswer: answer === 'Impair',
|
|
88
|
+
format: 'raw',
|
|
89
|
+
});
|
|
90
|
+
res.push({
|
|
91
|
+
id: (0, uuid_1.v4)(),
|
|
92
|
+
statement: `Parfois pair, parfois impair`,
|
|
93
|
+
isRightAnswer: answer === 'Parfois pair, parfois impair',
|
|
94
|
+
format: 'raw',
|
|
95
|
+
});
|
|
96
|
+
res.push({
|
|
97
|
+
id: (0, uuid_1.v4)(),
|
|
98
|
+
statement: `Premier`,
|
|
99
|
+
isRightAnswer: answer === 'Premier',
|
|
100
|
+
format: 'raw',
|
|
101
|
+
});
|
|
102
|
+
return (0, shuffle_1.shuffle)(res);
|
|
103
|
+
};
|
|
104
|
+
const question = {
|
|
105
|
+
answer: answer,
|
|
106
|
+
instruction,
|
|
107
|
+
keys: [],
|
|
108
|
+
getPropositions,
|
|
109
|
+
answerFormat: 'raw',
|
|
110
|
+
};
|
|
111
|
+
return question;
|
|
112
|
+
}
|
|
113
|
+
exports.getParitySumsAndProductsQuestion = getParitySumsAndProductsQuestion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anagrams.d.ts","sourceRoot":"","sources":["../../../src/exercises/combinatory/anagrams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,YAAY,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAqEhH,eAAO,MAAM,QAAQ,EAAE,YAWtB,CAAC;AAEF,wBAAgB,mBAAmB,IAAI,QAAQ,CAoD9C"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAnagramsQuestion = exports.anagrams = 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 random_1 = require("../../utils/random");
|
|
8
|
+
const uuid_1 = require("uuid");
|
|
9
|
+
const words = [
|
|
10
|
+
'angle',
|
|
11
|
+
'armoire',
|
|
12
|
+
'banc',
|
|
13
|
+
'bureau',
|
|
14
|
+
'cabinet',
|
|
15
|
+
'carreau',
|
|
16
|
+
'chaise',
|
|
17
|
+
'classe',
|
|
18
|
+
'clé',
|
|
19
|
+
'coin',
|
|
20
|
+
'couloir',
|
|
21
|
+
'dossier',
|
|
22
|
+
'eau',
|
|
23
|
+
'école',
|
|
24
|
+
'écriture',
|
|
25
|
+
'entrée',
|
|
26
|
+
'escalier',
|
|
27
|
+
'étagère',
|
|
28
|
+
'étude',
|
|
29
|
+
'extérieur',
|
|
30
|
+
'fenêtre',
|
|
31
|
+
'intérieur',
|
|
32
|
+
'lavabo',
|
|
33
|
+
'lecture',
|
|
34
|
+
'lit',
|
|
35
|
+
'marche',
|
|
36
|
+
'matelas',
|
|
37
|
+
'maternelle',
|
|
38
|
+
'meuble',
|
|
39
|
+
'mousse',
|
|
40
|
+
'mur',
|
|
41
|
+
'peluche',
|
|
42
|
+
'placard',
|
|
43
|
+
'plafond',
|
|
44
|
+
'porte',
|
|
45
|
+
'portemanteau',
|
|
46
|
+
'poubelle',
|
|
47
|
+
'radiateur',
|
|
48
|
+
'rampe',
|
|
49
|
+
'récréation',
|
|
50
|
+
'rentrée',
|
|
51
|
+
'rideau',
|
|
52
|
+
'robinet',
|
|
53
|
+
'salle',
|
|
54
|
+
'savon',
|
|
55
|
+
'serrure',
|
|
56
|
+
'serviette',
|
|
57
|
+
'siège',
|
|
58
|
+
'sieste',
|
|
59
|
+
'silence',
|
|
60
|
+
'sol',
|
|
61
|
+
'sommeil',
|
|
62
|
+
'sonnette',
|
|
63
|
+
'sortie',
|
|
64
|
+
'table',
|
|
65
|
+
'tableau',
|
|
66
|
+
'tabouret',
|
|
67
|
+
'tapis',
|
|
68
|
+
'tiroir',
|
|
69
|
+
'toilette',
|
|
70
|
+
'vitre',
|
|
71
|
+
];
|
|
72
|
+
exports.anagrams = {
|
|
73
|
+
id: 'anagrams',
|
|
74
|
+
connector: '=',
|
|
75
|
+
instruction: '',
|
|
76
|
+
label: "Compter le nombre d'anagrammes d'un mot",
|
|
77
|
+
levels: ['TermSpé'],
|
|
78
|
+
isSingleStep: true,
|
|
79
|
+
sections: ['Combinatoire et dénombrement'],
|
|
80
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getAnagramsQuestion, nb),
|
|
81
|
+
qcmTimer: 60,
|
|
82
|
+
freeTimer: 60,
|
|
83
|
+
};
|
|
84
|
+
function getAnagramsQuestion() {
|
|
85
|
+
const word = (0, random_1.random)(words);
|
|
86
|
+
const answer = word
|
|
87
|
+
.split('')
|
|
88
|
+
.map((el, index) => index + 1)
|
|
89
|
+
.reduce((acc, curr) => acc * curr, 1);
|
|
90
|
+
const getPropositions = (n) => {
|
|
91
|
+
const res = [];
|
|
92
|
+
res.push({
|
|
93
|
+
id: (0, uuid_1.v4)(),
|
|
94
|
+
statement: answer + ``,
|
|
95
|
+
isRightAnswer: true,
|
|
96
|
+
format: 'tex',
|
|
97
|
+
});
|
|
98
|
+
(0, exercise_1.tryToAddWrongProp)(res, Math.pow(word.length, word.length) + '');
|
|
99
|
+
(0, exercise_1.tryToAddWrongProp)(res, (word.length * (word.length + 1)) / 2 + '');
|
|
100
|
+
(0, exercise_1.tryToAddWrongProp)(res, word.length * word.length + '');
|
|
101
|
+
const missing = n - res.length;
|
|
102
|
+
for (let i = 0; i < missing; i++) {
|
|
103
|
+
let isDuplicate;
|
|
104
|
+
let proposition;
|
|
105
|
+
do {
|
|
106
|
+
const wrongAnswer = (0, randint_1.randint)(1000, 10000);
|
|
107
|
+
proposition = {
|
|
108
|
+
id: (0, uuid_1.v4)() + ``,
|
|
109
|
+
statement: wrongAnswer + '',
|
|
110
|
+
isRightAnswer: false,
|
|
111
|
+
format: 'tex',
|
|
112
|
+
};
|
|
113
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
114
|
+
} while (isDuplicate);
|
|
115
|
+
res.push(proposition);
|
|
116
|
+
}
|
|
117
|
+
return (0, exercise_1.shuffleProps)(res, n);
|
|
118
|
+
};
|
|
119
|
+
const question = {
|
|
120
|
+
answer: answer + '',
|
|
121
|
+
instruction: `Combien d'anagrammes mathématiques du mot ${word} sont possibles ? `,
|
|
122
|
+
keys: [],
|
|
123
|
+
getPropositions,
|
|
124
|
+
answerFormat: 'tex',
|
|
125
|
+
};
|
|
126
|
+
return question;
|
|
127
|
+
}
|
|
128
|
+
exports.getAnagramsQuestion = getAnagramsQuestion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ballsCounting.d.ts","sourceRoot":"","sources":["../../../src/exercises/combinatory/ballsCounting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,YAAY,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAKhH,eAAO,MAAM,aAAa,EAAE,YAW3B,CAAC;AAEF,wBAAgB,wBAAwB,IAAI,QAAQ,CA8GnD"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBallsCountingQuestion = exports.ballsCounting = 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 uuid_1 = require("uuid");
|
|
8
|
+
exports.ballsCounting = {
|
|
9
|
+
id: 'ballsCounting',
|
|
10
|
+
connector: '=',
|
|
11
|
+
instruction: '',
|
|
12
|
+
label: 'Dénombrement avec des boules',
|
|
13
|
+
levels: ['TermSpé'],
|
|
14
|
+
isSingleStep: true,
|
|
15
|
+
sections: ['Combinatoire et dénombrement'],
|
|
16
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getBallsCountingQuestion, nb),
|
|
17
|
+
qcmTimer: 60,
|
|
18
|
+
freeTimer: 60,
|
|
19
|
+
};
|
|
20
|
+
function getBallsCountingQuestion() {
|
|
21
|
+
const type = (0, randint_1.randint)(0, 6);
|
|
22
|
+
let instruction = '';
|
|
23
|
+
let answer = '';
|
|
24
|
+
const blacks = (0, randint_1.randint)(2, 6);
|
|
25
|
+
const greens = (0, randint_1.randint)(2, 6);
|
|
26
|
+
const reds = (0, randint_1.randint)(3, 6);
|
|
27
|
+
const total = blacks + greens + reds;
|
|
28
|
+
switch (type) {
|
|
29
|
+
case 0:
|
|
30
|
+
instruction = ``;
|
|
31
|
+
answer = total * (total - 1) * (total - 2) + '';
|
|
32
|
+
break;
|
|
33
|
+
case 1:
|
|
34
|
+
instruction = `comportant trois boules rouges`;
|
|
35
|
+
answer = reds * (reds - 1) * (reds - 2) + '';
|
|
36
|
+
break;
|
|
37
|
+
case 2:
|
|
38
|
+
instruction = `ne comportant pas de boule noire`;
|
|
39
|
+
answer = (reds + greens) * (reds + greens - 1) * (reds + greens - 2) + '';
|
|
40
|
+
break;
|
|
41
|
+
case 3:
|
|
42
|
+
instruction = `comportant au moins une boule noire`;
|
|
43
|
+
answer = total * (total - 1) * (total - 2) - (reds + greens) * (reds + greens - 1) * (reds + greens - 2) + '';
|
|
44
|
+
break;
|
|
45
|
+
case 4:
|
|
46
|
+
instruction = `comportant trois boules de trois couleurs différentes`;
|
|
47
|
+
answer = 6 * (blacks * greens * reds) + '';
|
|
48
|
+
break;
|
|
49
|
+
case 5:
|
|
50
|
+
instruction = `comportant exactement une boule verte et deux boules noires`;
|
|
51
|
+
answer = 6 * (greens * blacks * (blacks - 1)) + '';
|
|
52
|
+
break;
|
|
53
|
+
case 6:
|
|
54
|
+
instruction = `comportant exactement une boule verte`;
|
|
55
|
+
answer = 6 * greens * (reds + blacks) * (reds + blacks - 1) + '';
|
|
56
|
+
}
|
|
57
|
+
const getPropositions = (n) => {
|
|
58
|
+
const res = [];
|
|
59
|
+
res.push({
|
|
60
|
+
id: (0, uuid_1.v4)(),
|
|
61
|
+
statement: answer,
|
|
62
|
+
isRightAnswer: true,
|
|
63
|
+
format: 'tex',
|
|
64
|
+
});
|
|
65
|
+
switch (type) {
|
|
66
|
+
case 0:
|
|
67
|
+
(0, exercise_1.tryToAddWrongProp)(res, total * total * total + '');
|
|
68
|
+
(0, exercise_1.tryToAddWrongProp)(res, 6 + '');
|
|
69
|
+
break;
|
|
70
|
+
case 1:
|
|
71
|
+
(0, exercise_1.tryToAddWrongProp)(res, reds * reds * reds + '');
|
|
72
|
+
(0, exercise_1.tryToAddWrongProp)(res, 1 + '');
|
|
73
|
+
break;
|
|
74
|
+
case 2:
|
|
75
|
+
(0, exercise_1.tryToAddWrongProp)(res, (reds + greens) * (reds + greens) * (reds + greens) + '');
|
|
76
|
+
(0, exercise_1.tryToAddWrongProp)(res, 6 * blacks * (reds + greens) * (reds + greens - 1) + '');
|
|
77
|
+
break;
|
|
78
|
+
case 3:
|
|
79
|
+
(0, exercise_1.tryToAddWrongProp)(res, (reds + greens) * (reds + greens) * (reds + greens) + '');
|
|
80
|
+
(0, exercise_1.tryToAddWrongProp)(res, 3 * (reds + greens) * (reds + greens - 1) + '');
|
|
81
|
+
break;
|
|
82
|
+
case 4:
|
|
83
|
+
(0, exercise_1.tryToAddWrongProp)(res, blacks * greens * reds + '');
|
|
84
|
+
(0, exercise_1.tryToAddWrongProp)(res, 6 + '');
|
|
85
|
+
break;
|
|
86
|
+
case 5:
|
|
87
|
+
(0, exercise_1.tryToAddWrongProp)(res, 6 * greens * blacks * blacks + '');
|
|
88
|
+
(0, exercise_1.tryToAddWrongProp)(res, 6 + '');
|
|
89
|
+
break;
|
|
90
|
+
case 6:
|
|
91
|
+
(0, exercise_1.tryToAddWrongProp)(res, 6 * (blacks * greens * reds) + '');
|
|
92
|
+
(0, exercise_1.tryToAddWrongProp)(res, greens * (reds + blacks) * (reds + blacks - 1) + '');
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
const missing = n - res.length;
|
|
96
|
+
for (let i = 0; i < missing; i++) {
|
|
97
|
+
let isDuplicate;
|
|
98
|
+
let proposition;
|
|
99
|
+
do {
|
|
100
|
+
const wrongAnswer = (0, randint_1.randint)(1, 100) + '';
|
|
101
|
+
proposition = {
|
|
102
|
+
id: (0, uuid_1.v4)() + ``,
|
|
103
|
+
statement: wrongAnswer,
|
|
104
|
+
isRightAnswer: false,
|
|
105
|
+
format: 'tex',
|
|
106
|
+
};
|
|
107
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
108
|
+
} while (isDuplicate);
|
|
109
|
+
res.push(proposition);
|
|
110
|
+
}
|
|
111
|
+
return (0, exercise_1.shuffleProps)(res, n);
|
|
112
|
+
};
|
|
113
|
+
const question = {
|
|
114
|
+
answer: answer,
|
|
115
|
+
instruction: `Une urne contient ${blacks} boules noires numérotées de 1 à ${blacks}, ${reds} boules rouges numérotées de 1 à ${reds} et ${greens} boules vertes numérotées de 1 à ${greens}.
|
|
116
|
+
On tire successivement et sans remise 3 boules dans l'urne.
|
|
117
|
+
Combien de tirages ${instruction} sont possibles ?`,
|
|
118
|
+
keys: [],
|
|
119
|
+
getPropositions,
|
|
120
|
+
answerFormat: 'tex',
|
|
121
|
+
};
|
|
122
|
+
return question;
|
|
123
|
+
}
|
|
124
|
+
exports.getBallsCountingQuestion = getBallsCountingQuestion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diceCounting.d.ts","sourceRoot":"","sources":["../../../src/exercises/combinatory/diceCounting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,YAAY,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAKhH,eAAO,MAAM,YAAY,EAAE,YAW1B,CAAC;AAEF,wBAAgB,uBAAuB,IAAI,QAAQ,CAwHlD"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDiceCountingQuestion = exports.diceCounting = 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 uuid_1 = require("uuid");
|
|
8
|
+
exports.diceCounting = {
|
|
9
|
+
id: 'diceCounting',
|
|
10
|
+
connector: '=',
|
|
11
|
+
instruction: '',
|
|
12
|
+
label: 'Dénombrement avec des dés',
|
|
13
|
+
levels: ['TermSpé'],
|
|
14
|
+
isSingleStep: true,
|
|
15
|
+
sections: ['Combinatoire et dénombrement'],
|
|
16
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getDiceCountingQuestion, nb),
|
|
17
|
+
qcmTimer: 60,
|
|
18
|
+
freeTimer: 60,
|
|
19
|
+
};
|
|
20
|
+
function getDiceCountingQuestion() {
|
|
21
|
+
const type = (0, randint_1.randint)(0, 8);
|
|
22
|
+
let instruction = '';
|
|
23
|
+
let answer = '';
|
|
24
|
+
let face1, face2, face3;
|
|
25
|
+
switch (type) {
|
|
26
|
+
case 0:
|
|
27
|
+
instruction = `avec exactement deux chiffres identiques`;
|
|
28
|
+
answer = 6 * 3 * 5 + '';
|
|
29
|
+
break;
|
|
30
|
+
case 1:
|
|
31
|
+
instruction = `avec trois chiffres identiques`;
|
|
32
|
+
answer = 6 + '';
|
|
33
|
+
break;
|
|
34
|
+
case 2:
|
|
35
|
+
face1 = (0, randint_1.randint)(1, 7);
|
|
36
|
+
instruction = `avec exactement une fois la face ${face1}`;
|
|
37
|
+
answer = 3 * 5 * 5 + '';
|
|
38
|
+
break;
|
|
39
|
+
case 3:
|
|
40
|
+
face1 = (0, randint_1.randint)(1, 7);
|
|
41
|
+
instruction = `avec exactement deux fois la face ${face1}`;
|
|
42
|
+
answer = 3 * 5 + '';
|
|
43
|
+
break;
|
|
44
|
+
case 4:
|
|
45
|
+
face1 = (0, randint_1.randint)(1, 7);
|
|
46
|
+
face2 = (0, randint_1.randint)(1, 7, [face1]);
|
|
47
|
+
face3 = (0, randint_1.randint)(1, 7, [face1, face2]);
|
|
48
|
+
instruction = `avec exactement les faces ${face1}, ${face2} et ${face3}`;
|
|
49
|
+
answer = 6 + '';
|
|
50
|
+
break;
|
|
51
|
+
case 5:
|
|
52
|
+
face1 = (0, randint_1.randint)(1, 7);
|
|
53
|
+
face2 = (0, randint_1.randint)(1, 7, [face1]);
|
|
54
|
+
face3 = (0, randint_1.randint)(1, 7, [face1, face2]);
|
|
55
|
+
instruction = `avec exactement une fois la face ${face1} et une fois la face ${face2}`;
|
|
56
|
+
answer = 3 * 5 + '';
|
|
57
|
+
break;
|
|
58
|
+
case 6:
|
|
59
|
+
instruction = `dans lesquels toutes les faces sont différentes`;
|
|
60
|
+
answer = 6 * 5 * 4 + '';
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
const getPropositions = (n) => {
|
|
64
|
+
const res = [];
|
|
65
|
+
res.push({
|
|
66
|
+
id: (0, uuid_1.v4)(),
|
|
67
|
+
statement: answer,
|
|
68
|
+
isRightAnswer: true,
|
|
69
|
+
format: 'tex',
|
|
70
|
+
});
|
|
71
|
+
switch (type) {
|
|
72
|
+
case 0:
|
|
73
|
+
(0, exercise_1.tryToAddWrongProp)(res, 3 * 5 + '');
|
|
74
|
+
(0, exercise_1.tryToAddWrongProp)(res, 6 * 6 * 3 + '');
|
|
75
|
+
(0, exercise_1.tryToAddWrongProp)(res, 6 * 3 + '');
|
|
76
|
+
break;
|
|
77
|
+
case 1:
|
|
78
|
+
(0, exercise_1.tryToAddWrongProp)(res, 6 * 3 + '');
|
|
79
|
+
(0, exercise_1.tryToAddWrongProp)(res, 1 + '');
|
|
80
|
+
break;
|
|
81
|
+
case 2:
|
|
82
|
+
(0, exercise_1.tryToAddWrongProp)(res, 3 * 6 * 6 + '');
|
|
83
|
+
(0, exercise_1.tryToAddWrongProp)(res, 6 + '');
|
|
84
|
+
(0, exercise_1.tryToAddWrongProp)(res, 5 * 5 + '');
|
|
85
|
+
break;
|
|
86
|
+
case 3:
|
|
87
|
+
(0, exercise_1.tryToAddWrongProp)(res, 6 * 3 + '');
|
|
88
|
+
(0, exercise_1.tryToAddWrongProp)(res, 6 * 5 + '');
|
|
89
|
+
(0, exercise_1.tryToAddWrongProp)(res, 5 + '');
|
|
90
|
+
break;
|
|
91
|
+
case 4:
|
|
92
|
+
(0, exercise_1.tryToAddWrongProp)(res, 3 + '');
|
|
93
|
+
(0, exercise_1.tryToAddWrongProp)(res, 1 + '');
|
|
94
|
+
(0, exercise_1.tryToAddWrongProp)(res, 6 * 6 * 6 + '');
|
|
95
|
+
break;
|
|
96
|
+
case 5:
|
|
97
|
+
(0, exercise_1.tryToAddWrongProp)(res, 6 * 3 + '');
|
|
98
|
+
(0, exercise_1.tryToAddWrongProp)(res, 6 * 5 + '');
|
|
99
|
+
(0, exercise_1.tryToAddWrongProp)(res, 5 + '');
|
|
100
|
+
break;
|
|
101
|
+
case 6:
|
|
102
|
+
(0, exercise_1.tryToAddWrongProp)(res, 6 * 6 * 6 + '');
|
|
103
|
+
(0, exercise_1.tryToAddWrongProp)(res, 6 * 5 + '');
|
|
104
|
+
(0, exercise_1.tryToAddWrongProp)(res, 6 + '');
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
const missing = n - res.length;
|
|
108
|
+
for (let i = 0; i < missing; i++) {
|
|
109
|
+
let isDuplicate;
|
|
110
|
+
let proposition;
|
|
111
|
+
do {
|
|
112
|
+
const wrongAnswer = (0, randint_1.randint)(1, 100) + '';
|
|
113
|
+
proposition = {
|
|
114
|
+
id: (0, uuid_1.v4)() + ``,
|
|
115
|
+
statement: wrongAnswer,
|
|
116
|
+
isRightAnswer: false,
|
|
117
|
+
format: 'tex',
|
|
118
|
+
};
|
|
119
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
120
|
+
} while (isDuplicate);
|
|
121
|
+
res.push(proposition);
|
|
122
|
+
}
|
|
123
|
+
return (0, exercise_1.shuffleProps)(res, n);
|
|
124
|
+
};
|
|
125
|
+
const question = {
|
|
126
|
+
answer: answer,
|
|
127
|
+
instruction: `On tire 3 fois consécutivement un dé à six faces numérotées de 1 à 6. Combien de tirages ${instruction} sont possibles ?`,
|
|
128
|
+
keys: [],
|
|
129
|
+
getPropositions,
|
|
130
|
+
answerFormat: 'tex',
|
|
131
|
+
};
|
|
132
|
+
return question;
|
|
133
|
+
}
|
|
134
|
+
exports.getDiceCountingQuestion = getDiceCountingQuestion;
|
|
@@ -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' | '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' | '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,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,cAAc,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAC;IACvC,eAAe,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,WAAW,EAAE,CAAC;CAC/C;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,GAAG,GAAG,OAAO,GAAG,UAAU,CAAC;IACvC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC;IACf,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,QAAQ,EAAE,CAAC;IAC9D,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,UAAU,GACV,SAAS,GACT,UAAU,GACV,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,MAAM,WAAW,GACnB,cAAc,GACd,iBAAiB,GACjB,SAAS,GACT,aAAa,GACb,YAAY,GACZ,SAAS,GACT,0BAA0B,GAC1B,WAAW,GACX,2BAA2B,GAC3B,eAAe,GACf,eAAe,GACf,kBAAkB,GAClB,WAAW,GACX,mBAAmB,GACnB,wBAAwB,GACxB,WAAW,GACX,uBAAuB,GACvB,uBAAuB,GACvB,aAAa,GACb,aAAa,GACb,SAAS,GACT,qBAAqB,GACrB,mBAAmB,GACnB,cAAc,GACd,YAAY,GACZ,cAAc,GACd,kBAAkB,GAClB,YAAY,GACZ,iBAAiB,GACjB,cAAc,GACd,cAAc,GACd,QAAQ,GACR,eAAe,GACf,UAAU,CAAC"}
|
|
1
|
+
{"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,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,cAAc,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAC;IACvC,eAAe,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,WAAW,EAAE,CAAC;CAC/C;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,GAAG,GAAG,OAAO,GAAG,UAAU,CAAC;IACvC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC;IACf,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,QAAQ,EAAE,CAAC;IAC9D,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,UAAU,GACV,SAAS,GACT,UAAU,GACV,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,MAAM,WAAW,GACnB,cAAc,GACd,iBAAiB,GACjB,SAAS,GACT,8BAA8B,GAC9B,aAAa,GACb,YAAY,GACZ,SAAS,GACT,0BAA0B,GAC1B,WAAW,GACX,2BAA2B,GAC3B,eAAe,GACf,eAAe,GACf,kBAAkB,GAClB,WAAW,GACX,mBAAmB,GACnB,wBAAwB,GACxB,WAAW,GACX,uBAAuB,GACvB,uBAAuB,GACvB,aAAa,GACb,aAAa,GACb,SAAS,GACT,qBAAqB,GACrB,mBAAmB,GACnB,cAAc,GACd,YAAY,GACZ,cAAc,GACd,kBAAkB,GAClB,YAAY,GACZ,iBAAiB,GACjB,cAAc,GACd,cAAc,GACd,QAAQ,GACR,eAAe,GACf,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exercises.d.ts","sourceRoot":"","sources":["../../src/exercises/exercises.ts"],"names":[],"mappings":"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;AAmB1C,eAAO,MAAM,SAAS,EAAE,YAAY,EAwRnC,CAAC"}
|
|
@@ -182,6 +182,11 @@ const niceRootsFromDevForm_1 = require("./functions/trinoms/niceRootsFromDevForm
|
|
|
182
182
|
const diceBasicProbas_1 = require("./probaStat/diceBasicProbas");
|
|
183
183
|
const cardBasicProbas_1 = require("./probaStat/cardBasicProbas");
|
|
184
184
|
const ballsBasicProbas_1 = require("./probaStat/ballsBasicProbas");
|
|
185
|
+
const coordinatesReading_1 = require("./geometry/vectors/coordinatesReading");
|
|
186
|
+
const anagrams_1 = require("./combinatory/anagrams");
|
|
187
|
+
const ballsCounting_1 = require("./combinatory/ballsCounting");
|
|
188
|
+
const diceCounting_1 = require("./combinatory/diceCounting");
|
|
189
|
+
const paritySumsAndProducts_1 = require("./calcul/arithmetics/paritySumsAndProducts");
|
|
185
190
|
exports.exercises = [
|
|
186
191
|
/**
|
|
187
192
|
* calcul litteral
|
|
@@ -205,6 +210,8 @@ exports.exercises = [
|
|
|
205
210
|
equationType4Exercise_1.equationType4Exercise,
|
|
206
211
|
firstDegreeEquation_1.firstDegreeEquation,
|
|
207
212
|
equationSimpleSquare_1.equationSimpleSquare,
|
|
213
|
+
multiplicationEquation_1.multiplicationEquation,
|
|
214
|
+
fractionEquation_1.fractionEquation,
|
|
208
215
|
/**
|
|
209
216
|
* inequations
|
|
210
217
|
*/
|
|
@@ -234,6 +241,10 @@ exports.exercises = [
|
|
|
234
241
|
addAndSubWithoutRelatives_1.addAndSubWithoutRelatives,
|
|
235
242
|
operationsPriorities_1.operationsPriorities,
|
|
236
243
|
operationsPrioritiesWithoutRelative_1.operationsPrioritiesWithoutRelative,
|
|
244
|
+
mentalAddAndSub_1.mentalAddAndSub,
|
|
245
|
+
mentalMultiplications_1.mentalMultiplications,
|
|
246
|
+
mentalDivisions_1.mentalDivisions,
|
|
247
|
+
mentalPercentage_1.mentalPercentage,
|
|
237
248
|
/**
|
|
238
249
|
* rounding
|
|
239
250
|
*/
|
|
@@ -264,12 +275,22 @@ exports.exercises = [
|
|
|
264
275
|
trigonometrySideCalcul_1.trigonometrySideCalcul,
|
|
265
276
|
rightTriangleArea_1.rightTriangleArea,
|
|
266
277
|
triangleArea_1.triangleArea,
|
|
278
|
+
rectangleArea_1.rectangleArea,
|
|
279
|
+
rectanglePerimeter_1.rectanglePerimeter,
|
|
280
|
+
squareArea_1.squareArea,
|
|
281
|
+
squarePerimeter_1.squarePerimeter,
|
|
282
|
+
triangleAreaV2_1.triangleAreaV2,
|
|
283
|
+
trianglePerimeter_1.trianglePerimeter,
|
|
284
|
+
circleArea_1.circleArea,
|
|
285
|
+
circleCircumference_1.circleCircumference,
|
|
286
|
+
distanceBetweenTwoPoints_1.distanceBetweenTwoPoints,
|
|
267
287
|
/**
|
|
268
288
|
* vectors
|
|
269
289
|
*/
|
|
270
290
|
scalarProductViaCoords_1.scalarProductViaCoords,
|
|
271
291
|
determinant_1.determinant,
|
|
272
292
|
chasles_1.chasles,
|
|
293
|
+
coordinatesReading_1.coordinatesReading,
|
|
273
294
|
/**
|
|
274
295
|
* puissances
|
|
275
296
|
*/
|
|
@@ -328,7 +349,7 @@ exports.exercises = [
|
|
|
328
349
|
expDerivativeTwo_1.expDerivativeTwo,
|
|
329
350
|
expDerivativeThree_1.expDerivativeThree,
|
|
330
351
|
/**
|
|
331
|
-
* primitive
|
|
352
|
+
* primitive and equa diff
|
|
332
353
|
*/
|
|
333
354
|
constantPrimitive_1.constantPrimitive,
|
|
334
355
|
polynomialPrimitive_1.polynomialPrimitive,
|
|
@@ -336,6 +357,8 @@ exports.exercises = [
|
|
|
336
357
|
exponentialPrimitive_1.exponentialPrimitive,
|
|
337
358
|
logarithmePrimitive_1.logarithmePrimitive,
|
|
338
359
|
usualPrimitives_1.usualPrimitives,
|
|
360
|
+
equaDiffGeneralForme_1.exponentialDifferentialEquation,
|
|
361
|
+
equaDiffGeneralFormeWithIC_1.exponentialDifferentialEquationWithIC,
|
|
339
362
|
/**
|
|
340
363
|
* probabilités
|
|
341
364
|
*/
|
|
@@ -344,39 +367,21 @@ exports.exercises = [
|
|
|
344
367
|
diceBasicProbas_1.diceBasicProbas,
|
|
345
368
|
cardBasicProbas_1.cardBasicProbas,
|
|
346
369
|
ballsBasicProbas_1.ballsBasicProbas,
|
|
370
|
+
/**arithmetic */
|
|
371
|
+
primeNumbers_1.primeNumbers,
|
|
372
|
+
paritySumsAndProducts_1.paritySumsAndProducts,
|
|
373
|
+
euclideanDivision_1.euclideanDivision,
|
|
347
374
|
/**
|
|
348
375
|
* islam
|
|
349
376
|
*/
|
|
350
377
|
leadingCoefficient_1.leadingCoefficient,
|
|
351
378
|
fractionToPercentToDecimal_1.fractionToPercentToDecimal,
|
|
352
379
|
marginalAndConditionalFrequency_1.marginalAndConditionalFrequency,
|
|
353
|
-
mentalAddAndSub_1.mentalAddAndSub,
|
|
354
|
-
mentalMultiplications_1.mentalMultiplications,
|
|
355
|
-
mentalDivisions_1.mentalDivisions,
|
|
356
|
-
mentalPercentage_1.mentalPercentage,
|
|
357
380
|
/**
|
|
358
381
|
* nv generateurs
|
|
359
382
|
*/
|
|
360
|
-
capacityConversion_1.capacityConversion,
|
|
361
|
-
lengthConversion_1.lengthConversion,
|
|
362
|
-
massConversion_1.massConversion,
|
|
363
|
-
aeraConversion_1.aeraConversion,
|
|
364
|
-
volumeConversion_1.volumeConversion,
|
|
365
|
-
volumeCapacityConversion_1.volumeCapacityConversion,
|
|
366
|
-
primeNumbers_1.primeNumbers,
|
|
367
|
-
multiplicationEquation_1.multiplicationEquation,
|
|
368
|
-
fractionEquation_1.fractionEquation,
|
|
369
383
|
leadingCoefficientCalculV1_1.leadingCoefficientCalculV1,
|
|
370
384
|
leadingCoefficientCalculV2_1.leadingCoefficientCalculV2,
|
|
371
|
-
rectangleArea_1.rectangleArea,
|
|
372
|
-
rectanglePerimeter_1.rectanglePerimeter,
|
|
373
|
-
squareArea_1.squareArea,
|
|
374
|
-
squarePerimeter_1.squarePerimeter,
|
|
375
|
-
triangleAreaV2_1.triangleAreaV2,
|
|
376
|
-
trianglePerimeter_1.trianglePerimeter,
|
|
377
|
-
circleArea_1.circleArea,
|
|
378
|
-
circleCircumference_1.circleCircumference,
|
|
379
|
-
distanceBetweenTwoPoints_1.distanceBetweenTwoPoints,
|
|
380
385
|
reduceExpression_1.reduceExpression,
|
|
381
386
|
evaluateExpression_1.evaluateExpression,
|
|
382
387
|
proportionalityTable_1.proportionalityTable,
|
|
@@ -384,11 +389,15 @@ exports.exercises = [
|
|
|
384
389
|
expEquation_1.expEquation,
|
|
385
390
|
expSimplifiying_1.expSimplifiying,
|
|
386
391
|
logSimplifiying_1.logSimplifiying,
|
|
387
|
-
euclideanDivision_1.euclideanDivision,
|
|
388
392
|
signFunction_1.signFunction,
|
|
389
393
|
thirdDegreeFunctionVariation_1.thirdDegreeFunctionVariation,
|
|
390
|
-
|
|
391
|
-
|
|
394
|
+
/**conversions */
|
|
395
|
+
capacityConversion_1.capacityConversion,
|
|
396
|
+
lengthConversion_1.lengthConversion,
|
|
397
|
+
massConversion_1.massConversion,
|
|
398
|
+
aeraConversion_1.aeraConversion,
|
|
399
|
+
volumeConversion_1.volumeConversion,
|
|
400
|
+
volumeCapacityConversion_1.volumeCapacityConversion,
|
|
392
401
|
/**Stats */
|
|
393
402
|
averageWithTable_1.averageWithTable,
|
|
394
403
|
medianList_1.medianWithList,
|
|
@@ -430,4 +439,8 @@ exports.exercises = [
|
|
|
430
439
|
sequenceRationalFracLimit_1.sequenceRationalFracLimit,
|
|
431
440
|
sequencePolynomProductLimit_1.sequencePolynomProductLimit,
|
|
432
441
|
sequenceGeometricLimit_1.sequenceGeometricLimit,
|
|
442
|
+
/**combinatory */
|
|
443
|
+
anagrams_1.anagrams,
|
|
444
|
+
ballsCounting_1.ballsCounting,
|
|
445
|
+
diceCounting_1.diceCounting,
|
|
433
446
|
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordinatesReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/vectors/coordinatesReading.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,YAAY,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAMhH,eAAO,MAAM,kBAAkB,EAAE,YAWhC,CAAC;AAEF,wBAAgB,6BAA6B,IAAI,QAAQ,CAsExD"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCoordinatesReadingQuestion = exports.coordinatesReading = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const integer_1 = require("../../../math/numbers/integer/integer");
|
|
7
|
+
const uuid_1 = require("uuid");
|
|
8
|
+
exports.coordinatesReading = {
|
|
9
|
+
id: 'coordinatesReading',
|
|
10
|
+
connector: '=',
|
|
11
|
+
instruction: '',
|
|
12
|
+
label: "Lire les coordonnées d'un vecteur",
|
|
13
|
+
levels: ['2nde', '1reESM'],
|
|
14
|
+
isSingleStep: true,
|
|
15
|
+
sections: ['Vecteurs'],
|
|
16
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getCoordinatesReadingQuestion, nb),
|
|
17
|
+
qcmTimer: 60,
|
|
18
|
+
freeTimer: 60,
|
|
19
|
+
};
|
|
20
|
+
function getCoordinatesReadingQuestion() {
|
|
21
|
+
const [xA, yA] = integer_1.IntegerConstructor.randomDifferents(-5, 6, 2);
|
|
22
|
+
let xB, yB;
|
|
23
|
+
do {
|
|
24
|
+
[xB, yB] = integer_1.IntegerConstructor.randomDifferents(-5, 6, 2);
|
|
25
|
+
} while (xA === xB && yA === yB);
|
|
26
|
+
const xDelta = xB - xA;
|
|
27
|
+
const yDelta = yB - yA;
|
|
28
|
+
const answer = `\\left(${xDelta};${yDelta}\\right)`;
|
|
29
|
+
const commands = [`Vector((${xA},${yA}), (${xB}, ${yB}))`];
|
|
30
|
+
const xMin = Math.min(xA, xB);
|
|
31
|
+
const yMin = Math.min(yA, yB);
|
|
32
|
+
const xMax = Math.max(xA, xB);
|
|
33
|
+
const yMax = Math.max(yA, yB);
|
|
34
|
+
const coords = [
|
|
35
|
+
xMin === xMax ? xMin - 1 : xMin - 0.2 * Math.abs(xDelta),
|
|
36
|
+
xMin === xMax ? xMax + 1 : xMax + 0.2 * Math.abs(xDelta),
|
|
37
|
+
yMin === yMax ? yMin - 1 : yMin - 0.2 * Math.abs(yDelta),
|
|
38
|
+
yMin === yMax ? yMax + 1 : yMax + 0.2 * Math.abs(yDelta),
|
|
39
|
+
];
|
|
40
|
+
const getPropositions = (n) => {
|
|
41
|
+
const res = [];
|
|
42
|
+
res.push({
|
|
43
|
+
id: (0, uuid_1.v4)(),
|
|
44
|
+
statement: answer,
|
|
45
|
+
isRightAnswer: true,
|
|
46
|
+
format: 'tex',
|
|
47
|
+
});
|
|
48
|
+
(0, exercise_1.tryToAddWrongProp)(res, `\\left(${xA - xB};${yA - yB}\\right)`);
|
|
49
|
+
(0, exercise_1.tryToAddWrongProp)(res, `\\left(${xA + xB};${yA + yB}\\right)`);
|
|
50
|
+
(0, exercise_1.tryToAddWrongProp)(res, `\\left(${xA - yA};${xB - yB}\\right)`);
|
|
51
|
+
(0, exercise_1.tryToAddWrongProp)(res, `\\left(${yA - xA};${yB - xB}\\right)`);
|
|
52
|
+
const missing = n - res.length;
|
|
53
|
+
for (let i = 0; i < missing; i++) {
|
|
54
|
+
let isDuplicate;
|
|
55
|
+
let proposition;
|
|
56
|
+
do {
|
|
57
|
+
const wrongAnswer = '';
|
|
58
|
+
proposition = {
|
|
59
|
+
id: (0, uuid_1.v4)() + ``,
|
|
60
|
+
statement: wrongAnswer,
|
|
61
|
+
isRightAnswer: false,
|
|
62
|
+
format: 'tex',
|
|
63
|
+
};
|
|
64
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
65
|
+
} while (isDuplicate);
|
|
66
|
+
res.push(proposition);
|
|
67
|
+
}
|
|
68
|
+
return (0, exercise_1.shuffleProps)(res, n);
|
|
69
|
+
};
|
|
70
|
+
const question = {
|
|
71
|
+
answer: answer,
|
|
72
|
+
instruction: `Lire les coordonnées du vecteur $\\overrightarrow u$ représentée ci-dessous :`,
|
|
73
|
+
keys: ['semicolon', 'u', 'overrightarrow', 'equal'],
|
|
74
|
+
getPropositions,
|
|
75
|
+
answerFormat: 'tex',
|
|
76
|
+
commands,
|
|
77
|
+
coords,
|
|
78
|
+
};
|
|
79
|
+
return question;
|
|
80
|
+
}
|
|
81
|
+
exports.getCoordinatesReadingQuestion = getCoordinatesReadingQuestion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=getAdaptedCoords.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAdaptedCoords.d.ts","sourceRoot":"","sources":["../../../../src/exercises/utils/geogebra/getAdaptedCoords.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|