math-exercises 2.0.36 → 2.0.37

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.
@@ -1 +1 @@
1
- {"version":3,"file":"secondDegreeDerivative.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/secondDegreeDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAEZ,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAGJ,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,iBAAiB,CAAC,WAAW,CAgBpE,CAAC;AAEF,eAAO,MAAM,qCAAqC,EAAE,YAAY,CAC9D,WAAW,CA4BZ,CAAC;AACF,eAAO,MAAM,mCAAmC,EAAE,GAAG,CAAC,WAAW,CAShE,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,YAAY,CAAC,WAAW,CAqB5D,CAAC"}
1
+ {"version":3,"file":"secondDegreeDerivative.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/secondDegreeDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAEZ,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAGJ,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,iBAAiB,CAAC,WAAW,CAkBpE,CAAC;AAEF,eAAO,MAAM,qCAAqC,EAAE,YAAY,CAC9D,WAAW,CA+BZ,CAAC;AACF,eAAO,MAAM,mCAAmC,EAAE,GAAG,CAAC,WAAW,CAShE,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,YAAY,CAAC,WAAW,CAqB5D,CAAC"}
@@ -12,7 +12,9 @@ const getSecondDegreeDerivative = () => {
12
12
  const derivative = polynomial.derivate();
13
13
  const answer = derivative.toTree().toTex();
14
14
  const question = {
15
- instruction: `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par $f(x) = ${polynomial.toString()}$.`,
15
+ instruction: `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par $f(x) = ${polynomial
16
+ .toTree()
17
+ .toTex()}$.`,
16
18
  startStatement: `f'(x)`,
17
19
  answer,
18
20
  keys: ["x"],
@@ -38,7 +40,7 @@ const getSecondDegreeDerivativePropositions = (n, { answer, coefficients }) => {
38
40
  coefficients[2] + (0, randint_1.randint)(-3, 4, [0, -coefficients[2]]),
39
41
  ];
40
42
  const randomPolynomial = new polynomial_1.Polynomial(randomCoefficients);
41
- (0, exercise_1.tryToAddWrongProp)(propositions, randomPolynomial.derivate().toString());
43
+ (0, exercise_1.tryToAddWrongProp)(propositions, randomPolynomial.derivate().toTree().toTex());
42
44
  }
43
45
  return (0, shuffle_1.shuffle)(propositions);
44
46
  };
@@ -1 +1 @@
1
- {"version":3,"file":"thirdDegreeDerivative.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/thirdDegreeDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAEZ,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAIJ,MAAM,0BAA0B,CAAC;AAKlC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,iBAAiB,CAAC,WAAW,CAoBnE,CAAC;AAEF,eAAO,MAAM,oCAAoC,EAAE,YAAY,CAAC,WAAW,CAqC1E,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE,GAAG,CAAC,WAAW,CAS/D,CAAC;AACF,eAAO,MAAM,qBAAqB,EAAE,YAAY,CAAC,WAAW,CAoB3D,CAAC"}
1
+ {"version":3,"file":"thirdDegreeDerivative.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/thirdDegreeDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAEZ,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAIJ,MAAM,0BAA0B,CAAC;AAKlC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,iBAAiB,CAAC,WAAW,CAsBnE,CAAC;AAEF,eAAO,MAAM,oCAAoC,EAAE,YAAY,CAAC,WAAW,CAqC1E,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE,GAAG,CAAC,WAAW,CAS/D,CAAC;AACF,eAAO,MAAM,qBAAqB,EAAE,YAAY,CAAC,WAAW,CAoB3D,CAAC"}
@@ -14,7 +14,9 @@ const getThirdDegreeDerivative = () => {
14
14
  const derivative = polynomial.derivate();
15
15
  const answer = derivative.toTree().toTex();
16
16
  const question = {
17
- instruction: `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par $f(x) = ${polynomial.toString()}$.`,
17
+ instruction: `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par $f(x) = ${polynomial
18
+ .toTree()
19
+ .toTex()}$.`,
18
20
  startStatement: `f'(x)`,
19
21
  answer: answer,
20
22
  keys: ["x"],
@@ -1 +1 @@
1
- {"version":3,"file":"arithmeticExplicitFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/arithmetic/arithmeticExplicitFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA2CF,eAAO,MAAM,8BAA8B,EAAE,YAAY,CAAC,WAAW,CAapE,CAAC"}
1
+ {"version":3,"file":"arithmeticExplicitFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/arithmetic/arithmeticExplicitFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA6CF,eAAO,MAAM,8BAA8B,EAAE,YAAY,CAAC,WAAW,CAapE,CAAC"}
@@ -13,7 +13,9 @@ const getArithmeticExplicitFormulaUsage = () => {
13
13
  const polynomial = new polynomial_1.Polynomial([firstValue, reason], "n");
14
14
  const answer = (firstValue + askedRank * reason).toString();
15
15
  const question = {
16
- instruction: `$(u_n)$ est une suite arithmétique définie par $u_n = ${polynomial.toString()}$. Calculer : $u_{${askedRank}}$`,
16
+ instruction: `$(u_n)$ est une suite arithmétique définie par $u_n = ${polynomial
17
+ .toTree()
18
+ .toTex()}$. Calculer : $u_{${askedRank}}$`,
17
19
  startStatement: `u_{${askedRank}}`,
18
20
  answer,
19
21
  keys: ["r", "n", "u", "underscore"],
@@ -1 +1 @@
1
- {"version":3,"file":"arithmeticFindExplicitFormula.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/arithmetic/arithmeticFindExplicitFormula.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAmDF,eAAO,MAAM,6BAA6B,EAAE,YAAY,CAAC,WAAW,CAanE,CAAC"}
1
+ {"version":3,"file":"arithmeticFindExplicitFormula.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/arithmetic/arithmeticFindExplicitFormula.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAqDF,eAAO,MAAM,6BAA6B,EAAE,YAAY,CAAC,WAAW,CAanE,CAAC"}
@@ -27,7 +27,9 @@ const getPropositions = (n, { answer, firstValue, reason }) => {
27
27
  const propositions = [];
28
28
  (0, exercise_1.addValidProp)(propositions, answer);
29
29
  while (propositions.length < n) {
30
- (0, exercise_1.tryToAddWrongProp)(propositions, new polynomial_1.Polynomial([firstValue + (0, randint_1.randint)(-3, 4), reason + (0, randint_1.randint)(-3, 4, [-reason])], "n").toString());
30
+ (0, exercise_1.tryToAddWrongProp)(propositions, new polynomial_1.Polynomial([firstValue + (0, randint_1.randint)(-3, 4), reason + (0, randint_1.randint)(-3, 4, [-reason])], "n")
31
+ .toTree()
32
+ .toTex());
31
33
  }
32
34
  return (0, shuffle_1.shuffle)(propositions);
33
35
  };
@@ -1 +1 @@
1
- {"version":3,"file":"arithmeticThresholdFind.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/arithmetic/arithmeticThresholdFind.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,YAAY,EAQb,MAAM,gBAAgB,CAAC;AAGxB,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAqDF,eAAO,MAAM,uBAAuB,EAAE,YAAY,CAAC,WAAW,CAa7D,CAAC"}
1
+ {"version":3,"file":"arithmeticThresholdFind.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/arithmetic/arithmeticThresholdFind.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,YAAY,EAQb,MAAM,gBAAgB,CAAC;AAGxB,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAuDF,eAAO,MAAM,uBAAuB,EAAE,YAAY,CAAC,WAAW,CAa7D,CAAC"}
@@ -11,7 +11,9 @@ const getArithmeticThresholdFind = () => {
11
11
  const reason = (0, randint_1.randint)(-10, 10, [0]);
12
12
  let randValue = firstValue;
13
13
  const formula = new polynomial_1.Polynomial([firstValue, reason], "n");
14
- let instruction = `$(u_n)$ est une suite arithmétique définie par $u_n = ${formula.toString()}$. `;
14
+ let instruction = `$(u_n)$ est une suite arithmétique définie par $u_n = ${formula
15
+ .toTree()
16
+ .toTex()}$. `;
15
17
  if (reason > 0) {
16
18
  randValue += (0, randint_1.randint)(reason, 100);
17
19
  instruction += `À partir de quel rang $n$ a-t-on $u_n > ${randValue}$ ?`;
package/lib/server.js CHANGED
@@ -51,6 +51,7 @@ const runServer = () => {
51
51
  dotenv_1.default.config();
52
52
  const app = (0, express_1.default)();
53
53
  app.use((0, cors_1.default)());
54
+ console.log(exercises.length);
54
55
  app.get("/", (req, res) => {
55
56
  res.json(allExercises);
56
57
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "math-exercises",
3
- "version": "2.0.36",
3
+ "version": "2.0.37",
4
4
  "description": "Math exercises generator for middle school and high school",
5
5
  "main": "lib/index.js",
6
6
  "files": [