math-exercises 2.0.5 → 2.0.7

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 (78) hide show
  1. package/lib/exercises/calculLitteral/equation/index.d.ts +0 -2
  2. package/lib/exercises/calculLitteral/equation/index.d.ts.map +1 -1
  3. package/lib/exercises/calculLitteral/equation/index.js +0 -2
  4. package/lib/exercises/calculLitteral/simplifying/index.d.ts +0 -2
  5. package/lib/exercises/calculLitteral/simplifying/index.d.ts.map +1 -1
  6. package/lib/exercises/calculLitteral/simplifying/index.js +0 -2
  7. package/lib/exercises/exercise.d.ts +1 -1
  8. package/lib/exercises/exercise.d.ts.map +1 -1
  9. package/lib/exercises/functions/basics/graphicEquation.d.ts +8 -0
  10. package/lib/exercises/functions/basics/graphicEquation.d.ts.map +1 -0
  11. package/lib/exercises/functions/basics/graphicEquation.js +109 -0
  12. package/lib/exercises/functions/basics/graphicInequation.d.ts +16 -0
  13. package/lib/exercises/functions/basics/graphicInequation.d.ts.map +1 -0
  14. package/lib/exercises/functions/basics/graphicInequation.js +147 -0
  15. package/lib/exercises/functions/basics/index.d.ts +2 -0
  16. package/lib/exercises/functions/basics/index.d.ts.map +1 -1
  17. package/lib/exercises/functions/basics/index.js +2 -0
  18. package/lib/exercises/functions/exponential/expEquation.d.ts +8 -0
  19. package/lib/exercises/functions/exponential/expEquation.d.ts.map +1 -0
  20. package/lib/exercises/functions/exponential/expEquation.js +75 -0
  21. package/lib/exercises/functions/exponential/expSimplifiying.d.ts +10 -0
  22. package/lib/exercises/functions/exponential/expSimplifiying.d.ts.map +1 -0
  23. package/lib/exercises/functions/exponential/expSimplifiying.js +116 -0
  24. package/lib/exercises/functions/exponential/index.d.ts +3 -0
  25. package/lib/exercises/functions/exponential/index.d.ts.map +1 -0
  26. package/lib/exercises/functions/exponential/index.js +18 -0
  27. package/lib/exercises/functions/index.d.ts +2 -0
  28. package/lib/exercises/functions/index.d.ts.map +1 -1
  29. package/lib/exercises/functions/index.js +2 -0
  30. package/lib/exercises/functions/logarithm/index.d.ts +4 -0
  31. package/lib/exercises/functions/logarithm/index.d.ts.map +1 -0
  32. package/lib/exercises/functions/logarithm/index.js +20 -0
  33. package/lib/exercises/functions/logarithm/log10PowerSimplifying.d.ts +7 -0
  34. package/lib/exercises/functions/logarithm/log10PowerSimplifying.d.ts.map +1 -0
  35. package/lib/exercises/functions/logarithm/log10PowerSimplifying.js +53 -0
  36. package/lib/exercises/functions/logarithm/logEquation.d.ts +9 -0
  37. package/lib/exercises/functions/logarithm/logEquation.d.ts.map +1 -0
  38. package/lib/exercises/functions/logarithm/logEquation.js +74 -0
  39. package/lib/exercises/functions/logarithm/logPowerEquation.d.ts +6 -0
  40. package/lib/exercises/functions/logarithm/logPowerEquation.d.ts.map +1 -0
  41. package/lib/exercises/functions/logarithm/logPowerEquation.js +73 -0
  42. package/lib/exercises/functions/logarithm/logSimplifiying.d.ts +9 -0
  43. package/lib/exercises/functions/logarithm/logSimplifiying.d.ts.map +1 -0
  44. package/lib/exercises/functions/logarithm/logSimplifiying.js +77 -0
  45. package/lib/exercises/sets/intervals/inequalityToInterval.d.ts.map +1 -1
  46. package/lib/index.d.ts +32 -17
  47. package/lib/index.d.ts.map +1 -1
  48. package/lib/math/complex/complex.d.ts +1 -1
  49. package/lib/math/numbers/logarithms/ln.d.ts +12 -0
  50. package/lib/math/numbers/logarithms/ln.d.ts.map +1 -0
  51. package/lib/math/numbers/logarithms/ln.js +18 -0
  52. package/lib/tree/nodes/functions/functionNode.d.ts +3 -2
  53. package/lib/tree/nodes/functions/functionNode.d.ts.map +1 -1
  54. package/lib/tree/nodes/functions/functionNode.js +3 -2
  55. package/lib/tree/nodes/functions/log10Node.d.ts +18 -0
  56. package/lib/tree/nodes/functions/log10Node.d.ts.map +1 -0
  57. package/lib/tree/nodes/functions/log10Node.js +54 -0
  58. package/lib/tree/nodes/functions/logNode.js +1 -1
  59. package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts +3 -2
  60. package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts.map +1 -1
  61. package/lib/tree/nodes/inequations/inequationSolutionNode.js +15 -6
  62. package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
  63. package/lib/tree/nodes/operators/addNode.js +2 -0
  64. package/lib/tree/nodes/operators/multiplyNode.js +9 -9
  65. package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
  66. package/lib/tree/nodes/sets/discreteSetNode.d.ts +3 -1
  67. package/lib/tree/nodes/sets/discreteSetNode.d.ts.map +1 -1
  68. package/lib/tree/nodes/sets/discreteSetNode.js +7 -1
  69. package/lib/tree/nodes/sets/intervalNode.d.ts +3 -1
  70. package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
  71. package/lib/tree/nodes/sets/intervalNode.js +7 -1
  72. package/lib/tree/nodes/sets/setNode.d.ts +9 -1
  73. package/lib/tree/nodes/sets/setNode.d.ts.map +1 -1
  74. package/lib/tree/nodes/sets/setNode.js +12 -0
  75. package/lib/tree/nodes/sets/unionIntervalNode.d.ts +3 -1
  76. package/lib/tree/nodes/sets/unionIntervalNode.d.ts.map +1 -1
  77. package/lib/tree/nodes/sets/unionIntervalNode.js +7 -1
  78. package/package.json +1 -1
@@ -3,9 +3,7 @@ export * from "./equationType1Exercise";
3
3
  export * from "./equationType2Exercise";
4
4
  export * from "./equationType3Exercise";
5
5
  export * from "./equationType4Exercise";
6
- export * from "./expEquation";
7
6
  export * from "./firstDegreeEquation";
8
7
  export * from "./fractionEquation";
9
- export * from "./logEquation";
10
8
  export * from "./multiplicationEquation";
11
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/equation/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/equation/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC"}
@@ -19,8 +19,6 @@ __exportStar(require("./equationType1Exercise"), exports);
19
19
  __exportStar(require("./equationType2Exercise"), exports);
20
20
  __exportStar(require("./equationType3Exercise"), exports);
21
21
  __exportStar(require("./equationType4Exercise"), exports);
22
- __exportStar(require("./expEquation"), exports);
23
22
  __exportStar(require("./firstDegreeEquation"), exports);
24
23
  __exportStar(require("./fractionEquation"), exports);
25
- __exportStar(require("./logEquation"), exports);
26
24
  __exportStar(require("./multiplicationEquation"), exports);
@@ -1,5 +1,3 @@
1
1
  export * from "./evaluateExpression";
2
- export * from "./expSimplifiying";
3
- export * from "./logSimplifiying";
4
2
  export * from "./reduceExpression";
5
3
  //# 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,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,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"}
@@ -15,6 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./evaluateExpression"), exports);
18
- __exportStar(require("./expSimplifiying"), exports);
19
- __exportStar(require("./logSimplifiying"), exports);
20
18
  __exportStar(require("./reduceExpression"), exports);
@@ -47,5 +47,5 @@ export interface MathExercise<TIdentifiers = {}> {
47
47
  isAnswerValid?: VEA<TIdentifiers>;
48
48
  }
49
49
  export type MathLevel = "6ème" | "5ème" | "4ème" | "3ème" | "2nde" | "1reTech" | "1reESM" | "1reSpé" | "TermSpé" | "TermTech" | "MathExp" | "MathComp" | "CAP" | "2ndPro" | "1rePro" | "TermPro";
50
- 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" | "Nombres complexes" | "Périmètres" | "Pourcentages" | "Primitives" | "Probabilités" | "Proportionnalité" | "Puissances" | "Racines carrées" | "Second degré" | "Statistiques" | "Suites" | "Théorème de Pythagore" | "Théorème de Thalès" | "Trigonométrie" | "Valeur absolue" | "Vecteurs";
50
+ 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" | "Nombres complexes" | "Périmètres" | "Pourcentages" | "Primitives" | "Probabilités" | "Proportionnalité" | "Puissances" | "Racines carrées" | "Second degré" | "Statistiques" | "Suites" | "Théorème de Pythagore" | "Théorème de Thalès" | "Trigonométrie" | "Valeur absolue" | "Vecteurs";
51
51
  //# sourceMappingURL=exercise.d.ts.map
@@ -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;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,MAAM,kBAE3D,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAElC,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;IACvB,MAAM,EAAE,KAAK,GAAG,KAAK,CAAC;CACvB,CAAC;AACF,MAAM,WAAW,QAAQ,CAAC,YAAY,GAAG,EAAE;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,KAAK,GAAG,KAAK,CAAC;IAC5B,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,cAAc,CAAC,EAA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N,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,mBAAmB,GACnB,YAAY,GACZ,cAAc,GACd,YAAY,GACZ,cAAc,GACd,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,MAAM,kBAE3D,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAElC,MAAM,MAAM,WAAW,GAAG;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1,8 @@
1
+ import { MathExercise } from "../../../exercises/exercise";
2
+ type Identifiers = {
3
+ yValue: number;
4
+ splinePoints: [number, number][];
5
+ };
6
+ export declare const graphicEquation: MathExercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=graphicEquation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphicEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/basics/graphicEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;CAClC,CAAC;AAiGF,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,WAAW,CAarD,CAAC"}
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.graphicEquation = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
6
+ const equationKeys_1 = require("../../../exercises/utils/keys/equationKeys");
7
+ const randint_1 = require("../../../math/utils/random/randint");
8
+ const equationSolutionNode_1 = require("../../../tree/nodes/equations/equationSolutionNode");
9
+ const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
10
+ const discreteSetNode_1 = require("../../../tree/nodes/sets/discreteSetNode");
11
+ const coinFlip_1 = require("../../../utils/coinFlip");
12
+ const getGraphicEquationQuestion = () => {
13
+ let xSolutions = [];
14
+ const nb = (0, randint_1.randint)(2, 4);
15
+ // const nb = 2;
16
+ for (let i = 0; i < nb; i++) {
17
+ xSolutions.push((0, randint_1.randint)(-9, 10, xSolutions));
18
+ }
19
+ xSolutions.sort((a, b) => a - b);
20
+ const answer = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode(xSolutions.map((sol) => new numberNode_1.NumberNode(sol)))).toTex();
21
+ const yValue = (0, randint_1.randint)(-5, 6);
22
+ const splinePoints = [];
23
+ let prevYWasAbove = (0, coinFlip_1.coinFlip)();
24
+ if ((0, coinFlip_1.coinFlip)()) {
25
+ const y = prevYWasAbove ? (0, randint_1.randint)(-2, 0) : (0, randint_1.randint)(1, 3);
26
+ prevYWasAbove = y > 0;
27
+ splinePoints.push([xSolutions[0] - (1 + Math.random() * 3), yValue + y]);
28
+ }
29
+ for (let i = 0; i < xSolutions.length; i++) {
30
+ splinePoints.push([xSolutions[i], yValue]);
31
+ if (i < xSolutions.length - 1) {
32
+ const mid = (xSolutions[i] + xSolutions[i + 1]) / 2;
33
+ const distance = xSolutions[i + 1] - xSolutions[i];
34
+ const x = mid + ((Math.random() * 2) / 5) * (distance / 2);
35
+ const y = prevYWasAbove ? (0, randint_1.randint)(-2, 0) : (0, randint_1.randint)(1, 3);
36
+ prevYWasAbove = y > 0;
37
+ splinePoints.push([x, yValue + y]);
38
+ }
39
+ }
40
+ if ((0, coinFlip_1.coinFlip)() || splinePoints.length < 4) {
41
+ const y = prevYWasAbove ? (0, randint_1.randint)(-2, 0) : (0, randint_1.randint)(1, 3);
42
+ prevYWasAbove = y > 0;
43
+ splinePoints.push([
44
+ xSolutions[xSolutions.length - 1] + (1 + Math.random() * 3),
45
+ yValue + y,
46
+ ]);
47
+ }
48
+ const xMin = Math.min(...splinePoints.map((point) => point[0]));
49
+ const yMin = Math.min(...splinePoints.map((point) => point[1]));
50
+ const xMax = Math.max(...splinePoints.map((point) => point[0]));
51
+ const yMax = Math.max(...splinePoints.map((point) => point[1]));
52
+ const question = {
53
+ answer,
54
+ instruction: `Déterminer graphiquement les solutions de l'équation $f(x) = ${yValue}$ où $f$ est la fonction représentée ci-dessous.`,
55
+ keys: equationKeys_1.equationKeys,
56
+ answerFormat: "tex",
57
+ commands: [
58
+ `Spline(${splinePoints
59
+ .map((point) => `(${point[0]},${point[1]})`)
60
+ .join(",")})`,
61
+ ...splinePoints.map((point) => `(${point[0]},${point[1]})`),
62
+ ],
63
+ coords: [
64
+ Math.min(xMin - 1, -1),
65
+ Math.max(xMax + 1, 1),
66
+ Math.min(yMin - 1, -1),
67
+ Math.max(yMax + 1, 1),
68
+ ],
69
+ identifiers: { yValue, splinePoints },
70
+ };
71
+ return question;
72
+ };
73
+ const getPropositions = (n, { answer }) => {
74
+ const propositions = [];
75
+ (0, exercise_1.addValidProp)(propositions, answer);
76
+ (0, exercise_1.tryToAddWrongProp)(propositions, `S=\\emptyset`);
77
+ while (propositions.length < n) {
78
+ const nbs = [];
79
+ const nbSol = (0, randint_1.randint)(2, 4);
80
+ for (let i = 0; i < nbSol; i++) {
81
+ nbs.push((0, randint_1.randint)(-9, 10, nbs));
82
+ }
83
+ nbs.sort((a, b) => a - b);
84
+ const sol = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode(nbs.map((nb) => new numberNode_1.NumberNode(nb))));
85
+ (0, exercise_1.tryToAddWrongProp)(propositions, sol.toTex());
86
+ }
87
+ return (0, exercise_1.shuffleProps)(propositions, n);
88
+ };
89
+ const isAnswerValid = (ans, { yValue, splinePoints }) => {
90
+ const xSolutions = splinePoints
91
+ .filter((p) => p[1] === yValue)
92
+ .map((p) => p[0]);
93
+ const answerTree = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode(xSolutions.map((sol) => new numberNode_1.NumberNode(sol))));
94
+ const texs = answerTree.toAllValidTexs();
95
+ return texs.includes(ans);
96
+ };
97
+ exports.graphicEquation = {
98
+ id: "graphicEquation",
99
+ connector: "\\iff",
100
+ label: "Résoudre graphiquement une équation",
101
+ levels: ["2ndPro", "2nde", "1rePro", "1reESM", "1reTech"],
102
+ isSingleStep: true,
103
+ sections: ["Équations", "Fonctions"],
104
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getGraphicEquationQuestion, nb),
105
+ qcmTimer: 60,
106
+ freeTimer: 60,
107
+ getPropositions,
108
+ isAnswerValid,
109
+ };
@@ -0,0 +1,16 @@
1
+ import { MathExercise } from "../../../exercises/exercise";
2
+ import { ClosureType } from "../../../tree/nodes/sets/intervalNode";
3
+ type Identifiers = {
4
+ yValue: number;
5
+ splinePoints: [number, number][];
6
+ isStrict: boolean;
7
+ isAskingSup: boolean;
8
+ intervals: {
9
+ a: number;
10
+ b: number;
11
+ closure: ClosureType;
12
+ }[];
13
+ };
14
+ export declare const graphicInequation: MathExercise<Identifiers>;
15
+ export {};
16
+ //# sourceMappingURL=graphicInequation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphicInequation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/basics/graphicInequation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAAE,WAAW,EAAgB,MAAM,oCAAoC,CAAC;AAI/E,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,WAAW,CAAA;KAAE,EAAE,CAAC;CAC7D,CAAC;AA6JF,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAAC,WAAW,CAavD,CAAC"}
@@ -0,0 +1,147 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.graphicInequation = 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 inequationSolutionNode_1 = require("../../../tree/nodes/inequations/inequationSolutionNode");
8
+ const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
9
+ const intervalNode_1 = require("../../../tree/nodes/sets/intervalNode");
10
+ const unionIntervalNode_1 = require("../../../tree/nodes/sets/unionIntervalNode");
11
+ const coinFlip_1 = require("../../../utils/coinFlip");
12
+ const getGraphicInequationQuestion = () => {
13
+ let xSolutions = [];
14
+ const nb = (0, randint_1.randint)(2, 4);
15
+ for (let i = 0; i < nb; i++) {
16
+ xSolutions.push((0, randint_1.randint)(-9, 10, xSolutions));
17
+ }
18
+ xSolutions.sort((a, b) => a - b);
19
+ const isAskingSup = (0, coinFlip_1.coinFlip)();
20
+ const isStrict = (0, coinFlip_1.coinFlip)();
21
+ const intervals = [];
22
+ const yValue = (0, randint_1.randint)(-5, 6);
23
+ const splinePoints = [];
24
+ let prevYWasAbove = (0, coinFlip_1.coinFlip)();
25
+ if (!isStrict || (0, coinFlip_1.coinFlip)()) {
26
+ //le !isStrict sert à empcher les points uniques solution
27
+ const x = xSolutions[0] - (0, randint_1.randint)(1, 3);
28
+ const y = prevYWasAbove ? (0, randint_1.randint)(-2, 0) : (0, randint_1.randint)(1, 3);
29
+ if ((y > 0 && isAskingSup) || (y < 0 && !isAskingSup)) {
30
+ intervals.push({
31
+ a: x,
32
+ b: xSolutions[0],
33
+ closure: isStrict ? intervalNode_1.ClosureType.FO : intervalNode_1.ClosureType.FF,
34
+ });
35
+ }
36
+ prevYWasAbove = y > 0;
37
+ splinePoints.push([x, yValue + y]);
38
+ }
39
+ for (let i = 0; i < xSolutions.length; i++) {
40
+ splinePoints.push([xSolutions[i], yValue]);
41
+ if (i < xSolutions.length - 1) {
42
+ const mid = (xSolutions[i] + xSolutions[i + 1]) / 2;
43
+ const distance = xSolutions[i + 1] - xSolutions[i];
44
+ const x = mid + ((Math.random() * 2) / 5) * (distance / 2);
45
+ const y = prevYWasAbove ? (0, randint_1.randint)(-2, 0) : (0, randint_1.randint)(1, 3);
46
+ if ((y > 0 && isAskingSup) || (y < 0 && !isAskingSup)) {
47
+ intervals.push({
48
+ a: xSolutions[i],
49
+ b: xSolutions[i + 1],
50
+ closure: isStrict ? intervalNode_1.ClosureType.OO : intervalNode_1.ClosureType.FF,
51
+ });
52
+ }
53
+ prevYWasAbove = y > 0;
54
+ splinePoints.push([x, yValue + y]);
55
+ }
56
+ }
57
+ if (!isStrict || (0, coinFlip_1.coinFlip)() || splinePoints.length < 4) {
58
+ const x = xSolutions[xSolutions.length - 1] + (0, randint_1.randint)(1, 3);
59
+ const y = prevYWasAbove ? (0, randint_1.randint)(-2, 0) : (0, randint_1.randint)(1, 3);
60
+ if ((y > 0 && isAskingSup) || (y < 0 && !isAskingSup)) {
61
+ intervals.push({
62
+ a: xSolutions[xSolutions.length - 1],
63
+ b: x,
64
+ closure: isStrict ? intervalNode_1.ClosureType.OF : intervalNode_1.ClosureType.FF,
65
+ });
66
+ }
67
+ prevYWasAbove = y > 0;
68
+ splinePoints.push([x, yValue + y]);
69
+ }
70
+ const xMin = Math.min(...splinePoints.map((point) => point[0]));
71
+ const yMin = Math.min(...splinePoints.map((point) => point[1]));
72
+ const xMax = Math.max(...splinePoints.map((point) => point[0]));
73
+ const yMax = Math.max(...splinePoints.map((point) => point[1]));
74
+ const intervalsNodes = intervals.map((i) => new intervalNode_1.IntervalNode(new numberNode_1.NumberNode(i.a), new numberNode_1.NumberNode(i.b), i.closure));
75
+ const answer = intervalsNodes.length === 1
76
+ ? `S=${intervalsNodes[0].toTex()}`
77
+ : `S=${new unionIntervalNode_1.UnionIntervalNode(intervalsNodes).toTex()}`;
78
+ const question = {
79
+ answer,
80
+ instruction: `Déterminer graphiquement les solutions de l'inéquation $f(x)${isAskingSup ? (isStrict ? ">" : "\\geq") : isStrict ? "<" : "\\leq"}${yValue}$ où $f$ est la fonction représentée ci-dessous.`,
81
+ keys: [
82
+ "S",
83
+ "equal",
84
+ "lbracket",
85
+ "semicolon",
86
+ "rbracket",
87
+ "cup",
88
+ "lbrace",
89
+ "rbrace",
90
+ ],
91
+ answerFormat: "tex",
92
+ commands: [
93
+ `Spline(${splinePoints
94
+ .map((point) => `(${point[0]},${point[1]})`)
95
+ .join(",")})`,
96
+ ...splinePoints.map((point) => `(${point[0]},${point[1]})`),
97
+ ],
98
+ coords: [
99
+ Math.min(xMin - 1, -1),
100
+ Math.max(xMax + 1, 1),
101
+ Math.min(yMin - 1, -1),
102
+ Math.max(yMax + 1, 1),
103
+ ],
104
+ identifiers: {
105
+ yValue,
106
+ splinePoints,
107
+ isAskingSup,
108
+ isStrict,
109
+ intervals,
110
+ },
111
+ };
112
+ return question;
113
+ };
114
+ const getPropositions = (n, { answer, intervals, splinePoints, yValue }) => {
115
+ const propositions = [];
116
+ (0, exercise_1.addValidProp)(propositions, answer);
117
+ (0, exercise_1.tryToAddWrongProp)(propositions, `S=\\emptyset`);
118
+ (0, exercise_1.tryToAddWrongProp)(propositions, `S=${new intervalNode_1.IntervalNode(new numberNode_1.NumberNode(splinePoints[0][0]), new numberNode_1.NumberNode(yValue), intervalNode_1.ClosureType.FF).toTex()}`);
119
+ while (propositions.length < n) {
120
+ const a = (0, randint_1.randint)(-9, 3);
121
+ const b = (0, randint_1.randint)(3, 10, [a]);
122
+ (0, exercise_1.tryToAddWrongProp)(propositions, `S=${new intervalNode_1.IntervalNode(new numberNode_1.NumberNode(a), new numberNode_1.NumberNode(b), intervalNode_1.ClosureType.FF).toTex()}`);
123
+ }
124
+ return (0, exercise_1.shuffleProps)(propositions, n);
125
+ };
126
+ const isAnswerValid = (ans, { intervals }) => {
127
+ const intervalsNodes = intervals.map((n) => new intervalNode_1.IntervalNode(new numberNode_1.NumberNode(n.a), new numberNode_1.NumberNode(n.b), n.closure));
128
+ const intervalsTree = intervalsNodes.length === 1
129
+ ? intervalsNodes[0]
130
+ : new unionIntervalNode_1.UnionIntervalNode(intervalsNodes);
131
+ const answerTree = new inequationSolutionNode_1.InequationSolutionNode(intervalsTree);
132
+ const texs = answerTree.toAllValidTexs();
133
+ return texs.includes(ans);
134
+ };
135
+ exports.graphicInequation = {
136
+ id: "graphicInequation",
137
+ connector: "\\iff",
138
+ label: "Résoudre graphiquement une inéquation",
139
+ levels: ["2ndPro", "2nde", "1rePro", "1reESM", "1reTech"],
140
+ isSingleStep: true,
141
+ sections: ["Inéquations", "Fonctions"],
142
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getGraphicInequationQuestion, nb),
143
+ qcmTimer: 60,
144
+ freeTimer: 60,
145
+ getPropositions,
146
+ isAnswerValid,
147
+ };
@@ -2,4 +2,6 @@ export * from "./imageFunction";
2
2
  export * from "./imageFunctionGeogebra";
3
3
  export * from "./inverseImageFunction";
4
4
  export * from "./inverseImageFunctionGeogebra";
5
+ export * from "./graphicEquation";
6
+ export * from "./graphicInequation";
5
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/basics/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/basics/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
@@ -18,3 +18,5 @@ __exportStar(require("./imageFunction"), exports);
18
18
  __exportStar(require("./imageFunctionGeogebra"), exports);
19
19
  __exportStar(require("./inverseImageFunction"), exports);
20
20
  __exportStar(require("./inverseImageFunctionGeogebra"), exports);
21
+ __exportStar(require("./graphicEquation"), exports);
22
+ __exportStar(require("./graphicInequation"), exports);
@@ -0,0 +1,8 @@
1
+ import { MathExercise } from "../../../exercises/exercise";
2
+ type Identifiers = {
3
+ a: number;
4
+ k: number;
5
+ };
6
+ export declare const expEquation: MathExercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=expEquation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/exponential/expEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAelC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAwEF,eAAO,MAAM,WAAW,EAAE,YAAY,CAAC,WAAW,CAYjD,CAAC"}
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.expEquation = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
6
+ const rational_1 = require("../../../math/numbers/rationals/rational");
7
+ const randint_1 = require("../../../math/utils/random/randint");
8
+ const equationSolutionNode_1 = require("../../../tree/nodes/equations/equationSolutionNode");
9
+ const expNode_1 = require("../../../tree/nodes/functions/expNode");
10
+ const logNode_1 = require("../../../tree/nodes/functions/logNode");
11
+ const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
12
+ const equalNode_1 = require("../../../tree/nodes/equations/equalNode");
13
+ const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
14
+ const discreteSetNode_1 = require("../../../tree/nodes/sets/discreteSetNode");
15
+ const variableNode_1 = require("../../../tree/nodes/variables/variableNode");
16
+ const shuffle_1 = require("../../../utils/shuffle");
17
+ const getExpEquation = () => {
18
+ const a = (0, randint_1.randint)(-9, 20, [0]);
19
+ const k = a > 0 ? (0, randint_1.randint)(1, 20) : (0, randint_1.randint)(-20, 0);
20
+ const equation = new equalNode_1.EqualNode(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a), new expNode_1.ExpNode(new variableNode_1.VariableNode("x"))), new numberNode_1.NumberNode(k));
21
+ const answer = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode([new logNode_1.LogNode(new rational_1.Rational(k, a).simplify().toTree())])).toTex();
22
+ const question = {
23
+ instruction: `Résoudre l'équation $${equation.toTex()}$.`,
24
+ answer: answer,
25
+ keys: [
26
+ "x",
27
+ "equal",
28
+ "epower",
29
+ "exp",
30
+ "ln",
31
+ "S",
32
+ "lbrace",
33
+ "semicolon",
34
+ "rbrace",
35
+ ],
36
+ answerFormat: "tex",
37
+ identifiers: { a, k },
38
+ };
39
+ return question;
40
+ };
41
+ const getPropositions = (n, { answer }) => {
42
+ const propositions = [];
43
+ (0, exercise_1.addValidProp)(propositions, answer);
44
+ while (propositions.length < n) {
45
+ const randomA = (0, randint_1.randint)(1, 10);
46
+ const randomK = (0, randint_1.randint)(1, 20);
47
+ (0, exercise_1.tryToAddWrongProp)(propositions, new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode([
48
+ new logNode_1.LogNode(new rational_1.Rational(randomK, randomA).simplify().toTree()),
49
+ ])).toTex());
50
+ }
51
+ return (0, shuffle_1.shuffle)(propositions);
52
+ };
53
+ const isAnswerValid = (ans, { a, k }) => {
54
+ const answer = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode([
55
+ new logNode_1.LogNode(new rational_1.Rational(k, a)
56
+ .simplify()
57
+ .toTree({ allowFractionToDecimal: true })),
58
+ ], { allowRawRightChildAsSolution: true }));
59
+ const texs = answer.toAllValidTexs();
60
+ console.log(texs);
61
+ return texs.includes(ans);
62
+ };
63
+ exports.expEquation = {
64
+ id: "expEquation",
65
+ connector: "=",
66
+ label: "Résoudre des équations de type $a \\times \\exp(x) = k$",
67
+ levels: ["1reSpé", "TermSpé", "MathComp"],
68
+ sections: ["Exponentielle"],
69
+ isSingleStep: false,
70
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getExpEquation, nb),
71
+ qcmTimer: 60,
72
+ freeTimer: 60,
73
+ getPropositions,
74
+ isAnswerValid,
75
+ };
@@ -0,0 +1,10 @@
1
+ import { MathExercise } from "../../../exercises/exercise";
2
+ type Identifiers = {
3
+ random: number;
4
+ a?: number;
5
+ uCoeffs: number[];
6
+ vCoeffs: number[];
7
+ };
8
+ export declare const expSimplifiying: MathExercise<Identifiers>;
9
+ export {};
10
+ //# sourceMappingURL=expSimplifiying.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expSimplifiying.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/exponential/expSimplifiying.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAclC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAmIF,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,WAAW,CAYrD,CAAC"}
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.expSimplifiying = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
6
+ const polynomial_1 = require("../../../math/polynomials/polynomial");
7
+ const randint_1 = require("../../../math/utils/random/randint");
8
+ const expNode_1 = require("../../../tree/nodes/functions/expNode");
9
+ const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
10
+ const fractionNode_1 = require("../../../tree/nodes/operators/fractionNode");
11
+ const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
12
+ const shuffle_1 = require("../../../utils/shuffle");
13
+ const getExpSimplifiying = () => {
14
+ const random = (0, randint_1.randint)(1, 4);
15
+ let a;
16
+ let u, v;
17
+ let expression;
18
+ let answer;
19
+ switch (random) {
20
+ case 1:
21
+ //e^u*e^a / e^v
22
+ a = (0, randint_1.randint)(-9, 10, [0]);
23
+ u = new polynomial_1.Polynomial([0, (0, randint_1.randint)(-9, 10, [0])]);
24
+ v = new polynomial_1.Polynomial([(0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-9, 10, [0])]);
25
+ expression = new fractionNode_1.FractionNode(new multiplyNode_1.MultiplyNode(new expNode_1.ExpNode(u.toTree()), new expNode_1.ExpNode(new numberNode_1.NumberNode(a))), new expNode_1.ExpNode(v.toTree()));
26
+ answer = new expNode_1.ExpNode(u.add(a).add(v.opposite()).toTree()).toTex();
27
+ break;
28
+ case 2:
29
+ //e^u * e^v
30
+ u = new polynomial_1.Polynomial([(0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-9, 10, [0])]);
31
+ v = new polynomial_1.Polynomial([(0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-9, 10, [0])]);
32
+ expression = new multiplyNode_1.MultiplyNode(new expNode_1.ExpNode(u.toTree()), new expNode_1.ExpNode(v.toTree()));
33
+ expression.shuffle();
34
+ answer = new expNode_1.ExpNode(u.add(v).toTree()).toTex();
35
+ break;
36
+ case 3:
37
+ //e^u / e^v
38
+ u = new polynomial_1.Polynomial([(0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-9, 10, [0])]);
39
+ v = new polynomial_1.Polynomial([(0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-9, 10, [0])]);
40
+ expression = new fractionNode_1.FractionNode(new expNode_1.ExpNode(u.toTree()), new expNode_1.ExpNode(v.toTree()));
41
+ answer = new expNode_1.ExpNode(u.add(v.opposite()).toTree()).toTex();
42
+ break;
43
+ default:
44
+ throw Error("something wrong happened");
45
+ }
46
+ const question = {
47
+ instruction: `Simplifier l'expression $${expression.toTex()}$.`,
48
+ answer,
49
+ keys: ["x", "epower", "exp"],
50
+ answerFormat: "tex",
51
+ identifiers: {
52
+ random,
53
+ a,
54
+ uCoeffs: u.coefficients,
55
+ vCoeffs: v.coefficients,
56
+ },
57
+ };
58
+ return question;
59
+ };
60
+ const getPropositions = (n, { answer, random, a, uCoeffs, vCoeffs }) => {
61
+ const propositions = [];
62
+ (0, exercise_1.addValidProp)(propositions, answer);
63
+ const u = new polynomial_1.Polynomial(uCoeffs);
64
+ const v = new polynomial_1.Polynomial(vCoeffs);
65
+ switch (random) {
66
+ case 1:
67
+ (0, exercise_1.tryToAddWrongProp)(propositions, new expNode_1.ExpNode(u.times(a).add(v.opposite()).toTree()).toTex());
68
+ break;
69
+ case 2:
70
+ (0, exercise_1.tryToAddWrongProp)(propositions, new expNode_1.ExpNode(u.multiply(v).toTree()).toTex());
71
+ break;
72
+ case 3:
73
+ (0, exercise_1.tryToAddWrongProp)(propositions, new expNode_1.ExpNode(new fractionNode_1.FractionNode(u.toTree(), v.toTree())).toTex());
74
+ (0, exercise_1.tryToAddWrongProp)(propositions, new expNode_1.ExpNode(u.add(v).toTree()).toTex());
75
+ break;
76
+ default:
77
+ throw Error("received wrong quesiton type");
78
+ }
79
+ while (propositions.length < n) {
80
+ (0, exercise_1.tryToAddWrongProp)(propositions, new expNode_1.ExpNode(polynomial_1.PolynomialConstructor.randomWithOrder(1).toTree()).toTex());
81
+ }
82
+ return (0, shuffle_1.shuffle)(propositions);
83
+ };
84
+ const isAnswerValid = (ans, { a, random, uCoeffs, vCoeffs }) => {
85
+ const u = new polynomial_1.Polynomial(uCoeffs);
86
+ const v = new polynomial_1.Polynomial(vCoeffs);
87
+ let answer;
88
+ switch (random) {
89
+ case 1:
90
+ answer = new expNode_1.ExpNode(u.add(a).add(v.opposite()).toTree());
91
+ break;
92
+ case 2:
93
+ answer = new expNode_1.ExpNode(u.add(v).toTree());
94
+ break;
95
+ case 3:
96
+ answer = new expNode_1.ExpNode(u.add(v.opposite()).toTree());
97
+ break;
98
+ default:
99
+ throw Error("wrong random in exp simplifying");
100
+ }
101
+ const texs = answer.toAllValidTexs();
102
+ return texs.includes(ans);
103
+ };
104
+ exports.expSimplifiying = {
105
+ id: "expSimplifiying",
106
+ connector: "\\iff",
107
+ label: "Simplifier des expressions avec l'exponentielle",
108
+ levels: ["1reSpé", "TermSpé", "MathComp"],
109
+ sections: ["Exponentielle"],
110
+ isSingleStep: false,
111
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getExpSimplifiying, nb),
112
+ qcmTimer: 60,
113
+ freeTimer: 60,
114
+ getPropositions,
115
+ isAnswerValid,
116
+ };
@@ -0,0 +1,3 @@
1
+ export * from "./expEquation";
2
+ export * from "./expSimplifiying";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/exponential/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./expEquation"), exports);
18
+ __exportStar(require("./expSimplifiying"), exports);
@@ -4,4 +4,6 @@ export * from "./basics";
4
4
  export * from "./cube";
5
5
  export * from "./rationalFraction";
6
6
  export * from "./trinoms";
7
+ export * from "./exponential";
8
+ export * from "./logarithm";
7
9
  //# sourceMappingURL=index.d.ts.map