math-exercises 1.3.8 → 1.3.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/factorisation/factoIdRmq.d.ts +7 -0
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq.d.ts.map +1 -0
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq.js +38 -0
- package/lib/exercises/exercise.d.ts +2 -1
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/exercises.d.ts.map +1 -1
- package/lib/exercises/exercises.js +13 -0
- package/lib/exercises/sequences/geometric/geometricExplicitFormulaUsage.js +1 -1
- package/lib/exercises/sequences/geometric/geometricFindExplicitFormula.js +1 -1
- package/lib/exercises/sequences/geometric/geometricRecurrenceFormulaUsage.d.ts +6 -2
- package/lib/exercises/sequences/geometric/geometricRecurrenceFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/sequences/geometric/geometricRecurrenceFormulaUsage.js +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +0 -16
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* type (ax+b)(cx+d) ± (ax+b)(ex+f)
|
|
3
|
+
*/
|
|
4
|
+
import { Exercise, Question } from '../../../exercises/exercise';
|
|
5
|
+
export declare const factoType1Exercise: Exercise;
|
|
6
|
+
export declare function getFactoType1Question(): Question;
|
|
7
|
+
//# sourceMappingURL=factoIdRmq.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factoIdRmq.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/factorisation/factoIdRmq.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAS9D,eAAO,MAAM,kBAAkB,EAAE,QAShC,CAAC;AAEF,wBAAgB,qBAAqB,IAAI,QAAQ,CA4BhD"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* type (ax+b)(cx+d) ± (ax+b)(ex+f)
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getFactoType1Question = exports.factoType1Exercise = void 0;
|
|
7
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
8
|
+
const affine_1 = require("../../../math/polynomials/affine");
|
|
9
|
+
const addNode_1 = require("../../../tree/nodes/operators/addNode");
|
|
10
|
+
const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
|
|
11
|
+
const substractNode_1 = require("../../../tree/nodes/operators/substractNode");
|
|
12
|
+
const random_1 = require("../../../utils/random");
|
|
13
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
14
|
+
exports.factoType1Exercise = {
|
|
15
|
+
id: 'factoIdRmq1',
|
|
16
|
+
connector: '=',
|
|
17
|
+
instruction: 'Factoriser :',
|
|
18
|
+
isSingleStep: false,
|
|
19
|
+
label: 'Factorisation du type $(ax+b)(cx+d) \\pm (ax+b)(ex+f)$',
|
|
20
|
+
levels: ['3', '2'],
|
|
21
|
+
section: 'Calcul littéral',
|
|
22
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getFactoType1Question, nb),
|
|
23
|
+
};
|
|
24
|
+
function getFactoType1Question() {
|
|
25
|
+
const affines = affine_1.AffineConstructor.differentRandoms(3);
|
|
26
|
+
const permut = [(0, shuffle_1.shuffle)([affines[0], affines[1]]), (0, shuffle_1.shuffle)([affines[0], affines[2]])];
|
|
27
|
+
const operation = (0, random_1.random)(['add', 'substract']);
|
|
28
|
+
const statementTree = operation === 'add'
|
|
29
|
+
? new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(permut[0][0].toTree(), permut[0][1].toTree()), new multiplyNode_1.MultiplyNode(permut[1][0].toTree(), permut[1][1].toTree()))
|
|
30
|
+
: new substractNode_1.SubstractNode(new multiplyNode_1.MultiplyNode(permut[0][0].toTree(), permut[0][1].toTree()), new multiplyNode_1.MultiplyNode(permut[1][0].toTree(), permut[1][1].toTree()));
|
|
31
|
+
const answerTree = new multiplyNode_1.MultiplyNode(affines[0].toTree(), affines[1].add(operation === 'add' ? affines[2] : affines[2].opposite()).toTree());
|
|
32
|
+
const question = {
|
|
33
|
+
startStatement: statementTree.toTex(),
|
|
34
|
+
answer: answerTree.toTex(),
|
|
35
|
+
};
|
|
36
|
+
return question;
|
|
37
|
+
}
|
|
38
|
+
exports.getFactoType1Question = getFactoType1Question;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type GeneratorOptions = {};
|
|
1
2
|
export interface Question {
|
|
2
3
|
instruction?: string;
|
|
3
4
|
startStatement?: string;
|
|
@@ -11,6 +12,6 @@ export interface Exercise {
|
|
|
11
12
|
section: string;
|
|
12
13
|
levels: string[];
|
|
13
14
|
connector: string;
|
|
14
|
-
generator(nb: number): Question[];
|
|
15
|
+
generator(nb: number, options: GeneratorOptions): Question[];
|
|
15
16
|
}
|
|
16
17
|
//# sourceMappingURL=exercise.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,QAAQ;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAElC,MAAM,WAAW,QAAQ;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,GAAG,QAAQ,EAAE,CAAC;CAC9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exercises.d.ts","sourceRoot":"","sources":["../../src/exercises/exercises.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"exercises.d.ts","sourceRoot":"","sources":["../../src/exercises/exercises.ts"],"names":[],"mappings":"AAyCA,eAAO,MAAM,SAAS,iCA6ErB,CAAC"}
|
|
@@ -29,6 +29,11 @@ const powersOfTenToDecimal_1 = require("./powers/powersOfTenToDecimal");
|
|
|
29
29
|
const powersPower_1 = require("./powers/powersPower");
|
|
30
30
|
const powersProduct_1 = require("./powers/powersProduct");
|
|
31
31
|
const scientificToDecimal_1 = require("./powers/scientificToDecimal");
|
|
32
|
+
const geometricExplicitFormulaUsage_1 = require("./sequences/geometric/geometricExplicitFormulaUsage");
|
|
33
|
+
const geometricFindExplicitFormula_1 = require("./sequences/geometric/geometricFindExplicitFormula");
|
|
34
|
+
const geometricFindReason_1 = require("./sequences/geometric/geometricFindReason");
|
|
35
|
+
const geometricReasonUsage_1 = require("./sequences/geometric/geometricReasonUsage");
|
|
36
|
+
const geometricRecurrenceFormulaUsage_1 = require("./sequences/geometric/geometricRecurrenceFormulaUsage");
|
|
32
37
|
const simpifySquareRoot_1 = require("./squareRoots/simpifySquareRoot");
|
|
33
38
|
exports.exercises = [
|
|
34
39
|
/**
|
|
@@ -91,4 +96,12 @@ exports.exercises = [
|
|
|
91
96
|
powersProduct_1.powersOfTenProduct,
|
|
92
97
|
scientificToDecimal_1.scientificToDecimal,
|
|
93
98
|
powersOfTenToDecimal_1.powersOfTenToDecimal,
|
|
99
|
+
/**
|
|
100
|
+
* suites
|
|
101
|
+
*/
|
|
102
|
+
geometricExplicitFormulaUsage_1.geometricExplicitFormulaUsage,
|
|
103
|
+
geometricFindReason_1.geometricFindReason,
|
|
104
|
+
geometricFindExplicitFormula_1.geometricFindExplicitFormula,
|
|
105
|
+
geometricReasonUsage_1.geometricReasonUsage,
|
|
106
|
+
geometricRecurrenceFormulaUsage_1.geometricRecurrenceFormulaUsage,
|
|
94
107
|
];
|
|
@@ -12,7 +12,7 @@ exports.geometricExplicitFormulaUsage = {
|
|
|
12
12
|
id: 'geometricExplicitFormulaUsage',
|
|
13
13
|
connector: '=',
|
|
14
14
|
instruction: '',
|
|
15
|
-
label: "Utiliser la formule
|
|
15
|
+
label: "Utiliser la formule générale d'une suite géométrique",
|
|
16
16
|
levels: ['1', '0'],
|
|
17
17
|
isSingleStep: false,
|
|
18
18
|
section: 'Suites',
|
|
@@ -12,7 +12,7 @@ exports.geometricFindExplicitFormula = {
|
|
|
12
12
|
id: 'geometricFindExplicitFormula',
|
|
13
13
|
connector: '=',
|
|
14
14
|
instruction: '',
|
|
15
|
-
label: "Déterminer la formule
|
|
15
|
+
label: "Déterminer la formule générale d'une suite géométrique",
|
|
16
16
|
levels: ['1', '0'],
|
|
17
17
|
isSingleStep: false,
|
|
18
18
|
section: 'Suites',
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import { Exercise, Question } from '../../../exercises/exercise';
|
|
1
|
+
import { Exercise, GeneratorOptions, Question } from '../../../exercises/exercise';
|
|
2
|
+
interface GeometricRecurrenceFormulaUsageOptions extends GeneratorOptions {
|
|
3
|
+
test: boolean;
|
|
4
|
+
}
|
|
2
5
|
export declare const geometricRecurrenceFormulaUsage: Exercise;
|
|
3
|
-
export declare function getGeometricRecurrenceFormulaUsage(): Question;
|
|
6
|
+
export declare function getGeometricRecurrenceFormulaUsage(options: GeometricRecurrenceFormulaUsageOptions): Question;
|
|
7
|
+
export {};
|
|
4
8
|
//# sourceMappingURL=geometricRecurrenceFormulaUsage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometricRecurrenceFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/geometric/geometricRecurrenceFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"geometricRecurrenceFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/geometric/geometricRecurrenceFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIhF,UAAU,sCAAuC,SAAQ,gBAAgB;IACvE,IAAI,EAAE,OAAO,CAAC;CACf;AAED,eAAO,MAAM,+BAA+B,EAAE,QAU7C,CAAC;AAEF,wBAAgB,kCAAkC,CAAC,OAAO,EAAE,sCAAsC,GAAG,QAAQ,CAY5G"}
|
|
@@ -11,9 +11,9 @@ exports.geometricRecurrenceFormulaUsage = {
|
|
|
11
11
|
levels: ['1', '0'],
|
|
12
12
|
isSingleStep: false,
|
|
13
13
|
section: 'Suites',
|
|
14
|
-
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getGeometricRecurrenceFormulaUsage, nb),
|
|
14
|
+
generator: (nb, options) => (0, getDistinctQuestions_1.getDistinctQuestions)(getGeometricRecurrenceFormulaUsage, nb),
|
|
15
15
|
};
|
|
16
|
-
function getGeometricRecurrenceFormulaUsage() {
|
|
16
|
+
function getGeometricRecurrenceFormulaUsage(options) {
|
|
17
17
|
const firstRank = (0, randint_1.randint)(1, 20);
|
|
18
18
|
const firstValue = (0, randint_1.randint)(1, 10);
|
|
19
19
|
const reason = (0, randint_1.randint)(2, 10);
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,YAAY,2CAAiB,CAAC;AAMpC,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -2,21 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.allExercises = void 0;
|
|
4
4
|
const exercises_1 = require("./exercises/exercises");
|
|
5
|
-
const geometricExplicitFormulaUsage_1 = require("./exercises/sequences/geometric/geometricExplicitFormulaUsage");
|
|
6
|
-
const geometricFindExplicitFormula_1 = require("./exercises/sequences/geometric/geometricFindExplicitFormula");
|
|
7
|
-
const geometricFindReason_1 = require("./exercises/sequences/geometric/geometricFindReason");
|
|
8
|
-
const geometricReasonUsage_1 = require("./exercises/sequences/geometric/geometricReasonUsage");
|
|
9
|
-
const geometricRecurrenceFormulaUsage_1 = require("./exercises/sequences/geometric/geometricRecurrenceFormulaUsage");
|
|
10
5
|
const allExercises = [...exercises_1.exercises];
|
|
11
6
|
exports.allExercises = allExercises;
|
|
12
|
-
const exos = [
|
|
13
|
-
geometricExplicitFormulaUsage_1.geometricExplicitFormulaUsage,
|
|
14
|
-
geometricFindExplicitFormula_1.geometricFindExplicitFormula,
|
|
15
|
-
geometricFindReason_1.geometricFindReason,
|
|
16
|
-
geometricReasonUsage_1.geometricReasonUsage,
|
|
17
|
-
geometricRecurrenceFormulaUsage_1.geometricRecurrenceFormulaUsage,
|
|
18
|
-
];
|
|
19
|
-
exos.forEach((exo) => {
|
|
20
|
-
console.log(exo);
|
|
21
|
-
console.log(exo.generator(10));
|
|
22
|
-
});
|