math-exercises 2.2.41 → 2.2.42
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 +42 -36
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSum.d.ts +4 -1
- package/lib/exercises/math/calcul/fractions/fractionsSum.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSum.js +23 -4
- package/lib/exercises/math/calcul/rounding/rounding.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/firstIdentity.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/firstIdentity.js +3 -0
- package/lib/exercises/math/functions/logarithm/log10Simplifying.d.ts.map +1 -1
- package/lib/exercises/math/functions/logarithm/logPowerEquation.d.ts.map +1 -1
- package/lib/exercises/math/percent/evolutionRateFromValues.d.ts.map +1 -1
- package/lib/exercises/math/percent/evolutionRateFromValues.js +2 -2
- package/lib/exercises/math/percent/evolutionToCM.d.ts.map +1 -1
- package/lib/exercises/math/percent/evolutionToCM.js +3 -1
- package/lib/exercises/math/powers/powersDivision.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersPower.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersProduct.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticReasonUsage.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticReasonUsage.js +1 -0
- package/lib/exercises/math/trigonometry/mainAngleMeasure.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/mainAngleMeasure.js +0 -3
- package/lib/exercises/utils/getDistinctQuestions.d.ts +1 -1
- package/lib/exercises/utils/getDistinctQuestions.d.ts.map +1 -1
- package/lib/index.d.ts +512 -510
- package/lib/index.d.ts.map +1 -1
- package/lib/math/sets/intervals/intervals.js +1 -1
- package/lib/math/systems/system.d.ts.map +1 -1
- package/lib/math/systems/system.js +29 -7
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +7 -1
- package/lib/server.js +9 -2
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +41 -0
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +2 -2
- package/lib/tree/parsers/rationalParser.d.ts +1 -0
- package/lib/tree/parsers/rationalParser.d.ts.map +1 -0
- package/lib/tree/parsers/rationalParser.js +9 -0
- package/package.json +1 -1
|
@@ -4,7 +4,11 @@ export declare const addValidProp: (props: Proposition[], statement: string, for
|
|
|
4
4
|
export declare const addWrongProp: (props: Proposition[], statement: string, format?: "tex" | "raw") => void;
|
|
5
5
|
export declare const tryToAddWrongProp: (props: Proposition[], statement: string, format?: "tex" | "raw") => void;
|
|
6
6
|
export declare const shuffleProps: (props: Proposition[], n: number) => Proposition[];
|
|
7
|
-
export type GeneratorOptions = {
|
|
7
|
+
export type GeneratorOptions = {
|
|
8
|
+
id: string;
|
|
9
|
+
label: string;
|
|
10
|
+
type: "checkbox" | "select";
|
|
11
|
+
};
|
|
8
12
|
export type Proposition = {
|
|
9
13
|
id: string;
|
|
10
14
|
statement: string;
|
|
@@ -37,7 +41,7 @@ export type GeogebraOptions = {
|
|
|
37
41
|
export type KeyboardOptions = {
|
|
38
42
|
parenthesisShouldNotProduceLeftRight?: boolean;
|
|
39
43
|
};
|
|
40
|
-
export interface Question<TIdentifiers = {}> {
|
|
44
|
+
export interface Question<TIdentifiers = {}, TOptions = {}> {
|
|
41
45
|
instruction: string;
|
|
42
46
|
hint?: string;
|
|
43
47
|
correction?: string;
|
|
@@ -54,40 +58,42 @@ export interface Question<TIdentifiers = {}> {
|
|
|
54
58
|
};
|
|
55
59
|
divisionFormat?: "fraction" | "obelus";
|
|
56
60
|
identifiers: TIdentifiers;
|
|
61
|
+
options?: TOptions;
|
|
57
62
|
}
|
|
58
|
-
export type QCMGenerator<TIdentifiers> = (n: number, args: {
|
|
63
|
+
export type QCMGenerator<TIdentifiers, TOptions = {}> = (n: number, args: {
|
|
59
64
|
answer: string;
|
|
60
|
-
} & TIdentifiers) => Proposition[];
|
|
61
|
-
export type VEA<TIdentifiers> = (studentAnswer: string, args: {
|
|
65
|
+
} & TIdentifiers, options?: TOptions) => Proposition[];
|
|
66
|
+
export type VEA<TIdentifiers, TOptions = {}> = (studentAnswer: string, args: {
|
|
62
67
|
answer: string;
|
|
63
|
-
} & TIdentifiers) => boolean;
|
|
64
|
-
export type GGBVEA<TIdentifiers> = (studentAnswer: string[], args: {
|
|
68
|
+
} & TIdentifiers, options?: TOptions) => boolean;
|
|
69
|
+
export type GGBVEA<TIdentifiers, TOptions = {}> = (studentAnswer: string[], args: {
|
|
65
70
|
ggbAnswer: string[];
|
|
66
|
-
} & TIdentifiers) => boolean;
|
|
67
|
-
export type QuestionGenerator<TIdentifiers = {}, TOptions =
|
|
68
|
-
export type GetHint<TIdentifiers,
|
|
69
|
-
export type GetCorrection<TIdentifiers> = (args: TIdentifiers) => string;
|
|
70
|
-
export type GetInstruction<TIdentifiers> = (args: TIdentifiers) => string;
|
|
71
|
-
export type GetAnswer<TIdentifiers> = (args: TIdentifiers) => string;
|
|
72
|
-
export type GetKeys<TIdentifiers> = (args: TIdentifiers) => (KeyId | KeyProps)[];
|
|
73
|
-
export type GetGGBAnswer<TIdentifiers> = (args: TIdentifiers) => string[];
|
|
74
|
-
export type GetGGBOptions<TIdentifiers> = (args: TIdentifiers) => GeogebraOptions;
|
|
75
|
-
export type GetStudentGGBOptions<TIdentifiers> = (args: TIdentifiers) => GeogebraOptions;
|
|
76
|
-
export type RebuildIdentifiers<TIdentifiers> = (oldIdentifiers: any) => TIdentifiers;
|
|
77
|
-
export type GetQuestionFromIdentifiers<TIdentifiers> = (identifiers: TIdentifiers) => Question<TIdentifiers>;
|
|
78
|
-
export type QuestionHotFix<TIdentifiers> = (q: Question<TIdentifiers
|
|
71
|
+
} & TIdentifiers, options?: TOptions) => boolean;
|
|
72
|
+
export type QuestionGenerator<TIdentifiers = {}, TOptions = any> = (opts?: TOptions) => Question<TIdentifiers, TOptions>;
|
|
73
|
+
export type GetHint<TIdentifiers, TOptions = {}> = (args: TIdentifiers, options?: TOptions) => string;
|
|
74
|
+
export type GetCorrection<TIdentifiers, TOptions = {}> = (args: TIdentifiers, options?: TOptions) => string;
|
|
75
|
+
export type GetInstruction<TIdentifiers, TOptions = {}> = (args: TIdentifiers, options?: TOptions) => string;
|
|
76
|
+
export type GetAnswer<TIdentifiers, TOptions = {}> = (args: TIdentifiers, options?: TOptions) => string;
|
|
77
|
+
export type GetKeys<TIdentifiers, TOptions = {}> = (args: TIdentifiers, options?: TOptions) => (KeyId | KeyProps)[];
|
|
78
|
+
export type GetGGBAnswer<TIdentifiers, TOptions = {}> = (args: TIdentifiers, options?: TOptions) => string[];
|
|
79
|
+
export type GetGGBOptions<TIdentifiers, TOptions = {}> = (args: TIdentifiers, options?: TOptions) => GeogebraOptions;
|
|
80
|
+
export type GetStudentGGBOptions<TIdentifiers, TOptions = {}> = (args: TIdentifiers, options?: TOptions) => GeogebraOptions;
|
|
81
|
+
export type RebuildIdentifiers<TIdentifiers, TOptions = {}> = (oldIdentifiers: any, options?: TOptions) => TIdentifiers;
|
|
82
|
+
export type GetQuestionFromIdentifiers<TIdentifiers, TOptions = {}> = (identifiers: TIdentifiers, options?: TOptions) => Question<TIdentifiers>;
|
|
83
|
+
export type QuestionHotFix<TIdentifiers, TOptions = {}> = (q: Question<TIdentifiers>, options?: TOptions) => Question<TIdentifiers>;
|
|
79
84
|
type PDFOptions = {
|
|
80
85
|
shouldSpreadPropositions?: boolean;
|
|
81
86
|
};
|
|
82
|
-
export interface Exercise<TIdentifiers = {}> {
|
|
87
|
+
export interface Exercise<TIdentifiers = {}, TOptions = {}> {
|
|
83
88
|
id: string;
|
|
84
89
|
isSingleStep: boolean;
|
|
85
90
|
label: string;
|
|
86
91
|
pdfOptions?: PDFOptions;
|
|
92
|
+
options?: GeneratorOptions[];
|
|
87
93
|
sections?: (MathSection | PCSection)[];
|
|
88
94
|
levels?: MathLevel[];
|
|
89
95
|
connector?: "=" | "\\iff" | "\\approx";
|
|
90
|
-
generator: (n: number) => Question<TIdentifiers>[];
|
|
96
|
+
generator: (n: number, opts?: TOptions) => Question<TIdentifiers, TOptions>[];
|
|
91
97
|
maxAllowedQuestions?: number;
|
|
92
98
|
answerType?: "GGB" | "QCM" | "free" | "QCU";
|
|
93
99
|
isQCM?: boolean;
|
|
@@ -96,23 +102,23 @@ export interface Exercise<TIdentifiers = {}> {
|
|
|
96
102
|
ggbTimer?: number;
|
|
97
103
|
getPropositions?: QCMGenerator<{
|
|
98
104
|
answer: string;
|
|
99
|
-
} & TIdentifiers>;
|
|
100
|
-
isAnswerValid?: VEA<TIdentifiers>;
|
|
101
|
-
isGGBAnswerValid?: GGBVEA<TIdentifiers>;
|
|
105
|
+
} & TIdentifiers, TOptions>;
|
|
106
|
+
isAnswerValid?: VEA<TIdentifiers, TOptions>;
|
|
107
|
+
isGGBAnswerValid?: GGBVEA<TIdentifiers, TOptions>;
|
|
102
108
|
hasGeogebra?: boolean;
|
|
103
109
|
subject: "Mathématiques" | "Chimie" | "Physique";
|
|
104
110
|
hasHintAndCorrection?: boolean;
|
|
105
|
-
getInstruction?: GetInstruction<TIdentifiers>;
|
|
106
|
-
getHint?: GetHint<TIdentifiers>;
|
|
107
|
-
getCorrection?: GetCorrection<TIdentifiers>;
|
|
108
|
-
getKeys?: GetKeys<TIdentifiers>;
|
|
109
|
-
getAnswer?: GetAnswer<TIdentifiers>;
|
|
110
|
-
getGGBAnswer?: GetGGBAnswer<TIdentifiers>;
|
|
111
|
-
getGGBOptions?: GetGGBOptions<TIdentifiers>;
|
|
112
|
-
getStudentGGBOptions?: GetStudentGGBOptions<TIdentifiers>;
|
|
113
|
-
rebuildIdentifiers?: RebuildIdentifiers<TIdentifiers>;
|
|
114
|
-
getQuestionFromIdentifiers?: GetQuestionFromIdentifiers<TIdentifiers>;
|
|
115
|
-
hotFix?: QuestionHotFix<TIdentifiers>;
|
|
111
|
+
getInstruction?: GetInstruction<TIdentifiers, TOptions>;
|
|
112
|
+
getHint?: GetHint<TIdentifiers, TOptions>;
|
|
113
|
+
getCorrection?: GetCorrection<TIdentifiers, TOptions>;
|
|
114
|
+
getKeys?: GetKeys<TIdentifiers, TOptions>;
|
|
115
|
+
getAnswer?: GetAnswer<TIdentifiers, TOptions>;
|
|
116
|
+
getGGBAnswer?: GetGGBAnswer<TIdentifiers, TOptions>;
|
|
117
|
+
getGGBOptions?: GetGGBOptions<TIdentifiers, TOptions>;
|
|
118
|
+
getStudentGGBOptions?: GetStudentGGBOptions<TIdentifiers, TOptions>;
|
|
119
|
+
rebuildIdentifiers?: RebuildIdentifiers<TIdentifiers, TOptions>;
|
|
120
|
+
getQuestionFromIdentifiers?: GetQuestionFromIdentifiers<TIdentifiers, TOptions>;
|
|
121
|
+
hotFix?: QuestionHotFix<TIdentifiers, TOptions>;
|
|
116
122
|
}
|
|
117
123
|
export type MathLevel = "6ème" | "5ème" | "4ème" | "3ème" | "2nde" | "1reTech" | "1reESM" | "1reSpé" | "TermSpé" | "TermTech" | "MathExp" | "MathComp" | "CAP" | "2ndPro" | "1rePro" | "TermPro";
|
|
118
124
|
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" | "Matrices" | "Nombres complexes" | "Périmètres" | "Pourcentages" | "Primitives" | "Probabilités" | "Produit scalaire" | "Proportionnalité" | "Python" | "Puissances" | "Python" | "Racines carrées" | "Second degré" | "Statistiques" | "Suites" | "Systèmes" | "Théorème de Pythagore" | "Théorème de Thalès" | "Trigonométrie" | "Valeur absolue" | "Vecteurs";
|
|
@@ -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;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAIhD,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;
|
|
1
|
+
{"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAIhD,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;IAC7B,EAAE,EAAE,MAAM,CAA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BAAoB,GACpB,WAAW,GACX,iBAAiB,GACjB,SAAS,CAAC"}
|
|
@@ -3,6 +3,9 @@ type Identifiers = {
|
|
|
3
3
|
rational: [number, number];
|
|
4
4
|
rational2: [number, number];
|
|
5
5
|
};
|
|
6
|
-
|
|
6
|
+
type Options = {
|
|
7
|
+
allowNonIrreductible: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const fractionsSum: Exercise<Identifiers, Options>;
|
|
7
10
|
export {};
|
|
8
11
|
//# sourceMappingURL=fractionsSum.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fractionsSum.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsSum.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"fractionsSum.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsSum.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3B,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7B,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,oBAAoB,EAAE,OAAO,CAAC;CAC/B,CAAC;AA+EF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAevD,CAAC"}
|
|
@@ -5,8 +5,9 @@ const exercise_1 = require("../../../../exercises/exercise");
|
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
6
|
const rational_1 = require("../../../../math/numbers/rationals/rational");
|
|
7
7
|
const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
8
|
+
const latexParser_1 = require("../../../../tree/parsers/latexParser");
|
|
8
9
|
const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
9
|
-
const getFractionsSum = () => {
|
|
10
|
+
const getFractionsSum = (opts) => {
|
|
10
11
|
const rational = rational_1.RationalConstructor.randomIrreductible();
|
|
11
12
|
const rational2 = rational_1.RationalConstructor.randomIrreductible();
|
|
12
13
|
const statementTree = new addNode_1.AddNode(rational.toTree(), rational2.toTree());
|
|
@@ -36,15 +37,32 @@ const getPropositions = (n, { answer, rational, rational2 }) => {
|
|
|
36
37
|
}
|
|
37
38
|
return (0, shuffle_1.shuffle)(propositions);
|
|
38
39
|
};
|
|
39
|
-
const isAnswerValid = (ans, { rational, rational2 }) => {
|
|
40
|
+
const isAnswerValid = (ans, { rational, rational2 }, opts) => {
|
|
40
41
|
const rationalA = new rational_1.Rational(rational[0], rational[1]);
|
|
41
42
|
const rationalB = new rational_1.Rational(rational2[0], rational2[1]);
|
|
43
|
+
const allow = opts?.allowNonIrreductible;
|
|
42
44
|
const answerTree = rationalA
|
|
43
45
|
.add(rationalB)
|
|
44
46
|
.toTree({ allowFractionToDecimal: true });
|
|
45
47
|
const texs = answerTree.toAllValidTexs();
|
|
46
|
-
|
|
48
|
+
if (allow)
|
|
49
|
+
try {
|
|
50
|
+
const parsed = (0, latexParser_1.parseLatex)(ans).simplify().toTex();
|
|
51
|
+
return texs.includes(parsed);
|
|
52
|
+
}
|
|
53
|
+
catch (err) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
else
|
|
57
|
+
return texs.includes(ans);
|
|
47
58
|
};
|
|
59
|
+
const options = [
|
|
60
|
+
{
|
|
61
|
+
id: "allowNonIrreductible",
|
|
62
|
+
label: "Autoriser les fractions non réduites",
|
|
63
|
+
type: "checkbox",
|
|
64
|
+
},
|
|
65
|
+
];
|
|
48
66
|
exports.fractionsSum = {
|
|
49
67
|
id: "fractionsSum",
|
|
50
68
|
connector: "=",
|
|
@@ -52,10 +70,11 @@ exports.fractionsSum = {
|
|
|
52
70
|
levels: ["4ème", "3ème", "2nde", "CAP", "2ndPro", "1rePro"],
|
|
53
71
|
sections: ["Fractions"],
|
|
54
72
|
isSingleStep: false,
|
|
55
|
-
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getFractionsSum, nb),
|
|
73
|
+
generator: (nb, opts) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getFractionsSum(opts), nb),
|
|
56
74
|
qcmTimer: 60,
|
|
57
75
|
freeTimer: 60,
|
|
58
76
|
getPropositions,
|
|
59
77
|
isAnswerValid,
|
|
60
78
|
subject: "Mathématiques",
|
|
79
|
+
options,
|
|
61
80
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rounding.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/rounding/rounding.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"rounding.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/rounding/rounding.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AA+ElC,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAgDF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAe7C,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAehD,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAejD,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAejD,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAkB9C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firstIdentity.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/firstIdentity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAER,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAGJ,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,iBAAiB,CAAC,WAAW,CA6DnE,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,YAAY,CAAC,WAAW,CAkClE,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,GAAG,CAAC,WAAW,CAKvD,CAAC;
|
|
1
|
+
{"version":3,"file":"firstIdentity.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/firstIdentity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAER,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAGJ,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,iBAAiB,CAAC,WAAW,CA6DnE,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,YAAY,CAAC,WAAW,CAkClE,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,GAAG,CAAC,WAAW,CAKvD,CAAC;AAMF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAc/C,CAAC"}
|
|
@@ -85,6 +85,9 @@ const isFirstIdentityAnswerValid = (ans, { a, b }) => {
|
|
|
85
85
|
return texs.includes(ans);
|
|
86
86
|
};
|
|
87
87
|
exports.isFirstIdentityAnswerValid = isFirstIdentityAnswerValid;
|
|
88
|
+
const tests = () => {
|
|
89
|
+
//si identifiers = x,y alors questions devrait etre x,y et vea devrait accepter x,y,z
|
|
90
|
+
};
|
|
88
91
|
exports.firstIdentity = {
|
|
89
92
|
id: "idRmq1",
|
|
90
93
|
connector: "=",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log10Simplifying.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/log10Simplifying.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,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;
|
|
1
|
+
{"version":3,"file":"log10Simplifying.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/log10Simplifying.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,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;AA8FF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAiBrD,CAAC;AACF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAiBnD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logPowerEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/logPowerEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,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;
|
|
1
|
+
{"version":3,"file":"logPowerEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/logPowerEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,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;AA0GF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAelD,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAkBpD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evolutionRateFromValues.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/evolutionRateFromValues.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;
|
|
1
|
+
{"version":3,"file":"evolutionRateFromValues.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/evolutionRateFromValues.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAoGF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAiBzD,CAAC"}
|
|
@@ -38,7 +38,7 @@ t = \\frac{V_a-V_d}{V_d}\\times 100
|
|
|
38
38
|
$$`;
|
|
39
39
|
};
|
|
40
40
|
const getCorrection = (identifiers) => {
|
|
41
|
-
const answer =
|
|
41
|
+
const answer = (0, round_1.round)(((identifiers.vf - identifiers.vd) / identifiers.vd) * 100, 2).frenchify();
|
|
42
42
|
return `Si une valeur passe d'une valeur de départ $V_d$ à une valeur d'arrivée $V_a$, alors le taux d'évolution $t$ en pourcentage est donné par la formule :
|
|
43
43
|
|
|
44
44
|
$$
|
|
@@ -47,7 +47,7 @@ $$
|
|
|
47
47
|
|
|
48
48
|
Ici, on a $V_d = ${identifiers.vd.frenchify()}$ et $V_a = ${identifiers.vf.frenchify()}$.
|
|
49
49
|
|
|
50
|
-
Donc, le taux d'évolution est :
|
|
50
|
+
Donc, le taux d'évolution, en pourcentage, est :
|
|
51
51
|
|
|
52
52
|
${(0, alignTex_1.alignTex)([
|
|
53
53
|
[
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evolutionToCM.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/evolutionToCM.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"evolutionToCM.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/evolutionToCM.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAuEF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAc/C,CAAC"}
|
|
@@ -5,6 +5,7 @@ const exercise_1 = require("../../../exercises/exercise");
|
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
6
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
7
|
const round_1 = require("../../../math/utils/round");
|
|
8
|
+
const numberParser_1 = require("../../../tree/parsers/numberParser");
|
|
8
9
|
const getEvolutionToCmQuestion = () => {
|
|
9
10
|
const evolution = (0, randint_1.randint)(-99, 101, [0]);
|
|
10
11
|
const isHausse = evolution > 0;
|
|
@@ -42,7 +43,8 @@ const getPropositions = (n, { answer, evolution }) => {
|
|
|
42
43
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
43
44
|
};
|
|
44
45
|
const isAnswerValid = (ans, { answer }) => {
|
|
45
|
-
|
|
46
|
+
const parsed = (0, numberParser_1.numberParser)(ans);
|
|
47
|
+
return parsed === answer;
|
|
46
48
|
};
|
|
47
49
|
exports.evolutionToCM = {
|
|
48
50
|
id: "evolutionToCM",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"powersDivision.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/powersDivision.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAGxB,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;
|
|
1
|
+
{"version":3,"file":"powersDivision.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/powersDivision.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAGxB,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAyFF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CA6BhD,CAAC;AACF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAkBrD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"powersPower.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/powersPower.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,OAAO,EACL,QAAQ,EAST,MAAM,gBAAgB,CAAC;AAExB,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;
|
|
1
|
+
{"version":3,"file":"powersPower.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/powersPower.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,OAAO,EACL,QAAQ,EAST,MAAM,gBAAgB,CAAC;AAExB,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAyDF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CA6BlD,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAiB7C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"powersProduct.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/powersProduct.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAIxB,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;
|
|
1
|
+
{"version":3,"file":"powersProduct.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/powersProduct.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAIxB,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA+EF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CA8BpD,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAkB/C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arithmeticReasonUsage.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticReasonUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAIlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;
|
|
1
|
+
{"version":3,"file":"arithmeticReasonUsage.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticReasonUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAIlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAoCF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAavD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mainAngleMeasure.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/mainAngleMeasure.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAelC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,MAAM,CAAC;IAC3B,OAAO,EAAE,GAAG,CAAC;CACd,CAAC;
|
|
1
|
+
{"version":3,"file":"mainAngleMeasure.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/mainAngleMeasure.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAelC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,MAAM,CAAC;IAC3B,OAAO,EAAE,GAAG,CAAC;CACd,CAAC;AA4FF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAiBlD,CAAC"}
|
|
@@ -57,14 +57,11 @@ const isAnswerValid = (ans, { answer, degree }) => {
|
|
|
57
57
|
const value = remarkableValues_1.mainTrigoValues.find((e) => e.degree === degree);
|
|
58
58
|
try {
|
|
59
59
|
const parsed = (0, latexParser_1.parseLatex)(ans);
|
|
60
|
-
console.log("parsed", parsed);
|
|
61
60
|
const simplified = parsed.simplify().toTex();
|
|
62
|
-
console.log("simp", simplified);
|
|
63
61
|
return simplified === answer;
|
|
64
62
|
// return value.angle.toAllValidTexs().includes(ans);
|
|
65
63
|
}
|
|
66
64
|
catch (err) {
|
|
67
|
-
console.log(err);
|
|
68
65
|
return false;
|
|
69
66
|
}
|
|
70
67
|
};
|
|
@@ -7,5 +7,5 @@ export declare function equalTab<T>(array1: T[], array2: T[]): boolean;
|
|
|
7
7
|
* @param max included
|
|
8
8
|
* @returns
|
|
9
9
|
*/
|
|
10
|
-
export declare const getDistinctQuestions: (generator: () => Question<any>, nb: number, max?: number, discriminator?: ((q1: Question<any>, q2: Question<any>) => boolean) | undefined) => Question<any>[];
|
|
10
|
+
export declare const getDistinctQuestions: (generator: () => Question<any, any>, nb: number, max?: number, discriminator?: ((q1: Question<any, any>, q2: Question<any, any>) => boolean) | undefined) => Question<any, any>[];
|
|
11
11
|
//# sourceMappingURL=getDistinctQuestions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDistinctQuestions.d.ts","sourceRoot":"","sources":["../../../src/exercises/utils/getDistinctQuestions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,WAOnD;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,cACpB,MAAM,SAAS,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"getDistinctQuestions.d.ts","sourceRoot":"","sources":["../../../src/exercises/utils/getDistinctQuestions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,WAOnD;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,cACpB,MAAM,SAAS,GAAG,EAAE,GAAG,CAAC,MAC/B,MAAM,QACJ,MAAM,wBACS,SAAS,GAAG,EAAE,GAAG,CAAC,MAAM,SAAS,GAAG,EAAE,GAAG,CAAC,KAAK,OAAO,kBAC1E,SAAS,GAAG,EAAE,GAAG,CAAC,EAapB,CAAC"}
|