math-exercises 3.0.140 → 3.0.141
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/math/calcul/arithmetics/euclideanDivision.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/euclideanDivision.js +65 -8
- package/lib/exercises/math/calcul/arithmetics/findRightPrimeDecomposition.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/findRightPrimeDecomposition.js +3 -6
- package/lib/exercises/math/calcul/arithmetics/index.d.ts +3 -0
- package/lib/exercises/math/calcul/arithmetics/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/index.js +3 -1
- package/lib/exercises/math/calcul/arithmetics/primeNumbersAffirmations.d.ts +8 -0
- package/lib/exercises/math/calcul/arithmetics/primeNumbersAffirmations.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/primeNumbersAffirmations.js +128 -0
- package/lib/exercises/math/calcul/proportionality/fourthProportionalFromProblem.d.ts +8 -0
- package/lib/exercises/math/calcul/proportionality/fourthProportionalFromProblem.d.ts.map +1 -0
- package/lib/exercises/math/calcul/proportionality/fourthProportionalFromProblem.js +392 -0
- package/lib/exercises/math/calcul/proportionality/index.d.ts +2 -0
- package/lib/exercises/math/calcul/proportionality/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/index.js +2 -0
- package/lib/exercises/math/calcul/proportionality/isProportionalFromProblem.d.ts +8 -0
- package/lib/exercises/math/calcul/proportionality/isProportionalFromProblem.d.ts.map +1 -0
- package/lib/exercises/math/calcul/proportionality/isProportionalFromProblem.js +349 -0
- package/lib/exercises/math/calculLitteral/equation/isEqualityTrue.js +1 -1
- package/lib/exercises/math/dataRepresentations/index.js +1 -0
- package/lib/exercises/math/dataRepresentations/placePointsFromDataTable.d.ts +12 -0
- package/lib/exercises/math/dataRepresentations/placePointsFromDataTable.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/placePointsFromDataTable.js +175 -0
- package/lib/exercises/math/functions/affines/index.d.ts +2 -0
- package/lib/exercises/math/functions/affines/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/index.js +2 -0
- package/lib/exercises/math/functions/affines/placePointsFromAffine.d.ts +8 -0
- package/lib/exercises/math/functions/affines/placePointsFromAffine.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/placePointsFromAffine.js +135 -0
- package/lib/exercises/math/functions/affines/recognizeAffinePointsFromPoints.d.ts +10 -0
- package/lib/exercises/math/functions/affines/recognizeAffinePointsFromPoints.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/recognizeAffinePointsFromPoints.js +208 -0
- package/lib/exercises/math/functions/basics/index.d.ts +1 -0
- package/lib/exercises/math/functions/basics/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/index.js +1 -0
- package/lib/exercises/math/functions/basics/placePointsFromValueTable.d.ts +8 -0
- package/lib/exercises/math/functions/basics/placePointsFromValueTable.d.ts.map +1 -0
- package/lib/exercises/math/functions/basics/placePointsFromValueTable.js +128 -0
- package/lib/exercises/math/geometry/pythagore/isTriangleRight.d.ts.map +1 -1
- package/lib/exercises/math/geometry/pythagore/isTriangleRight.js +19 -9
- package/lib/exercises/utils/data/boxXY.d.ts +7 -0
- package/lib/exercises/utils/data/boxXY.d.ts.map +1 -0
- package/lib/exercises/utils/data/boxXY.js +16 -0
- package/lib/exercises/utils/data/isBoxable.d.ts +2 -0
- package/lib/exercises/utils/data/isBoxable.d.ts.map +1 -0
- package/lib/exercises/utils/data/isBoxable.js +5 -0
- package/lib/exercises/utils/data/randomDataTable.d.ts +11 -0
- package/lib/exercises/utils/data/randomDataTable.d.ts.map +1 -0
- package/lib/exercises/utils/data/randomDataTable.js +65 -0
- package/lib/index.d.ts +21 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/math/utils/random/randfloat.d.ts +1 -0
- package/lib/math/utils/random/randfloat.d.ts.map +1 -1
- package/lib/math/utils/random/randfloat.js +35 -0
- package/lib/utils/arrays/transpose.d.ts +2 -0
- package/lib/utils/arrays/transpose.d.ts.map +1 -0
- package/lib/utils/arrays/transpose.js +10 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"euclideanDivision.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/arithmetics/euclideanDivision.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"euclideanDivision.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/arithmetics/euclideanDivision.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA4HF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAanD,CAAC"}
|
|
@@ -2,9 +2,9 @@ import { addValidProp, propWhile, shuffleProps, tryToAddWrongProp, } from "../..
|
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
4
4
|
import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
|
|
5
|
-
import { AddNode } from "../../../../tree/nodes/operators/addNode.js";
|
|
6
|
-
import { EqualNode } from "../../../../tree/nodes/equations/equalNode.js";
|
|
7
|
-
import { MultiplyNode } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
5
|
+
import { add, AddNode } from "../../../../tree/nodes/operators/addNode.js";
|
|
6
|
+
import { equal, EqualNode } from "../../../../tree/nodes/equations/equalNode.js";
|
|
7
|
+
import { multiply, MultiplyNode, } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
8
8
|
const getInstruction = (identifiers) => {
|
|
9
9
|
const { dividend, divisor } = identifiers;
|
|
10
10
|
return `Écrire la division euclidienne de $${dividend}$ par $${divisor}$.`;
|
|
@@ -15,6 +15,34 @@ const getAnswer = (identifiers) => {
|
|
|
15
15
|
const answerTex = answer.toTex();
|
|
16
16
|
return answerTex;
|
|
17
17
|
};
|
|
18
|
+
const getHint = (identifiers) => {
|
|
19
|
+
const { dividend, divisor } = identifiers;
|
|
20
|
+
return `La division euclidienne de $${dividend}$ par $${divisor}$ est de la forme :
|
|
21
|
+
|
|
22
|
+
$$
|
|
23
|
+
${dividend} = ${divisor} \\times q + r
|
|
24
|
+
$$
|
|
25
|
+
|
|
26
|
+
où $q$ (le quotient) et $r$ (le reste) sont deux entier naturels, avec $r<${divisor}$.`;
|
|
27
|
+
};
|
|
28
|
+
const getCorrection = (identifiers) => {
|
|
29
|
+
const { dividend, divisor, quotient, remainder } = identifiers;
|
|
30
|
+
// const steps = divisionStepsManual(identifiers.dividend, identifiers.divisor);
|
|
31
|
+
return `On a :
|
|
32
|
+
|
|
33
|
+
$$
|
|
34
|
+
${divisor}\\times ${quotient} = ${divisor * quotient}
|
|
35
|
+
$$
|
|
36
|
+
|
|
37
|
+
On en déduit donc que :
|
|
38
|
+
|
|
39
|
+
$$
|
|
40
|
+
${getAnswer(identifiers)}
|
|
41
|
+
$$
|
|
42
|
+
|
|
43
|
+
Cette écriture est bien la division euclidienne de $${dividend}$ par $${divisor}$, car le reste $${remainder}$ est bien inférieur à $${divisor}$.
|
|
44
|
+
`;
|
|
45
|
+
};
|
|
18
46
|
const getEuclideanDivisionQuestions = () => {
|
|
19
47
|
let dividend = randint(5, 100);
|
|
20
48
|
let divisor = randint(2, 11);
|
|
@@ -34,6 +62,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
34
62
|
keys: ["equal"],
|
|
35
63
|
answerFormat: "tex",
|
|
36
64
|
identifiers,
|
|
65
|
+
hint: getHint(identifiers),
|
|
66
|
+
correction: getCorrection(identifiers),
|
|
37
67
|
};
|
|
38
68
|
return question;
|
|
39
69
|
};
|
|
@@ -42,14 +72,15 @@ const isAnswerValid = (ans, { dividend, divisor, quotient, remainder }) => {
|
|
|
42
72
|
const validLatexs = tree.toAllValidTexs();
|
|
43
73
|
return validLatexs.includes(ans);
|
|
44
74
|
};
|
|
45
|
-
const getPropositions = (n, { answer, dividend }) => {
|
|
75
|
+
const getPropositions = (n, { answer, dividend, divisor, quotient, remainder }) => {
|
|
46
76
|
const propositions = [];
|
|
47
77
|
addValidProp(propositions, answer);
|
|
78
|
+
tryToAddWrongProp(propositions, equal(dividend, add(multiply(divisor, quotient - 1), remainder + dividend)).toTex());
|
|
48
79
|
propWhile(propositions, n, () => {
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
const wrongAnswer = new EqualNode(new NumberNode(dividend), new AddNode(new MultiplyNode(new NumberNode(
|
|
80
|
+
const fakeDivisor = randint(2, 11);
|
|
81
|
+
const fakeQuotient = Math.floor(randint(5, 100) / fakeDivisor);
|
|
82
|
+
const fakeRemainder = randint(5, 100) % fakeDivisor;
|
|
83
|
+
const wrongAnswer = new EqualNode(new NumberNode(dividend), new AddNode(new MultiplyNode(new NumberNode(fakeDivisor), new NumberNode(fakeQuotient)), new NumberNode(fakeRemainder)));
|
|
53
84
|
tryToAddWrongProp(propositions, wrongAnswer.toTex());
|
|
54
85
|
});
|
|
55
86
|
return shuffleProps(propositions, n);
|
|
@@ -66,4 +97,30 @@ export const euclideanDivision = {
|
|
|
66
97
|
isAnswerValid,
|
|
67
98
|
subject: "Mathématiques",
|
|
68
99
|
getQuestionFromIdentifiers,
|
|
100
|
+
hasHintAndCorrection: true,
|
|
69
101
|
};
|
|
102
|
+
function _divisionStepsManual(dividend, divisor) {
|
|
103
|
+
if (divisor === 0) {
|
|
104
|
+
throw new Error("Division par zéro impossible.");
|
|
105
|
+
}
|
|
106
|
+
const steps = [];
|
|
107
|
+
let remainder = dividend;
|
|
108
|
+
const quotient = Math.floor(dividend / divisor);
|
|
109
|
+
const quotientStr = quotient.toString();
|
|
110
|
+
for (let i = 0; i < quotientStr.length; i++) {
|
|
111
|
+
// On forme la "partie" du quotient qu'on utilise (ex : 10, puis 3)
|
|
112
|
+
const factor = parseInt(quotientStr[i], 10) * Math.pow(10, quotientStr.length - 1 - i);
|
|
113
|
+
if (factor === 0)
|
|
114
|
+
continue;
|
|
115
|
+
const product = factor * divisor;
|
|
116
|
+
const before = remainder;
|
|
117
|
+
remainder -= product;
|
|
118
|
+
steps.push({
|
|
119
|
+
quotientPart: factor,
|
|
120
|
+
product,
|
|
121
|
+
remainderBefore: before,
|
|
122
|
+
remainderAfter: remainder,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
return steps;
|
|
126
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findRightPrimeDecomposition.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/arithmetics/findRightPrimeDecomposition.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"findRightPrimeDecomposition.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/arithmetics/findRightPrimeDecomposition.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAQrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAU7C,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,eAAe,EAAE,CAAC;CAChC,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAiIF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAsBtE,CAAC"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { addValidProp, shuffleProps, GeneratorOptionTarget, GeneratorOptionType,
|
|
2
|
-
// tryToAddWrongProp,
|
|
3
|
-
addWrongProp, } from "../../../../exercises/exercise.js";
|
|
1
|
+
import { addValidProp, shuffleProps, GeneratorOptionTarget, GeneratorOptionType, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
4
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
5
3
|
import { dividersOf } from "../../../../math/utils/arithmetic/dividersOf.js";
|
|
6
4
|
import { isPrime } from "../../../../math/utils/arithmetic/isPrime.js";
|
|
@@ -27,7 +25,7 @@ const getPropositions = (n, { answer, fakeDecomps }) => {
|
|
|
27
25
|
const propositions = [];
|
|
28
26
|
addValidProp(propositions, answer);
|
|
29
27
|
for (const decomp of fakeDecomps) {
|
|
30
|
-
|
|
28
|
+
tryToAddWrongProp(propositions, reifyAlgebraic(decomp).toTex({ forceNoSimplification: true }));
|
|
31
29
|
}
|
|
32
30
|
return shuffleProps(propositions, n);
|
|
33
31
|
};
|
|
@@ -50,7 +48,7 @@ n = p_1^{k_1} \\times p_2^{k_2} \\times ...
|
|
|
50
48
|
$$`}
|
|
51
49
|
|
|
52
50
|
où $p_1$, $p_2$, ... sont des nombres premiers${opts?.doNotUsePowers
|
|
53
|
-
? "
|
|
51
|
+
? "."
|
|
54
52
|
: " et $k_1$, $k_2$, ... sont des entiers naturels."}
|
|
55
53
|
|
|
56
54
|
Parmi les écritures proposées, il faut donc repérer celle dans laquelle chaque facteur est un nombre premier.`;
|
|
@@ -75,7 +73,6 @@ const getFindRightPrimeDecompositionQuestion = (opts) => {
|
|
|
75
73
|
// );
|
|
76
74
|
const fakeDecomps = [];
|
|
77
75
|
const nonPrimes = [];
|
|
78
|
-
console.log(nb);
|
|
79
76
|
for (let i = 0; i < 3; i++) {
|
|
80
77
|
const nonPrime = doWhile(() => random(divisors.slice(1).filter((n) => !isPrime(n))), (n) => nonPrimes.includes(n));
|
|
81
78
|
nonPrimes.push(nonPrime);
|
|
@@ -13,4 +13,7 @@ export * from "./isMultipleOrDivisor.js";
|
|
|
13
13
|
export * from "./coprime.js";
|
|
14
14
|
export * from "./countDivisors.js";
|
|
15
15
|
export * from "./findPrimeInList.js";
|
|
16
|
+
export * from "./findRightPrimeDecomposition.js";
|
|
17
|
+
export * from "./primeNumberIdentification.js";
|
|
18
|
+
export * from "./primeNumbersAffirmations.js";
|
|
16
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/arithmetics/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/arithmetics/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC"}
|
|
@@ -13,4 +13,6 @@ export * from "./isMultipleOrDivisor.js";
|
|
|
13
13
|
export * from "./coprime.js";
|
|
14
14
|
export * from "./countDivisors.js";
|
|
15
15
|
export * from "./findPrimeInList.js";
|
|
16
|
-
|
|
16
|
+
export * from "./findRightPrimeDecomposition.js";
|
|
17
|
+
export * from "./primeNumberIdentification.js";
|
|
18
|
+
export * from "./primeNumbersAffirmations.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
rightAffirmationsIndexes: number[];
|
|
4
|
+
wrongAffirmationsIndexes: number[];
|
|
5
|
+
};
|
|
6
|
+
export declare const primeNumbersAffirmations: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=primeNumbersAffirmations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primeNumbersAffirmations.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/arithmetics/primeNumbersAffirmations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAiDrC,KAAK,WAAW,GAAG;IACjB,wBAAwB,EAAE,MAAM,EAAE,CAAC;IACnC,wBAAwB,EAAE,MAAM,EAAE,CAAC;CACpC,CAAC;AAqFF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAkB1D,CAAC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, addWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
4
|
+
import { randTupleInt } from "../../../../math/utils/random/randTupleInt.js";
|
|
5
|
+
const rightAffirmations = [
|
|
6
|
+
"Tout entier naturel est diviseur de lui-même.",
|
|
7
|
+
"Il y a une infinité de nombres premiers.",
|
|
8
|
+
"Tout nombre entier admet au moins deux diviseurs.",
|
|
9
|
+
"$1$ est diviseur de tous les nombres entiers.",
|
|
10
|
+
"$2$ est le seul nombre premier pair.",
|
|
11
|
+
"Un nombre premier n'a que deux diviseurs : $1$ et lui-même.",
|
|
12
|
+
];
|
|
13
|
+
const rightAffirmationsCorrections = [
|
|
14
|
+
`C'est vrai, car pour tout entier naturel $n$, on a :
|
|
15
|
+
|
|
16
|
+
$$
|
|
17
|
+
n = n\\times 1
|
|
18
|
+
$$`,
|
|
19
|
+
"C'est vrai, c'est une propriété du cours.",
|
|
20
|
+
`C'est vrai, car pour tout entier naturel $n$, on a :
|
|
21
|
+
|
|
22
|
+
$$
|
|
23
|
+
n = n\\times 1
|
|
24
|
+
$$
|
|
25
|
+
|
|
26
|
+
donc tout entier naturel est divisible par $1$ et par lui-même.`,
|
|
27
|
+
`C'est vrai, car pour tout entier naturel $n$, on a :
|
|
28
|
+
|
|
29
|
+
$$
|
|
30
|
+
n = 1\\times n
|
|
31
|
+
$$`,
|
|
32
|
+
`C'est vrai, car $2$ est divisible uniquement par $1$ et par lui-même, et tous les nombres pairs sont divisibles par $2$, donc ils au moins trois diviseurs.`,
|
|
33
|
+
"C'est vrai, c'est la définition d'un nombre premier.",
|
|
34
|
+
];
|
|
35
|
+
const wrongAffirmations = [
|
|
36
|
+
"Tout nombre impair est premier.",
|
|
37
|
+
"$0$ est diviseur de tous les nombres entiers.",
|
|
38
|
+
"$1$ est un nombre premier.",
|
|
39
|
+
"Tout nombre premier est impair.",
|
|
40
|
+
"Il n'existe pas de nombre premier qui soit pair.",
|
|
41
|
+
];
|
|
42
|
+
const wrongAffirmationsCorrections = [
|
|
43
|
+
"C'est faux, par exemple $9$ est divisible par $1$, par $3$ et par lui-même, donc il n'a pas uniquement deux diviseurs.",
|
|
44
|
+
"C'est faux, $0$ est un diviseur de lui-même, mais d'aucun autre entier naturel.",
|
|
45
|
+
"C'est faux, car $1$ n'a qu'un seul diviseur, lui-même.",
|
|
46
|
+
"C'est faux, car $2$ est un nombre premier pair.",
|
|
47
|
+
"C'est faux, $2$ est un nombre premier pair.",
|
|
48
|
+
];
|
|
49
|
+
const getPropositions = (n, { rightAffirmationsIndexes, wrongAffirmationsIndexes }) => {
|
|
50
|
+
const propositions = [];
|
|
51
|
+
for (const i of rightAffirmationsIndexes) {
|
|
52
|
+
addValidProp(propositions, rightAffirmations[i], "raw");
|
|
53
|
+
}
|
|
54
|
+
for (const i of wrongAffirmationsIndexes) {
|
|
55
|
+
addWrongProp(propositions, wrongAffirmations[i], "raw");
|
|
56
|
+
}
|
|
57
|
+
return shuffleProps(propositions, n);
|
|
58
|
+
};
|
|
59
|
+
const getInstruction = () => {
|
|
60
|
+
return `Parmi les affirmations suivantes, laquelle ou lesquelles sont vraies ?`;
|
|
61
|
+
};
|
|
62
|
+
const getHint = () => {
|
|
63
|
+
return `Un nombre $k$ est un diviseur d'un nombre $n$ si on peut l'écrire sous la forme $n = k \\times m$, où $m$ est un entier naturel.`;
|
|
64
|
+
};
|
|
65
|
+
const getCorrection = (identifiers) => {
|
|
66
|
+
const { rightAffirmationsIndexes, wrongAffirmationsIndexes } = identifiers;
|
|
67
|
+
return `Voici le(s) affirmation(s) correcte(s) :
|
|
68
|
+
|
|
69
|
+
${rightAffirmationsIndexes
|
|
70
|
+
.map((i) => `- ${rightAffirmations[i]}\n \n ${rightAffirmationsCorrections[i]}\n \n `)
|
|
71
|
+
.join("")}
|
|
72
|
+
|
|
73
|
+
\n \n \n
|
|
74
|
+
${wrongAffirmationsIndexes.length === 0
|
|
75
|
+
? ""
|
|
76
|
+
: `Le(s) affirmation(s) incorrecte(s) sont donc les suivantes :
|
|
77
|
+
|
|
78
|
+
${wrongAffirmationsIndexes
|
|
79
|
+
.map((i) => `- ${wrongAffirmations[i]}\n \n ${wrongAffirmationsCorrections[i]}\n \n `)
|
|
80
|
+
.join("")}`}`;
|
|
81
|
+
};
|
|
82
|
+
const getPrimeNumbersAffirmationsQuestion = () => {
|
|
83
|
+
const rightAnswersCount = randint(1, 5);
|
|
84
|
+
const wrongAnswersCount = 4 - rightAnswersCount;
|
|
85
|
+
const rightIndexes = randTupleInt(rightAnswersCount, {
|
|
86
|
+
from: 0,
|
|
87
|
+
to: rightAffirmations.length,
|
|
88
|
+
allDifferent: true,
|
|
89
|
+
});
|
|
90
|
+
const wrongIndexes = wrongAnswersCount > 0
|
|
91
|
+
? randTupleInt(wrongAnswersCount, {
|
|
92
|
+
from: 0,
|
|
93
|
+
to: wrongAffirmations.length,
|
|
94
|
+
allDifferent: true,
|
|
95
|
+
})
|
|
96
|
+
: [];
|
|
97
|
+
const identifiers = {
|
|
98
|
+
rightAffirmationsIndexes: rightIndexes,
|
|
99
|
+
wrongAffirmationsIndexes: wrongIndexes,
|
|
100
|
+
};
|
|
101
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
102
|
+
};
|
|
103
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
104
|
+
return {
|
|
105
|
+
instruction: getInstruction(identifiers),
|
|
106
|
+
answerFormat: "tex",
|
|
107
|
+
identifiers,
|
|
108
|
+
hint: getHint(identifiers),
|
|
109
|
+
correction: getCorrection(identifiers),
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
export const primeNumbersAffirmations = {
|
|
113
|
+
id: "primeNumbersAffirmations",
|
|
114
|
+
label: "Sélectionner les affirmations correctes concernant les nombres premiers",
|
|
115
|
+
isSingleStep: true,
|
|
116
|
+
generator: (nb, opts) => getDistinctQuestions(() => getPrimeNumbersAffirmationsQuestion(opts), nb),
|
|
117
|
+
qcmTimer: 60,
|
|
118
|
+
freeTimer: 60,
|
|
119
|
+
getPropositions,
|
|
120
|
+
subject: "Mathématiques",
|
|
121
|
+
getInstruction,
|
|
122
|
+
getHint,
|
|
123
|
+
getCorrection,
|
|
124
|
+
getQuestionFromIdentifiers,
|
|
125
|
+
hasHintAndCorrection: true,
|
|
126
|
+
answerType: "QCM",
|
|
127
|
+
isQCM: true,
|
|
128
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
situationIndex: number;
|
|
4
|
+
values: number[][];
|
|
5
|
+
};
|
|
6
|
+
export declare const fourthProportionalFromProblem: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=fourthProportionalFromProblem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fourthProportionalFromProblem.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/proportionality/fourthProportionalFromProblem.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAyBrC,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;CACpB,CAAC;AA6cF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAoB/D,CAAC"}
|