math-exercises 2.2.49 → 2.2.50

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 (114) hide show
  1. package/lib/exercises/exercise.d.ts +6 -1
  2. package/lib/exercises/exercise.d.ts.map +1 -1
  3. package/lib/exercises/exercise.js +1 -0
  4. package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSubNoRelative.d.ts.map +1 -1
  5. package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSubNoRelative.js +2 -1
  6. package/lib/exercises/math/calcul/mentalCaluls/mentalPercentage.d.ts.map +1 -1
  7. package/lib/exercises/math/calcul/mentalCaluls/mentalPercentage.js +2 -4
  8. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.d.ts.map +1 -1
  9. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.js +8 -0
  10. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.d.ts.map +1 -1
  11. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.js +8 -0
  12. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq3.d.ts.map +1 -1
  13. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq3.js +10 -0
  14. package/lib/exercises/math/conversion/lengthConversion.d.ts +4 -1
  15. package/lib/exercises/math/conversion/lengthConversion.d.ts.map +1 -1
  16. package/lib/exercises/math/conversion/lengthConversion.js +60 -19
  17. package/lib/exercises/math/conversion/massConversion.d.ts.map +1 -1
  18. package/lib/exercises/math/conversion/massConversion.js +5 -1
  19. package/lib/exercises/math/functions/trinoms/index.d.ts +1 -0
  20. package/lib/exercises/math/functions/trinoms/index.d.ts.map +1 -1
  21. package/lib/exercises/math/functions/trinoms/index.js +1 -0
  22. package/lib/exercises/math/functions/trinoms/trinomSignFromRoots.d.ts +8 -0
  23. package/lib/exercises/math/functions/trinoms/trinomSignFromRoots.d.ts.map +1 -0
  24. package/lib/exercises/math/functions/trinoms/trinomSignFromRoots.js +114 -0
  25. package/lib/exercises/math/geometry/cartesian/readAbscissOnLine.js +1 -1
  26. package/lib/exercises/math/geometry/parametric/pointFromParametricLine.js +3 -3
  27. package/lib/exercises/math/geometry/volumes/coneVolume.d.ts.map +1 -1
  28. package/lib/exercises/math/geometry/volumes/coneVolume.js +5 -3
  29. package/lib/exercises/math/probaStat/probaFromTableWithContext.js +2 -2
  30. package/lib/exercises/math/squareRoots/squareRootIdentities.js +3 -3
  31. package/lib/exercises/vea/numberVEA.d.ts +2 -0
  32. package/lib/exercises/vea/numberVEA.d.ts.map +1 -0
  33. package/lib/exercises/vea/numberVEA.js +11 -0
  34. package/lib/index.d.ts +6 -1
  35. package/lib/index.d.ts.map +1 -1
  36. package/lib/math/geometry/parametricLine.js +0 -1
  37. package/lib/math/polynomials/affine.d.ts.map +1 -1
  38. package/lib/math/polynomials/affine.js +3 -1
  39. package/lib/math/polynomials/generalTrinom.d.ts +52 -0
  40. package/lib/math/polynomials/generalTrinom.d.ts.map +1 -0
  41. package/lib/math/polynomials/generalTrinom.js +102 -0
  42. package/lib/math/polynomials/trinom.d.ts +5 -1
  43. package/lib/math/polynomials/trinom.d.ts.map +1 -1
  44. package/lib/math/polynomials/trinom.js +9 -4
  45. package/lib/playground.js +5 -4
  46. package/lib/tree/nodes/algebraicNode.d.ts +1 -1
  47. package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
  48. package/lib/tree/nodes/functions/absNode.d.ts +1 -1
  49. package/lib/tree/nodes/functions/absNode.d.ts.map +1 -1
  50. package/lib/tree/nodes/functions/arcSinNode.d.ts +1 -1
  51. package/lib/tree/nodes/functions/arcSinNode.d.ts.map +1 -1
  52. package/lib/tree/nodes/functions/arccosNode.d.ts +1 -1
  53. package/lib/tree/nodes/functions/arccosNode.d.ts.map +1 -1
  54. package/lib/tree/nodes/functions/arctanNode.d.ts +1 -1
  55. package/lib/tree/nodes/functions/arctanNode.d.ts.map +1 -1
  56. package/lib/tree/nodes/functions/cosNode.d.ts +1 -1
  57. package/lib/tree/nodes/functions/cosNode.d.ts.map +1 -1
  58. package/lib/tree/nodes/functions/expNode.d.ts +1 -1
  59. package/lib/tree/nodes/functions/expNode.d.ts.map +1 -1
  60. package/lib/tree/nodes/functions/log10Node.d.ts +1 -1
  61. package/lib/tree/nodes/functions/log10Node.d.ts.map +1 -1
  62. package/lib/tree/nodes/functions/logNode.d.ts +1 -1
  63. package/lib/tree/nodes/functions/logNode.d.ts.map +1 -1
  64. package/lib/tree/nodes/functions/oppositeNode.d.ts +2 -1
  65. package/lib/tree/nodes/functions/oppositeNode.d.ts.map +1 -1
  66. package/lib/tree/nodes/functions/oppositeNode.js +6 -1
  67. package/lib/tree/nodes/functions/sinNode.d.ts +1 -1
  68. package/lib/tree/nodes/functions/sinNode.d.ts.map +1 -1
  69. package/lib/tree/nodes/functions/sqrtNode.d.ts +2 -1
  70. package/lib/tree/nodes/functions/sqrtNode.d.ts.map +1 -1
  71. package/lib/tree/nodes/functions/sqrtNode.js +6 -1
  72. package/lib/tree/nodes/functions/tanNode.d.ts +1 -1
  73. package/lib/tree/nodes/functions/tanNode.d.ts.map +1 -1
  74. package/lib/tree/nodes/geometry/degree.d.ts +1 -1
  75. package/lib/tree/nodes/geometry/degree.d.ts.map +1 -1
  76. package/lib/tree/nodes/geometry/lengthNode.d.ts +1 -1
  77. package/lib/tree/nodes/geometry/lengthNode.d.ts.map +1 -1
  78. package/lib/tree/nodes/geometry/lengthNode.js +2 -2
  79. package/lib/tree/nodes/node.d.ts +2 -1
  80. package/lib/tree/nodes/node.d.ts.map +1 -1
  81. package/lib/tree/nodes/node.js +1 -0
  82. package/lib/tree/nodes/nodeSuperset.d.ts +1 -0
  83. package/lib/tree/nodes/nodeSuperset.d.ts.map +1 -0
  84. package/lib/tree/nodes/nodeSuperset.js +1 -0
  85. package/lib/tree/nodes/numbers/constantNode.d.ts +1 -1
  86. package/lib/tree/nodes/numbers/constantNode.d.ts.map +1 -1
  87. package/lib/tree/nodes/numbers/numberNode.d.ts +1 -1
  88. package/lib/tree/nodes/numbers/numberNode.d.ts.map +1 -1
  89. package/lib/tree/nodes/operators/addNode.d.ts +2 -1
  90. package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
  91. package/lib/tree/nodes/operators/addNode.js +7 -1
  92. package/lib/tree/nodes/operators/divideNode.d.ts +1 -1
  93. package/lib/tree/nodes/operators/divideNode.d.ts.map +1 -1
  94. package/lib/tree/nodes/operators/fractionNode.d.ts +2 -1
  95. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  96. package/lib/tree/nodes/operators/fractionNode.js +14 -1
  97. package/lib/tree/nodes/operators/limitNode.d.ts +1 -1
  98. package/lib/tree/nodes/operators/limitNode.d.ts.map +1 -1
  99. package/lib/tree/nodes/operators/multiplyNode.d.ts +2 -1
  100. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  101. package/lib/tree/nodes/operators/multiplyNode.js +7 -1
  102. package/lib/tree/nodes/operators/powerNode.d.ts +2 -1
  103. package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
  104. package/lib/tree/nodes/operators/powerNode.js +6 -1
  105. package/lib/tree/nodes/operators/substractNode.d.ts +2 -1
  106. package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
  107. package/lib/tree/nodes/operators/substractNode.js +7 -1
  108. package/lib/tree/nodes/variables/variableNode.d.ts +1 -1
  109. package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
  110. package/lib/tree/nodes/variables/variableNode.js +1 -1
  111. package/lib/utils/alea/random.d.ts +1 -1
  112. package/lib/utils/alea/random.d.ts.map +1 -1
  113. package/lib/utils/alea/random.js +5 -1
  114. package/package.json +1 -1
@@ -17,7 +17,8 @@ export declare enum GeneratorOptionTarget {
17
17
  }
18
18
  export declare enum GeneratorOptionType {
19
19
  checkbox = "checkbox",
20
- select = "select"
20
+ select = "select",
21
+ multiSelect = "multiSelect"
21
22
  }
22
23
  export type GeneratorOption<TValue = any> = {
23
24
  id: string;
@@ -139,6 +140,10 @@ export interface Exercise<TIdentifiers = {}, TOptions = {}> {
139
140
  rebuildIdentifiers?: RebuildIdentifiers<TIdentifiers, TOptions>;
140
141
  getQuestionFromIdentifiers?: GetQuestionFromIdentifiers<TIdentifiers, TOptions>;
141
142
  hotFix?: QuestionHotFix<TIdentifiers, TOptions>;
143
+ validateOptions?: (opts: TOptions) => {
144
+ message: string;
145
+ valid: boolean;
146
+ };
142
147
  }
143
148
  export type MathLevel = "6ème" | "5ème" | "4ème" | "3ème" | "2nde" | "1reTech" | "1reESM" | "1reSpé" | "TermSpé" | "TermTech" | "MathExp" | "MathComp" | "CAP" | "2ndPro" | "1rePro" | "TermPro";
144
149
  export type MathSection = "Aires" | "Arithmétique" | "Calcul littéral" | "Calculs" | "Combinatoire et dénombrement" | "Conversions" | "Dérivation" | "Droites" | "Ensembles et intervalles" | "Équations" | "Équations différentielles" | "Exponentielle" | "Fonction cube" | "Fonction inverse" | "Fonctions" | "Fonctions affines" | "Fonctions de référence" | "Fractions" | "Géométrie cartésienne" | "Géométrie euclidienne" | "Inéquations" | "Intégration" | "Limites" | "Logarithme népérien" | "Logarithme décimal" | "Matrices" | "Nombres complexes" | "Périmètres" | "Pourcentages" | "Primitives" | "Probabilités" | "Produit scalaire" | "Proportionnalité" | "Python" | "Puissances" | "Python" | "Racines carrées" | "Second degré" | "Statistiques" | "Suites" | "Systèmes" | "Théorème de Pythagore" | "Théorème de Thalès" | "Trigonométrie" | "Valeur absolue" | "Vecteurs";
@@ -1 +1 @@
1
- {"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAIhD,eAAO,MAAM,YAAY,UAChB,WAAW,EAAE,aACT,MAAM,WACT,KAAK,GAAG,KAAK,SAQtB,CAAC;AACF,eAAO,MAAM,YAAY,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GAC9B,aAAa,GACb,YAAY,GACZ,SAAS,GACT,0BAA0B,GAC1B,WAAW,GACX,2BAA2B,GAC3B,eAAe,GACf,eAAe,GACf,kBAAkB,GAClB,WAAW,GACX,mBAAmB,GACnB,wBAAwB,GACxB,WAAW,GACX,uBAAuB,GACvB,uBAAuB,GACvB,aAAa,GACb,aAAa,GACb,SAAS,GACT,qBAAqB,GACrB,oBAAoB,GACpB,UAAU,GACV,mBAAmB,GACnB,YAAY,GACZ,cAAc,GACd,YAAY,GACZ,cAAc,GACd,kBAAkB,GAClB,kBAAkB,GAClB,QAAQ,GACR,YAAY,GACZ,QAAQ,GACR,iBAAiB,GACjB,cAAc,GACd,cAAc,GACd,QAAQ,GACR,UAAU,GACV,uBAAuB,GACvB,oBAAoB,GACpB,eAAe,GACf,gBAAgB,GAChB,UAAU,CAAC;AAEf,MAAM,MAAM,SAAS,GACjB,mBAAmB,GACnB,sBAAsB,GACtB,QAAQ,GACR,kBAAkB,GAClB,WAAW,GACX,SAAS,GACT,cAAc,GACd,+CAA+C,GAC/C,OAAO,GACP,KAAK,GACL,wBAAwB,GACxB,SAAS,GACT,KAAK,GACL,aAAa,GACb,4BAA4B,GAC5B,oBAAoB,GACpB,WAAW,GACX,iBAAiB,GACjB,SAAS,CAAC"}
1
+ {"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAIhD,eAAO,MAAM,YAAY,UAChB,WAAW,EAAE,aACT,MAAM,WACT,KAAK,GAAG,KAAK,SAQtB,CAAC;AACF,eAAO,MAAM,YAAY,UAChB,WAAW,EAAE,aACT,MAAM,WACT,KAAK,GAAG,KAAK,SAQtB,CAAC;AACF,eAAO,MAAM,iBAAiB,UACrB,WAAW,EAAE,aACT,MAAM,WACT,KAAK,GAAG,KAAK,SAUt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8B,GAC9B,aAAa,GACb,YAAY,GACZ,SAAS,GACT,0BAA0B,GAC1B,WAAW,GACX,2BAA2B,GAC3B,eAAe,GACf,eAAe,GACf,kBAAkB,GAClB,WAAW,GACX,mBAAmB,GACnB,wBAAwB,GACxB,WAAW,GACX,uBAAuB,GACvB,uBAAuB,GACvB,aAAa,GACb,aAAa,GACb,SAAS,GACT,qBAAqB,GACrB,oBAAoB,GACpB,UAAU,GACV,mBAAmB,GACnB,YAAY,GACZ,cAAc,GACd,YAAY,GACZ,cAAc,GACd,kBAAkB,GAClB,kBAAkB,GAClB,QAAQ,GACR,YAAY,GACZ,QAAQ,GACR,iBAAiB,GACjB,cAAc,GACd,cAAc,GACd,QAAQ,GACR,UAAU,GACV,uBAAuB,GACvB,oBAAoB,GACpB,eAAe,GACf,gBAAgB,GAChB,UAAU,CAAC;AAEf,MAAM,MAAM,SAAS,GACjB,mBAAmB,GACnB,sBAAsB,GACtB,QAAQ,GACR,kBAAkB,GAClB,WAAW,GACX,SAAS,GACT,cAAc,GACd,+CAA+C,GAC/C,OAAO,GACP,KAAK,GACL,wBAAwB,GACxB,SAAS,GACT,KAAK,GACL,aAAa,GACb,4BAA4B,GAC5B,oBAAoB,GACpB,WAAW,GACX,iBAAiB,GACjB,SAAS,CAAC"}
@@ -52,4 +52,5 @@ var GeneratorOptionType;
52
52
  (function (GeneratorOptionType) {
53
53
  GeneratorOptionType["checkbox"] = "checkbox";
54
54
  GeneratorOptionType["select"] = "select";
55
+ GeneratorOptionType["multiSelect"] = "multiSelect";
55
56
  })(GeneratorOptionType || (exports.GeneratorOptionType = GeneratorOptionType = {}));
@@ -1 +1 @@
1
- {"version":3,"file":"mentalAddAndSubNoRelative.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/mentalCaluls/mentalAddAndSubNoRelative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAgEF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAc3D,CAAC"}
1
+ {"version":3,"file":"mentalAddAndSubNoRelative.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/mentalCaluls/mentalAddAndSubNoRelative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAgEF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAc3D,CAAC"}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.mentalAddAndSubNoRelative = 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");
@@ -53,7 +54,7 @@ const getPropositions = (n, { answer }) => {
53
54
  return (0, exercise_1.shuffleProps)(propositions, n);
54
55
  };
55
56
  const isAnswerValid = (ans, { answer }) => {
56
- return ans === answer;
57
+ return (0, numberVEA_1.numberVEA)(ans, answer);
57
58
  };
58
59
  exports.mentalAddAndSubNoRelative = {
59
60
  id: "mentalAddAndSubNoRelative",
@@ -1 +1 @@
1
- {"version":3,"file":"mentalPercentage.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/mentalCaluls/mentalPercentage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAyElC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAsEF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAwBlD,CAAC"}
1
+ {"version":3,"file":"mentalPercentage.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/mentalCaluls/mentalPercentage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AA0ElC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAoEF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAwBlD,CAAC"}
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.mentalPercentage = 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 randint_1 = require("../../../../math/utils/random/randint");
7
- const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
8
8
  const coinFlip_1 = require("../../../../utils/alea/coinFlip");
9
9
  const shuffle_1 = require("../../../../utils/alea/shuffle");
10
10
  const getMentalPercentage = () => {
@@ -110,9 +110,7 @@ const getPropositions = (n, { answer, rand }) => {
110
110
  return (0, shuffle_1.shuffle)(propositions);
111
111
  };
112
112
  const isAnswerValid = (studentAns, { answer }) => {
113
- const answerTree = new numberNode_1.NumberNode(Number(answer.replace(",", ".")));
114
- const texs = answerTree.toAllValidTexs();
115
- return texs.includes(studentAns);
113
+ return (0, numberVEA_1.numberVEA)(studentAns, answer);
116
114
  };
117
115
  exports.mentalPercentage = {
118
116
  id: "mentalPercentage",
@@ -1 +1 @@
1
- {"version":3,"file":"factoIdRmq1.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoIdRmq1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAsFF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAc7C,CAAC"}
1
+ {"version":3,"file":"factoIdRmq1.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoIdRmq1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAalC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAgGF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAc7C,CAAC"}
@@ -11,6 +11,7 @@ const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
11
11
  const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
12
12
  const alignTex_1 = require("../../../../utils/latex/alignTex");
13
13
  const shuffle_1 = require("../../../../utils/alea/shuffle");
14
+ const gcd_1 = require("../../../../math/utils/arithmetic/gcd");
14
15
  const getFactoType1Question = () => {
15
16
  const affine = affine_1.AffineConstructor.random({ min: 1, max: 10 }, {
16
17
  min: 1,
@@ -68,6 +69,13 @@ const isAnswerValid = (ans, { a, b }) => {
68
69
  const affine = new affine_1.Affine(a, b);
69
70
  const answerTree = new powerNode_1.SquareNode(affine.toTree());
70
71
  const validLatexs = answerTree.toAllValidTexs();
72
+ const pgcd = (0, gcd_1.gcd)(a, b);
73
+ if (pgcd !== 1) {
74
+ const affine2 = new affine_1.Affine(a / pgcd, b / pgcd);
75
+ const coeff = pgcd ** 2;
76
+ const answerTree2 = new multiplyNode_1.MultiplyNode(coeff.toTree(), affine2.toTree());
77
+ validLatexs.push(...answerTree2.toAllValidTexs());
78
+ }
71
79
  return validLatexs.includes(ans);
72
80
  };
73
81
  exports.factoIdRmq1 = {
@@ -1 +1 @@
1
- {"version":3,"file":"factoIdRmq2.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoIdRmq2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAalC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAyFF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAc7C,CAAC"}
1
+ {"version":3,"file":"factoIdRmq2.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoIdRmq2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAclC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAgGF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAc7C,CAAC"}
@@ -12,6 +12,7 @@ const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
12
12
  const substractNode_1 = require("../../../../tree/nodes/operators/substractNode");
13
13
  const alignTex_1 = require("../../../../utils/latex/alignTex");
14
14
  const shuffle_1 = require("../../../../utils/alea/shuffle");
15
+ const gcd_1 = require("../../../../math/utils/arithmetic/gcd");
15
16
  const getFactoType1Question = () => {
16
17
  const affine = affine_1.AffineConstructor.random({
17
18
  min: 1,
@@ -70,6 +71,13 @@ const isAnswerValid = (ans, { a, b }) => {
70
71
  const affine = new affine_1.Affine(a, b);
71
72
  const answerTree = new powerNode_1.SquareNode(affine.toTree());
72
73
  const validLatexs = answerTree.toAllValidTexs();
74
+ const pgcd = (0, gcd_1.gcd)(a, Math.abs(b));
75
+ if (pgcd !== 1) {
76
+ const affine2 = new affine_1.Affine(a / pgcd, b / pgcd);
77
+ const coeff = pgcd ** 2;
78
+ const answerTree2 = new multiplyNode_1.MultiplyNode(coeff.toTree(), affine2.toTree());
79
+ validLatexs.push(...answerTree2.toAllValidTexs());
80
+ }
73
81
  return validLatexs.includes(ans);
74
82
  };
75
83
  exports.factoIdRmq2 = {
@@ -1 +1 @@
1
- {"version":3,"file":"factoIdRmq3.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoIdRmq3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AA6GF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAc7C,CAAC"}
1
+ {"version":3,"file":"factoIdRmq3.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoIdRmq3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AA4HF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAc7C,CAAC"}
@@ -4,6 +4,7 @@ exports.factoIdRmq3 = void 0;
4
4
  const exercise_1 = require("../../../../exercises/exercise");
5
5
  const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
6
  const affine_1 = require("../../../../math/polynomials/affine");
7
+ const gcd_1 = require("../../../../math/utils/arithmetic/gcd");
7
8
  const randint_1 = require("../../../../math/utils/random/randint");
8
9
  const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
9
10
  const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
@@ -76,6 +77,15 @@ const isAnswerValid = (ans, { affine1Coeffs, affine2Coeffs }) => {
76
77
  const affine2 = new affine_1.Affine(affine2Coeffs[1], affine2Coeffs[0]);
77
78
  const answerTree = new multiplyNode_1.MultiplyNode(affine.toTree(), affine2.toTree());
78
79
  const validLatexs = answerTree.toAllValidTexs();
80
+ const pgcd = (0, gcd_1.gcd)(Math.abs(affine1Coeffs[1]), Math.abs(affine1Coeffs[0]));
81
+ if (pgcd !== 1) {
82
+ const affineA = new affine_1.Affine(affine1Coeffs[1] / pgcd, affine1Coeffs[0] / pgcd);
83
+ const affineB = new affine_1.Affine(affine2Coeffs[1] / pgcd, affine2Coeffs[0] / pgcd);
84
+ const answer2 = new multiplyNode_1.MultiplyNode(affineA.toTree(), affineB.toTree());
85
+ const coeff = pgcd ** 2;
86
+ const answerTree2 = new multiplyNode_1.MultiplyNode(coeff.toTree(), answer2);
87
+ validLatexs.push(...answerTree2.toAllValidTexs());
88
+ }
79
89
  return validLatexs.includes(ans);
80
90
  };
81
91
  exports.factoIdRmq3 = {
@@ -4,6 +4,9 @@ type Identifiers = {
4
4
  randomUnitInstructionIndex: number;
5
5
  randomLength: number;
6
6
  };
7
- export declare const lengthConversion: Exercise<Identifiers>;
7
+ type Options = {
8
+ units: string[];
9
+ };
10
+ export declare const lengthConversion: Exercise<Identifiers, Options>;
8
11
  export {};
9
12
  //# sourceMappingURL=lengthConversion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lengthConversion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/lengthConversion.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAIxB,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,0BAA0B,EAAE,MAAM,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AA6DF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAalD,CAAC"}
1
+ {"version":3,"file":"lengthConversion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/lengthConversion.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,QAAQ,EAaT,MAAM,gBAAgB,CAAC;AAIxB,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,0BAA0B,EAAE,MAAM,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AACF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAqHF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkB3D,CAAC"}
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.lengthConversion = void 0;
4
+ const numberVEA_1 = require("../../../exercises/vea/numberVEA");
4
5
  const decimal_1 = require("../../../math/numbers/decimals/decimal");
5
6
  const randint_1 = require("../../../math/utils/random/randint");
6
7
  const measure_1 = require("../../../pc/measure/measure");
7
8
  const distanceUnits_1 = require("../../../pc/units/distanceUnits");
9
+ const random_1 = require("../../../utils/alea/random");
8
10
  const shuffle_1 = require("../../../utils/alea/shuffle");
9
11
  const exercise_1 = require("../../exercise");
10
12
  const getDistinctQuestions_1 = require("../../utils/getDistinctQuestions");
@@ -18,30 +20,45 @@ const unitsObj = [
18
20
  distanceUnits_1.DistanceUnit.hm,
19
21
  distanceUnits_1.DistanceUnit.km,
20
22
  ];
21
- const getLengthConversion = () => {
22
- const randomUnitIndex = (0, randint_1.randint)(0, 7);
23
- const randomUnitInstructionIndex = (0, randint_1.randint)(0, 7, [randomUnitIndex]);
24
- const randomLength = decimal_1.DecimalConstructor.random(0, 1000, (0, randint_1.randint)(0, 4));
25
- const measure = new measure_1.Measure(randomLength.value, 0, unitsObj[randomUnitIndex]);
23
+ const getInstruction = (identifiers, options) => {
24
+ const measure = new measure_1.Measure(identifiers.randomLength, 0, unitsObj[identifiers.randomUnitIndex]);
25
+ return `Compléter : $${measure.toTex({
26
+ notScientific: true,
27
+ })} = \\ldots ${unitsObj[identifiers.randomUnitInstructionIndex].toTex()}$`;
28
+ };
29
+ const getAnswer = (identifiers, options) => {
30
+ const measure = new measure_1.Measure(identifiers.randomLength, 0, unitsObj[identifiers.randomUnitIndex]);
26
31
  const answer = measure
27
- .convert(units[randomUnitInstructionIndex])
28
- .toTex({ notScientific: true });
32
+ .convert(units[identifiers.randomUnitInstructionIndex])
33
+ .toTex({ notScientific: true, hideUnit: true });
34
+ return answer;
35
+ };
36
+ const getLengthConversion = (options) => {
37
+ if (options && !validateOptions(options).valid)
38
+ throw Error("options invalides, gen lengthConversion");
39
+ const availableUnitsIndexes = units
40
+ .map((e, i) => i)
41
+ .filter((i) => !options?.units?.length || options.units.includes(units[i]));
42
+ const randomUnitIndex = (0, random_1.random)(availableUnitsIndexes);
43
+ const randomUnitInstructionIndex = (0, random_1.random)(availableUnitsIndexes, [
44
+ randomUnitIndex,
45
+ ]);
46
+ const randomLength = decimal_1.DecimalConstructor.random(0, 1000, (0, randint_1.randint)(0, 4));
47
+ const identifiers = {
48
+ randomLength: randomLength.value,
49
+ randomUnitIndex,
50
+ randomUnitInstructionIndex,
51
+ };
29
52
  const question = {
30
- instruction: `Compléter : $${measure.toTex({
31
- notScientific: true,
32
- })} = \\ldots ${unitsObj[randomUnitInstructionIndex].toTex()}$`,
33
- answer,
53
+ instruction: getInstruction(identifiers, options),
54
+ answer: getAnswer(identifiers, options),
34
55
  keys: [],
35
56
  answerFormat: "tex",
36
- identifiers: {
37
- randomLength: randomLength.value,
38
- randomUnitIndex,
39
- randomUnitInstructionIndex,
40
- },
57
+ identifiers,
41
58
  };
42
59
  return question;
43
60
  };
44
- const getPropositions = (n, { answer, randomLength, randomUnitIndex, randomUnitInstructionIndex }) => {
61
+ const getPropositions = (n, { answer, randomLength, randomUnitIndex, randomUnitInstructionIndex }, options) => {
45
62
  const propositions = [];
46
63
  (0, exercise_1.addValidProp)(propositions, answer);
47
64
  const lengthDecimal = new decimal_1.Decimal(randomLength);
@@ -55,7 +72,27 @@ const getPropositions = (n, { answer, randomLength, randomUnitIndex, randomUnitI
55
72
  return (0, shuffle_1.shuffle)(propositions);
56
73
  };
57
74
  const isAnswerValid = (ans, { answer }) => {
58
- return ans === answer;
75
+ return (0, numberVEA_1.numberVEA)(ans, answer);
76
+ };
77
+ const options = [
78
+ {
79
+ id: "units",
80
+ label: "N'utiliser que les unités suivantes :",
81
+ type: exercise_1.GeneratorOptionType.multiSelect,
82
+ target: exercise_1.GeneratorOptionTarget.generation,
83
+ values: units,
84
+ },
85
+ ];
86
+ const validateOptions = (opts) => {
87
+ if (opts.units.length < 2)
88
+ return {
89
+ message: "Vous devez choisir au moins deux unités.",
90
+ valid: false,
91
+ };
92
+ return {
93
+ message: "Options valides",
94
+ valid: true,
95
+ };
59
96
  };
60
97
  exports.lengthConversion = {
61
98
  id: "lengthConversion",
@@ -64,10 +101,14 @@ exports.lengthConversion = {
64
101
  levels: ["6ème", "5ème", "CAP", "2ndPro"],
65
102
  sections: ["Conversions"],
66
103
  isSingleStep: true,
67
- generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getLengthConversion, nb),
104
+ generator: (nb, opts) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getLengthConversion(opts), nb),
68
105
  qcmTimer: 60,
69
106
  freeTimer: 60,
70
107
  getPropositions,
71
108
  isAnswerValid,
72
109
  subject: "Mathématiques",
110
+ getAnswer,
111
+ getInstruction,
112
+ options,
113
+ validateOptions,
73
114
  };
@@ -1 +1 @@
1
- {"version":3,"file":"massConversion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/massConversion.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAGxB,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,0BAA0B,EAAE,MAAM,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAuDF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAahD,CAAC"}
1
+ {"version":3,"file":"massConversion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/massConversion.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAGxB,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,0BAA0B,EAAE,MAAM,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAyDF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAahD,CAAC"}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.massConversion = void 0;
4
4
  const decimal_1 = require("../../../math/numbers/decimals/decimal");
5
5
  const randint_1 = require("../../../math/utils/random/randint");
6
+ const numberParser_1 = require("../../../tree/parsers/numberParser");
6
7
  const shuffle_1 = require("../../../utils/alea/shuffle");
7
8
  const exercise_1 = require("../../exercise");
8
9
  const getDistinctQuestions_1 = require("../../utils/getDistinctQuestions");
@@ -41,7 +42,10 @@ const getPropositions = (n, { answer, randomMass, randomUnitIndex, randomUnitIns
41
42
  return (0, shuffle_1.shuffle)(propositions);
42
43
  };
43
44
  const isAnswerValid = (ans, { answer }) => {
44
- return ans === answer;
45
+ const parsed = (0, numberParser_1.numberParser)(ans);
46
+ if (!parsed)
47
+ return false;
48
+ return parsed === answer;
45
49
  };
46
50
  exports.massConversion = {
47
51
  id: "massConversion",
@@ -17,4 +17,5 @@ export * from "./summitAbscissFromDevForm";
17
17
  export * from "./trinomialMeanValue";
18
18
  export * from "./solveSecondDegreeEquationByFactorisation";
19
19
  export * from "./solveSecondDegreeEquationFromCano";
20
+ export * from "./trinomSignFromRoots";
20
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC;AAC9B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC;AAC9B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC;AACpD,cAAc,uBAAuB,CAAC"}
@@ -33,3 +33,4 @@ __exportStar(require("./summitAbscissFromDevForm"), exports);
33
33
  __exportStar(require("./trinomialMeanValue"), exports);
34
34
  __exportStar(require("./solveSecondDegreeEquationByFactorisation"), exports);
35
35
  __exportStar(require("./solveSecondDegreeEquationFromCano"), exports);
36
+ __exportStar(require("./trinomSignFromRoots"), exports);
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ trinomCoeffs: number[];
4
+ isAskingPositive: boolean;
5
+ };
6
+ export declare const trinomSignFromRoots: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=trinomSignFromRoots.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trinomSignFromRoots.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/trinomSignFromRoots.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,0BAA0B,CAAC;AAalC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAmHF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAgBrD,CAAC"}
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.trinomSignFromRoots = void 0;
4
+ const exercise_1 = require("../../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const generalTrinom_1 = require("../../../../math/polynomials/generalTrinom");
7
+ const intervals_1 = require("../../../../math/sets/intervals/intervals");
8
+ const infiniteNode_1 = require("../../../../tree/nodes/numbers/infiniteNode");
9
+ const closure_1 = require("../../../../tree/nodes/sets/closure");
10
+ const intervalNode_1 = require("../../../../tree/nodes/sets/intervalNode");
11
+ const unionIntervalNode_1 = require("../../../../tree/nodes/sets/unionIntervalNode");
12
+ const coinFlip_1 = require("../../../../utils/alea/coinFlip");
13
+ const getPropositions = (n, { answer, trinomCoeffs, isAskingPositive }) => {
14
+ const propositions = [];
15
+ (0, exercise_1.addValidProp)(propositions, answer);
16
+ const trinom = generalTrinom_1.GeneralTrinomConstructor.fromCoeffs(trinomCoeffs);
17
+ const roots = trinom.getRoots();
18
+ const a = trinomCoeffs[2];
19
+ const b = trinomCoeffs[1];
20
+ (0, exercise_1.tryToAddWrongProp)(propositions, getAnswer({ trinomCoeffs, isAskingPositive: !isAskingPositive }));
21
+ (0, exercise_1.tryToAddWrongProp)(propositions, new intervalNode_1.IntervalNode(trinom.a, trinom.b, closure_1.ClosureType.FF).toTex());
22
+ while (propositions.length < n) {
23
+ const interval = intervals_1.IntervalConstructor.random();
24
+ (0, exercise_1.tryToAddWrongProp)(propositions, interval.toTree().toTex());
25
+ }
26
+ return (0, exercise_1.shuffleProps)(propositions, n);
27
+ };
28
+ const getAnswerNode = (identifiers) => {
29
+ const trinom = generalTrinom_1.GeneralTrinomConstructor.fromCoeffs(identifiers.trinomCoeffs);
30
+ const roots = trinom.getRoots();
31
+ const a = identifiers.trinomCoeffs[2];
32
+ return a > 0 === identifiers.isAskingPositive
33
+ ? new unionIntervalNode_1.UnionIntervalNode([
34
+ new intervalNode_1.IntervalNode(infiniteNode_1.MinusInfinityNode, roots[0], closure_1.ClosureType.OF),
35
+ new intervalNode_1.IntervalNode(roots[1], infiniteNode_1.PlusInfinityNode, closure_1.ClosureType.FO),
36
+ ])
37
+ : new intervalNode_1.IntervalNode(roots[0], roots[1], closure_1.ClosureType.FF);
38
+ };
39
+ const getAnswer = (identifiers) => {
40
+ return getAnswerNode(identifiers).toTex();
41
+ };
42
+ const getInstruction = (identifiers) => {
43
+ const trinom = generalTrinom_1.GeneralTrinomConstructor.fromCoeffs(identifiers.trinomCoeffs);
44
+ const roots = trinom.getRoots();
45
+ return `Soit $f$ une fonction polynôme de degré $2$ définie sur $\\mathbb{R}$ par $f(x) = ${trinom.toTex()}$.
46
+
47
+ Les racines de $f$ sont $x_1 = ${roots[0].toTex()}$ et $x_2=${roots[1].toTex()}$.
48
+
49
+ Sur quel(s) intervalle(s) les valeurs de la fonction $f$ sont-elles ${identifiers.isAskingPositive ? "positives" : "négatives"} ?`;
50
+ };
51
+ const getHint = (identifiers) => {
52
+ return `Une fonction polynôme de degré $2$ est du signe de son coefficient $a$, sauf entre ses racines.`;
53
+ };
54
+ const getCorrection = (identifiers) => {
55
+ const trinom = generalTrinom_1.GeneralTrinomConstructor.fromCoeffs(identifiers.trinomCoeffs);
56
+ const roots = trinom.getRoots();
57
+ const a = identifiers.trinomCoeffs[2];
58
+ const answer = getAnswer(identifiers);
59
+ const ineqSign = a > 0 ? ">" : "<";
60
+ const sign = a > 0 ? "positive" : "négative";
61
+ return `On sait qu'une fonction polynôme de degré $2$ est du signe de son coefficient $a$, sauf entre ses racines.
62
+
63
+ Ici, $a = ${a}${ineqSign}0$.
64
+
65
+ $f$ est donc ${sign} sauf sur l'intervalle $${new intervalNode_1.IntervalNode(roots[0], roots[1], closure_1.ClosureType.FF).toTex()}$.
66
+
67
+ On en déduit que $f$ est ${identifiers.isAskingPositive ? "positive" : "négative"} sur :
68
+
69
+ $$
70
+ ${answer}
71
+ $$`;
72
+ };
73
+ const getKeys = (identifiers) => {
74
+ return ["lbracket", "semicolon", "rbracket", "infty", "cup"];
75
+ };
76
+ const isAnswerValid = (ans, { answer, isAskingPositive, trinomCoeffs }) => {
77
+ const ansNode = getAnswerNode({ isAskingPositive, trinomCoeffs });
78
+ const texs = ansNode.toAllValidTexs();
79
+ return texs.includes(ans);
80
+ };
81
+ const getTrinomSignFromRootsQuestion = () => {
82
+ const trinom = generalTrinom_1.GeneralTrinomConstructor.randomNiceRoots(2);
83
+ const isAskingPositive = (0, coinFlip_1.coinFlip)();
84
+ const identifiers = {
85
+ isAskingPositive,
86
+ trinomCoeffs: trinom.getCoeffs(),
87
+ };
88
+ const question = {
89
+ answer: getAnswer(identifiers),
90
+ instruction: getInstruction(identifiers),
91
+ keys: getKeys(identifiers),
92
+ answerFormat: "tex",
93
+ identifiers,
94
+ hint: getHint(identifiers),
95
+ correction: getCorrection(identifiers),
96
+ };
97
+ return question;
98
+ };
99
+ exports.trinomSignFromRoots = {
100
+ id: "trinomSignFromRoots",
101
+ connector: "\\iff",
102
+ label: "Déterminer le signe d'un trinôme en connaissant ses racines",
103
+ isSingleStep: true,
104
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getTrinomSignFromRootsQuestion, nb),
105
+ qcmTimer: 60,
106
+ freeTimer: 60,
107
+ getPropositions,
108
+ isAnswerValid,
109
+ subject: "Mathématiques",
110
+ getHint,
111
+ getCorrection,
112
+ getAnswer,
113
+ hasHintAndCorrection: true,
114
+ };
@@ -105,7 +105,7 @@ const getReadAbscissOnLineQuestion = () => {
105
105
  break;
106
106
  case nombre_1.NumberType.Decimal:
107
107
  default:
108
- axisUnit = (0, randfloat_1.randfloat)(0, 5, 1);
108
+ axisUnit = (0, randfloat_1.randfloat)(0.1, 5, 1);
109
109
  coeff = (0, randint_1.randint)(-6, 7, [0, 1]);
110
110
  absciss = (0, round_1.round)(axisUnit * coeff, 2);
111
111
  oneUnitTex = axisUnit.frenchify();
@@ -21,8 +21,8 @@ const getAnswer = (identifiers) => {
21
21
  return identifiers.isOnLine ? "Oui" : "Non";
22
22
  };
23
23
  const getInstruction = (identifiers) => {
24
- const point = spacePoint_1.SpacePointConstructor.fromScalars(identifiers.askedPointCoords, identifiers.askedPointName);
25
- const line = new parametricLine_1.ParametricLine(point, spaceVector_1.SpaceVectorConstructor.fromScalars(identifiers.vector));
24
+ const askedPoint = spacePoint_1.SpacePointConstructor.fromScalars(identifiers.askedPointCoords, identifiers.askedPointName);
25
+ const line = new parametricLine_1.ParametricLine(spacePoint_1.SpacePointConstructor.fromScalars(identifiers.startPoint), spaceVector_1.SpaceVectorConstructor.fromScalars(identifiers.vector));
26
26
  return `Soit $d$ la droite d'équation paramétrique :
27
27
 
28
28
  $$
@@ -31,7 +31,7 @@ $$
31
31
 
32
32
  où $t\\in \\mathbb{R}$.
33
33
 
34
- Le point $${point.toTexWithCoords()}$ appartient-il à $d$ ?
34
+ Le point $${askedPoint.toTexWithCoords()}$ appartient-il à $d$ ?
35
35
  `;
36
36
  };
37
37
  // const getHint: GetHint<Identifiers> = (identifiers) => {};
@@ -1 +1 @@
1
- {"version":3,"file":"coneVolume.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/volumes/coneVolume.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAwGF,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,WAAW,CAa5C,CAAC"}
1
+ {"version":3,"file":"coneVolume.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/volumes/coneVolume.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAoGF,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,WAAW,CAa5C,CAAC"}
@@ -6,6 +6,7 @@ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQ
6
6
  const randint_1 = require("../../../../math/utils/random/randint");
7
7
  const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor");
8
8
  const round_1 = require("../../../../math/utils/round");
9
+ const numberParser_1 = require("../../../../tree/parsers/numberParser");
9
10
  const getConeVolumeQuestion = () => {
10
11
  let radius, height;
11
12
  do {
@@ -77,9 +78,10 @@ const getPropositions = (n, { answer, radius, height }) => {
77
78
  return (0, exercise_1.shuffleProps)(propositions, n);
78
79
  };
79
80
  const isAnswerValid = (ans, { answer, radius, height }) => {
80
- const validanswer = (0, round_1.round)((1 / 3) * Math.PI * Math.pow(radius, 2) * height, 2).toTree();
81
- const latexs = validanswer.toAllValidTexs();
82
- return latexs.includes(ans);
81
+ const parsed = (0, numberParser_1.numberParser)(ans);
82
+ if (!parsed)
83
+ return false;
84
+ return parsed === answer;
83
85
  };
84
86
  exports.coneVolume = {
85
87
  id: "coneVolume",
@@ -42,9 +42,9 @@ const getProbaFromTableWithContextQuestion = () => {
42
42
  case "singleEvent":
43
43
  [event, proba] = (0, random_1.random)([
44
44
  ["une fille", [aTotal, total]],
45
- ["une élève qui porte des lunettes", [bTotal, total]],
45
+ ["un élève qui porte des lunettes", [bTotal, total]],
46
46
  ["un garçon", [aBarreTotal, total]],
47
- ["une élève qui ne porte pas de lunettes", [bBarreTotal, total]],
47
+ ["un élève qui ne porte pas de lunettes", [bBarreTotal, total]],
48
48
  ]);
49
49
  break;
50
50
  case "intersection":
@@ -16,12 +16,12 @@ const shuffle_1 = require("../../../utils/alea/shuffle");
16
16
  const getAnswer = (type, firstTerm, secondTerm) => {
17
17
  switch (type) {
18
18
  case 1: //(a+b)^2
19
- return new addNode_1.AddNode(new powerNode_1.SquareNode(firstTerm), new addNode_1.AddNode(new powerNode_1.SquareNode(secondTerm), new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(2), new multiplyNode_1.MultiplyNode(firstTerm, secondTerm)))).simplify({ keepPowers: false });
19
+ return new addNode_1.AddNode(new powerNode_1.SquareNode(firstTerm), new addNode_1.AddNode(new powerNode_1.SquareNode(secondTerm), new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(2), new multiplyNode_1.MultiplyNode(firstTerm, secondTerm)))).simplify({ keepPowers: false, forbidFactorize: true });
20
20
  case 2:
21
- return new addNode_1.AddNode(new powerNode_1.SquareNode(firstTerm), new substractNode_1.SubstractNode(new powerNode_1.SquareNode(secondTerm), new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(2), new multiplyNode_1.MultiplyNode(firstTerm, secondTerm)))).simplify({ keepPowers: false });
21
+ return new addNode_1.AddNode(new powerNode_1.SquareNode(firstTerm), new substractNode_1.SubstractNode(new powerNode_1.SquareNode(secondTerm), new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(2), new multiplyNode_1.MultiplyNode(firstTerm, secondTerm)))).simplify({ keepPowers: false, forbidFactorize: true });
22
22
  case 3:
23
23
  default:
24
- return new substractNode_1.SubstractNode(new powerNode_1.SquareNode(firstTerm), new powerNode_1.SquareNode(secondTerm)).simplify({ keepPowers: false });
24
+ return new substractNode_1.SubstractNode(new powerNode_1.SquareNode(firstTerm), new powerNode_1.SquareNode(secondTerm)).simplify({ keepPowers: false, forbidFactorize: true });
25
25
  }
26
26
  };
27
27
  //(x sqrt(a) +- [y || y*sqrt(b)])^2
@@ -0,0 +1,2 @@
1
+ export declare const numberVEA: (studentAns: string, answer: string) => boolean;
2
+ //# sourceMappingURL=numberVEA.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"numberVEA.d.ts","sourceRoot":"","sources":["../../../src/exercises/vea/numberVEA.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,eAAgB,MAAM,UAAU,MAAM,YAI3D,CAAC"}