math-exercises 2.0.33 → 2.0.35

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 (99) hide show
  1. package/lib/exercises/calculLitteral/simplifying/distributeAndSimplify.d.ts +14 -0
  2. package/lib/exercises/calculLitteral/simplifying/distributeAndSimplify.d.ts.map +1 -0
  3. package/lib/exercises/calculLitteral/simplifying/distributeAndSimplify.js +67 -0
  4. package/lib/exercises/calculLitteral/simplifying/index.d.ts +1 -0
  5. package/lib/exercises/calculLitteral/simplifying/index.d.ts.map +1 -1
  6. package/lib/exercises/calculLitteral/simplifying/index.js +1 -0
  7. package/lib/exercises/equaDiff/equaDiffCheckSolutionFirstOrder.d.ts +10 -0
  8. package/lib/exercises/equaDiff/equaDiffCheckSolutionFirstOrder.d.ts.map +1 -0
  9. package/lib/exercises/equaDiff/equaDiffCheckSolutionFirstOrder.js +101 -0
  10. package/lib/exercises/equaDiff/index.d.ts +1 -0
  11. package/lib/exercises/equaDiff/index.d.ts.map +1 -1
  12. package/lib/exercises/equaDiff/index.js +1 -0
  13. package/lib/exercises/exercise.d.ts +1 -0
  14. package/lib/exercises/exercise.d.ts.map +1 -1
  15. package/lib/exercises/functions/trinoms/factorizedFormFromRoots.d.ts +8 -0
  16. package/lib/exercises/functions/trinoms/factorizedFormFromRoots.d.ts.map +1 -0
  17. package/lib/exercises/functions/trinoms/factorizedFormFromRoots.js +67 -0
  18. package/lib/exercises/functions/trinoms/index.d.ts +3 -0
  19. package/lib/exercises/functions/trinoms/index.d.ts.map +1 -1
  20. package/lib/exercises/functions/trinoms/index.js +3 -0
  21. package/lib/exercises/functions/trinoms/rootsReading.d.ts +9 -0
  22. package/lib/exercises/functions/trinoms/rootsReading.d.ts.map +1 -0
  23. package/lib/exercises/functions/trinoms/rootsReading.js +67 -0
  24. package/lib/exercises/functions/trinoms/summitReading.d.ts +9 -0
  25. package/lib/exercises/functions/trinoms/summitReading.d.ts.map +1 -0
  26. package/lib/exercises/functions/trinoms/summitReading.js +59 -0
  27. package/lib/exercises/geometry/vectors/equalCaracteristicFromGraph.d.ts +9 -0
  28. package/lib/exercises/geometry/vectors/equalCaracteristicFromGraph.d.ts.map +1 -0
  29. package/lib/exercises/geometry/vectors/equalCaracteristicFromGraph.js +194 -0
  30. package/lib/exercises/geometry/vectors/index.d.ts +1 -0
  31. package/lib/exercises/geometry/vectors/index.d.ts.map +1 -1
  32. package/lib/exercises/geometry/vectors/index.js +1 -0
  33. package/lib/exercises/matrices/index.d.ts +1 -0
  34. package/lib/exercises/matrices/index.d.ts.map +1 -1
  35. package/lib/exercises/matrices/index.js +1 -0
  36. package/lib/exercises/matrices/matrixInversibilityDomain.js +1 -1
  37. package/lib/exercises/matrices/productCell.d.ts +10 -0
  38. package/lib/exercises/matrices/productCell.d.ts.map +1 -0
  39. package/lib/exercises/matrices/productCell.js +57 -0
  40. package/lib/exercises/probaStat/index.d.ts +3 -0
  41. package/lib/exercises/probaStat/index.d.ts.map +1 -1
  42. package/lib/exercises/probaStat/index.js +3 -0
  43. package/lib/exercises/probaStat/issuesCountingForCards.d.ts +7 -0
  44. package/lib/exercises/probaStat/issuesCountingForCards.d.ts.map +1 -0
  45. package/lib/exercises/probaStat/issuesCountingForCards.js +78 -0
  46. package/lib/exercises/probaStat/probaFromTableNoContext.d.ts +13 -0
  47. package/lib/exercises/probaStat/probaFromTableNoContext.d.ts.map +1 -0
  48. package/lib/exercises/probaStat/probaFromTableNoContext.js +115 -0
  49. package/lib/exercises/probaStat/probaFromTableWithContext.d.ts +13 -0
  50. package/lib/exercises/probaStat/probaFromTableWithContext.d.ts.map +1 -0
  51. package/lib/exercises/probaStat/probaFromTableWithContext.js +121 -0
  52. package/lib/exercises/python/index.d.ts +1 -0
  53. package/lib/exercises/python/index.d.ts.map +1 -0
  54. package/lib/exercises/python/index.js +1 -0
  55. package/lib/exercises/sequences/arithmetic/index.d.ts +4 -0
  56. package/lib/exercises/sequences/arithmetic/index.d.ts.map +1 -1
  57. package/lib/exercises/sequences/arithmetic/index.js +4 -0
  58. package/lib/exercises/sequences/arithmetic/recognizeArithmeticFromFirstTerms.d.ts +8 -0
  59. package/lib/exercises/sequences/arithmetic/recognizeArithmeticFromFirstTerms.d.ts.map +1 -0
  60. package/lib/exercises/sequences/arithmetic/recognizeArithmeticFromFirstTerms.js +71 -0
  61. package/lib/exercises/sequences/arithmetic/recognizeArithmeticFromGraph.d.ts +8 -0
  62. package/lib/exercises/sequences/arithmetic/recognizeArithmeticFromGraph.d.ts.map +1 -0
  63. package/lib/exercises/sequences/arithmetic/recognizeArithmeticFromGraph.js +87 -0
  64. package/lib/exercises/sequences/arithmetic/recognizeReasonFromFirstTerms.d.ts +8 -0
  65. package/lib/exercises/sequences/arithmetic/recognizeReasonFromFirstTerms.d.ts.map +1 -0
  66. package/lib/exercises/sequences/arithmetic/recognizeReasonFromFirstTerms.js +44 -0
  67. package/lib/exercises/sequences/arithmetic/recognizeReasonFromGraph.d.ts +8 -0
  68. package/lib/exercises/sequences/arithmetic/recognizeReasonFromGraph.d.ts.map +1 -0
  69. package/lib/exercises/sequences/arithmetic/recognizeReasonFromGraph.js +58 -0
  70. package/lib/exercises/utils/getDistinctQuestions.d.ts.map +1 -1
  71. package/lib/exercises/utils/getDistinctQuestions.js +1 -0
  72. package/lib/exercises/utils/keys/intervalKeys.js +1 -1
  73. package/lib/geogebra/geogebraConstructor.d.ts +2 -0
  74. package/lib/geogebra/geogebraConstructor.d.ts.map +1 -1
  75. package/lib/geogebra/geogebraConstructor.js +2 -0
  76. package/lib/index.d.ts +64 -0
  77. package/lib/index.d.ts.map +1 -1
  78. package/lib/math/geometry/point.d.ts +1 -0
  79. package/lib/math/geometry/point.d.ts.map +1 -1
  80. package/lib/math/geometry/point.js +3 -0
  81. package/lib/math/polynomials/trinom.d.ts +2 -0
  82. package/lib/math/polynomials/trinom.d.ts.map +1 -1
  83. package/lib/math/polynomials/trinom.js +29 -0
  84. package/lib/math/utils/random/randTupleInt.d.ts +1 -1
  85. package/lib/math/utils/random/randTupleInt.js +1 -1
  86. package/lib/math/utils/random/randfloat.d.ts +5 -0
  87. package/lib/math/utils/random/randfloat.d.ts.map +1 -0
  88. package/lib/math/utils/random/randfloat.js +18 -0
  89. package/lib/math/utils/sum.d.ts +8 -0
  90. package/lib/math/utils/sum.d.ts.map +1 -0
  91. package/lib/math/utils/sum.js +17 -0
  92. package/lib/tree/nodes/algebraicNode.d.ts +1 -0
  93. package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
  94. package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
  95. package/lib/tree/nodes/operators/powerNode.js +3 -1
  96. package/lib/utils/doWhile.d.ts +2 -0
  97. package/lib/utils/doWhile.d.ts.map +1 -0
  98. package/lib/utils/doWhile.js +11 -0
  99. package/package.json +1 -1
@@ -0,0 +1,14 @@
1
+ import { MathExercise } from "../../../exercises/exercise";
2
+ type Identifiers = {
3
+ firstTermIsAffine: boolean;
4
+ a: number;
5
+ b: number;
6
+ c: number;
7
+ d: number;
8
+ e: number;
9
+ f: number;
10
+ g: number;
11
+ };
12
+ export declare const distributeAndSimplify: MathExercise<Identifiers>;
13
+ export {};
14
+ //# sourceMappingURL=distributeAndSimplify.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"distributeAndSimplify.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/simplifying/distributeAndSimplify.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA2DF,eAAO,MAAM,qBAAqB,EAAE,YAAY,CAAC,WAAW,CAa3D,CAAC"}
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.distributeAndSimplify = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
6
+ const affine_1 = require("../../../math/polynomials/affine");
7
+ const randint_1 = require("../../../math/utils/random/randint");
8
+ const addNode_1 = require("../../../tree/nodes/operators/addNode");
9
+ const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
10
+ const coinFlip_1 = require("../../../utils/coinFlip");
11
+ //[a]|[b*(cx+d)] +- e*(fx+g)]
12
+ // c & f > 0
13
+ const getDistributeAndSimplifyQuestion = () => {
14
+ const firstTermIsAffine = (0, coinFlip_1.coinFlip)();
15
+ const a = (0, randint_1.randint)(-5, 6, [0]);
16
+ const b = (0, randint_1.randint)(-5, 6, [0]);
17
+ const c = (0, randint_1.randint)(1, 6);
18
+ const d = (0, randint_1.randint)(-5, 6, [0]);
19
+ const e = (0, randint_1.randint)(-5, 6, [0, 1]);
20
+ let f = 0;
21
+ do {
22
+ f = (0, randint_1.randint)(1, 6);
23
+ } while (b * c + e * f === 0);
24
+ const g = (0, randint_1.randint)(-5, 6, [0]);
25
+ const statement = new addNode_1.AddNode(firstTermIsAffine
26
+ ? new multiplyNode_1.MultiplyNode(b.toTree(), new affine_1.Affine(c, d).toTree())
27
+ : a.toTree(), new multiplyNode_1.MultiplyNode(e.toTree(), new affine_1.Affine(f, g).toTree())).simplify();
28
+ const answer = firstTermIsAffine
29
+ ? new affine_1.Affine(b * c + e * f, b * d + e * g).toTree().toTex()
30
+ : new affine_1.Affine(e * f, a + e * g).toTree().toTex();
31
+ const question = {
32
+ answer,
33
+ instruction: `Développer et réduire : $${statement.toTex()}$`,
34
+ keys: ["x"],
35
+ answerFormat: "tex",
36
+ identifiers: { firstTermIsAffine, a, b, c, d, e, f, g },
37
+ };
38
+ return question;
39
+ };
40
+ const getPropositions = (n, { answer }) => {
41
+ const propositions = [];
42
+ (0, exercise_1.addValidProp)(propositions, answer);
43
+ while (propositions.length < n) {
44
+ (0, exercise_1.tryToAddWrongProp)(propositions, affine_1.AffineConstructor.random().toTree().toTex());
45
+ }
46
+ return (0, exercise_1.shuffleProps)(propositions, n);
47
+ };
48
+ const isAnswerValid = (ans, { answer, firstTermIsAffine, a, b, c, d, e, f, g }) => {
49
+ const answerNode = firstTermIsAffine
50
+ ? new affine_1.Affine(b * c + e * f, b * d + e * g).toTree()
51
+ : new affine_1.Affine(e * f, a + e * g).toTree();
52
+ const texs = answerNode.toAllValidTexs();
53
+ return texs.includes(ans);
54
+ };
55
+ exports.distributeAndSimplify = {
56
+ id: "distributeAndSimplify",
57
+ connector: "=",
58
+ label: "Développer et réduire une expression",
59
+ levels: ["4ème", "3ème", "2nde"],
60
+ isSingleStep: true,
61
+ sections: ["Calcul littéral"],
62
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getDistributeAndSimplifyQuestion, nb),
63
+ qcmTimer: 60,
64
+ freeTimer: 60,
65
+ getPropositions,
66
+ isAnswerValid,
67
+ };
@@ -1,3 +1,4 @@
1
1
  export * from "./evaluateExpression";
2
2
  export * from "./reduceExpression";
3
+ export * from "./distributeAndSimplify";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/simplifying/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/simplifying/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC"}
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./evaluateExpression"), exports);
18
18
  __exportStar(require("./reduceExpression"), exports);
19
+ __exportStar(require("./distributeAndSimplify"), exports);
@@ -0,0 +1,10 @@
1
+ import { MathExercise } from "../../exercises/exercise";
2
+ type Identifiers = {
3
+ type: string;
4
+ d: number;
5
+ e: number;
6
+ f: number | undefined;
7
+ };
8
+ export declare const equaDiffCheckSolutionFirstOrder: MathExercise<Identifiers>;
9
+ export {};
10
+ //# sourceMappingURL=equaDiffCheckSolutionFirstOrder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"equaDiffCheckSolutionFirstOrder.d.ts","sourceRoot":"","sources":["../../../src/exercises/equaDiff/equaDiffCheckSolutionFirstOrder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAgBlC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvB,CAAC;AAkHF,eAAO,MAAM,+BAA+B,EAAE,YAAY,CAAC,WAAW,CAcrE,CAAC"}
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.equaDiffCheckSolutionFirstOrder = void 0;
4
+ const exercise_1 = require("../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../exercises/utils/getDistinctQuestions");
6
+ const affine_1 = require("../../math/polynomials/affine");
7
+ const trinom_1 = require("../../math/polynomials/trinom");
8
+ const randint_1 = require("../../math/utils/random/randint");
9
+ const equalNode_1 = require("../../tree/nodes/equations/equalNode");
10
+ const expNode_1 = require("../../tree/nodes/functions/expNode");
11
+ const addNode_1 = require("../../tree/nodes/operators/addNode");
12
+ const multiplyNode_1 = require("../../tree/nodes/operators/multiplyNode");
13
+ const variableNode_1 = require("../../tree/nodes/variables/variableNode");
14
+ const coinFlip_1 = require("../../utils/coinFlip");
15
+ const doWhile_1 = require("../../utils/doWhile");
16
+ const random_1 = require("../../utils/random");
17
+ const getEquaDiffCheckSolutionFirstOrderQuestion = () => {
18
+ //types : constante, affine, tirnom, exp
19
+ const type = (0, random_1.random)(["affine", "trinom", "exp"]);
20
+ const isSolution = (0, coinFlip_1.coinFlip)();
21
+ const answer = isSolution ? "Oui" : "Non";
22
+ let equaDiff;
23
+ let randomFunc;
24
+ let d;
25
+ let e;
26
+ let f;
27
+ switch (type) {
28
+ case "affine":
29
+ // y = y' + dx+e, alors y = ax+b
30
+ //ax+b = a + dx + e
31
+ //a = d et e = b-a
32
+ const affineSolution = affine_1.AffineConstructor.random();
33
+ d = affineSolution.a;
34
+ e = affineSolution.b - affineSolution.a;
35
+ const affine = new affine_1.Affine(d, e);
36
+ equaDiff = new equalNode_1.EqualNode(new variableNode_1.VariableNode("y"), new addNode_1.AddNode(new variableNode_1.VariableNode("y'"), affine.toTree()));
37
+ randomFunc = isSolution
38
+ ? affineSolution.toTree()
39
+ : (0, doWhile_1.doWhile)(() => affine_1.AffineConstructor.random(), (P) => P.equals(affineSolution)).toTree();
40
+ break;
41
+ case "trinom":
42
+ /**y = y' + dx^2+ex+f, alors y = ax^2+bx+c */
43
+ const trinomSolution = trinom_1.TrinomConstructor.random();
44
+ d = trinomSolution.a;
45
+ e = trinomSolution.b - 2 * trinomSolution.a;
46
+ f = trinomSolution.c - trinomSolution.b;
47
+ const trinom = new trinom_1.Trinom(d, e, f);
48
+ equaDiff = new equalNode_1.EqualNode(new variableNode_1.VariableNode("y"), new addNode_1.AddNode(new variableNode_1.VariableNode("y'"), trinom.toTree()));
49
+ randomFunc = isSolution
50
+ ? trinomSolution.toTree()
51
+ : (0, doWhile_1.doWhile)(() => trinom_1.TrinomConstructor.random(), (P) => P.equals(trinomSolution)).toTree();
52
+ break;
53
+ case "exp":
54
+ /**y = y' +d exp(e*x), alors y = a exp(e*x) */
55
+ //a exp(ex) = ae*exp(ex) + dexp(e*x)
56
+ //a = ae + d
57
+ //d/(1-e) == a
58
+ e = (0, randint_1.randint)(-4, 5, [0, 1]);
59
+ const a = (0, randint_1.randint)(-5, 5, [0]);
60
+ d = a - a * e;
61
+ const expSolution = new multiplyNode_1.MultiplyNode(a.toTree(), new expNode_1.ExpNode(new multiplyNode_1.MultiplyNode(e.toTree(), new variableNode_1.VariableNode("x"))));
62
+ const exp = new multiplyNode_1.MultiplyNode(d.toTree(), new expNode_1.ExpNode(new multiplyNode_1.MultiplyNode(e.toTree(), new variableNode_1.VariableNode("x"))));
63
+ equaDiff = new equalNode_1.EqualNode(new variableNode_1.VariableNode("y"), new addNode_1.AddNode(new variableNode_1.VariableNode("y'"), exp));
64
+ randomFunc = isSolution
65
+ ? expSolution
66
+ : (0, doWhile_1.doWhile)(() => new multiplyNode_1.MultiplyNode((0, randint_1.randint)(-5, 5, [0]).toTree(), new expNode_1.ExpNode(new multiplyNode_1.MultiplyNode(e.toTree(), new variableNode_1.VariableNode("x")))), (P) => P.equals(expSolution));
67
+ break;
68
+ }
69
+ const question = {
70
+ answer,
71
+ instruction: `Soit l'équation différentielle suivante : $${equaDiff.toTex()}$. La fonction $y = ${randomFunc.toTex()}$ est-elle solution de cette équation ?`,
72
+ keys: [],
73
+ answerFormat: "tex",
74
+ identifiers: { type, d, e, f },
75
+ };
76
+ return question;
77
+ };
78
+ const getPropositions = (n, { answer }) => {
79
+ const propositions = [];
80
+ (0, exercise_1.addValidProp)(propositions, answer, "raw");
81
+ (0, exercise_1.tryToAddWrongProp)(propositions, "Oui", "raw");
82
+ (0, exercise_1.tryToAddWrongProp)(propositions, "Non", "raw");
83
+ (0, exercise_1.tryToAddWrongProp)(propositions, "On ne peut pas savoir", "raw");
84
+ return (0, exercise_1.shuffleProps)(propositions, n);
85
+ };
86
+ const isAnswerValid = (ans, { answer }) => {
87
+ return ans === answer;
88
+ };
89
+ exports.equaDiffCheckSolutionFirstOrder = {
90
+ id: "equaDiffCheckSolutionFirstOrder",
91
+ label: "Vérifier si une fonction est solution d'une équation différentielle du premier ordre",
92
+ levels: ["TermTech", "MathComp", "TermSpé"],
93
+ isSingleStep: true,
94
+ sections: ["Équations différentielles"],
95
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getEquaDiffCheckSolutionFirstOrderQuestion, nb),
96
+ qcmTimer: 60,
97
+ freeTimer: 60,
98
+ getPropositions,
99
+ isAnswerValid,
100
+ answerType: "QCM",
101
+ };
@@ -1,3 +1,4 @@
1
1
  export * from "./equaDiffGeneralForme";
2
2
  export * from "./equaDiffGeneralFormeWithIC";
3
+ export * from "./equaDiffCheckSolutionFirstOrder";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/equaDiff/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/equaDiff/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC"}
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./equaDiffGeneralForme"), exports);
18
18
  __exportStar(require("./equaDiffGeneralFormeWithIC"), exports);
19
+ __exportStar(require("./equaDiffCheckSolutionFirstOrder"), exports);
@@ -25,6 +25,7 @@ export interface Question<TIdentifiers = {}> {
25
25
  isGridBold?: boolean;
26
26
  isGridSimple?: boolean;
27
27
  isAxesRatioFixed?: boolean;
28
+ isXAxesNatural?: boolean;
28
29
  };
29
30
  divisionFormat?: "fraction" | "obelus";
30
31
  identifiers: TIdentifiers;
@@ -1 +1 @@
1
- {"version":3,"file":"exercise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;CACnC;AAED,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,UAAU,GACV,SAAS,GACT,UAAU,GACV,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,MAAM,WAAW,GACnB,OAAO,GACP,cAAc,GACd,iBAAiB,GACjB,SAAS,GACT,8BAA8B,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,YAAY,GACZ,iBAAiB,GACjB,cAAc,GACd,cAAc,GACd,QAAQ,GACR,uBAAuB,GACvB,oBAAoB,GACpB,eAAe,GACf,gBAAgB,GAChB,UAAU,CAAC"}
1
+ {"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAI3C,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,SAUtB,CAAC;AAEF,eAAO,MAAM,YAAY,UAAW,WAAW,EAAE,KAAK,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AAe,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,YAAY,GACZ,iBAAiB,GACjB,cAAc,GACd,cAAc,GACd,QAAQ,GACR,uBAAuB,GACvB,oBAAoB,GACpB,eAAe,GACf,gBAAgB,GAChB,UAAU,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { MathExercise } from "../../../exercises/exercise";
2
+ type Identifiers = {
3
+ roots: number[];
4
+ a: number;
5
+ };
6
+ export declare const factorizedFormFromRoots: MathExercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=factorizedFormFromRoots.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factorizedFormFromRoots.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/trinoms/factorizedFormFromRoots.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA8EF,eAAO,MAAM,uBAAuB,EAAE,YAAY,CAAC,WAAW,CAa7D,CAAC"}
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.factorizedFormFromRoots = 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 multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
8
+ const powerNode_1 = require("../../../tree/nodes/operators/powerNode");
9
+ const substractNode_1 = require("../../../tree/nodes/operators/substractNode");
10
+ const variableNode_1 = require("../../../tree/nodes/variables/variableNode");
11
+ const probaFlip_1 = require("../../../utils/probaFlip");
12
+ const getAnswer = (roots, a) => {
13
+ const isSingleRoot = roots.length === 1;
14
+ return isSingleRoot
15
+ ? new multiplyNode_1.MultiplyNode(a.toTree(), new powerNode_1.SquareNode(new substractNode_1.SubstractNode(new variableNode_1.VariableNode("x"), roots[0].toTree()))).simplify({ keepPowers: true })
16
+ : new multiplyNode_1.MultiplyNode(new multiplyNode_1.MultiplyNode(a.toTree(), new substractNode_1.SubstractNode(new variableNode_1.VariableNode("x"), roots[0].toTree())), new substractNode_1.SubstractNode(new variableNode_1.VariableNode("x"), roots[1].toTree())).simplify();
17
+ };
18
+ const getFactorizedFormFromRootsQuestion = () => {
19
+ const a = (0, randint_1.randint)(-10, 10, [0]);
20
+ const firstRoot = (0, randint_1.randint)(-10, 10);
21
+ const secondRoot = (0, randint_1.randint)(-10, 10, [firstRoot]);
22
+ const isSingleRoot = (0, probaFlip_1.probaFlip)(0.3);
23
+ const roots = isSingleRoot
24
+ ? [firstRoot]
25
+ : [firstRoot, secondRoot].sort((a, b) => a - b);
26
+ const answer = getAnswer(roots, a);
27
+ const answerTex = answer.toTex();
28
+ const question = {
29
+ answer: answerTex,
30
+ instruction: `Soit $f$ un polynôme du second degré avec $a = ${a}$ et qui a ${roots.length === 1
31
+ ? `une racine : $${roots[0]}$`
32
+ : `deux racines : $${roots[0]}$ et $${roots[1]}$`}. Déterminer la forme factorisée de $f$.`,
33
+ keys: ["x"],
34
+ answerFormat: "tex",
35
+ identifiers: { a, roots },
36
+ };
37
+ return question;
38
+ };
39
+ const getPropositions = (n, { answer, a, roots }) => {
40
+ const propositions = [];
41
+ (0, exercise_1.addValidProp)(propositions, answer);
42
+ (0, exercise_1.tryToAddWrongProp)(propositions, getAnswer(roots.map((r) => -r), a).toTex());
43
+ while (propositions.length < n) {
44
+ const x1 = (0, randint_1.randint)(-10, 10);
45
+ const x2 = (0, randint_1.randint)(-10, 10, [x1]);
46
+ (0, exercise_1.tryToAddWrongProp)(propositions, getAnswer([x1, x2].sort((a, b) => a - b), (0, randint_1.randint)(-10, 10, [0])).toTex());
47
+ }
48
+ return (0, exercise_1.shuffleProps)(propositions, n);
49
+ };
50
+ const isAnswerValid = (ans, { answer, a, roots }) => {
51
+ const answerNode = getAnswer(roots, a);
52
+ const texs = answerNode.toAllValidTexs();
53
+ return texs.includes(ans);
54
+ };
55
+ exports.factorizedFormFromRoots = {
56
+ id: "factorizedFormFromRoots",
57
+ connector: "=",
58
+ label: "Déterminer la forme factorisée en connaissant les racines",
59
+ levels: ["1rePro", "1reSpé"],
60
+ isSingleStep: true,
61
+ sections: ["Second degré"],
62
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getFactorizedFormFromRootsQuestion, nb),
63
+ qcmTimer: 60,
64
+ freeTimer: 60,
65
+ getPropositions,
66
+ isAnswerValid,
67
+ };
@@ -9,4 +9,7 @@ export * from "./rootsFromDevForm";
9
9
  export * from "./rootsFromFactorizedForm";
10
10
  export * from "./variationsFromAlgebricForm";
11
11
  export * from "./secondDegreeInequation";
12
+ export * from "./rootsReading";
13
+ export * from "./factorizedFormFromRoots";
14
+ export * from "./summitReading";
12
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/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"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/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"}
@@ -25,3 +25,6 @@ __exportStar(require("./rootsFromDevForm"), exports);
25
25
  __exportStar(require("./rootsFromFactorizedForm"), exports);
26
26
  __exportStar(require("./variationsFromAlgebricForm"), exports);
27
27
  __exportStar(require("./secondDegreeInequation"), exports);
28
+ __exportStar(require("./rootsReading"), exports);
29
+ __exportStar(require("./factorizedFormFromRoots"), exports);
30
+ __exportStar(require("./summitReading"), exports);
@@ -0,0 +1,9 @@
1
+ import { MathExercise } from "../../../exercises/exercise";
2
+ type Identifiers = {
3
+ a: number;
4
+ b: number;
5
+ c: number;
6
+ };
7
+ export declare const rootsReading: MathExercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=rootsReading.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rootsReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/trinoms/rootsReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAuDF,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,WAAW,CAWlD,CAAC"}
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rootsReading = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
6
+ const colors_1 = require("../../../geogebra/colors");
7
+ const geogebraConstructor_1 = require("../../../geogebra/geogebraConstructor");
8
+ const trinom_1 = require("../../../math/polynomials/trinom");
9
+ const randint_1 = require("../../../math/utils/random/randint");
10
+ const getRootsReadingQuestion = () => {
11
+ const trinom = trinom_1.TrinomConstructor.randomNiceRoots((0, randint_1.randint)(1, 3));
12
+ const roots = trinom.getRoots();
13
+ const commands = [
14
+ `f(x) = ${trinom.toString()}`,
15
+ `SetColor(f, "${(0, colors_1.randomColor)()}")`,
16
+ ];
17
+ const ggb = new geogebraConstructor_1.GeogebraConstructor(commands, {
18
+ isGridSimple: true,
19
+ isAxesRatioFixed: false,
20
+ gridDistance: false,
21
+ });
22
+ const answer = roots.length === 1 ? roots[0].toString() : roots.join("\\text{ et }");
23
+ const question = {
24
+ answer,
25
+ instruction: `Déterminer graphiquement le ou les racine(s) du polynôme du second degré représenté ci-dessous : `,
26
+ keys: ["et", "aucun"],
27
+ answerFormat: "tex",
28
+ commands: ggb.commands,
29
+ options: ggb.getOptions(),
30
+ coords: trinom.getCoords(),
31
+ identifiers: { a: trinom.a, b: trinom.b, c: trinom.c },
32
+ };
33
+ return question;
34
+ };
35
+ const getPropositions = (n, { answer }) => {
36
+ const propositions = [];
37
+ (0, exercise_1.addValidProp)(propositions, answer);
38
+ while (propositions.length < n) {
39
+ const x1 = (0, randint_1.randint)(-10, 10);
40
+ const x2 = (0, randint_1.randint)(-10, 10, [x1]);
41
+ const fakeRoots = x1 > x2 ? [x2, x1] : [x1, x2];
42
+ (0, exercise_1.tryToAddWrongProp)(propositions, fakeRoots.join("\\text{ et }"));
43
+ }
44
+ return (0, exercise_1.shuffleProps)(propositions, n);
45
+ };
46
+ const isAnswerValid = (ans, { answer, a, b, c }) => {
47
+ const roots = new trinom_1.Trinom(a, b, c).getRoots();
48
+ const studentNumbers = ans
49
+ .split("\\text{ et }")
50
+ .map((n) => Number(n.replace(",", ".")))
51
+ .filter((n) => !isNaN(n))
52
+ .sort((a, b) => a - b);
53
+ return (!!studentNumbers.length &&
54
+ studentNumbers.every((nb, index) => Math.abs(nb - roots[index]) < 0.2));
55
+ };
56
+ exports.rootsReading = {
57
+ id: "rootsReading",
58
+ label: "Lire graphiquement les racines d'un trinôme",
59
+ levels: ["1reSpé", "1rePro"],
60
+ isSingleStep: true,
61
+ sections: ["Second degré"],
62
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getRootsReadingQuestion, nb),
63
+ qcmTimer: 60,
64
+ freeTimer: 60,
65
+ getPropositions,
66
+ isAnswerValid,
67
+ };
@@ -0,0 +1,9 @@
1
+ import { MathExercise } from "../../../exercises/exercise";
2
+ type Identifiers = {
3
+ a: number;
4
+ b: number;
5
+ c: number;
6
+ };
7
+ export declare const summitReading: MathExercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=summitReading.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summitReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/trinoms/summitReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAsDF,eAAO,MAAM,aAAa,EAAE,YAAY,CAAC,WAAW,CAWnD,CAAC"}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.summitReading = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
6
+ const colors_1 = require("../../../geogebra/colors");
7
+ const geogebraConstructor_1 = require("../../../geogebra/geogebraConstructor");
8
+ const point_1 = require("../../../math/geometry/point");
9
+ const trinom_1 = require("../../../math/polynomials/trinom");
10
+ const randint_1 = require("../../../math/utils/random/randint");
11
+ const getSummitReadingQuestion = () => {
12
+ const trinom = trinom_1.TrinomConstructor.randomCanonical();
13
+ const commands = [
14
+ `f(x) = ${trinom.toString()}`,
15
+ `SetColor(f, "${(0, colors_1.randomColor)()}")`,
16
+ ];
17
+ const ggb = new geogebraConstructor_1.GeogebraConstructor(commands, {
18
+ isGridSimple: true,
19
+ });
20
+ const answer = trinom.getSommet().toCoords();
21
+ const question = {
22
+ answer,
23
+ instruction: `Déterminer les coordonnées du sommet de la parabole représentée ci-dessous :`,
24
+ keys: ["leftParenthesis", "semicolon", "rightParenthesis"],
25
+ commands: ggb.commands,
26
+ options: ggb.getOptions(),
27
+ coords: trinom.getCoords(),
28
+ answerFormat: "tex",
29
+ identifiers: { a: trinom.a, b: trinom.b, c: trinom.c },
30
+ };
31
+ return question;
32
+ };
33
+ const getPropositions = (n, { answer, a, b, c }) => {
34
+ const propositions = [];
35
+ const trinom = new trinom_1.Trinom(a, b, c);
36
+ const alpha = trinom.getAlpha();
37
+ const beta = trinom.getBeta();
38
+ (0, exercise_1.addValidProp)(propositions, answer);
39
+ (0, exercise_1.tryToAddWrongProp)(propositions, new point_1.Point("S", beta.toTree(), alpha.toTree()).toCoords());
40
+ while (propositions.length < n) {
41
+ (0, exercise_1.tryToAddWrongProp)(propositions, new point_1.Point("S", (0, randint_1.randint)(-10, 10).toTree(), (0, randint_1.randint)(-10, 10).toTree()).toCoords());
42
+ }
43
+ return (0, exercise_1.shuffleProps)(propositions, n);
44
+ };
45
+ const isAnswerValid = (ans, { answer }) => {
46
+ return ans === answer;
47
+ };
48
+ exports.summitReading = {
49
+ id: "summitReading",
50
+ label: "Déterminer graphiquement les coordonnées du sommet d'une parabole",
51
+ levels: ["1rePro", "1reSpé"],
52
+ isSingleStep: true,
53
+ sections: ["Second degré"],
54
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getSummitReadingQuestion, nb),
55
+ qcmTimer: 60,
56
+ freeTimer: 60,
57
+ getPropositions,
58
+ isAnswerValid,
59
+ };
@@ -0,0 +1,9 @@
1
+ import { MathExercise } from "../../../exercises/exercise";
2
+ type Identifiers = {
3
+ caracAsked: string;
4
+ uPoints: number[][];
5
+ vPoints: number[][];
6
+ };
7
+ export declare const equalCaracteristicFromGraph: MathExercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=equalCaracteristicFromGraph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"equalCaracteristicFromGraph.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/vectors/equalCaracteristicFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC;CACrB,CAAC;AAwLF,eAAO,MAAM,2BAA2B,EAAE,YAAY,CAAC,WAAW,CAajE,CAAC"}