math-exercises 2.0.6 → 2.0.9
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.
- package/lib/exercises/calculLitteral/equation/index.d.ts +0 -2
- package/lib/exercises/calculLitteral/equation/index.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/index.js +0 -2
- package/lib/exercises/calculLitteral/simplifying/index.d.ts +0 -2
- package/lib/exercises/calculLitteral/simplifying/index.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/simplifying/index.js +0 -2
- package/lib/exercises/complex/argumentFromAlgebraicComplex.d.ts +6 -0
- package/lib/exercises/complex/argumentFromAlgebraicComplex.d.ts.map +1 -1
- package/lib/exercises/complex/argumentFromAlgebraicComplex.js +62 -51
- package/lib/exercises/complex/index.d.ts +1 -0
- package/lib/exercises/complex/index.d.ts.map +1 -1
- package/lib/exercises/complex/index.js +1 -0
- package/lib/exercises/exercise.d.ts +1 -1
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/functions/basics/graphicEquation.d.ts +8 -0
- package/lib/exercises/functions/basics/graphicEquation.d.ts.map +1 -0
- package/lib/exercises/functions/basics/graphicEquation.js +109 -0
- package/lib/exercises/functions/basics/graphicInequation.d.ts +16 -0
- package/lib/exercises/functions/basics/graphicInequation.d.ts.map +1 -0
- package/lib/exercises/functions/basics/graphicInequation.js +147 -0
- package/lib/exercises/functions/basics/index.d.ts +2 -0
- package/lib/exercises/functions/basics/index.d.ts.map +1 -1
- package/lib/exercises/functions/basics/index.js +2 -0
- package/lib/exercises/functions/exponential/expEquation.d.ts +9 -0
- package/lib/exercises/functions/exponential/expEquation.d.ts.map +1 -0
- package/lib/exercises/functions/exponential/expEquation.js +75 -0
- package/lib/exercises/functions/exponential/expSimplifiying.d.ts +10 -0
- package/lib/exercises/functions/exponential/expSimplifiying.d.ts.map +1 -0
- package/lib/exercises/functions/exponential/expSimplifiying.js +116 -0
- package/lib/exercises/functions/exponential/index.d.ts +3 -0
- package/lib/exercises/functions/exponential/index.d.ts.map +1 -0
- package/lib/exercises/functions/exponential/index.js +18 -0
- package/lib/exercises/functions/index.d.ts +2 -0
- package/lib/exercises/functions/index.d.ts.map +1 -1
- package/lib/exercises/functions/index.js +2 -0
- package/lib/exercises/functions/logarithm/index.d.ts +5 -0
- package/lib/exercises/functions/logarithm/index.d.ts.map +1 -0
- package/lib/exercises/functions/logarithm/index.js +20 -0
- package/lib/exercises/functions/logarithm/log10PowerSimplifying.d.ts +7 -0
- package/lib/exercises/functions/logarithm/log10PowerSimplifying.d.ts.map +1 -0
- package/lib/exercises/functions/logarithm/log10PowerSimplifying.js +54 -0
- package/lib/exercises/functions/logarithm/logEquation.d.ts +9 -0
- package/lib/exercises/functions/logarithm/logEquation.d.ts.map +1 -0
- package/lib/exercises/functions/logarithm/logEquation.js +74 -0
- package/lib/exercises/functions/logarithm/logPowerEquation.d.ts +12 -0
- package/lib/exercises/functions/logarithm/logPowerEquation.d.ts.map +1 -0
- package/lib/exercises/functions/logarithm/logPowerEquation.js +103 -0
- package/lib/exercises/functions/logarithm/logSimplifiying.d.ts +9 -0
- package/lib/exercises/functions/logarithm/logSimplifiying.d.ts.map +1 -0
- package/lib/exercises/functions/logarithm/logSimplifiying.js +77 -0
- package/lib/exercises/sets/intervals/inequalityToInterval.d.ts.map +1 -1
- package/lib/exercises/trigonometry/associatePoint.d.ts +7 -0
- package/lib/exercises/trigonometry/associatePoint.d.ts.map +1 -0
- package/lib/exercises/trigonometry/associatePoint.js +64 -0
- package/lib/exercises/trigonometry/index.d.ts +1 -0
- package/lib/exercises/trigonometry/index.d.ts.map +1 -1
- package/lib/exercises/trigonometry/index.js +1 -0
- package/lib/exercises/trigonometry/remarkableValues.d.ts +1 -1
- package/lib/exercises/trigonometry/remarkableValues.d.ts.map +1 -1
- package/lib/exercises/trigonometry/remarkableValues.js +9 -7
- package/lib/index.d.ts +43 -18
- package/lib/index.d.ts.map +1 -1
- package/lib/math/complex/complex.d.ts +1 -1
- package/lib/math/numbers/logarithms/ln.d.ts +12 -0
- package/lib/math/numbers/logarithms/ln.d.ts.map +1 -0
- package/lib/math/numbers/logarithms/ln.js +18 -0
- package/lib/math/numbers/nombre.js +1 -1
- package/lib/math/numbers/reals/extendedRingElement.d.ts +2 -1
- package/lib/math/numbers/reals/extendedRingElement.d.ts.map +1 -1
- package/lib/math/polynomials/trinom.d.ts +2 -2
- package/lib/math/trigonometry/remarkableValue.d.ts +3 -10
- package/lib/math/trigonometry/remarkableValue.d.ts.map +1 -1
- package/lib/math/trigonometry/remarkableValue.js +5 -15
- package/lib/math/trigonometry/remarkableValues.d.ts +7 -1
- package/lib/math/trigonometry/remarkableValues.d.ts.map +1 -1
- package/lib/math/trigonometry/remarkableValues.js +63 -13
- package/lib/math/utils/arithmetic/gcd.js +1 -1
- package/lib/server.js +1 -7
- package/lib/tree/nodes/algebraicNode.d.ts +3 -0
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/absNode.d.ts +3 -1
- package/lib/tree/nodes/functions/absNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/absNode.js +5 -1
- package/lib/tree/nodes/functions/cosNode.d.ts +3 -1
- package/lib/tree/nodes/functions/cosNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/cosNode.js +21 -0
- package/lib/tree/nodes/functions/expNode.d.ts +3 -1
- package/lib/tree/nodes/functions/expNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/expNode.js +4 -0
- package/lib/tree/nodes/functions/functionNode.d.ts +3 -2
- package/lib/tree/nodes/functions/functionNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/functionNode.js +3 -2
- package/lib/tree/nodes/functions/log10Node.d.ts +20 -0
- package/lib/tree/nodes/functions/log10Node.d.ts.map +1 -0
- package/lib/tree/nodes/functions/log10Node.js +82 -0
- package/lib/tree/nodes/functions/logNode.d.ts +3 -1
- package/lib/tree/nodes/functions/logNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/logNode.js +33 -1
- package/lib/tree/nodes/functions/oppositeNode.d.ts +3 -0
- package/lib/tree/nodes/functions/oppositeNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/oppositeNode.js +7 -0
- package/lib/tree/nodes/functions/sinNode.d.ts +3 -1
- package/lib/tree/nodes/functions/sinNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sinNode.js +21 -0
- package/lib/tree/nodes/functions/sqrtNode.d.ts +3 -0
- package/lib/tree/nodes/functions/sqrtNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sqrtNode.js +41 -0
- package/lib/tree/nodes/geometry/lengthNode.d.ts +5 -1
- package/lib/tree/nodes/geometry/lengthNode.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/lengthNode.js +12 -1
- package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts +3 -2
- package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts.map +1 -1
- package/lib/tree/nodes/inequations/inequationSolutionNode.js +15 -6
- package/lib/tree/nodes/node.d.ts +1 -0
- package/lib/tree/nodes/node.d.ts.map +1 -1
- package/lib/tree/nodes/node.js +14 -1
- package/lib/tree/nodes/numbers/constantNode.d.ts +3 -0
- package/lib/tree/nodes/numbers/constantNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/constantNode.js +7 -0
- package/lib/tree/nodes/numbers/numberNode.d.ts +3 -0
- package/lib/tree/nodes/numbers/numberNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/numberNode.js +7 -0
- package/lib/tree/nodes/operators/addNode.d.ts +3 -0
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +175 -0
- package/lib/tree/nodes/operators/divideNode.d.ts +3 -0
- package/lib/tree/nodes/operators/divideNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/divideNode.js +12 -0
- package/lib/tree/nodes/operators/fractionNode.d.ts +3 -0
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +86 -0
- package/lib/tree/nodes/operators/multiplyNode.d.ts +5 -0
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +127 -10
- package/lib/tree/nodes/operators/powerNode.d.ts +3 -0
- package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/powerNode.js +46 -0
- package/lib/tree/nodes/operators/substractNode.d.ts +3 -0
- package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/substractNode.js +12 -0
- package/lib/tree/nodes/sets/discreteSetNode.d.ts +3 -1
- package/lib/tree/nodes/sets/discreteSetNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/discreteSetNode.js +7 -1
- package/lib/tree/nodes/sets/intervalNode.d.ts +3 -1
- package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/intervalNode.js +7 -1
- package/lib/tree/nodes/sets/setNode.d.ts +9 -1
- package/lib/tree/nodes/sets/setNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/setNode.js +12 -0
- package/lib/tree/nodes/sets/unionIntervalNode.d.ts +3 -1
- package/lib/tree/nodes/sets/unionIntervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/unionIntervalNode.js +7 -1
- package/lib/tree/nodes/variables/variableNode.d.ts +3 -0
- package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
- package/lib/tree/nodes/variables/variableNode.js +10 -0
- package/package.json +1 -1
|
@@ -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 @@
|
|
|
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);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/functions/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/functions/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
|
|
@@ -20,3 +20,5 @@ __exportStar(require("./basics"), exports);
|
|
|
20
20
|
__exportStar(require("./cube"), exports);
|
|
21
21
|
__exportStar(require("./rationalFraction"), exports);
|
|
22
22
|
__exportStar(require("./trinoms"), exports);
|
|
23
|
+
__exportStar(require("./exponential"), exports);
|
|
24
|
+
__exportStar(require("./logarithm"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/logarithm/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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("./logEquation"), exports);
|
|
18
|
+
__exportStar(require("./logSimplifiying"), exports);
|
|
19
|
+
__exportStar(require("./log10PowerSimplifying"), exports);
|
|
20
|
+
__exportStar(require("./logPowerEquation"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log10PowerSimplifying.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/logarithm/log10PowerSimplifying.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAqCF,eAAO,MAAM,qBAAqB,EAAE,YAAY,CAAC,WAAW,CAc3D,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.log10PowerSimplifying = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const decimal_1 = require("../../../math/numbers/decimals/decimal");
|
|
7
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
|
+
const log10Node_1 = require("../../../tree/nodes/functions/log10Node");
|
|
9
|
+
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
10
|
+
const powerNode_1 = require("../../../tree/nodes/operators/powerNode");
|
|
11
|
+
const probaFlip_1 = require("../../../utils/probaFlip");
|
|
12
|
+
const getLog10PowerSimplifyingQuestion = () => {
|
|
13
|
+
const tenthPower = (0, randint_1.randint)(-5, 6, [0, 1]);
|
|
14
|
+
const shouldEvaluate = (0, probaFlip_1.probaFlip)(0.7);
|
|
15
|
+
const nb = shouldEvaluate
|
|
16
|
+
? new decimal_1.Decimal(1).multiplyByPowerOfTen(tenthPower).toTree()
|
|
17
|
+
: new powerNode_1.PowerNode(new numberNode_1.NumberNode(10), new numberNode_1.NumberNode(tenthPower));
|
|
18
|
+
const answer = tenthPower + "";
|
|
19
|
+
const question = {
|
|
20
|
+
answer,
|
|
21
|
+
instruction: `Calculer : $${new log10Node_1.Log10Node(nb).toTex()}$`,
|
|
22
|
+
keys: [],
|
|
23
|
+
answerFormat: "tex",
|
|
24
|
+
identifiers: { tenthPower },
|
|
25
|
+
};
|
|
26
|
+
return question;
|
|
27
|
+
};
|
|
28
|
+
const getPropositions = (n, { answer, tenthPower }) => {
|
|
29
|
+
const propositions = [];
|
|
30
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
31
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "10");
|
|
32
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, tenthPower + 1 + "");
|
|
33
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, tenthPower + 2 + "");
|
|
34
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, tenthPower - 1 + "");
|
|
35
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, tenthPower - 2 + "");
|
|
36
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
37
|
+
};
|
|
38
|
+
const isAnswerValid = (ans, { answer, tenthPower }) => {
|
|
39
|
+
return ans === answer;
|
|
40
|
+
};
|
|
41
|
+
exports.log10PowerSimplifying = {
|
|
42
|
+
id: "log10PowerSimplifying",
|
|
43
|
+
connector: "=",
|
|
44
|
+
label: "Calculer un logarithme décimal",
|
|
45
|
+
levels: ["TermTech", "MathComp"],
|
|
46
|
+
isSingleStep: true,
|
|
47
|
+
sections: ["Logarithme décimal", "Puissances"],
|
|
48
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getLog10PowerSimplifyingQuestion, nb, 15),
|
|
49
|
+
qcmTimer: 60,
|
|
50
|
+
freeTimer: 60,
|
|
51
|
+
getPropositions,
|
|
52
|
+
isAnswerValid,
|
|
53
|
+
maxAllowedQuestions: 15,
|
|
54
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/logarithm/logEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAclC,cAAc;AACd,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAqEF,eAAO,MAAM,WAAW,EAAE,YAAY,CAAC,WAAW,CAYjD,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.logEquation = 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 getLnEquation = () => {
|
|
18
|
+
const a = (0, randint_1.randint)(-9, 20, [0]);
|
|
19
|
+
const k = (0, randint_1.randint)(-9, 20, [0]);
|
|
20
|
+
const equation = new equalNode_1.EqualNode(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a), new logNode_1.LogNode(new variableNode_1.VariableNode("x"))), new numberNode_1.NumberNode(k));
|
|
21
|
+
const answer = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode([new expNode_1.ExpNode(new rational_1.Rational(k, a).simplify().toTree())])).toTex();
|
|
22
|
+
const question = {
|
|
23
|
+
instruction: `Résoudre l'équation $${equation.toTex()}$.`,
|
|
24
|
+
answer,
|
|
25
|
+
keys: [
|
|
26
|
+
"x",
|
|
27
|
+
"equal",
|
|
28
|
+
"ln",
|
|
29
|
+
"e",
|
|
30
|
+
"epower",
|
|
31
|
+
"exp",
|
|
32
|
+
"lbrace",
|
|
33
|
+
"S",
|
|
34
|
+
"semicolon",
|
|
35
|
+
"rbrace",
|
|
36
|
+
],
|
|
37
|
+
answerFormat: "tex",
|
|
38
|
+
identifiers: { a, k },
|
|
39
|
+
};
|
|
40
|
+
return question;
|
|
41
|
+
};
|
|
42
|
+
const getPropositions = (n, { answer }) => {
|
|
43
|
+
const propositions = [];
|
|
44
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
45
|
+
while (propositions.length < n) {
|
|
46
|
+
const randomA = (0, randint_1.randint)(1, 10);
|
|
47
|
+
const randomK = (0, randint_1.randint)(1, 20);
|
|
48
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode([
|
|
49
|
+
new expNode_1.ExpNode(new rational_1.Rational(randomK, randomA).simplify().toTree()),
|
|
50
|
+
])).toTex());
|
|
51
|
+
}
|
|
52
|
+
return (0, shuffle_1.shuffle)(propositions);
|
|
53
|
+
};
|
|
54
|
+
const isAnswerValid = (ans, { a, k }) => {
|
|
55
|
+
const answer = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode([
|
|
56
|
+
new expNode_1.ExpNode(new rational_1.Rational(k, a).simplify().toTree({ allowFractionToDecimal: true })),
|
|
57
|
+
]));
|
|
58
|
+
const texs = answer.toAllValidTexs();
|
|
59
|
+
console.log(texs);
|
|
60
|
+
return texs.includes(ans);
|
|
61
|
+
};
|
|
62
|
+
exports.logEquation = {
|
|
63
|
+
id: "logEquation",
|
|
64
|
+
connector: "=",
|
|
65
|
+
label: "Résoudre des équations de type $a \\times \\ln(x) = k$",
|
|
66
|
+
levels: ["1reSpé", "TermSpé", "MathComp"],
|
|
67
|
+
sections: ["Logarithme népérien", "Exponentielle"],
|
|
68
|
+
isSingleStep: false,
|
|
69
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getLnEquation, nb),
|
|
70
|
+
getPropositions,
|
|
71
|
+
qcmTimer: 60,
|
|
72
|
+
freeTimer: 60,
|
|
73
|
+
isAnswerValid,
|
|
74
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MathExercise } from "../../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
a: number;
|
|
4
|
+
powered: number;
|
|
5
|
+
c: number;
|
|
6
|
+
k: number;
|
|
7
|
+
isLog10: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const logPowerEquation: MathExercise<Identifiers>;
|
|
10
|
+
export declare const log10PowerEquation: MathExercise<Identifiers>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=logPowerEquation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logPowerEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/logarithm/logPowerEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAgBlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE,MAAM,CAAC;IAChB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAwGF,eAAO,MAAM,gBAAgB,EAAE,YAAY,CAAC,WAAW,CAatD,CAAC;AACF,eAAO,MAAM,kBAAkB,EAAE,YAAY,CAAC,WAAW,CAgBxD,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.log10PowerEquation = exports.logPowerEquation = 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 equalNode_1 = require("../../../tree/nodes/equations/equalNode");
|
|
8
|
+
const equationSolutionNode_1 = require("../../../tree/nodes/equations/equationSolutionNode");
|
|
9
|
+
const log10Node_1 = require("../../../tree/nodes/functions/log10Node");
|
|
10
|
+
const logNode_1 = require("../../../tree/nodes/functions/logNode");
|
|
11
|
+
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
12
|
+
const addNode_1 = require("../../../tree/nodes/operators/addNode");
|
|
13
|
+
const fractionNode_1 = require("../../../tree/nodes/operators/fractionNode");
|
|
14
|
+
const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
|
|
15
|
+
const powerNode_1 = require("../../../tree/nodes/operators/powerNode");
|
|
16
|
+
const discreteSetNode_1 = require("../../../tree/nodes/sets/discreteSetNode");
|
|
17
|
+
const variableNode_1 = require("../../../tree/nodes/variables/variableNode");
|
|
18
|
+
/**a*b^x+c=d */
|
|
19
|
+
const getLogPowerEquationQuestion = (opts) => {
|
|
20
|
+
const powered = (0, randint_1.randint)(2, 8);
|
|
21
|
+
const a = (0, randint_1.randint)(1, 10, [powered]);
|
|
22
|
+
const c = (0, randint_1.randint)(-5, 5, [a]);
|
|
23
|
+
const k = (0, randint_1.randint)(5, 15, [powered]);
|
|
24
|
+
const d = k * a + c;
|
|
25
|
+
const xNode = new variableNode_1.VariableNode("x");
|
|
26
|
+
const poweredNode = new numberNode_1.NumberNode(powered);
|
|
27
|
+
const LNode = opts?.isLog10 ? log10Node_1.Log10Node : logNode_1.LogNode;
|
|
28
|
+
const answer = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode([
|
|
29
|
+
new fractionNode_1.FractionNode(new LNode(new numberNode_1.NumberNode(k)), new LNode(poweredNode)).simplify(),
|
|
30
|
+
])).toTex();
|
|
31
|
+
const equation = new equalNode_1.EqualNode(new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a), new powerNode_1.PowerNode(poweredNode, xNode)), new numberNode_1.NumberNode(c)).simplify(), new numberNode_1.NumberNode(d));
|
|
32
|
+
const keys = [
|
|
33
|
+
"log",
|
|
34
|
+
"x",
|
|
35
|
+
"equal",
|
|
36
|
+
"S",
|
|
37
|
+
"lbrace",
|
|
38
|
+
"semicolon",
|
|
39
|
+
"rbrace",
|
|
40
|
+
];
|
|
41
|
+
keys.push(opts?.isLog10 ? "log" : "ln");
|
|
42
|
+
const question = {
|
|
43
|
+
answer,
|
|
44
|
+
instruction: `Résoudre : $${equation.toTex()}$`,
|
|
45
|
+
keys,
|
|
46
|
+
answerFormat: "tex",
|
|
47
|
+
identifiers: { a, c, k, powered, isLog10: opts?.isLog10 ?? false },
|
|
48
|
+
};
|
|
49
|
+
return question;
|
|
50
|
+
};
|
|
51
|
+
const getPropositions = (n, { answer, isLog10, a, c, k, powered }) => {
|
|
52
|
+
const propositions = [];
|
|
53
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
54
|
+
const LNode = isLog10 ? log10Node_1.Log10Node : logNode_1.LogNode;
|
|
55
|
+
const withoutLogs = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode([
|
|
56
|
+
new fractionNode_1.FractionNode(new numberNode_1.NumberNode(k), new numberNode_1.NumberNode(powered)).simplify(),
|
|
57
|
+
]));
|
|
58
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, withoutLogs.toTex());
|
|
59
|
+
while (propositions.length < n) {
|
|
60
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode([
|
|
61
|
+
new fractionNode_1.FractionNode(new LNode(new numberNode_1.NumberNode((0, randint_1.randint)(2, 10))), new LNode(new numberNode_1.NumberNode((0, randint_1.randint)(2, 10)))).simplify(),
|
|
62
|
+
])).toTex());
|
|
63
|
+
}
|
|
64
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
65
|
+
};
|
|
66
|
+
const isAnswerValid = (ans, { a, c, k, powered, isLog10 }) => {
|
|
67
|
+
const LNode = isLog10 ? log10Node_1.Log10Node : logNode_1.LogNode;
|
|
68
|
+
const poweredNode = new numberNode_1.NumberNode(powered);
|
|
69
|
+
const answerSimp = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode([
|
|
70
|
+
new fractionNode_1.FractionNode(new LNode(new numberNode_1.NumberNode(k)), new LNode(poweredNode)).simplify(),
|
|
71
|
+
]));
|
|
72
|
+
const answer = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode([
|
|
73
|
+
new fractionNode_1.FractionNode(new LNode(new numberNode_1.NumberNode(k)), new LNode(poweredNode)),
|
|
74
|
+
]));
|
|
75
|
+
const texs = [...answerSimp.toAllValidTexs(), ...answer.toAllValidTexs()];
|
|
76
|
+
return texs.includes(ans);
|
|
77
|
+
};
|
|
78
|
+
exports.logPowerEquation = {
|
|
79
|
+
id: "logPowerEquation",
|
|
80
|
+
connector: "\\iff",
|
|
81
|
+
label: "Résoudre une équation du type $a\\times b^x + c = d$",
|
|
82
|
+
levels: ["TermSpé", "MathComp"],
|
|
83
|
+
isSingleStep: true,
|
|
84
|
+
sections: ["Logarithme népérien", "Puissances"],
|
|
85
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getLogPowerEquationQuestion, nb),
|
|
86
|
+
qcmTimer: 60,
|
|
87
|
+
freeTimer: 60,
|
|
88
|
+
getPropositions,
|
|
89
|
+
isAnswerValid,
|
|
90
|
+
};
|
|
91
|
+
exports.log10PowerEquation = {
|
|
92
|
+
id: "log10PowerEquation",
|
|
93
|
+
connector: "\\iff",
|
|
94
|
+
label: "Résoudre une équation du type $a\\times b^x + c = d$",
|
|
95
|
+
levels: ["TermSpé", "MathComp"],
|
|
96
|
+
isSingleStep: true,
|
|
97
|
+
sections: ["Logarithme décimal", "Puissances"],
|
|
98
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getLogPowerEquationQuestion({ isLog10: true }), nb),
|
|
99
|
+
qcmTimer: 60,
|
|
100
|
+
freeTimer: 60,
|
|
101
|
+
getPropositions,
|
|
102
|
+
isAnswerValid,
|
|
103
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logSimplifiying.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/logarithm/logSimplifiying.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAqEF,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,WAAW,CAYrD,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.logSimplifiying = 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 logNode_1 = require("../../../tree/nodes/functions/logNode");
|
|
9
|
+
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
10
|
+
const addNode_1 = require("../../../tree/nodes/operators/addNode");
|
|
11
|
+
const substractNode_1 = require("../../../tree/nodes/operators/substractNode");
|
|
12
|
+
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
13
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
14
|
+
const getExpSimplifiying = () => {
|
|
15
|
+
let expression;
|
|
16
|
+
let simplifiedExpression;
|
|
17
|
+
let pm = (0, coinFlip_1.coinFlip)() ? 1 : -1;
|
|
18
|
+
const a = (0, randint_1.randint)(1, 10);
|
|
19
|
+
let b;
|
|
20
|
+
do {
|
|
21
|
+
b = (0, randint_1.randint)(1, 10);
|
|
22
|
+
} while (pm === -1 && a === b);
|
|
23
|
+
const opts = { allowLnOfOne: true };
|
|
24
|
+
if (pm === 1) {
|
|
25
|
+
expression = new addNode_1.AddNode(new logNode_1.LogNode(new numberNode_1.NumberNode(a), opts), new logNode_1.LogNode(new numberNode_1.NumberNode(b), opts));
|
|
26
|
+
simplifiedExpression = new logNode_1.LogNode(new numberNode_1.NumberNode(a * b));
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
expression = new substractNode_1.SubstractNode(new logNode_1.LogNode(new numberNode_1.NumberNode(a), opts), new logNode_1.LogNode(new numberNode_1.NumberNode(b), opts));
|
|
30
|
+
simplifiedExpression = new logNode_1.LogNode(new rational_1.Rational(a, b).simplify().toTree());
|
|
31
|
+
}
|
|
32
|
+
const answer = simplifiedExpression.toTex();
|
|
33
|
+
const question = {
|
|
34
|
+
instruction: `Simplifier l'expression suivante : $${expression.toTex()}$.`,
|
|
35
|
+
answer,
|
|
36
|
+
keys: ["ln"],
|
|
37
|
+
answerFormat: "tex",
|
|
38
|
+
identifiers: { pm, a, b },
|
|
39
|
+
};
|
|
40
|
+
return question;
|
|
41
|
+
};
|
|
42
|
+
const getPropositions = (n, { answer, pm }) => {
|
|
43
|
+
const propositions = [];
|
|
44
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
45
|
+
while (propositions.length < n) {
|
|
46
|
+
const a = (0, randint_1.randint)(1, 10);
|
|
47
|
+
const b = (0, randint_1.randint)(1, 10);
|
|
48
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, pm > 0
|
|
49
|
+
? new logNode_1.LogNode(new numberNode_1.NumberNode(a * b)).toTex()
|
|
50
|
+
: new logNode_1.LogNode(new rational_1.Rational(a, b).simplify().toTree()).toTex());
|
|
51
|
+
}
|
|
52
|
+
return (0, shuffle_1.shuffle)(propositions);
|
|
53
|
+
};
|
|
54
|
+
const isAnswerValid = (ans, { a, b, pm }) => {
|
|
55
|
+
let answer;
|
|
56
|
+
if (pm === 1) {
|
|
57
|
+
answer = new logNode_1.LogNode(new numberNode_1.NumberNode(a * b));
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
answer = new logNode_1.LogNode(new rational_1.Rational(a, b).simplify().toTree({ allowFractionToDecimal: true }));
|
|
61
|
+
}
|
|
62
|
+
const texs = answer.toAllValidTexs();
|
|
63
|
+
return texs.includes(ans);
|
|
64
|
+
};
|
|
65
|
+
exports.logSimplifiying = {
|
|
66
|
+
id: "logSimplifiying",
|
|
67
|
+
connector: "\\iff",
|
|
68
|
+
label: "Simplifier des expressions avec $\\ln$",
|
|
69
|
+
levels: ["1reSpé", "TermSpé", "MathComp"],
|
|
70
|
+
sections: ["Logarithme népérien"],
|
|
71
|
+
isSingleStep: false,
|
|
72
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getExpSimplifiying, nb),
|
|
73
|
+
qcmTimer: 60,
|
|
74
|
+
freeTimer: 60,
|
|
75
|
+
getPropositions,
|
|
76
|
+
isAnswerValid,
|
|
77
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inequalityToInterval.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sets/intervals/inequalityToInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"inequalityToInterval.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sets/intervals/inequalityToInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAalC,KAAK,WAAW,GAAG;IACjB,sBAAsB,EAAE,OAAO,CAAC;IAChC,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAmKF,eAAO,MAAM,oBAAoB,EAAE,YAAY,CAAC,WAAW,CAa1D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"associatePoint.d.ts","sourceRoot":"","sources":["../../../src/exercises/trigonometry/associatePoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAqDF,eAAO,MAAM,cAAc,EAAE,YAAY,CAAC,WAAW,CAapD,CAAC"}
|