math-exercises 2.0.17 → 2.0.18
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/functions/affines/index.d.ts +1 -0
- package/lib/exercises/functions/affines/index.d.ts.map +1 -1
- package/lib/exercises/functions/affines/index.js +1 -0
- package/lib/exercises/functions/affines/interceptReading.d.ts +8 -0
- package/lib/exercises/functions/affines/interceptReading.d.ts.map +1 -0
- package/lib/exercises/functions/affines/interceptReading.js +58 -0
- package/lib/exercises/limits/limitReading.js +1 -1
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/affines/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/affines/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC"}
|
|
@@ -19,3 +19,4 @@ __exportStar(require("./leadingCoefficientCalculV1"), exports);
|
|
|
19
19
|
__exportStar(require("./leadingCoefficientCalculV2"), exports);
|
|
20
20
|
__exportStar(require("./signFunction"), exports);
|
|
21
21
|
__exportStar(require("./affineExpressionReading"), exports);
|
|
22
|
+
__exportStar(require("./interceptReading"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interceptReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/affines/interceptReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAalC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AA+CF,eAAO,MAAM,gBAAgB,EAAE,YAAY,CAAC,WAAW,CAatD,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.interceptReading = 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 getInterceptReadingQuestion = () => {
|
|
8
|
+
const b = (0, randint_1.randint)(-5, 6);
|
|
9
|
+
const secondPoint = [(0, randint_1.randint)(-5, 6, [0]), (0, randint_1.randint)(-5, 6)];
|
|
10
|
+
const answer = b + "";
|
|
11
|
+
let xMin = Math.min(0, secondPoint[0]);
|
|
12
|
+
if (xMin > 0)
|
|
13
|
+
xMin = -0.5;
|
|
14
|
+
let xMax = Math.max(0, secondPoint[0]);
|
|
15
|
+
if (xMax < 0)
|
|
16
|
+
xMax = 0.5;
|
|
17
|
+
let yMin = Math.min(b, secondPoint[1]);
|
|
18
|
+
if (yMin > 0)
|
|
19
|
+
yMin = -0.5;
|
|
20
|
+
let yMax = Math.max(b, secondPoint[1]);
|
|
21
|
+
if (yMax < 0)
|
|
22
|
+
yMax = 0.5;
|
|
23
|
+
const coords = [xMin - 1, xMax + 1, yMin - 1, yMax + 1];
|
|
24
|
+
const question = {
|
|
25
|
+
answer,
|
|
26
|
+
instruction: `Ci-dessous est tracée la courbe représentative d'une fonction affine $f$. Déterminer graphiquement l'ordonnée à l'origine $b$ de la fonction $f$.`,
|
|
27
|
+
keys: [],
|
|
28
|
+
commands: [`Line((0, ${b}), (${secondPoint[0]}, ${secondPoint[1]}))`],
|
|
29
|
+
coords,
|
|
30
|
+
answerFormat: "tex",
|
|
31
|
+
identifiers: { b, secondPoint },
|
|
32
|
+
};
|
|
33
|
+
return question;
|
|
34
|
+
};
|
|
35
|
+
const getPropositions = (n, { answer, b, secondPoint }) => {
|
|
36
|
+
const propositions = [];
|
|
37
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
38
|
+
while (propositions.length < n) {
|
|
39
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, randint_1.randint)(-5, 6) + "");
|
|
40
|
+
}
|
|
41
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
42
|
+
};
|
|
43
|
+
const isAnswerValid = (ans, { answer, secondPoint, b }) => {
|
|
44
|
+
return ans === answer;
|
|
45
|
+
};
|
|
46
|
+
exports.interceptReading = {
|
|
47
|
+
id: "interceptReading",
|
|
48
|
+
connector: "=",
|
|
49
|
+
label: "Lire graphiquement l'ordonnée à l'origine",
|
|
50
|
+
levels: ["2nde", "1reESM", "1rePro", "1reSpé", "1reTech"],
|
|
51
|
+
isSingleStep: true,
|
|
52
|
+
sections: ["Droites", "Fonctions affines"],
|
|
53
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getInterceptReadingQuestion, nb),
|
|
54
|
+
qcmTimer: 60,
|
|
55
|
+
freeTimer: 60,
|
|
56
|
+
getPropositions,
|
|
57
|
+
isAnswerValid,
|
|
58
|
+
};
|
|
@@ -72,7 +72,7 @@ const getLimitReadingQuestion = () => {
|
|
|
72
72
|
const question = {
|
|
73
73
|
answer,
|
|
74
74
|
instruction: `Ci-dessous est tracée la courbe représentative d'une fonction $f$. Déterminer la limite: $\\displaystyle ${new limitNode_1.LimitNode(to, new variableNode_1.VariableNode("f(x)"), from).toTex()}$`,
|
|
75
|
-
keys: [],
|
|
75
|
+
keys: ["infty"],
|
|
76
76
|
commands: [fct],
|
|
77
77
|
coords: [-10, 10, -10, 10],
|
|
78
78
|
answerFormat: "tex",
|
package/lib/index.d.ts
CHANGED
|
@@ -330,6 +330,9 @@ declare const mathExercises: (import("./exercises/exercise").MathExercise<{
|
|
|
330
330
|
}> | import("./exercises/exercise").MathExercise<{
|
|
331
331
|
b: number;
|
|
332
332
|
secondPoint: number[];
|
|
333
|
+
}> | import("./exercises/exercise").MathExercise<{
|
|
334
|
+
b: number;
|
|
335
|
+
secondPoint: number[];
|
|
333
336
|
}> | import("./exercises/exercise").MathExercise<{
|
|
334
337
|
rand: boolean;
|
|
335
338
|
poly1: number[];
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAqCA,QAAA,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAqCA,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA2B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,CAAC"}
|