math-exercises 3.0.91 → 3.0.92
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/math/calcul/arithmetics/commonDivisorsList.js +1 -1
- package/lib/exercises/math/calcul/arithmetics/isMultipleOrDivisor.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/isMultipleOrDivisor.js +3 -8
- package/lib/exercises/math/calcul/arithmetics/ppcmCalcul.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/ppcmCalcul.js +43 -4
- package/lib/exercises/math/calcul/arithmetics/primeNumbers.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/primeNumbers.js +11 -12
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerSum.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerSum.js +6 -2
- package/lib/exercises/math/calcul/fractions/fractionsMix.d.ts +12 -0
- package/lib/exercises/math/calcul/fractions/fractionsMix.d.ts.map +1 -0
- package/lib/exercises/math/calcul/fractions/fractionsMix.js +221 -0
- package/lib/exercises/math/calcul/fractions/fractionsOperations.js +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSubstraction.js +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSum.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSum.js +3 -1
- package/lib/exercises/math/calcul/fractions/index.d.ts +1 -0
- package/lib/exercises/math/calcul/fractions/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/index.js +1 -0
- package/lib/exercises/math/calcul/fractions/simplifyFractionWithPrimeFactorization.d.ts +4 -1
- package/lib/exercises/math/calcul/fractions/simplifyFractionWithPrimeFactorization.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/simplifyFractionWithPrimeFactorization.js +29 -11
- package/lib/exercises/math/calcul/proportionality/scaleCalculation.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/scaleCalculation.js +4 -2
- package/lib/exercises/math/calcul/proportionality/scaleUsage.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/scaleUsage.js +6 -4
- package/lib/exercises/math/calcul/sign/absoluteNumber.d.ts.map +1 -1
- package/lib/exercises/math/calcul/sign/absoluteNumber.js +7 -4
- package/lib/exercises/math/calculLitteral/inequations/inequationsSign.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/inequations/inequationsSign.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/inequations/inequationsSign.js +16 -10
- package/lib/exercises/math/calculLitteral/inequations/isInequalityTrue.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/inequations/isInequalityTrue.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/inequations/isInequalityTrue.js +36 -11
- package/lib/exercises/math/derivation/variations/index.d.ts +1 -0
- package/lib/exercises/math/derivation/variations/index.d.ts.map +1 -1
- package/lib/exercises/math/derivation/variations/index.js +1 -0
- package/lib/exercises/math/derivation/variations/variationArrowAmount.d.ts +10 -0
- package/lib/exercises/math/derivation/variations/variationArrowAmount.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/variationArrowAmount.js +188 -0
- package/lib/exercises/math/functions/basics/graphicInequation.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/graphicInequation.js +9 -0
- package/lib/exercises/math/functions/basics/graphicInequationAffine.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/graphicInequationAffine.js +28 -6
- package/lib/exercises/math/functions/sign/equationFromSignTable.d.ts +11 -0
- package/lib/exercises/math/functions/sign/equationFromSignTable.d.ts.map +1 -0
- package/lib/exercises/math/functions/sign/equationFromSignTable.js +222 -0
- package/lib/exercises/math/functions/sign/index.d.ts +2 -0
- package/lib/exercises/math/functions/sign/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/sign/index.js +2 -0
- package/lib/exercises/math/functions/sign/partialSignTableFromGraph.d.ts +12 -0
- package/lib/exercises/math/functions/sign/partialSignTableFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/functions/sign/partialSignTableFromGraph.js +152 -0
- package/lib/exercises/math/functions/sqrt/squareRootCalculation.d.ts.map +1 -1
- package/lib/exercises/math/functions/sqrt/squareRootCalculation.js +3 -1
- package/lib/exercises/math/functions/square/squareImageInterval.d.ts.map +1 -1
- package/lib/exercises/math/functions/square/squareImageInterval.js +34 -2
- package/lib/exercises/math/geometry/vectors/scalarProduct/findCoordinatesToOrthogonalize.js +1 -1
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithSquareOrRectBase.js +1 -1
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleBase.js +1 -1
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleRectBase.js +1 -1
- package/lib/exercises/math/percent/evolutions/findRightCalculForPriceEvolution.d.ts.map +1 -1
- package/lib/exercises/math/percent/evolutions/findRightCalculForPriceEvolution.js +1 -1
- package/lib/exercises/math/percent/index.d.ts +1 -0
- package/lib/exercises/math/percent/index.d.ts.map +1 -1
- package/lib/exercises/math/percent/index.js +1 -0
- package/lib/exercises/math/percent/percentOfPercentOfNumber.d.ts +9 -0
- package/lib/exercises/math/percent/percentOfPercentOfNumber.d.ts.map +1 -0
- package/lib/exercises/math/percent/percentOfPercentOfNumber.js +98 -0
- package/lib/exercises/math/sets/nameOfNumberSets.d.ts.map +1 -1
- package/lib/exercises/math/sets/nameOfNumberSets.js +2 -1
- package/lib/exercises/math/sets/subsetsOfKnownSets.d.ts.map +1 -1
- package/lib/exercises/math/sets/subsetsOfKnownSets.js +4 -3
- package/lib/index.d.ts +33 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/math/inequations/inequation.d.ts +1 -0
- package/lib/math/inequations/inequation.d.ts.map +1 -1
- package/lib/math/inequations/inequation.js +21 -0
- package/lib/math/numbers/rationals/rational.d.ts +0 -1
- package/lib/math/numbers/rationals/rational.d.ts.map +1 -1
- package/lib/math/numbers/rationals/rational.js +0 -3
- package/lib/tree/parsers/discreteSetParser.d.ts +7 -0
- package/lib/tree/parsers/discreteSetParser.d.ts.map +1 -1
- package/lib/tree/parsers/discreteSetParser.js +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { numberVEA } from "../../../exercises/vea/numberVEA.js";
|
|
4
|
+
import { randfloat } from "../../../math/utils/random/randfloat.js";
|
|
5
|
+
import { randint } from "../../../math/utils/random/randint.js";
|
|
6
|
+
import { round } from "../../../math/utils/round.js";
|
|
7
|
+
import { frac } from "../../../tree/nodes/operators/fractionNode.js";
|
|
8
|
+
import { multiply } from "../../../tree/nodes/operators/multiplyNode.js";
|
|
9
|
+
import { handleVEAError } from "../../../utils/errors/handleVEAError.js";
|
|
10
|
+
const getPropositions = (n, { answer }) => {
|
|
11
|
+
const propositions = [];
|
|
12
|
+
addValidProp(propositions, answer);
|
|
13
|
+
while (propositions.length < n) {
|
|
14
|
+
tryToAddWrongProp(propositions, randfloat(1, 100, 4).frenchify());
|
|
15
|
+
}
|
|
16
|
+
return shuffleProps(propositions, n);
|
|
17
|
+
};
|
|
18
|
+
const getAnswer = (identifiers) => {
|
|
19
|
+
const { x, y, z } = identifiers;
|
|
20
|
+
return `${round((x / 100) * (y / 100) * z, 4).frenchify()}`;
|
|
21
|
+
};
|
|
22
|
+
const getInstruction = (identifiers) => {
|
|
23
|
+
const { x, y, z } = identifiers;
|
|
24
|
+
return `Calculer $${x}\\ \\%$ de $${y}\\ \\%$ de $${z}$.`;
|
|
25
|
+
};
|
|
26
|
+
const getHint = (identifiers) => {
|
|
27
|
+
return `Pour calculer $x\\%$ de $y\\%$ d'un nombre, tu peux multiplier ce nombre par les deux pourcentages.`;
|
|
28
|
+
};
|
|
29
|
+
const getCorrection = (identifiers) => {
|
|
30
|
+
const { x, y, z } = identifiers;
|
|
31
|
+
const inter = round((y / 100) * z, 4);
|
|
32
|
+
const answer = getAnswer(identifiers);
|
|
33
|
+
return `On calcule $${y}\\%$ de $${z}$ :
|
|
34
|
+
|
|
35
|
+
$$
|
|
36
|
+
${multiply(frac(y, 100), z).toTex()} = ${inter.frenchify()}
|
|
37
|
+
$$
|
|
38
|
+
|
|
39
|
+
Puis, on calcule $${x}\\%$ de ce résultat :
|
|
40
|
+
|
|
41
|
+
$$
|
|
42
|
+
${multiply(frac(x, 100), inter).toTex()} = ${answer}
|
|
43
|
+
$$
|
|
44
|
+
|
|
45
|
+
Ainsi, $${x}\\%$ de $${y}\\%$ de $${z}$ vaut :
|
|
46
|
+
|
|
47
|
+
$$
|
|
48
|
+
${answer}
|
|
49
|
+
$$
|
|
50
|
+
`;
|
|
51
|
+
};
|
|
52
|
+
const getKeys = (identifiers) => {
|
|
53
|
+
return [];
|
|
54
|
+
};
|
|
55
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
56
|
+
try {
|
|
57
|
+
return numberVEA(ans, answer, 4);
|
|
58
|
+
}
|
|
59
|
+
catch (err) {
|
|
60
|
+
return handleVEAError(err);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
const getPercentOfPercentQuestion = (ops) => {
|
|
64
|
+
const x = randint(1, 100);
|
|
65
|
+
const y = randint(1, 100);
|
|
66
|
+
const z = randint(1, 100);
|
|
67
|
+
const identifiers = { x, y, z };
|
|
68
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
69
|
+
};
|
|
70
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
71
|
+
return {
|
|
72
|
+
answer: getAnswer(identifiers),
|
|
73
|
+
instruction: getInstruction(identifiers),
|
|
74
|
+
keys: getKeys(identifiers),
|
|
75
|
+
answerFormat: "tex",
|
|
76
|
+
identifiers,
|
|
77
|
+
hint: getHint(identifiers),
|
|
78
|
+
correction: getCorrection(identifiers),
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
export const percentOfPercentOfNumber = {
|
|
82
|
+
id: "percentOfPercentOfNumber",
|
|
83
|
+
connector: "=",
|
|
84
|
+
label: "Calculer un pourcentage de pourcentage d'un nombre",
|
|
85
|
+
isSingleStep: true,
|
|
86
|
+
generator: (nb, opts) => getDistinctQuestions(() => getPercentOfPercentQuestion(opts), nb),
|
|
87
|
+
qcmTimer: 60,
|
|
88
|
+
freeTimer: 60,
|
|
89
|
+
getPropositions,
|
|
90
|
+
isAnswerValid,
|
|
91
|
+
subject: "Mathématiques",
|
|
92
|
+
getInstruction,
|
|
93
|
+
getHint,
|
|
94
|
+
getCorrection,
|
|
95
|
+
getAnswer,
|
|
96
|
+
getQuestionFromIdentifiers,
|
|
97
|
+
hasHintAndCorrection: true,
|
|
98
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nameOfNumberSets.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sets/nameOfNumberSets.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,uBAAuB,EAAE,OAAO,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAgJF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"nameOfNumberSets.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sets/nameOfNumberSets.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,uBAAuB,EAAE,OAAO,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAgJF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAiBlD,CAAC"}
|
|
@@ -112,8 +112,9 @@ export const nameOfNumberSets = {
|
|
|
112
112
|
label: "Nommer les ensembles des nombres",
|
|
113
113
|
answerType: "QCU",
|
|
114
114
|
isSingleStep: true,
|
|
115
|
-
generator: (nb, opts) => getDistinctQuestions(() => getNameOfNumberSetsQuestion(opts), 5),
|
|
115
|
+
generator: (nb, opts) => getDistinctQuestions(() => getNameOfNumberSetsQuestion(opts), nb, 5),
|
|
116
116
|
qcmTimer: 60,
|
|
117
|
+
maxAllowedQuestions: 5,
|
|
117
118
|
freeTimer: 60,
|
|
118
119
|
getPropositions,
|
|
119
120
|
isAnswerValid,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subsetsOfKnownSets.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sets/subsetsOfKnownSets.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAIrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAiGF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"subsetsOfKnownSets.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sets/subsetsOfKnownSets.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAIrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAiGF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAkBpD,CAAC"}
|
|
@@ -64,8 +64,8 @@ $$`
|
|
|
64
64
|
: `On a donc $${caseToTex(set)} \\subset ${caseToTex(subset)}$, mais $${caseToTex(subset)} \\not\\subset ${caseToTex(set)}$. `}`;
|
|
65
65
|
};
|
|
66
66
|
const getSubsetsOfKnownSetsQuestion = (ops) => {
|
|
67
|
-
const subset = randint(0,
|
|
68
|
-
const set = randint(0,
|
|
67
|
+
const subset = randint(0, 5);
|
|
68
|
+
const set = randint(0, 5, [subset]);
|
|
69
69
|
const identifiers = { subset, set };
|
|
70
70
|
return getQuestionFromIdentifiers(identifiers);
|
|
71
71
|
};
|
|
@@ -85,7 +85,7 @@ export const subsetsOfKnownSets = {
|
|
|
85
85
|
label: "Inclusions des ensembles de nombres",
|
|
86
86
|
answerType: "QCU",
|
|
87
87
|
isSingleStep: true,
|
|
88
|
-
generator: (nb, opts) => getDistinctQuestions(() => getSubsetsOfKnownSetsQuestion(opts), nb),
|
|
88
|
+
generator: (nb, opts) => getDistinctQuestions(() => getSubsetsOfKnownSetsQuestion(opts), nb, 15),
|
|
89
89
|
qcmTimer: 60,
|
|
90
90
|
freeTimer: 60,
|
|
91
91
|
getPropositions,
|
|
@@ -94,6 +94,7 @@ export const subsetsOfKnownSets = {
|
|
|
94
94
|
getHint,
|
|
95
95
|
getCorrection,
|
|
96
96
|
getAnswer,
|
|
97
|
+
maxAllowedQuestions: 15,
|
|
97
98
|
getQuestionFromIdentifiers,
|
|
98
99
|
hasHintAndCorrection: true,
|
|
99
100
|
};
|
package/lib/index.d.ts
CHANGED
|
@@ -119,7 +119,9 @@ declare const mathExercises: (Exercise<{
|
|
|
119
119
|
}, {}> | Exercise<{
|
|
120
120
|
num: number;
|
|
121
121
|
denum: number;
|
|
122
|
-
}, {
|
|
122
|
+
}, {
|
|
123
|
+
withoutGivenPrimeFactors?: boolean;
|
|
124
|
+
}> | Exercise<{
|
|
123
125
|
num: number;
|
|
124
126
|
denum: number;
|
|
125
127
|
leadingPart: number;
|
|
@@ -165,6 +167,13 @@ declare const mathExercises: (Exercise<{
|
|
|
165
167
|
}, {}> | Exercise<{
|
|
166
168
|
expr: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
167
169
|
x: number;
|
|
170
|
+
}, {}> | Exercise<{
|
|
171
|
+
type: number;
|
|
172
|
+
a: number;
|
|
173
|
+
b: number;
|
|
174
|
+
c: number;
|
|
175
|
+
d: number;
|
|
176
|
+
e: number;
|
|
168
177
|
}, {}> | Exercise<{
|
|
169
178
|
numbers: number[];
|
|
170
179
|
}, {}> | Exercise<{
|
|
@@ -491,6 +500,7 @@ declare const mathExercises: (Exercise<{
|
|
|
491
500
|
a: number;
|
|
492
501
|
lt: boolean;
|
|
493
502
|
b: number;
|
|
503
|
+
isStrict: boolean;
|
|
494
504
|
}, {}> | Exercise<{
|
|
495
505
|
aLimit: number;
|
|
496
506
|
bLimit: number;
|
|
@@ -507,6 +517,7 @@ declare const mathExercises: (Exercise<{
|
|
|
507
517
|
left: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
508
518
|
right: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
509
519
|
inequalitySign: boolean;
|
|
520
|
+
isStrict: boolean;
|
|
510
521
|
}, {}> | Exercise<{
|
|
511
522
|
rand: boolean;
|
|
512
523
|
poly1: number[];
|
|
@@ -735,6 +746,11 @@ declare const mathExercises: (Exercise<{
|
|
|
735
746
|
coin: number;
|
|
736
747
|
racine1: number;
|
|
737
748
|
racine2: number;
|
|
749
|
+
}, {}> | Exercise<{
|
|
750
|
+
a: number;
|
|
751
|
+
b: number;
|
|
752
|
+
c: number;
|
|
753
|
+
d: number;
|
|
738
754
|
}, {}> | Exercise<{
|
|
739
755
|
coeffs: number[];
|
|
740
756
|
}, {}> | Exercise<{
|
|
@@ -1153,6 +1169,18 @@ declare const mathExercises: (Exercise<{
|
|
|
1153
1169
|
x1: number;
|
|
1154
1170
|
x2: number;
|
|
1155
1171
|
x3: number;
|
|
1172
|
+
}, {}> | Exercise<{
|
|
1173
|
+
signs: string[];
|
|
1174
|
+
xs: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers[];
|
|
1175
|
+
type: number;
|
|
1176
|
+
ineqSymbol?: string;
|
|
1177
|
+
}, {}> | Exercise<{
|
|
1178
|
+
initTable: string[][];
|
|
1179
|
+
a: number;
|
|
1180
|
+
x1: number;
|
|
1181
|
+
x2: number;
|
|
1182
|
+
x3: number;
|
|
1183
|
+
lineAsked: number;
|
|
1156
1184
|
}, {}> | Exercise<{
|
|
1157
1185
|
xValues: number[];
|
|
1158
1186
|
yValues: number[];
|
|
@@ -1753,6 +1781,10 @@ declare const mathExercises: (Exercise<{
|
|
|
1753
1781
|
}> | Exercise<{
|
|
1754
1782
|
x: number;
|
|
1755
1783
|
y: number;
|
|
1784
|
+
}, {}> | Exercise<{
|
|
1785
|
+
x: number;
|
|
1786
|
+
y: number;
|
|
1787
|
+
z: number;
|
|
1756
1788
|
}, {}> | Exercise<{
|
|
1757
1789
|
int: number;
|
|
1758
1790
|
power: number;
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAE3D,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,QAAA,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAE3D,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAA+B,CAAC;AACnD,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -12,5 +12,6 @@ export declare class InequationSymbol {
|
|
|
12
12
|
toReversed: () => InequationSymbol;
|
|
13
13
|
toStrictnessToggled: () => InequationSymbol;
|
|
14
14
|
strictnessToggled: () => InegalitySymbols;
|
|
15
|
+
toWord: (isPlural?: boolean, isFeminine?: boolean) => string;
|
|
15
16
|
}
|
|
16
17
|
//# sourceMappingURL=inequation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inequation.d.ts","sourceRoot":"","sources":["../../../src/math/inequations/inequation.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,gBAAgB,GAAG,GAAG,GAAG,GAAG,GAAG,MAAM,GAAG,MAAM,CAAC;AAE3D,8BAAsB,2BAA2B;IAC/C,MAAM,CAAC,MAAM;IAGb,MAAM,CAAC,YAAY;CAGpB;AACD,qBAAa,gBAAgB;IAC3B,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,gBAAgB,CAAC;gBACb,MAAM,EAAE,gBAAgB;IAKpC,QAAQ,QAAO,gBAAgB,CAW7B;IACF,UAAU,yBAER;IACF,mBAAmB,yBAEjB;IACF,iBAAiB,QAAO,gBAAgB,CAWtC;CACH"}
|
|
1
|
+
{"version":3,"file":"inequation.d.ts","sourceRoot":"","sources":["../../../src/math/inequations/inequation.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,gBAAgB,GAAG,GAAG,GAAG,GAAG,GAAG,MAAM,GAAG,MAAM,CAAC;AAE3D,8BAAsB,2BAA2B;IAC/C,MAAM,CAAC,MAAM;IAGb,MAAM,CAAC,YAAY;CAGpB;AACD,qBAAa,gBAAgB;IAC3B,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,gBAAgB,CAAC;gBACb,MAAM,EAAE,gBAAgB;IAKpC,QAAQ,QAAO,gBAAgB,CAW7B;IACF,UAAU,yBAER;IACF,mBAAmB,yBAEjB;IACF,iBAAiB,QAAO,gBAAgB,CAWtC;IACF,MAAM,uDAoBJ;CACH"}
|
|
@@ -46,4 +46,25 @@ export class InequationSymbol {
|
|
|
46
46
|
return "<";
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
|
+
toWord = (isPlural = false, isFeminine = false) => {
|
|
50
|
+
const s = isPlural ? "s" : "";
|
|
51
|
+
const e = isFeminine ? "e" : "";
|
|
52
|
+
const egalWord = isPlural
|
|
53
|
+
? isFeminine
|
|
54
|
+
? "égales"
|
|
55
|
+
: "égaux"
|
|
56
|
+
: isFeminine
|
|
57
|
+
? "égale"
|
|
58
|
+
: "égal";
|
|
59
|
+
switch (this.symbol) {
|
|
60
|
+
case "<":
|
|
61
|
+
return `strictement inférieur${e}${s}`;
|
|
62
|
+
case ">":
|
|
63
|
+
return `strictement supérieur${e}${s}`;
|
|
64
|
+
case "\\ge":
|
|
65
|
+
return `supérieur${e}${s} ou ${egalWord}`;
|
|
66
|
+
case "\\le":
|
|
67
|
+
return `inférieur${e}${s} ou ${egalWord}`;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
49
70
|
}
|
|
@@ -25,7 +25,6 @@ export declare class Rational implements Nombre {
|
|
|
25
25
|
constructor(numerator: number, denumerator: number);
|
|
26
26
|
toArray(): number[];
|
|
27
27
|
equals(n: Nombre): boolean;
|
|
28
|
-
toTex(): string;
|
|
29
28
|
add(nb: Nombre): Nombre;
|
|
30
29
|
multiply(nb: Nombre): Rational | Integer;
|
|
31
30
|
reverse(shouldSimplify: boolean): Nombre;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rational.d.ts","sourceRoot":"","sources":["../../../../src/math/numbers/rationals/rational.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAQvD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAElD,8BAAsB,mBAAmB;IACvC;;OAEG;IACH,MAAM,CAAC,kBAAkB,CAAC,MAAM,GAAE,MAAW;IAW7C,MAAM,CAAC,kBAAkB,CACvB,GAAG,GAAE,MAAW,EAChB,EAAE,UAAkB,EAAE,GAAE;QAAE,UAAU,CAAC,EAAE,OAAO,CAAA;KAAO;IASvD,MAAM,CAAC,uBAAuB,CAAC,QAAQ,GAAE,MAAW;IAKpD,MAAM,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AM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,OAAO,CAAC;IACtB,IAAI,EAAE,UAAU,CAAC;gBAEL,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;IAYlD,OAAO;IAGP,MAAM,CAAC,CAAC,EAAE,MAAM;IAIhB,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAkBvB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO;IAgBxC,OAAO,CAAC,cAAc,EAAE,OAAO,GAAG,MAAM;IAIxC,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAgB1B,QAAQ,IAAI,QAAQ;IAIpB,MAAM,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,aAAa;IAgBzC,cAAc;IAId,QAAQ,IAAI,OAAO,GAAG,QAAQ;CAqB/B"}
|
|
@@ -84,9 +84,6 @@ export class Rational {
|
|
|
84
84
|
equals(n) {
|
|
85
85
|
return this.value === n.value;
|
|
86
86
|
}
|
|
87
|
-
toTex() {
|
|
88
|
-
return `${this.num < 0 ? "-" : ""}\\frac{${this.num < 0 ? -this.num : this.num}}{${this.denum}}`;
|
|
89
|
-
}
|
|
90
87
|
add(nb) {
|
|
91
88
|
switch (nb.type) {
|
|
92
89
|
case NumberType.Integer: {
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import { DiscreteSetNode } from "../nodes/sets/discreteSetNode.js";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param str réponse de l'élève
|
|
5
|
+
* @returns un DiscretSetNode composé des éléments de la rpéonse
|
|
6
|
+
* false si la réponse n'est pas parsable en ensemble
|
|
7
|
+
* accepte les valeurs isolées
|
|
8
|
+
*/
|
|
2
9
|
export declare const discreteSetParser: (str: string) => false | DiscreteSetNode;
|
|
3
10
|
//# sourceMappingURL=discreteSetParser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discreteSetParser.d.ts","sourceRoot":"","sources":["../../../src/tree/parsers/discreteSetParser.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAY,MAAM,kCAAkC,CAAC;AAI7E,eAAO,MAAM,iBAAiB,QAAS,MAAM,4BAkB5C,CAAC"}
|
|
1
|
+
{"version":3,"file":"discreteSetParser.d.ts","sourceRoot":"","sources":["../../../src/tree/parsers/discreteSetParser.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAY,MAAM,kCAAkC,CAAC;AAI7E;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,QAAS,MAAM,4BAkB5C,CAAC"}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { handleVEAError } from "../../utils/errors/handleVEAError.js";
|
|
2
2
|
import { DiscreteSetNode, EmptySet } from "../nodes/sets/discreteSetNode.js";
|
|
3
3
|
import { parseAlgebraic } from "./latexParser.js";
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @param str réponse de l'élève
|
|
7
|
+
* @returns un DiscretSetNode composé des éléments de la rpéonse
|
|
8
|
+
* false si la réponse n'est pas parsable en ensemble
|
|
9
|
+
* accepte les valeurs isolées
|
|
10
|
+
*/
|
|
4
11
|
export const discreteSetParser = (str) => {
|
|
5
12
|
try {
|
|
6
13
|
const formated = str
|