math-exercises 3.0.132 → 3.0.133
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/mentalCaluls/mentalProgramSolve.d.ts +1 -1
- package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.d.ts.map +1 -1
- package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.js +5 -5
- package/lib/exercises/math/calcul/ordering/compareA10N.d.ts.map +1 -1
- package/lib/exercises/math/calcul/ordering/compareA10N.js +12 -7
- package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.d.ts.map +1 -1
- package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.js +8 -6
- package/lib/exercises/math/calculLitteral/equation/equationFromProblem.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationFromProblem.js +8 -9
- package/lib/exercises/math/calculLitteral/simplifying/compareATimes0.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/simplifying/compareATimes0.js +4 -4
- package/lib/exercises/math/conversion/prefixToNumber.d.ts +0 -2
- package/lib/exercises/math/conversion/prefixToNumber.d.ts.map +1 -1
- package/lib/exercises/math/conversion/prefixToNumber.js +27 -22
- package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.js +1 -2
- package/lib/exercises/math/geometry/cartesian/index.d.ts +1 -0
- package/lib/exercises/math/geometry/cartesian/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/index.js +1 -0
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.d.ts +6 -9
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.js +60 -137
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLineV2.d.ts +16 -0
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLineV2.d.ts.map +1 -0
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLineV2.js +213 -0
- package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.js +2 -2
- package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.js +6 -6
- package/lib/exercises/math/probaStat/probaAsSumOfProbas.d.ts +0 -1
- package/lib/exercises/math/probaStat/probaAsSumOfProbas.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaAsSumOfProbas.js +52 -59
- package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.js +70 -23
- package/lib/exercises/pc/index.d.ts +0 -1
- package/lib/exercises/pc/index.d.ts.map +1 -1
- package/lib/exercises/pc/index.js +0 -1
- package/lib/exercises/pc/motion/averageSpeed.d.ts +0 -2
- package/lib/exercises/pc/motion/averageSpeed.d.ts.map +1 -1
- package/lib/exercises/pc/motion/averageSpeed.js +28 -36
- package/lib/exercises/pc/weight/calculateWeight.d.ts +0 -1
- package/lib/exercises/pc/weight/calculateWeight.d.ts.map +1 -1
- package/lib/exercises/pc/weight/calculateWeight.js +26 -19
- package/lib/index.d.ts +9 -38
- package/lib/index.d.ts.map +1 -1
- package/lib/playgroundUtils.d.ts +3 -0
- package/lib/playgroundUtils.d.ts.map +1 -0
- package/lib/playgroundUtils.js +13 -0
- package/lib/server.js +121 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mentalProgramSolve.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/mentalCaluls/mentalProgramSolve.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAI7C,OAAO,EAGL,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;AA4BzC,KAAK,WAAW,GAAG;IACjB,qBAAqB,EAAE,eAAe,CAAC;IACvC,WAAW,EAAE,mBAAmB,CAAC;CAClC,CAAC;AAqOF,KAAK,OAAO,GAAG;IACb,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"mentalProgramSolve.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/mentalCaluls/mentalProgramSolve.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAI7C,OAAO,EAGL,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;AA4BzC,KAAK,WAAW,GAAG;IACjB,qBAAqB,EAAE,eAAe,CAAC;IACvC,WAAW,EAAE,mBAAmB,CAAC;CAClC,CAAC;AAqOF,KAAK,OAAO,GAAG;IACb,UAAU,EAAE,QAAQ,GAAG,SAAS,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAiCF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAyB7D,CAAC"}
|
|
@@ -88,7 +88,7 @@ const getInstruction = (identifiers, opts) => {
|
|
|
88
88
|
|
|
89
89
|
${str}`);
|
|
90
90
|
const strProgCalc = arrStrProgCalc.reduce((acc, str) => acc + str);
|
|
91
|
-
const strFinalNumber = opts?.numberType == "
|
|
91
|
+
const strFinalNumber = opts?.numberType == "Entier"
|
|
92
92
|
? nodeFinalNumber.evaluate().frenchify()
|
|
93
93
|
: nodeFinalNumber
|
|
94
94
|
.evaluate()
|
|
@@ -159,10 +159,10 @@ const getMentalProgramSolveQuestion = (optsIn) => {
|
|
|
159
159
|
const opts = optsIn ? Object.assign(optsDefault, optsIn) : optsDefault;
|
|
160
160
|
let nbDigits = 0;
|
|
161
161
|
switch (opts.numberType) {
|
|
162
|
-
case "
|
|
162
|
+
case "Entier":
|
|
163
163
|
nbDigits = 0;
|
|
164
164
|
break;
|
|
165
|
-
case "
|
|
165
|
+
case "Décimal":
|
|
166
166
|
nbDigits = Number(opts.nbDigits);
|
|
167
167
|
break;
|
|
168
168
|
}
|
|
@@ -189,7 +189,7 @@ const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
|
189
189
|
};
|
|
190
190
|
};
|
|
191
191
|
const optsDefault = {
|
|
192
|
-
numberType: "
|
|
192
|
+
numberType: "Entier",
|
|
193
193
|
nbSteps: "4",
|
|
194
194
|
nbDigits: "0",
|
|
195
195
|
};
|
|
@@ -198,7 +198,7 @@ const options = [
|
|
|
198
198
|
id: "numberType",
|
|
199
199
|
label: "Type de nombres utilisés",
|
|
200
200
|
defaultValue: optsDefault.numberType,
|
|
201
|
-
values: ["
|
|
201
|
+
values: ["Entier", "Décimal"],
|
|
202
202
|
target: GeneratorOptionTarget.generation,
|
|
203
203
|
type: GeneratorOptionType.select,
|
|
204
204
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compareA10N.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/ordering/compareA10N.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAkBrC,KAAK,IAAI,GAAG;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,KAAK,IAAI,GAAG;IACV,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,KAAK,EAAE,IAAI,EAAE,CAAC;CACf,CAAC;
|
|
1
|
+
{"version":3,"file":"compareA10N.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/ordering/compareA10N.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAkBrC,KAAK,IAAI,GAAG;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,KAAK,IAAI,GAAG;IACV,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,KAAK,EAAE,IAAI,EAAE,CAAC;CACf,CAAC;AA+TF,KAAK,OAAO,GAAG;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAyCF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgBtD,CAAC"}
|
|
@@ -17,15 +17,20 @@ const getTexForA10N = (a10N) => {
|
|
|
17
17
|
};
|
|
18
18
|
const getSciMultNodeForA10N = (a10N) => {
|
|
19
19
|
const { a, n } = a10N;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
if (a !== 0) {
|
|
21
|
+
const sign = Math.sign(a);
|
|
22
|
+
const sciMultNodeA = getSciMultNodeForA(sign * a);
|
|
23
|
+
const factor = sign * sciMultNodeA.leftChild.evaluate();
|
|
24
|
+
const nodePower10 = sciMultNodeA.rightChild;
|
|
25
|
+
const exponent = nodePower10.rightChild.evaluate() + n;
|
|
26
|
+
return multiply(factor, power(10, exponent));
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return multiply(a, power(10, n));
|
|
30
|
+
}
|
|
26
31
|
};
|
|
27
32
|
const getSciMultNodeForA = (a) => {
|
|
28
|
-
//a must be positive
|
|
33
|
+
//a must be strictly positive
|
|
29
34
|
const exponent = Math.floor(Math.log10(a));
|
|
30
35
|
const factor = round(frac(a, power(10, exponent)).evaluate(), 2);
|
|
31
36
|
const sciMultNode = multiply(factor, power(10, exponent));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"estimatePow10NPlusPow10MinusN.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;
|
|
1
|
+
{"version":3,"file":"estimatePow10NPlusPow10MinusN.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAiFF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAmB/D,CAAC"}
|
|
@@ -8,7 +8,7 @@ const getInstruction = (identifiers) => {
|
|
|
8
8
|
const A = varName;
|
|
9
9
|
return `On considère $${A}=10^{${n}}+10^{-${n}}$.
|
|
10
10
|
|
|
11
|
-
À quoi
|
|
11
|
+
À quoi $${A}$ est-il environ égal ?`;
|
|
12
12
|
};
|
|
13
13
|
const getHint = (identifiers) => {
|
|
14
14
|
const { n } = identifiers;
|
|
@@ -36,11 +36,13 @@ const getPropositions = (nbProps, { answer, ...identifiers }) => {
|
|
|
36
36
|
const { n } = identifiers;
|
|
37
37
|
const propositions = [];
|
|
38
38
|
addValidProp(propositions, `10^{${n}}`, "tex");
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
[
|
|
40
|
+
`${(0).frenchify()}`,
|
|
41
|
+
`10^0`,
|
|
42
|
+
random([`100^0`, `20^{-{${n}^2}}`, `20^{${n}}`]),
|
|
43
|
+
].forEach((wrongTex) => {
|
|
44
|
+
tryToAddWrongProp(propositions, wrongTex, "tex");
|
|
45
|
+
});
|
|
44
46
|
return shuffleProps(propositions, nbProps);
|
|
45
47
|
};
|
|
46
48
|
const getEstimatePow10NPlusPow10MinusNQuestion = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equationFromProblem.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationFromProblem.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAKlE,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"equationFromProblem.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationFromProblem.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAKlE,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAatE,KAAK,WAAW,GAAG;IACjB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,yBAAyB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC;IACzE,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,YAAY,EAAE,eAAe,CAAC;CAC/B,CAAC;AAsrBF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAcrD,CAAC"}
|
|
@@ -10,7 +10,6 @@ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
|
10
10
|
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
11
11
|
import { random, randomMany } from "../../../../utils/alea/random.js";
|
|
12
12
|
import { isOperatorNode, OperatorIds, } from "../../../../tree/nodes/operators/operatorNode.js";
|
|
13
|
-
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
14
13
|
class ProblemConstructor {
|
|
15
14
|
static byHydratingSkeleton(skeleton, groupNameToVarNameToValue, mysteryVarPath, shuffleArrays) {
|
|
16
15
|
const shuffleFuncs = shuffleArrays.map((shuffleArray) => {
|
|
@@ -71,14 +70,14 @@ class Problem {
|
|
|
71
70
|
});
|
|
72
71
|
}
|
|
73
72
|
getExplanationString() {
|
|
74
|
-
const arrArr = Object.values(this.groups).map((group) =>
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
return
|
|
73
|
+
const arrArr = Object.values(this.groups).map((group) => `\n - ${group.getScalarString(this.mysteryVar)}` +
|
|
74
|
+
` : ` +
|
|
75
|
+
`\n
|
|
76
|
+
$$
|
|
77
|
+
${group.getNode(this.mysteryVar, this.groups, this.shuffleFuncs).toTex()}
|
|
78
|
+
$$
|
|
79
|
+
\n `);
|
|
80
|
+
return arrArr.join("");
|
|
82
81
|
}
|
|
83
82
|
}
|
|
84
83
|
class ProblemVarGroup {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compareATimes0.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/simplifying/compareATimes0.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAKrC,KAAK,IAAI,GAAG;IACV,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,IAAI,EAAE,CAAC;CACf,CAAC;
|
|
1
|
+
{"version":3,"file":"compareATimes0.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/simplifying/compareATimes0.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAKrC,KAAK,IAAI,GAAG;IACV,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,IAAI,EAAE,CAAC;CACf,CAAC;AAwGF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAehD,CAAC"}
|
|
@@ -45,9 +45,9 @@ const getCompareATimes0Question = () => {
|
|
|
45
45
|
const nbInvalid = nbTotal - nbValid;
|
|
46
46
|
const validItems = [
|
|
47
47
|
`0 \\times a`,
|
|
48
|
-
`a \\times 0`,
|
|
49
48
|
`\\frac{0}{a}`,
|
|
50
49
|
`a + (-a)`,
|
|
50
|
+
`a \\times 0`,
|
|
51
51
|
].map((tex) => {
|
|
52
52
|
return {
|
|
53
53
|
tex,
|
|
@@ -55,8 +55,8 @@ const getCompareATimes0Question = () => {
|
|
|
55
55
|
};
|
|
56
56
|
});
|
|
57
57
|
const invalidItems = [
|
|
58
|
+
`\\frac{a}{0}`,
|
|
58
59
|
`a \\times (-a)`,
|
|
59
|
-
`(-a) \\times a`,
|
|
60
60
|
`\\frac{a}{a}`,
|
|
61
61
|
`\\frac{a}{-a}`,
|
|
62
62
|
`a - (-a)`,
|
|
@@ -68,8 +68,8 @@ const getCompareATimes0Question = () => {
|
|
|
68
68
|
};
|
|
69
69
|
});
|
|
70
70
|
const items = shuffle([
|
|
71
|
-
...shuffle(validItems).slice(0, nbValid),
|
|
72
|
-
...shuffle(invalidItems).slice(0, nbInvalid),
|
|
71
|
+
...shuffle(validItems.slice(0, Math.max(2, nbValid))).slice(0, nbValid),
|
|
72
|
+
...shuffle([...invalidItems.slice(0, 1), ...invalidItems.slice(1)]).slice(0, nbInvalid),
|
|
73
73
|
]);
|
|
74
74
|
return getQuestionFromIdentifiers({ items });
|
|
75
75
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prefixToNumber.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/prefixToNumber.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,QAAQ,EAiBT,MAAM,mBAAmB,CAAC;AAG3B,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"prefixToNumber.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/prefixToNumber.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,QAAQ,EAiBT,MAAM,mBAAmB,CAAC;AAG3B,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAyNF,KAAK,OAAO,GAAG;IACb,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AA0EF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAuBzD,CAAC"}
|
|
@@ -105,8 +105,10 @@ const getMdTable = (prefixes, indexBold = -1) => {
|
|
|
105
105
|
].map((str) => (i === indexBold ? boldify(str) : str))),
|
|
106
106
|
]);
|
|
107
107
|
};
|
|
108
|
-
const getInstruction = (identifiers) => {
|
|
109
|
-
const
|
|
108
|
+
const getInstruction = (identifiers, optsIn) => {
|
|
109
|
+
const opts = optsIn ?? optsDefault;
|
|
110
|
+
const { prefixIndex } = identifiers;
|
|
111
|
+
const { isFromSymbol, isToPow10 } = opts;
|
|
110
112
|
const prefix = prefixes[prefixIndex];
|
|
111
113
|
return `Quelle est la valeur du préfixe ${isFromSymbol ? `$${prefix.symbol}$` : prefix.name} ?
|
|
112
114
|
|
|
@@ -117,8 +119,10 @@ const getHint = (identifiers) => {
|
|
|
117
119
|
const prefixPool = prefixIndexesPool.map((i) => prefixes[i]);
|
|
118
120
|
return getMdTable(prefixPool);
|
|
119
121
|
};
|
|
120
|
-
const getCorrection = (identifiers) => {
|
|
121
|
-
const
|
|
122
|
+
const getCorrection = (identifiers, optsIn) => {
|
|
123
|
+
const opts = optsIn ?? optsDefault;
|
|
124
|
+
const { prefixIndexesPool, prefixIndex } = identifiers;
|
|
125
|
+
const { isToPow10 } = opts;
|
|
122
126
|
const prefix = prefixes[prefixIndex];
|
|
123
127
|
const prefixPool = prefixIndexesPool.map((i) => prefixes[i]);
|
|
124
128
|
const indexBold = (() => {
|
|
@@ -135,13 +139,17 @@ ${!isToPow10
|
|
|
135
139
|
? `$${prefix.texPow10}$ correspond à l'écriture décimale $${prefix.texValue}$.`
|
|
136
140
|
: ``}`;
|
|
137
141
|
};
|
|
138
|
-
const getAnswer = (identifiers) => {
|
|
139
|
-
const
|
|
142
|
+
const getAnswer = (identifiers, optsIn) => {
|
|
143
|
+
const opts = optsIn ?? optsDefault;
|
|
144
|
+
const { prefixIndex } = identifiers;
|
|
145
|
+
const { isToPow10 } = opts;
|
|
140
146
|
const prefix = prefixes[prefixIndex];
|
|
141
147
|
return isToPow10 ? prefix.texPow10 : prefix.texValue;
|
|
142
148
|
};
|
|
143
|
-
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
144
|
-
const
|
|
149
|
+
const getPropositions = (n, { answer, ...identifiers }, optsIn) => {
|
|
150
|
+
const opts = optsIn ?? optsDefault;
|
|
151
|
+
const { prefixIndexesPool, prefixIndex } = identifiers;
|
|
152
|
+
const { isToPow10 } = opts;
|
|
145
153
|
const propositions = [];
|
|
146
154
|
addValidProp(propositions, answer);
|
|
147
155
|
const wrongIndexesPool = prefixIndexesPool.filter((i) => i !== prefixIndex);
|
|
@@ -162,7 +170,7 @@ const isAnswerValid = (ans, { answer }) => {
|
|
|
162
170
|
const nodeAnswer = parseAlgebraic(answer);
|
|
163
171
|
return substract(nodeAns, nodeAnswer).evaluate() === 0;
|
|
164
172
|
};
|
|
165
|
-
const
|
|
173
|
+
const optsDefault = {
|
|
166
174
|
prefixPool: prefixes.map((prefix) => prefix.name),
|
|
167
175
|
isToPow10: true,
|
|
168
176
|
isFromSymbol: true,
|
|
@@ -174,25 +182,25 @@ const options = [
|
|
|
174
182
|
type: GeneratorOptionType.multiselect,
|
|
175
183
|
target: GeneratorOptionTarget.generation,
|
|
176
184
|
values: prefixes.map((prefix) => prefix.name),
|
|
177
|
-
defaultValue:
|
|
185
|
+
defaultValue: optsDefault.prefixPool,
|
|
178
186
|
},
|
|
179
187
|
{
|
|
180
188
|
id: "isToPow10",
|
|
181
189
|
label: "Réponse sous forme de puissance de 10 ?",
|
|
182
190
|
type: GeneratorOptionType.checkbox,
|
|
183
191
|
target: GeneratorOptionTarget.generation,
|
|
184
|
-
defaultValue:
|
|
192
|
+
defaultValue: optsDefault.isToPow10,
|
|
185
193
|
},
|
|
186
194
|
{
|
|
187
|
-
id: "
|
|
195
|
+
id: "isFromSymbol",
|
|
188
196
|
label: "Utiliser le symbole pour la question ?",
|
|
189
197
|
type: GeneratorOptionType.checkbox,
|
|
190
198
|
target: GeneratorOptionTarget.generation,
|
|
191
|
-
defaultValue:
|
|
199
|
+
defaultValue: optsDefault.isFromSymbol,
|
|
192
200
|
},
|
|
193
201
|
];
|
|
194
202
|
const getPrefixToNumberQuestion = (optsIn) => {
|
|
195
|
-
const opts = optsIn
|
|
203
|
+
const opts = optsIn ?? optsDefault;
|
|
196
204
|
const prefixIndexesPool = opts.prefixPool.map((prefixName) => {
|
|
197
205
|
const prefixIndex = (() => {
|
|
198
206
|
for (let i = 0; i < prefixes.length; i++) {
|
|
@@ -201,15 +209,11 @@ const getPrefixToNumberQuestion = (optsIn) => {
|
|
|
201
209
|
}
|
|
202
210
|
})();
|
|
203
211
|
return prefixIndex;
|
|
204
|
-
})
|
|
212
|
+
});
|
|
205
213
|
const prefixIndex = random(prefixIndexesPool);
|
|
206
|
-
const isFromSymbol = optsIn?.isFromSymbol ?? optionsDefault.isFromSymbol;
|
|
207
|
-
const isToPow10 = optsIn?.isToPow10 ?? optionsDefault.isToPow10;
|
|
208
214
|
const identifiers = {
|
|
209
215
|
prefixIndexesPool,
|
|
210
216
|
prefixIndex,
|
|
211
|
-
isFromSymbol,
|
|
212
|
-
isToPow10,
|
|
213
217
|
};
|
|
214
218
|
return getQuestionFromIdentifiers(identifiers, optsIn);
|
|
215
219
|
};
|
|
@@ -220,8 +224,9 @@ const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
|
220
224
|
keys: [],
|
|
221
225
|
answerFormat: "tex",
|
|
222
226
|
identifiers,
|
|
223
|
-
hint: getHint(identifiers),
|
|
224
|
-
correction: getCorrection(identifiers),
|
|
227
|
+
hint: getHint(identifiers, opts),
|
|
228
|
+
correction: getCorrection(identifiers, opts),
|
|
229
|
+
options: opts,
|
|
225
230
|
};
|
|
226
231
|
return question;
|
|
227
232
|
};
|
|
@@ -230,7 +235,7 @@ export const prefixToNumber = {
|
|
|
230
235
|
connector: "=",
|
|
231
236
|
label: "Convertir un préfixe en nombre",
|
|
232
237
|
isSingleStep: true,
|
|
233
|
-
generator: (nb, opts) => getDistinctQuestions(() => getPrefixToNumberQuestion(opts), nb, 10),
|
|
238
|
+
generator: (nb, opts) => getDistinctQuestions(() => getPrefixToNumberQuestion(opts), nb, 10, () => false),
|
|
234
239
|
maxAllowedQuestions: 10,
|
|
235
240
|
qcmTimer: 60,
|
|
236
241
|
freeTimer: 60,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawAffineFromPointAndLeadingCoeff.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAOtC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAI7C,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,YAAY,EAAE,eAAe,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;
|
|
1
|
+
{"version":3,"file":"drawAffineFromPointAndLeadingCoeff.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAOtC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAI7C,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,YAAY,EAAE,eAAe,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAmJF,KAAK,OAAO,GAAG;IACb,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AA4FF,eAAO,MAAM,kCAAkC,EAAE,QAAQ,CACvD,WAAW,EACX,OAAO,CAqBR,CAAC"}
|
|
@@ -51,8 +51,7 @@ const getInstruction = (identifiers) => {
|
|
|
51
51
|
const pointA = PointConstructor.fromIdentifiers(pointIdsA);
|
|
52
52
|
const coeff = NodeConstructor.fromIdentifiers(leadingCoeff);
|
|
53
53
|
const texCoeff = numberType === "Fraction" ? coeff.toTex() : coeff.evaluate().frenchify();
|
|
54
|
-
return `La fonction $${funcName}$
|
|
55
|
-
$ ${funcName}(${pointA.x.toTex()}) = ${pointA.y.toTex()} $.
|
|
54
|
+
return `La fonction affine $${funcName}$ a pour représentation graphique une droite de coefficient directeur $${texCoeff}$ et qui passe par le point de coordonnées $\\left(${pointA.x.toTex()}; ${pointA.y.toTex()}\\right)$.
|
|
56
55
|
|
|
57
56
|
Dans le repère, tracer la représentation graphique de la fonction $${funcName}$.`;
|
|
58
57
|
};
|
|
@@ -11,6 +11,7 @@ export * from "./readAbscissOnLine.js";
|
|
|
11
11
|
export * from "./readAbscissOnSemiLine.js";
|
|
12
12
|
export * from "./placeAbscissOnLine.js";
|
|
13
13
|
export * from "./placeAbscissOnSemiLine.js";
|
|
14
|
+
export * from "./placeAbscissOnSemiLineV2.js";
|
|
14
15
|
export * from "./cartesianFromVectorAndPoint.js";
|
|
15
16
|
export * from "./cartesianFromTwoPoints.js";
|
|
16
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oCAAoC,CAAC;AAEnD,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oCAAoC,CAAC;AAEnD,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC"}
|
|
@@ -12,5 +12,6 @@ export * from "./readAbscissOnLine.js";
|
|
|
12
12
|
export * from "./readAbscissOnSemiLine.js";
|
|
13
13
|
export * from "./placeAbscissOnLine.js";
|
|
14
14
|
export * from "./placeAbscissOnSemiLine.js";
|
|
15
|
+
export * from "./placeAbscissOnSemiLineV2.js";
|
|
15
16
|
export * from "./cartesianFromVectorAndPoint.js";
|
|
16
17
|
export * from "./cartesianFromTwoPoints.js";
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
2
|
import { NumberType } from "../../../../math/numbers/nombre.js";
|
|
3
|
-
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
|
|
4
3
|
type Identifiers = {
|
|
5
4
|
abscissType: NumberType;
|
|
6
|
-
axisUnit:
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
axisUnit: number;
|
|
6
|
+
oneUnitTex: string;
|
|
7
|
+
absciss: number;
|
|
8
|
+
abscissTex: string;
|
|
9
|
+
coeff: number;
|
|
9
10
|
};
|
|
10
|
-
|
|
11
|
-
questionType: "standard" | "éviter le comptage";
|
|
12
|
-
numberType: "Entiers" | "Rationnels" | "Décimaux";
|
|
13
|
-
};
|
|
14
|
-
export declare const placeAbscissOnSemiLine: Exercise<Identifiers, Options>;
|
|
11
|
+
export declare const placeAbscissOnSemiLine: Exercise<Identifiers>;
|
|
15
12
|
export {};
|
|
16
13
|
//# sourceMappingURL=placeAbscissOnSemiLine.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"placeAbscissOnSemiLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"placeAbscissOnSemiLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAQ1D,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,UAAU,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AA6IF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAWxD,CAAC"}
|