math-exercises 2.0.16 → 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.
@@ -3,4 +3,5 @@ export * from "./leadingCoefficientCalculV1";
3
3
  export * from "./leadingCoefficientCalculV2";
4
4
  export * from "./signFunction";
5
5
  export * from "./affineExpressionReading";
6
+ export * from "./interceptReading";
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -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,8 @@
1
+ import { MathExercise } from "../../../exercises/exercise";
2
+ type Identifiers = {
3
+ b: number;
4
+ secondPoint: number[];
5
+ };
6
+ export declare const interceptReading: MathExercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=interceptReading.d.ts.map
@@ -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
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"secondDegreeInequation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/trinoms/secondDegreeInequation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAa3C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,gBAAgB,CAAC;CAC5B,CAAC;AAgHF,eAAO,MAAM,sBAAsB,EAAE,YAAY,CAAC,WAAW,CAa5D,CAAC"}
1
+ {"version":3,"file":"secondDegreeInequation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/trinoms/secondDegreeInequation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAa3C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,gBAAgB,CAAC;CAC5B,CAAC;AAyHF,eAAO,MAAM,sBAAsB,EAAE,YAAY,CAAC,WAAW,CAa5D,CAAC"}
@@ -44,7 +44,16 @@ const getSecondDegreeInequationQuestion = () => {
44
44
  instruction: `Soit $f(x) = ${trinom
45
45
  .toTree()
46
46
  .toTex()}$. Résoudre l'inéquation $f(x) ${ineqType.symbol} 0$.`,
47
- keys: ["S", "equal", "lbracket", "semicolon", "rbracket", "cup"],
47
+ keys: [
48
+ "S",
49
+ "equal",
50
+ "lbracket",
51
+ "semicolon",
52
+ "rbracket",
53
+ "cup",
54
+ "infty",
55
+ "emptyset",
56
+ ],
48
57
  answerFormat: "tex",
49
58
  identifiers: {
50
59
  a: trinom.a,
@@ -27,7 +27,7 @@ const getScalarProductViaCosQuestion = () => {
27
27
  const question = {
28
28
  answer,
29
29
  instruction: `Soient trois points $${letterA}$, $${letterB}$ et $${letterC}$ tels que $${letterA}${letterB} = ${AB}$, $${letterA}${letterC}= ${AC}$, et $\\widehat{${letterB}${letterA}${letterC}} = ${trigo.angle.toTex()}$. Calculer $\\overrightarrow{${letterA}${letterB}}\\cdot \\overrightarrow{${letterA}${letterC}}$.`,
30
- keys: [],
30
+ keys: ["pi"],
31
31
  answerFormat: "tex",
32
32
  identifiers: { AB, AC, trigoPoint: trigo.point },
33
33
  };
@@ -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[];
@@ -1 +1 @@
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"}
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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "math-exercises",
3
- "version": "2.0.16",
3
+ "version": "2.0.18",
4
4
  "description": "Math exercises generator for middle school and high school",
5
5
  "main": "lib/index.js",
6
6
  "files": [