math-exercises 2.2.62 → 2.2.64

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.
Files changed (27) hide show
  1. package/lib/exercises/math/derivation/tangent/derivativeTangentEquationReading.d.ts.map +1 -1
  2. package/lib/exercises/math/derivation/tangent/derivativeTangentEquationReading.js +6 -1
  3. package/lib/exercises/math/functions/basics/graphicInequationAffine.d.ts.map +1 -1
  4. package/lib/exercises/math/functions/basics/graphicInequationAffine.js +2 -1
  5. package/lib/exercises/math/functions/square/squareImageInterval.js +1 -1
  6. package/lib/exercises/math/functions/trinoms/findSecondRoot.js +1 -1
  7. package/lib/exercises/math/functions/trinoms/rootsSum.js +2 -2
  8. package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts.map +1 -1
  9. package/lib/exercises/math/probaStat/stats1var/averageList.d.ts.map +1 -1
  10. package/lib/exercises/math/probaStat/stats1var/averageList.js +2 -1
  11. package/lib/index.d.ts +539 -538
  12. package/lib/index.d.ts.map +1 -1
  13. package/lib/math/geometry/triangle.d.ts.map +1 -1
  14. package/lib/math/geometry/triangle.js +5 -0
  15. package/lib/playground.d.ts.map +1 -1
  16. package/lib/playground.js +10 -4
  17. package/lib/tree/nodes/node.d.ts +2 -0
  18. package/lib/tree/nodes/node.d.ts.map +1 -1
  19. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  20. package/lib/tree/nodes/operators/fractionNode.js +5 -0
  21. package/lib/tree/nodes/sets/intervalNode.d.ts +1 -0
  22. package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
  23. package/lib/tree/nodes/sets/intervalNode.js +20 -6
  24. package/lib/tree/parsers/latexParser.js +1 -0
  25. package/lib/tree/parsers/rationalParser.d.ts.map +1 -1
  26. package/lib/tree/parsers/rationalParser.js +4 -0
  27. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"derivativeTangentEquationReading.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/tangent/derivativeTangentEquationReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAiBlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,GAAG,CAAC;IACb,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAyPF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CAmBlE,CAAC;;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG"}
1
+ {"version":3,"file":"derivativeTangentEquationReading.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/tangent/derivativeTangentEquationReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAwBlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,GAAG,CAAC;IACb,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AA+PF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CAmBlE,CAAC;;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG"}
@@ -64,8 +64,13 @@ const getAnswerTree = ({ xA, yA, yPrimeA }) => {
64
64
  const pente = new multiplyNode_1.MultiplyNode(yPrimeTree, "x".toTree());
65
65
  //f(a)-f'(a)a
66
66
  const b = new substractNode_1.SubstractNode(yA.toTree(), new multiplyNode_1.MultiplyNode(yPrimeTree, xA.toTree())).simplify();
67
- const ansTree = new addNode_1.AddNode(pente, b).simplify({
67
+ // const yPrimeTree = frac(-3, 2);
68
+ // const pente = multiply(yPrimeTree, "x");
69
+ // //f(a)-f'(a)a
70
+ // const b = substract((-2).toTree(), multiply(yPrimeTree, -3)).simplify();
71
+ const ansTree = (0, addNode_1.add)(pente, b).simplify({
68
72
  forceDistributeFractions: true,
73
+ forbidFactorize: true,
69
74
  });
70
75
  return ansTree;
71
76
  };
@@ -1 +1 @@
1
- {"version":3,"file":"graphicInequationAffine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/graphicInequationAffine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAa3C,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,gBAAgB,CAAC;IAClC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAsHF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAiBzD,CAAC"}
1
+ {"version":3,"file":"graphicInequationAffine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/graphicInequationAffine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAa3C,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,gBAAgB,CAAC;IAClC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAsHF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAkBzD,CAAC"}
@@ -22,7 +22,7 @@ const getPropositions = (n, { answer }) => {
22
22
  const bounds = isTowardsLeft
23
23
  ? [infiniteNode_1.MinusInfinityNode, k]
24
24
  : [k, infiniteNode_1.PlusInfinityNode];
25
- const closure = closure_1.Closure.fromBrackets(isTowardsLeft ? "]" : "[", (0, random_1.random)(["]", "["]));
25
+ const closure = closure_1.Closure.fromBrackets(isTowardsLeft ? "]" : (0, random_1.random)(["]", "["]), isTowardsLeft ? (0, random_1.random)(["]", "["]) : "[");
26
26
  (0, exercise_1.tryToAddWrongProp)(propositions, new intervalNode_1.IntervalNode(bounds[0], bounds[1], closure).toTex());
27
27
  }
28
28
  return (0, exercise_1.shuffleProps)(propositions, n);
@@ -120,4 +120,5 @@ exports.graphicInequationAffine = {
120
120
  getInstruction,
121
121
  getAnswer,
122
122
  getGGBOptions,
123
+ hasGeogebra: true,
123
124
  };
@@ -92,7 +92,7 @@ const getPropositions = (n, { answer, a, b, type, closure }) => {
92
92
  };
93
93
  const isAnswerValid = (ans, { answer, a, b, closure, type }) => {
94
94
  const interval = getAnswer(a, b, type, closure);
95
- const texs = interval.toAllValidTexs();
95
+ const texs = interval.toAllValidTexs({ allowCommaInInterval: true });
96
96
  return texs.includes(ans);
97
97
  };
98
98
  exports.squareImageInterval = {
@@ -80,7 +80,7 @@ const getFindSecondRootQuestion = (ops) => {
80
80
  // const firstRoot = coinFlip()
81
81
  // ? randint(-10, 10).toTree()
82
82
  // : RationalConstructor.randomIrreductibleWithSign(5).toTree();
83
- const firstRoot = (0, randint_1.randint)(-10, 10);
83
+ const firstRoot = (0, randint_1.randint)(-10, 10, [0]);
84
84
  // const secondRoot = doWhile(
85
85
  // () =>
86
86
  // coinFlip()
@@ -41,7 +41,7 @@ On admet que $f$ possède deux racines.
41
41
  Que vaut la somme des racines de $f$ ?`;
42
42
  };
43
43
  const getHint = (identifiers) => {
44
- return `Si $f(x) = ax^2 + bx + c$ admet deux racines, alors leur produit vaut :
44
+ return `Si $f(x) = ax^2 + bx + c$ admet deux racines, alors leur somme vaut :
45
45
 
46
46
  $$
47
47
  S = -\\frac{b}{a}
@@ -53,7 +53,7 @@ const getCorrection = (identifiers) => {
53
53
  const aTex = trinom.a.toTex();
54
54
  const bTex = trinom.b.toTex();
55
55
  const ans = (0, fractionNode_1.frac)((0, oppositeNode_1.opposite)(trinom.b), trinom.a);
56
- return `Si $f(x) = ax^2 + bx + c$ admet deux racines, alors leur smomme $S$ vaut :
56
+ return `Si $f(x) = ax^2 + bx + c$ admet deux racines, alors leur somme $S$ vaut :
57
57
 
58
58
  $$
59
59
  S = \\frac{c}{a}
@@ -1 +1 @@
1
- {"version":3,"file":"thalesCalcul.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/thales/thalesCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAqBT,MAAM,0BAA0B,CAAC;AASlC,OAAO,EAAoB,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAGL,kBAAkB,EACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAGL,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAUtC,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,uBAAuB,EAAE,gBAAgB,EAAE,CAAC;IAC5C,YAAY,EAAE,kBAAkB,CAAC;IACjC,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAsKF,KAAK,OAAO,GAAG;IACb,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAiEF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAwBvD,CAAC"}
1
+ {"version":3,"file":"thalesCalcul.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/thales/thalesCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAqBT,MAAM,0BAA0B,CAAC;AASlC,OAAO,EAAoB,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAGL,kBAAkB,EACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAGL,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAUtC,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,uBAAuB,EAAE,gBAAgB,EAAE,CAAC;IAC5C,YAAY,EAAE,kBAAkB,CAAC;IACjC,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAsKF,KAAK,OAAO,GAAG;IACb,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAmEF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAwBvD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"averageList.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/averageList.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AA0EF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAe7C,CAAC"}
1
+ {"version":3,"file":"averageList.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/averageList.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AA0EF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAe7C,CAAC"}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.averageList = void 0;
4
4
  const exercise_1 = require("../../../../exercises/exercise");
5
5
  const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const numberVEA_1 = require("../../../../exercises/vea/numberVEA");
6
7
  const randfloat_1 = require("../../../../math/utils/random/randfloat");
7
8
  const randint_1 = require("../../../../math/utils/random/randint");
8
9
  const round_1 = require("../../../../math/utils/round");
@@ -62,7 +63,7 @@ const getPropositions = (n, { answer, sortedValues }) => {
62
63
  return (0, exercise_1.shuffleProps)(propositions, n);
63
64
  };
64
65
  const isAnswerValid = (ans, { answer }) => {
65
- return ans === answer;
66
+ return (0, numberVEA_1.numberVEA)(ans, answer);
66
67
  };
67
68
  exports.averageList = {
68
69
  id: "averageList",