math-exercises 2.0.9 → 2.0.11
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/calcul/fractions/index.d.ts +1 -0
- package/lib/exercises/calcul/fractions/index.d.ts.map +1 -1
- package/lib/exercises/calcul/fractions/index.js +1 -0
- package/lib/exercises/calcul/fractions/periodicWritingToFraction.d.ts +9 -0
- package/lib/exercises/calcul/fractions/periodicWritingToFraction.d.ts.map +1 -0
- package/lib/exercises/calcul/fractions/periodicWritingToFraction.js +80 -0
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq3.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq3.js +2 -1
- package/lib/exercises/exercise.d.ts +1 -1
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/functions/affines/leadingCoefficient.d.ts.map +1 -1
- package/lib/exercises/functions/affines/leadingCoefficient.js +5 -1
- package/lib/exercises/functions/logarithm/index.d.ts +1 -0
- package/lib/exercises/functions/logarithm/index.d.ts.map +1 -1
- package/lib/exercises/functions/logarithm/index.js +1 -0
- package/lib/exercises/functions/logarithm/log10Simplifying.d.ts +11 -0
- package/lib/exercises/functions/logarithm/log10Simplifying.d.ts.map +1 -0
- package/lib/exercises/functions/logarithm/log10Simplifying.js +97 -0
- package/lib/exercises/functions/logarithm/logEquation.d.ts.map +1 -1
- package/lib/exercises/functions/logarithm/logEquation.js +0 -1
- package/lib/exercises/geometry/vectors/index.d.ts +1 -0
- package/lib/exercises/geometry/vectors/index.d.ts.map +1 -1
- package/lib/exercises/geometry/vectors/index.js +1 -0
- package/lib/exercises/geometry/vectors/scalarProductViaCoords.js +1 -1
- package/lib/exercises/geometry/vectors/scalarProductViaCos.d.ts +9 -0
- package/lib/exercises/geometry/vectors/scalarProductViaCos.d.ts.map +1 -0
- package/lib/exercises/geometry/vectors/scalarProductViaCos.js +66 -0
- package/lib/exercises/limits/index.d.ts +1 -0
- package/lib/exercises/limits/index.d.ts.map +1 -1
- package/lib/exercises/limits/index.js +1 -0
- package/lib/exercises/limits/limitReading.d.ts +10 -0
- package/lib/exercises/limits/limitReading.d.ts.map +1 -0
- package/lib/exercises/limits/limitReading.js +111 -0
- package/lib/exercises/squareRoots/index.d.ts +3 -0
- package/lib/exercises/squareRoots/index.d.ts.map +1 -1
- package/lib/exercises/squareRoots/index.js +3 -0
- package/lib/exercises/squareRoots/squareRootIdentities.d.ts +11 -0
- package/lib/exercises/squareRoots/squareRootIdentities.d.ts.map +1 -0
- package/lib/exercises/squareRoots/squareRootIdentities.js +124 -0
- package/lib/exercises/squareRoots/squareRootsDistributivity.d.ts +10 -0
- package/lib/exercises/squareRoots/squareRootsDistributivity.d.ts.map +1 -0
- package/lib/exercises/squareRoots/squareRootsDistributivity.js +67 -0
- package/lib/exercises/squareRoots/squareRootsSum.d.ts +13 -0
- package/lib/exercises/squareRoots/squareRootsSum.d.ts.map +1 -0
- package/lib/exercises/squareRoots/squareRootsSum.js +79 -0
- package/lib/index.d.ts +37 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/math/numbers/decimals/decimal.d.ts +3 -0
- package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
- package/lib/math/numbers/decimals/decimal.js +8 -0
- package/lib/math/numbers/integer/integer.d.ts +1 -1
- package/lib/math/numbers/nombre.d.ts +1 -1
- package/lib/math/polynomials/rationalFrac.d.ts +1 -1
- package/lib/server.js +11 -0
- package/lib/tree/nodes/algebraicNode.d.ts +4 -1
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/oppositeNode.d.ts +2 -2
- package/lib/tree/nodes/functions/oppositeNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/oppositeNode.js +2 -2
- package/lib/tree/nodes/functions/sqrtNode.d.ts +2 -2
- package/lib/tree/nodes/functions/sqrtNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sqrtNode.js +3 -3
- package/lib/tree/nodes/node.d.ts +4 -1
- package/lib/tree/nodes/node.d.ts.map +1 -1
- 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 +8 -1
- package/lib/tree/nodes/operators/addNode.d.ts +2 -2
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +7 -5
- package/lib/tree/nodes/operators/fractionNode.d.ts +2 -2
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +4 -6
- package/lib/tree/nodes/operators/limitNode.d.ts +29 -0
- package/lib/tree/nodes/operators/limitNode.d.ts.map +1 -0
- package/lib/tree/nodes/operators/limitNode.js +56 -0
- package/lib/tree/nodes/operators/multiplyNode.d.ts +2 -2
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +5 -6
- package/lib/tree/nodes/operators/operatorNode.d.ts +2 -1
- package/lib/tree/nodes/operators/operatorNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/operatorNode.js +1 -0
- package/lib/tree/nodes/operators/powerNode.d.ts +2 -2
- package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/powerNode.js +51 -2
- package/lib/tree/nodes/operators/substractNode.d.ts +2 -2
- package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/substractNode.js +2 -2
- package/lib/utils/randomLetter.d.ts +1 -1
- package/lib/utils/randomLetter.d.ts.map +1 -1
- package/lib/utils/randomLetter.js +6 -4
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calcul/fractions/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calcul/fractions/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC"}
|
|
@@ -22,3 +22,4 @@ __exportStar(require("./fractionsDivision"), exports);
|
|
|
22
22
|
__exportStar(require("./fractionsProduct"), exports);
|
|
23
23
|
__exportStar(require("./fractionsSum"), exports);
|
|
24
24
|
__exportStar(require("./simplifyFraction"), exports);
|
|
25
|
+
__exportStar(require("./periodicWritingToFraction"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MathExercise } from "../../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
num: number;
|
|
4
|
+
denum: number;
|
|
5
|
+
leadingPart: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const periodicWritingToFraction: MathExercise<Identifiers>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=periodicWritingToFraction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"periodicWritingToFraction.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calcul/fractions/periodicWritingToFraction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AA2EF,eAAO,MAAM,yBAAyB,EAAE,YAAY,CAAC,WAAW,CAa/D,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.periodicWritingToFraction = 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 rational_1 = require("../../../math/numbers/rationals/rational");
|
|
8
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
9
|
+
/**
|
|
10
|
+
* méthode : x = 0,123123123
|
|
11
|
+
* 1000x = 123,123123
|
|
12
|
+
* 999x = 123
|
|
13
|
+
*/
|
|
14
|
+
const getPeriodicWritingToFractionQuestion = () => {
|
|
15
|
+
const periodicPartLength = (0, randint_1.randint)(1, 4);
|
|
16
|
+
const periodicPart = [];
|
|
17
|
+
for (let i = 0; i < periodicPartLength; i++) {
|
|
18
|
+
periodicPart.push((0, randint_1.randint)(periodicPartLength === 1 ? 1 : 0, 10, periodicPart));
|
|
19
|
+
}
|
|
20
|
+
const num = Number("0." + periodicPart.join("")) * 10 ** periodicPartLength;
|
|
21
|
+
let denumString = "";
|
|
22
|
+
for (let i = 0; i < periodicPartLength; i++) {
|
|
23
|
+
denumString += "9";
|
|
24
|
+
}
|
|
25
|
+
const denum = Number(denumString);
|
|
26
|
+
const leadingPart = decimal_1.DecimalConstructor.random(0, 10, (0, randint_1.randint)(0, 3));
|
|
27
|
+
let x = leadingPart.toTree().toTex();
|
|
28
|
+
if (!x.includes(","))
|
|
29
|
+
x += ",";
|
|
30
|
+
for (let i = 0; i < 4; i++) {
|
|
31
|
+
x += periodicPart.join("");
|
|
32
|
+
}
|
|
33
|
+
x += "\\ldots";
|
|
34
|
+
const answer = new rational_1.Rational(num, denum * 10 ** leadingPart.precision)
|
|
35
|
+
.add(leadingPart.toRational())
|
|
36
|
+
.toTree()
|
|
37
|
+
.toTex();
|
|
38
|
+
const question = {
|
|
39
|
+
answer,
|
|
40
|
+
instruction: `Ecrire sous forme de fraction : $${x}$`,
|
|
41
|
+
keys: [],
|
|
42
|
+
answerFormat: "tex",
|
|
43
|
+
identifiers: { num, denum, leadingPart: leadingPart.value },
|
|
44
|
+
};
|
|
45
|
+
return question;
|
|
46
|
+
};
|
|
47
|
+
const getPropositions = (n, { answer, num, denum, leadingPart }) => {
|
|
48
|
+
const propositions = [];
|
|
49
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
50
|
+
const leadingPartDec = new decimal_1.Decimal(leadingPart);
|
|
51
|
+
const increments = [-1, 1, 2];
|
|
52
|
+
for (const i of increments) {
|
|
53
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new rational_1.Rational(num, denum * 10 ** (leadingPartDec.precision + i))
|
|
54
|
+
.add(leadingPartDec.toRational())
|
|
55
|
+
.toTree()
|
|
56
|
+
.toTex());
|
|
57
|
+
}
|
|
58
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
59
|
+
};
|
|
60
|
+
const isAnswerValid = (ans, { denum, leadingPart, num }) => {
|
|
61
|
+
const leadingPartDec = new decimal_1.Decimal(leadingPart);
|
|
62
|
+
const answer = new rational_1.Rational(num, denum * 10 ** leadingPartDec.precision)
|
|
63
|
+
.add(leadingPartDec.toRational())
|
|
64
|
+
.toTree();
|
|
65
|
+
const texs = answer.toAllValidTexs();
|
|
66
|
+
return texs.includes(ans);
|
|
67
|
+
};
|
|
68
|
+
exports.periodicWritingToFraction = {
|
|
69
|
+
id: "periodicWritingToFraction",
|
|
70
|
+
connector: "=",
|
|
71
|
+
label: "Passer de l'écriture décimale périodique à l'écriture fractionnaire",
|
|
72
|
+
levels: ["2nde"],
|
|
73
|
+
isSingleStep: true,
|
|
74
|
+
sections: ["Fractions"],
|
|
75
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getPeriodicWritingToFractionQuestion, nb),
|
|
76
|
+
qcmTimer: 60,
|
|
77
|
+
freeTimer: 60,
|
|
78
|
+
getPropositions,
|
|
79
|
+
isAnswerValid,
|
|
80
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factoIdRmq3.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/factorisation/factoIdRmq3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;
|
|
1
|
+
{"version":3,"file":"factoIdRmq3.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/factorisation/factoIdRmq3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AA8EF,eAAO,MAAM,WAAW,EAAE,YAAY,CAAC,WAAW,CAYjD,CAAC"}
|
|
@@ -11,7 +11,8 @@ const randint_1 = require("../../../math/utils/random/randint");
|
|
|
11
11
|
const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
|
|
12
12
|
const getFactoType1Question = () => {
|
|
13
13
|
const interval = new intervals_1.Interval("[[-10; 10]]").difference(new discreteSet_1.DiscreteSet([new integer_1.Integer(0)]));
|
|
14
|
-
const
|
|
14
|
+
const intervalPlus = new intervals_1.Interval("[[1; 10]]");
|
|
15
|
+
const affine = affine_1.AffineConstructor.random(intervalPlus, interval);
|
|
15
16
|
const affine2 = new affine_1.Affine(affine.a, -affine.b);
|
|
16
17
|
const statementTree = affine.multiply(affine2).toTree();
|
|
17
18
|
const answerTree = new multiplyNode_1.MultiplyNode(affine.toTree(), affine2.toTree());
|
|
@@ -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" | "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";
|
|
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" | "Produit scalaire" | "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,EAAE,UAAU,GAAG,QAAQ,CAAC;IACvC,WAAW,EAAE,YAAY,CAAC;CAC3B;AAED,MAAM,MAAM,YA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U,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,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;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IACl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ts","sourceRoot":"","sources":["../../../../src/exercises/functions/affines/leadingCoefficient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;
|
|
1
|
+
{"version":3,"file":"leadingCoefficient.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/affines/leadingCoefficient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAgFF,eAAO,MAAM,kBAAkB,EAAE,YAAY,CAAC,WAAW,CAaxD,CAAC"}
|
|
@@ -30,7 +30,11 @@ const getLeadingCoefficientQuestion = () => {
|
|
|
30
30
|
ymin = bValue - 1;
|
|
31
31
|
ymax = 1;
|
|
32
32
|
}
|
|
33
|
-
if (
|
|
33
|
+
if (aValue === 0) {
|
|
34
|
+
xmax = 5;
|
|
35
|
+
xmin = -5;
|
|
36
|
+
}
|
|
37
|
+
else if (-bValue / aValue > 0) {
|
|
34
38
|
xmax = -bValue / aValue + 1;
|
|
35
39
|
xmin = -1;
|
|
36
40
|
}
|
|
@@ -1 +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"}
|
|
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;AACnC,cAAc,oBAAoB,CAAC"}
|
|
@@ -18,3 +18,4 @@ __exportStar(require("./logEquation"), exports);
|
|
|
18
18
|
__exportStar(require("./logSimplifiying"), exports);
|
|
19
19
|
__exportStar(require("./log10PowerSimplifying"), exports);
|
|
20
20
|
__exportStar(require("./logPowerEquation"), exports);
|
|
21
|
+
__exportStar(require("./log10Simplifying"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MathExercise } from "../../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
nb: number;
|
|
4
|
+
powers: number[];
|
|
5
|
+
signs: number[];
|
|
6
|
+
isLog10: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const log10SumSimplifying: MathExercise<Identifiers>;
|
|
9
|
+
export declare const logSumSimplifying: MathExercise<Identifiers>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=log10Simplifying.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log10Simplifying.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/logarithm/log10Simplifying.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAalC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAsFF,eAAO,MAAM,mBAAmB,EAAE,YAAY,CAAC,WAAW,CAgBzD,CAAC;AACF,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAAC,WAAW,CAgBvD,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.logSumSimplifying = exports.log10SumSimplifying = 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 log10Node_1 = require("../../../tree/nodes/functions/log10Node");
|
|
8
|
+
const logNode_1 = require("../../../tree/nodes/functions/logNode");
|
|
9
|
+
const oppositeNode_1 = require("../../../tree/nodes/functions/oppositeNode");
|
|
10
|
+
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
11
|
+
const addNode_1 = require("../../../tree/nodes/operators/addNode");
|
|
12
|
+
const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
|
|
13
|
+
const powerNode_1 = require("../../../tree/nodes/operators/powerNode");
|
|
14
|
+
const operatorComposition_1 = require("../../../tree/utilities/operatorComposition");
|
|
15
|
+
const random_1 = require("../../../utils/random");
|
|
16
|
+
const getLog10SumSimplifyingQuestion = (opts) => {
|
|
17
|
+
const nb = (0, randint_1.randint)(2, 10);
|
|
18
|
+
const nbTerms = (0, randint_1.randint)(2, 4);
|
|
19
|
+
const powers = [];
|
|
20
|
+
const signs = [];
|
|
21
|
+
for (let i = 0; i < nbTerms; i++) {
|
|
22
|
+
const power = (0, randint_1.randint)(powers.includes(1) ? 2 : 1, 6, powers);
|
|
23
|
+
powers.push(power);
|
|
24
|
+
signs.push((0, random_1.random)([-1, 1]));
|
|
25
|
+
}
|
|
26
|
+
const nbNode = new numberNode_1.NumberNode(nb);
|
|
27
|
+
const LNode = opts?.isLog10 ? log10Node_1.Log10Node : logNode_1.LogNode;
|
|
28
|
+
const logs = powers.map((power, index) => nb ** power < 100
|
|
29
|
+
? signs[index] > 0
|
|
30
|
+
? new LNode(new numberNode_1.NumberNode(nb ** power))
|
|
31
|
+
: new oppositeNode_1.OppositeNode(new LNode(new numberNode_1.NumberNode(nb ** power)))
|
|
32
|
+
: signs[index] > 0
|
|
33
|
+
? new LNode(new powerNode_1.PowerNode(nbNode, new numberNode_1.NumberNode(power)))
|
|
34
|
+
: new oppositeNode_1.OppositeNode(new LNode(new powerNode_1.PowerNode(nbNode, new numberNode_1.NumberNode(power)))));
|
|
35
|
+
const statement = (0, operatorComposition_1.operatorComposition)(addNode_1.AddNode, logs);
|
|
36
|
+
const answer = statement.simplify();
|
|
37
|
+
const question = {
|
|
38
|
+
answer: answer.toTex(),
|
|
39
|
+
instruction: `Simplifier le plus possible l'expression suivante : $${statement.toTex()}$`,
|
|
40
|
+
keys: [opts?.isLog10 ? "log" : "ln"],
|
|
41
|
+
answerFormat: "tex",
|
|
42
|
+
identifiers: { nb, powers, signs, isLog10: opts?.isLog10 ?? false },
|
|
43
|
+
};
|
|
44
|
+
return question;
|
|
45
|
+
};
|
|
46
|
+
const getPropositions = (n, { answer, nb, isLog10 }) => {
|
|
47
|
+
const propositions = [];
|
|
48
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
49
|
+
const LNode = isLog10 ? log10Node_1.Log10Node : logNode_1.LogNode;
|
|
50
|
+
while (propositions.length < n) {
|
|
51
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode((0, randint_1.randint)(1, 10)), new LNode(new numberNode_1.NumberNode(nb)))
|
|
52
|
+
.simplify()
|
|
53
|
+
.toTex());
|
|
54
|
+
}
|
|
55
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
56
|
+
};
|
|
57
|
+
const isAnswerValid = (ans, { nb, powers, signs, isLog10 }) => {
|
|
58
|
+
const nbNode = new numberNode_1.NumberNode(nb);
|
|
59
|
+
const LNode = isLog10 ? log10Node_1.Log10Node : logNode_1.LogNode;
|
|
60
|
+
const logs = powers.map((power, index) => nb ** power < 100
|
|
61
|
+
? signs[index] > 0
|
|
62
|
+
? new LNode(new numberNode_1.NumberNode(nb ** power))
|
|
63
|
+
: new oppositeNode_1.OppositeNode(new LNode(new numberNode_1.NumberNode(nb ** power)))
|
|
64
|
+
: signs[index] > 0
|
|
65
|
+
? new LNode(new powerNode_1.PowerNode(nbNode, new numberNode_1.NumberNode(power)))
|
|
66
|
+
: new oppositeNode_1.OppositeNode(new LNode(new powerNode_1.PowerNode(nbNode, new numberNode_1.NumberNode(power)))));
|
|
67
|
+
const statement = (0, operatorComposition_1.operatorComposition)(addNode_1.AddNode, logs);
|
|
68
|
+
const answer = statement.simplify();
|
|
69
|
+
const texs = answer.toAllValidTexs();
|
|
70
|
+
return texs.includes(ans);
|
|
71
|
+
};
|
|
72
|
+
exports.log10SumSimplifying = {
|
|
73
|
+
id: "log10SumSimplifying",
|
|
74
|
+
connector: "=",
|
|
75
|
+
label: "Simplifer une somme de logarithmes décimaux",
|
|
76
|
+
levels: ["TermTech"],
|
|
77
|
+
isSingleStep: true,
|
|
78
|
+
sections: ["Logarithme décimal"],
|
|
79
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getLog10SumSimplifyingQuestion({ isLog10: true }), nb),
|
|
80
|
+
qcmTimer: 60,
|
|
81
|
+
freeTimer: 60,
|
|
82
|
+
getPropositions,
|
|
83
|
+
isAnswerValid,
|
|
84
|
+
};
|
|
85
|
+
exports.logSumSimplifying = {
|
|
86
|
+
id: "logSumSimplifying",
|
|
87
|
+
connector: "=",
|
|
88
|
+
label: "Simplifer une somme de logarithmes népériens",
|
|
89
|
+
levels: ["TermSpé", "MathComp"],
|
|
90
|
+
isSingleStep: true,
|
|
91
|
+
sections: ["Logarithme népérien"],
|
|
92
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getLog10SumSimplifyingQuestion({ isLog10: false }), nb),
|
|
93
|
+
qcmTimer: 60,
|
|
94
|
+
freeTimer: 60,
|
|
95
|
+
getPropositions,
|
|
96
|
+
isAnswerValid,
|
|
97
|
+
};
|
|
@@ -1 +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;
|
|
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;AAoEF,eAAO,MAAM,WAAW,EAAE,YAAY,CAAC,WAAW,CAYjD,CAAC"}
|
|
@@ -56,7 +56,6 @@ const isAnswerValid = (ans, { a, k }) => {
|
|
|
56
56
|
new expNode_1.ExpNode(new rational_1.Rational(k, a).simplify().toTree({ allowFractionToDecimal: true })),
|
|
57
57
|
]));
|
|
58
58
|
const texs = answer.toAllValidTexs();
|
|
59
|
-
console.log(texs);
|
|
60
59
|
return texs.includes(ans);
|
|
61
60
|
};
|
|
62
61
|
exports.logEquation = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/vectors/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/vectors/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,uBAAuB,CAAC"}
|
|
@@ -19,3 +19,4 @@ __exportStar(require("./coordinatesReading"), exports);
|
|
|
19
19
|
__exportStar(require("./determinant"), exports);
|
|
20
20
|
__exportStar(require("./scalarProductViaCoords"), exports);
|
|
21
21
|
__exportStar(require("./vectorCoordinatesFromTwoPoints"), exports);
|
|
22
|
+
__exportStar(require("./scalarProductViaCos"), exports);
|
|
@@ -43,7 +43,7 @@ exports.scalarProductViaCoords = {
|
|
|
43
43
|
isSingleStep: false,
|
|
44
44
|
label: "Calculer un produit scalaire à l'aide des coordonnées",
|
|
45
45
|
levels: ["1reSpé", "TermSpé"],
|
|
46
|
-
sections: ["Vecteurs"],
|
|
46
|
+
sections: ["Vecteurs", "Produit scalaire"],
|
|
47
47
|
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getScalarProductViaCoordsQuestion, nb),
|
|
48
48
|
qcmTimer: 60,
|
|
49
49
|
freeTimer: 60,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MathExercise } from "../../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
AB: number;
|
|
4
|
+
AC: number;
|
|
5
|
+
trigoPoint: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const scalarProductViaCos: MathExercise<Identifiers>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=scalarProductViaCos.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scalarProductViaCos.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/vectors/scalarProductViaCos.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAyDF,eAAO,MAAM,mBAAmB,EAAE,YAAY,CAAC,WAAW,CAazD,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.scalarProductViaCos = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const remarkableValue_1 = require("../../../math/trigonometry/remarkableValue");
|
|
7
|
+
const remarkableValues_1 = require("../../../math/trigonometry/remarkableValues");
|
|
8
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
9
|
+
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
10
|
+
const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
|
|
11
|
+
const randomLetter_1 = require("../../../utils/randomLetter");
|
|
12
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
13
|
+
//|u| |v| cos(u,v)
|
|
14
|
+
const getScalarProductViaCosQuestion = () => {
|
|
15
|
+
const AB = (0, randint_1.randint)(1, 10);
|
|
16
|
+
const AC = (0, randint_1.randint)(1, 10);
|
|
17
|
+
const trigo = remarkableValue_1.RemarkableValueConstructor.mainInterval();
|
|
18
|
+
const answer = new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(AB * AC), trigo.cos)
|
|
19
|
+
.simplify()
|
|
20
|
+
.toTex();
|
|
21
|
+
const letters = [];
|
|
22
|
+
for (let i = 0; i < 3; i++) {
|
|
23
|
+
letters.push((0, randomLetter_1.randomLetter)(true, letters));
|
|
24
|
+
}
|
|
25
|
+
letters.sort((a, b) => a.localeCompare(b));
|
|
26
|
+
const [letterA, letterB, letterC] = letters;
|
|
27
|
+
const question = {
|
|
28
|
+
answer,
|
|
29
|
+
instruction: `Soient trois points $${letterA}$, $${letterB}$ et $${letterC}$ tels que $${letterA}${letterB} = ${AB}$, $${letterA}${letterC}= ${AC}$, et $\\widehat{${letterB}${letterA}${letterC}} = ${trigo.angle.toTex()}$. Calculer $\\overrightarrow{${letterA}${letterB}}\\cdot \\overrightarrow{${letterA}${letterC}}$.`,
|
|
30
|
+
keys: [],
|
|
31
|
+
answerFormat: "tex",
|
|
32
|
+
identifiers: { AB, AC, trigoPoint: trigo.point },
|
|
33
|
+
};
|
|
34
|
+
return question;
|
|
35
|
+
};
|
|
36
|
+
const getPropositions = (n, { answer, AB, AC, trigoPoint }) => {
|
|
37
|
+
const propositions = [];
|
|
38
|
+
const trigo = remarkableValues_1.remarkableTrigoValues.find((v) => v.point === trigoPoint);
|
|
39
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
40
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(AB * AC), trigo.sin).simplify().toTex());
|
|
41
|
+
const coeff = new numberNode_1.NumberNode(AB * AC);
|
|
42
|
+
while (propositions.length < n) {
|
|
43
|
+
const trigoValue = remarkableValue_1.RemarkableValueConstructor.mainInterval();
|
|
44
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new multiplyNode_1.MultiplyNode(coeff, trigoValue.sin).simplify().toTex());
|
|
45
|
+
}
|
|
46
|
+
return (0, shuffle_1.shuffle)(propositions);
|
|
47
|
+
};
|
|
48
|
+
const isAnswerValid = (ans, { AB, AC, trigoPoint }) => {
|
|
49
|
+
const trigo = remarkableValues_1.remarkableTrigoValues.find((v) => v.point === trigoPoint);
|
|
50
|
+
const tree = new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(AB * AC), trigo.cos).simplify();
|
|
51
|
+
const texs = tree.toAllValidTexs();
|
|
52
|
+
return texs.includes(ans);
|
|
53
|
+
};
|
|
54
|
+
exports.scalarProductViaCos = {
|
|
55
|
+
id: "scalarProductViaCos",
|
|
56
|
+
connector: "=",
|
|
57
|
+
label: "Calculer un produit scalaire (formule avec $cos$)",
|
|
58
|
+
levels: ["1reSpé"],
|
|
59
|
+
isSingleStep: true,
|
|
60
|
+
sections: ["Vecteurs", "Produit scalaire"],
|
|
61
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getScalarProductViaCosQuestion, nb),
|
|
62
|
+
qcmTimer: 60,
|
|
63
|
+
freeTimer: 60,
|
|
64
|
+
getPropositions,
|
|
65
|
+
isAnswerValid,
|
|
66
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/limits/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mCAAmC,CAAC;AAClD,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/limits/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mCAAmC,CAAC;AAClD,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gBAAgB,CAAC"}
|
|
@@ -23,3 +23,4 @@ __exportStar(require("./sequencePolynomLimit"), exports);
|
|
|
23
23
|
__exportStar(require("./sequencePolynomNoFILimit"), exports);
|
|
24
24
|
__exportStar(require("./sequencePolynomProductLimit"), exports);
|
|
25
25
|
__exportStar(require("./sequenceRationalFracLimit"), exports);
|
|
26
|
+
__exportStar(require("./limitReading"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MathExercise } from "../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
type: number;
|
|
4
|
+
to: string;
|
|
5
|
+
from: string | undefined;
|
|
6
|
+
a: number | undefined;
|
|
7
|
+
};
|
|
8
|
+
export declare const limitReading: MathExercise<Identifiers>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=limitReading.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limitReading.d.ts","sourceRoot":"","sources":["../../../src/exercises/limits/limitReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAuBlC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvB,CAAC;AAmGF,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,WAAW,CAYlD,CAAC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.limitReading = 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 infiniteNode_1 = require("../../tree/nodes/numbers/infiniteNode");
|
|
8
|
+
const numberNode_1 = require("../../tree/nodes/numbers/numberNode");
|
|
9
|
+
const addNode_1 = require("../../tree/nodes/operators/addNode");
|
|
10
|
+
const fractionNode_1 = require("../../tree/nodes/operators/fractionNode");
|
|
11
|
+
const limitNode_1 = require("../../tree/nodes/operators/limitNode");
|
|
12
|
+
const substractNode_1 = require("../../tree/nodes/operators/substractNode");
|
|
13
|
+
const variableNode_1 = require("../../tree/nodes/variables/variableNode");
|
|
14
|
+
const coinFlip_1 = require("../../utils/coinFlip");
|
|
15
|
+
const getLimitReadingQuestion = () => {
|
|
16
|
+
let to;
|
|
17
|
+
let from = undefined;
|
|
18
|
+
const type = (0, randint_1.randint)(1, 3);
|
|
19
|
+
let fct;
|
|
20
|
+
let answer = "";
|
|
21
|
+
let a;
|
|
22
|
+
switch (type) {
|
|
23
|
+
case 1: //a + b/(x-c)
|
|
24
|
+
a = (0, randint_1.randint)(-3, 4);
|
|
25
|
+
const b = (0, randint_1.randint)(-1, 2, [0]);
|
|
26
|
+
const c = (0, randint_1.randint)(-5, 6);
|
|
27
|
+
fct = new addNode_1.AddNode(new numberNode_1.NumberNode(a), new fractionNode_1.FractionNode(new numberNode_1.NumberNode(b), new substractNode_1.SubstractNode(new variableNode_1.VariableNode("x"), new numberNode_1.NumberNode(c)))).toMathString();
|
|
28
|
+
if ((0, coinFlip_1.coinFlip)()) {
|
|
29
|
+
// limites en +-inf
|
|
30
|
+
answer = a + "";
|
|
31
|
+
to = (0, coinFlip_1.coinFlip)() ? infiniteNode_1.PlusInfinityNode : infiniteNode_1.MinusInfinityNode;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
// limite en VI
|
|
35
|
+
to = new numberNode_1.NumberNode(c);
|
|
36
|
+
if ((0, coinFlip_1.coinFlip)()) {
|
|
37
|
+
from = "+";
|
|
38
|
+
answer = b > 0 ? infiniteNode_1.PlusInfinityNode.toTex() : infiniteNode_1.MinusInfinityNode.toTex();
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
from = "-";
|
|
42
|
+
answer = b < 0 ? infiniteNode_1.PlusInfinityNode.toTex() : infiniteNode_1.MinusInfinityNode.toTex();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
break;
|
|
46
|
+
case 2:
|
|
47
|
+
default:
|
|
48
|
+
const aPositive = (0, coinFlip_1.coinFlip)();
|
|
49
|
+
const polyPoints = [];
|
|
50
|
+
polyPoints.push([-8, (0, randint_1.randint)(-4, 5)]);
|
|
51
|
+
polyPoints.push([
|
|
52
|
+
-4,
|
|
53
|
+
aPositive ? polyPoints[0][1] + 2 : polyPoints[0][1] - 2,
|
|
54
|
+
]);
|
|
55
|
+
polyPoints.push([2, polyPoints[0][1]]);
|
|
56
|
+
polyPoints.push([6, polyPoints[1][1]]);
|
|
57
|
+
const pointsString = polyPoints
|
|
58
|
+
.map((point) => `(${point[0]},${point[1]})`)
|
|
59
|
+
.join(",");
|
|
60
|
+
fct = `Polynomial({${pointsString}})`;
|
|
61
|
+
const isPlusInf = (0, coinFlip_1.coinFlip)();
|
|
62
|
+
to = isPlusInf ? infiniteNode_1.PlusInfinityNode : infiniteNode_1.MinusInfinityNode;
|
|
63
|
+
answer = aPositive
|
|
64
|
+
? isPlusInf
|
|
65
|
+
? infiniteNode_1.PlusInfinityNode.toTex()
|
|
66
|
+
: infiniteNode_1.MinusInfinityNode.toTex()
|
|
67
|
+
: isPlusInf
|
|
68
|
+
? infiniteNode_1.MinusInfinityNode.toTex()
|
|
69
|
+
: infiniteNode_1.PlusInfinityNode.toTex();
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
const question = {
|
|
73
|
+
answer,
|
|
74
|
+
instruction: `Ci-dessous est tracé la courbe représentative d'une fonction $f$. Déterminer la limite: $\\displaystyle ${new limitNode_1.LimitNode(to, new variableNode_1.VariableNode("f(x)"), from).toTex()}$`,
|
|
75
|
+
keys: [],
|
|
76
|
+
commands: [fct],
|
|
77
|
+
coords: [-10, 10, -10, 10],
|
|
78
|
+
answerFormat: "tex",
|
|
79
|
+
identifiers: { type, to: to.toTex(), from, a },
|
|
80
|
+
};
|
|
81
|
+
return question;
|
|
82
|
+
};
|
|
83
|
+
const getPropositions = (n, { answer, type, to, from, a }) => {
|
|
84
|
+
const propositions = [];
|
|
85
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
86
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "+\\infty");
|
|
87
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "-\\infty");
|
|
88
|
+
if (a !== undefined)
|
|
89
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, a + "");
|
|
90
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, to);
|
|
91
|
+
while (propositions.length < n) {
|
|
92
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, randint_1.randint)(-5, 6) + "");
|
|
93
|
+
}
|
|
94
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
95
|
+
};
|
|
96
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
97
|
+
return answer === ans;
|
|
98
|
+
};
|
|
99
|
+
exports.limitReading = {
|
|
100
|
+
id: "limitReading",
|
|
101
|
+
connector: "=",
|
|
102
|
+
label: "Conjecturer graphiquement la limite d'une fonction",
|
|
103
|
+
levels: ["1reSpé", "TermSpé", "MathComp"],
|
|
104
|
+
isSingleStep: true,
|
|
105
|
+
sections: ["Limites"],
|
|
106
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getLimitReadingQuestion, nb),
|
|
107
|
+
qcmTimer: 60,
|
|
108
|
+
freeTimer: 60,
|
|
109
|
+
getPropositions,
|
|
110
|
+
isAnswerValid,
|
|
111
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/squareRoots/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/squareRoots/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kBAAkB,CAAC"}
|
|
@@ -16,3 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./simpifySquareRoot"), exports);
|
|
18
18
|
__exportStar(require("./squareRootEquation"), exports);
|
|
19
|
+
__exportStar(require("./squareRootIdentities"), exports);
|
|
20
|
+
__exportStar(require("./squareRootsDistributivity"), exports);
|
|
21
|
+
__exportStar(require("./squareRootsSum"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MathExercise } from "../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
type: number;
|
|
4
|
+
a: number;
|
|
5
|
+
x: number;
|
|
6
|
+
b: number | undefined;
|
|
7
|
+
y: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const squareRootIdentities: MathExercise<Identifiers>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=squareRootIdentities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"squareRootIdentities.d.ts","sourceRoot":"","sources":["../../../src/exercises/squareRoots/squareRootIdentities.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAmBlC,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;IACtB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA2KF,eAAO,MAAM,oBAAoB,EAAE,YAAY,CAAC,WAAW,CAa1D,CAAC"}
|