math-exercises 2.0.10 → 2.0.12
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/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/logPowerEquation.d.ts.map +1 -1
- package/lib/exercises/functions/logarithm/logPowerEquation.js +2 -2
- 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 +28 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/server.js +11 -1
- 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 +5 -3
- 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 -4
- 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 -5
- 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
|
@@ -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,C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,YAAY,CAAC,CAAC;IAClE,aAAa,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC;CACnC;AAED,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,UAAU,GACV,SAAS,GACT,UAAU,GACV,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,MAAM,WAAW,GACnB,OAAO,GACP,cAAc,GACd,iBAAiB,GACjB,SAAS,GACT,8BAA8B,GAC9B,aAAa,GACb,YAAY,GACZ,SAAS,GACT,0BAA0B,GAC1B,WAAW,GACX,2BAA2B,GAC3B,eAAe,GACf,eAAe,GACf,kBAAkB,GAClB,WAAW,GACX,mBAAmB,GACnB,wBAAwB,GACxB,WAAW,GACX,uBAAuB,GACvB,uBAAuB,GACvB,aAAa,GACb,aAAa,GACb,SAAS,GACT,qBAAqB,GACrB,oBAAoB,GACpB,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,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kB,GAClB,kBAAkB,GAClB,YAAY,GACZ,iBAAiB,GACjB,cAAc,GACd,cAAc,GACd,QAAQ,GACR,uBAAuB,GACvB,oBAAoB,GACpB,eAAe,GACf,gBAAgB,GAChB,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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":"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,
|
|
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,CActD,CAAC;AACF,eAAO,MAAM,kBAAkB,EAAE,YAAY,CAAC,WAAW,CAiBxD,CAAC"}
|
|
@@ -78,7 +78,7 @@ const isAnswerValid = (ans, { a, c, k, powered, isLog10 }) => {
|
|
|
78
78
|
exports.logPowerEquation = {
|
|
79
79
|
id: "logPowerEquation",
|
|
80
80
|
connector: "\\iff",
|
|
81
|
-
label: "Résoudre une équation du type $a\\times b^x + c = d$",
|
|
81
|
+
label: "Résoudre une équation du type $a\\times b^x + c = d$ grâce au logarithme décimal",
|
|
82
82
|
levels: ["TermSpé", "MathComp"],
|
|
83
83
|
isSingleStep: true,
|
|
84
84
|
sections: ["Logarithme népérien", "Puissances"],
|
|
@@ -91,7 +91,7 @@ exports.logPowerEquation = {
|
|
|
91
91
|
exports.log10PowerEquation = {
|
|
92
92
|
id: "log10PowerEquation",
|
|
93
93
|
connector: "\\iff",
|
|
94
|
-
label: "Résoudre une équation du type $a\\times b^x + c = d$",
|
|
94
|
+
label: "Résoudre une équation du type $a\\times b^x + c = d$ grâce au logarithme népérien",
|
|
95
95
|
levels: ["TermSpé", "MathComp"],
|
|
96
96
|
isSingleStep: true,
|
|
97
97
|
sections: ["Logarithme décimal", "Puissances"],
|
|
@@ -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"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.squareRootIdentities = void 0;
|
|
4
|
+
const exercise_1 = require("../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const real_1 = require("../../math/numbers/reals/real");
|
|
7
|
+
const randint_1 = require("../../math/utils/random/randint");
|
|
8
|
+
const sqrtNode_1 = require("../../tree/nodes/functions/sqrtNode");
|
|
9
|
+
const numberNode_1 = require("../../tree/nodes/numbers/numberNode");
|
|
10
|
+
const addNode_1 = require("../../tree/nodes/operators/addNode");
|
|
11
|
+
const multiplyNode_1 = require("../../tree/nodes/operators/multiplyNode");
|
|
12
|
+
const powerNode_1 = require("../../tree/nodes/operators/powerNode");
|
|
13
|
+
const substractNode_1 = require("../../tree/nodes/operators/substractNode");
|
|
14
|
+
const probaFlip_1 = require("../../utils/probaFlip");
|
|
15
|
+
const shuffle_1 = require("../../utils/shuffle");
|
|
16
|
+
const getAnswer = (type, firstTerm, secondTerm) => {
|
|
17
|
+
switch (type) {
|
|
18
|
+
case 1: //(a+b)^2
|
|
19
|
+
return new addNode_1.AddNode(new powerNode_1.SquareNode(firstTerm), new addNode_1.AddNode(new powerNode_1.SquareNode(secondTerm), new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(2), new multiplyNode_1.MultiplyNode(firstTerm, secondTerm)))).simplify();
|
|
20
|
+
case 2:
|
|
21
|
+
return new addNode_1.AddNode(new powerNode_1.SquareNode(firstTerm), new substractNode_1.SubstractNode(new powerNode_1.SquareNode(secondTerm), new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(2), new multiplyNode_1.MultiplyNode(firstTerm, secondTerm)))).simplify();
|
|
22
|
+
case 3:
|
|
23
|
+
default:
|
|
24
|
+
return new substractNode_1.SubstractNode(new powerNode_1.SquareNode(firstTerm), new powerNode_1.SquareNode(secondTerm)).simplify();
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
//(x sqrt(a) +- [y || y*sqrt(b)])^2
|
|
28
|
+
//ou (x sqrt(a) + [y || y*sqrt(b)])(x sqrt(a) - [y || y*sqrt(b)])
|
|
29
|
+
const getSquareRootIdentitiesQuestion = () => {
|
|
30
|
+
const type = (0, randint_1.randint)(1, 4);
|
|
31
|
+
const a = real_1.SquareRootConstructor.randomIrreductible(10);
|
|
32
|
+
const x = (0, randint_1.randint)(1, 7);
|
|
33
|
+
let b;
|
|
34
|
+
let y = (0, randint_1.randint)(1, 7);
|
|
35
|
+
const otherTermIsSqrt = (0, probaFlip_1.probaFlip)(0.3);
|
|
36
|
+
if (otherTermIsSqrt) {
|
|
37
|
+
do {
|
|
38
|
+
b = real_1.SquareRootConstructor.randomIrreductible(10);
|
|
39
|
+
} while (b.operand === a.operand);
|
|
40
|
+
}
|
|
41
|
+
const firstTerm = new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(x), a.toTree());
|
|
42
|
+
const secondTerm = otherTermIsSqrt
|
|
43
|
+
? new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(y), b.toTree())
|
|
44
|
+
: new numberNode_1.NumberNode(y);
|
|
45
|
+
let statement;
|
|
46
|
+
switch (type) {
|
|
47
|
+
case 1: //(a+b)^2
|
|
48
|
+
statement = new powerNode_1.SquareNode(new addNode_1.AddNode(firstTerm, secondTerm));
|
|
49
|
+
break;
|
|
50
|
+
case 2:
|
|
51
|
+
statement = new powerNode_1.SquareNode(new substractNode_1.SubstractNode(firstTerm, secondTerm));
|
|
52
|
+
break;
|
|
53
|
+
case 3:
|
|
54
|
+
default:
|
|
55
|
+
statement = new multiplyNode_1.MultiplyNode(new addNode_1.AddNode(firstTerm, secondTerm), new substractNode_1.SubstractNode(firstTerm, secondTerm));
|
|
56
|
+
}
|
|
57
|
+
const answer = getAnswer(type, firstTerm, secondTerm).toTex();
|
|
58
|
+
const question = {
|
|
59
|
+
answer,
|
|
60
|
+
instruction: `Développer et simplifier : $${statement.toTex()}$`,
|
|
61
|
+
keys: [],
|
|
62
|
+
answerFormat: "tex",
|
|
63
|
+
identifiers: { type, a: a.operand, b: b?.operand, x, y },
|
|
64
|
+
};
|
|
65
|
+
return question;
|
|
66
|
+
};
|
|
67
|
+
const getPropositions = (n, { answer, a, b, type, x, y }) => {
|
|
68
|
+
const propositions = [];
|
|
69
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
70
|
+
const firstTerm = new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(x), new sqrtNode_1.SqrtNode(new numberNode_1.NumberNode(a)));
|
|
71
|
+
const secondTerm = b
|
|
72
|
+
? new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(y), new sqrtNode_1.SqrtNode(new numberNode_1.NumberNode(b)))
|
|
73
|
+
: new numberNode_1.NumberNode(y);
|
|
74
|
+
switch (type) {
|
|
75
|
+
case 1:
|
|
76
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new addNode_1.AddNode(new powerNode_1.SquareNode(firstTerm), new powerNode_1.SquareNode(secondTerm))
|
|
77
|
+
.simplify({ forbidFactorize: true })
|
|
78
|
+
.toTex());
|
|
79
|
+
while (propositions.length < n) {
|
|
80
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new addNode_1.AddNode(new numberNode_1.NumberNode((0, randint_1.randint)(1, 100)), new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode((0, randint_1.randint)(1, 100)), real_1.SquareRootConstructor.randomIrreductible().toTree())).toTex());
|
|
81
|
+
}
|
|
82
|
+
break;
|
|
83
|
+
case 2:
|
|
84
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new substractNode_1.SubstractNode(new powerNode_1.SquareNode(firstTerm), new powerNode_1.SquareNode(secondTerm))
|
|
85
|
+
.simplify({ forbidFactorize: true })
|
|
86
|
+
.toTex());
|
|
87
|
+
while (propositions.length < n) {
|
|
88
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new substractNode_1.SubstractNode(new numberNode_1.NumberNode((0, randint_1.randint)(1, 100)), new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode((0, randint_1.randint)(1, 100)), real_1.SquareRootConstructor.randomIrreductible().toTree())).toTex());
|
|
89
|
+
}
|
|
90
|
+
break;
|
|
91
|
+
case 3:
|
|
92
|
+
default:
|
|
93
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new substractNode_1.SubstractNode(new powerNode_1.SquareNode(secondTerm), new powerNode_1.SquareNode(firstTerm))
|
|
94
|
+
.simplify({ forbidFactorize: true })
|
|
95
|
+
.toTex());
|
|
96
|
+
while (propositions.length < n) {
|
|
97
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, randint_1.randint)(-100, 100) + "");
|
|
98
|
+
}
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
return (0, shuffle_1.shuffle)(propositions);
|
|
102
|
+
};
|
|
103
|
+
const isAnswerValid = (ans, { a, b, type, x, y }) => {
|
|
104
|
+
const firstTerm = new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(x), new sqrtNode_1.SqrtNode(new numberNode_1.NumberNode(a)));
|
|
105
|
+
const secondTerm = b
|
|
106
|
+
? new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(y), new sqrtNode_1.SqrtNode(new numberNode_1.NumberNode(b)))
|
|
107
|
+
: new numberNode_1.NumberNode(y);
|
|
108
|
+
const answer = getAnswer(type, firstTerm, secondTerm);
|
|
109
|
+
const texs = answer.toAllValidTexs();
|
|
110
|
+
return texs.includes(ans);
|
|
111
|
+
};
|
|
112
|
+
exports.squareRootIdentities = {
|
|
113
|
+
id: "squareRootIdentities",
|
|
114
|
+
connector: "=",
|
|
115
|
+
label: "Identités remarquables avec des racines carrées",
|
|
116
|
+
levels: ["2nde", "1reSpé"],
|
|
117
|
+
isSingleStep: true,
|
|
118
|
+
sections: ["Racines carrées", "Calcul littéral"],
|
|
119
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getSquareRootIdentitiesQuestion, nb),
|
|
120
|
+
qcmTimer: 60,
|
|
121
|
+
freeTimer: 60,
|
|
122
|
+
getPropositions,
|
|
123
|
+
isAnswerValid,
|
|
124
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MathExercise } from "../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
a: number;
|
|
4
|
+
b: number;
|
|
5
|
+
c: number;
|
|
6
|
+
d: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const squareRootsDistributivity: MathExercise<Identifiers>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=squareRootsDistributivity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"squareRootsDistributivity.d.ts","sourceRoot":"","sources":["../../../src/exercises/squareRoots/squareRootsDistributivity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAiEF,eAAO,MAAM,yBAAyB,EAAE,YAAY,CAAC,WAAW,CAa/D,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.squareRootsDistributivity = void 0;
|
|
4
|
+
const exercise_1 = require("../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const real_1 = require("../../math/numbers/reals/real");
|
|
7
|
+
const randint_1 = require("../../math/utils/random/randint");
|
|
8
|
+
const sqrtNode_1 = require("../../tree/nodes/functions/sqrtNode");
|
|
9
|
+
const numberNode_1 = require("../../tree/nodes/numbers/numberNode");
|
|
10
|
+
const addNode_1 = require("../../tree/nodes/operators/addNode");
|
|
11
|
+
const multiplyNode_1 = require("../../tree/nodes/operators/multiplyNode");
|
|
12
|
+
/**
|
|
13
|
+
* a sqrt(b) (c + d sqrt(b))
|
|
14
|
+
*/
|
|
15
|
+
const getSquareRootsDistributivityQuestion = () => {
|
|
16
|
+
const a = (0, randint_1.randint)(1, 7);
|
|
17
|
+
const aNode = new numberNode_1.NumberNode(a);
|
|
18
|
+
const c = (0, randint_1.randint)(1, 7);
|
|
19
|
+
const cNode = new numberNode_1.NumberNode(c);
|
|
20
|
+
const d = (0, randint_1.randint)(-6, 7, [0]);
|
|
21
|
+
const dNode = new numberNode_1.NumberNode(d);
|
|
22
|
+
const b = real_1.SquareRootConstructor.randomIrreductible(10);
|
|
23
|
+
const bTree = b.toTree();
|
|
24
|
+
const statement = new multiplyNode_1.MultiplyNode(new multiplyNode_1.MultiplyNode(aNode, bTree), new addNode_1.AddNode(cNode, new multiplyNode_1.MultiplyNode(dNode, bTree)));
|
|
25
|
+
const answer = new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(new multiplyNode_1.MultiplyNode(aNode, cNode), bTree), new multiplyNode_1.MultiplyNode(new multiplyNode_1.MultiplyNode(aNode, dNode), new numberNode_1.NumberNode(b.operand)))
|
|
26
|
+
.simplify({ forbidFactorize: true })
|
|
27
|
+
.toTex();
|
|
28
|
+
const question = {
|
|
29
|
+
answer,
|
|
30
|
+
instruction: `Développer et simplifier : $${statement.toTex()}$`,
|
|
31
|
+
keys: [],
|
|
32
|
+
answerFormat: "tex",
|
|
33
|
+
identifiers: { a, b: b.operand, c, d },
|
|
34
|
+
};
|
|
35
|
+
return question;
|
|
36
|
+
};
|
|
37
|
+
const getPropositions = (n, { answer, b }) => {
|
|
38
|
+
const propositions = [];
|
|
39
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
40
|
+
const sqrt = new sqrtNode_1.SqrtNode(new numberNode_1.NumberNode(b));
|
|
41
|
+
while (propositions.length < n) {
|
|
42
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode((0, randint_1.randint)(1, 10)), sqrt), new numberNode_1.NumberNode((0, randint_1.randint)(-100, 100, [0]))).toTex());
|
|
43
|
+
}
|
|
44
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
45
|
+
};
|
|
46
|
+
const isAnswerValid = (ans, { a, b, c, d }) => {
|
|
47
|
+
const aNode = new numberNode_1.NumberNode(a);
|
|
48
|
+
const cNode = new numberNode_1.NumberNode(c);
|
|
49
|
+
const dNode = new numberNode_1.NumberNode(d);
|
|
50
|
+
const bTree = new sqrtNode_1.SqrtNode(new numberNode_1.NumberNode(b));
|
|
51
|
+
const answer = new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(new multiplyNode_1.MultiplyNode(aNode, cNode), bTree), new multiplyNode_1.MultiplyNode(new multiplyNode_1.MultiplyNode(aNode, dNode), new numberNode_1.NumberNode(b))).simplify({ forbidFactorize: true });
|
|
52
|
+
const texs = answer.toAllValidTexs();
|
|
53
|
+
return texs.includes(ans);
|
|
54
|
+
};
|
|
55
|
+
exports.squareRootsDistributivity = {
|
|
56
|
+
id: "squareRootsDistributivity",
|
|
57
|
+
connector: "=",
|
|
58
|
+
label: "Distributivité avec des racines carrées",
|
|
59
|
+
levels: ["2nde"],
|
|
60
|
+
isSingleStep: true,
|
|
61
|
+
sections: ["Racines carrées", "Calcul littéral"],
|
|
62
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getSquareRootsDistributivityQuestion, nb),
|
|
63
|
+
qcmTimer: 60,
|
|
64
|
+
freeTimer: 60,
|
|
65
|
+
getPropositions,
|
|
66
|
+
isAnswerValid,
|
|
67
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MathExercise } from "../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
a: number;
|
|
4
|
+
b: number;
|
|
5
|
+
c: number;
|
|
6
|
+
d: number | undefined;
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
z: number | undefined;
|
|
10
|
+
};
|
|
11
|
+
export declare const squareRootsSum: MathExercise<Identifiers>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=squareRootsSum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"squareRootsSum.d.ts","sourceRoot":"","sources":["../../../src/exercises/squareRoots/squareRootsSum.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvB,CAAC;AA2EF,eAAO,MAAM,cAAc,EAAE,YAAY,CAAC,WAAW,CAapD,CAAC"}
|