math-exercises 2.2.48 → 2.2.50
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 +11 -2
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/exercise.js +1 -0
- package/lib/exercises/math/calcul/fractions/fractionsSum.d.ts +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSum.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSum.js +12 -4
- package/lib/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.js +33 -5
- package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.js +39 -5
- package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.js +33 -8
- package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSubNoRelative.d.ts.map +1 -1
- package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSubNoRelative.js +2 -1
- package/lib/exercises/math/calcul/mentalCaluls/mentalPercentage.d.ts.map +1 -1
- package/lib/exercises/math/calcul/mentalCaluls/mentalPercentage.js +2 -4
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.js +8 -0
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.js +8 -0
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq3.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq3.js +10 -0
- package/lib/exercises/math/conversion/lengthConversion.d.ts +4 -1
- package/lib/exercises/math/conversion/lengthConversion.d.ts.map +1 -1
- package/lib/exercises/math/conversion/lengthConversion.js +60 -19
- package/lib/exercises/math/conversion/massConversion.d.ts.map +1 -1
- package/lib/exercises/math/conversion/massConversion.js +5 -1
- package/lib/exercises/math/functions/trinoms/index.d.ts +1 -0
- package/lib/exercises/math/functions/trinoms/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/index.js +1 -0
- package/lib/exercises/math/functions/trinoms/trinomSignFromRoots.d.ts +8 -0
- package/lib/exercises/math/functions/trinoms/trinomSignFromRoots.d.ts.map +1 -0
- package/lib/exercises/math/functions/trinoms/trinomSignFromRoots.js +114 -0
- package/lib/exercises/math/geometry/cartesian/readAbscissOnLine.js +1 -1
- package/lib/exercises/math/geometry/index.d.ts +1 -0
- package/lib/exercises/math/geometry/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/index.js +1 -0
- package/lib/exercises/math/geometry/parametric/extractPointFromParametricLine.d.ts +8 -0
- package/lib/exercises/math/geometry/parametric/extractPointFromParametricLine.d.ts.map +1 -0
- package/lib/exercises/math/geometry/parametric/extractPointFromParametricLine.js +110 -0
- package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.d.ts +8 -0
- package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.d.ts.map +1 -0
- package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.js +108 -0
- package/lib/exercises/math/geometry/parametric/index.d.ts +4 -0
- package/lib/exercises/math/geometry/parametric/index.d.ts.map +1 -0
- package/lib/exercises/math/geometry/parametric/index.js +19 -0
- package/lib/exercises/math/geometry/parametric/pointFromParametricLine.d.ts +12 -0
- package/lib/exercises/math/geometry/parametric/pointFromParametricLine.d.ts.map +1 -0
- package/lib/exercises/math/geometry/parametric/pointFromParametricLine.js +95 -0
- package/lib/exercises/math/geometry/volumes/coneVolume.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/coneVolume.js +5 -3
- package/lib/exercises/math/probaStat/probaFromTableWithContext.js +2 -2
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormula.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormula.js +66 -24
- package/lib/exercises/math/squareRoots/squareRootIdentities.js +3 -3
- package/lib/exercises/vea/numberVEA.d.ts +2 -0
- package/lib/exercises/vea/numberVEA.d.ts.map +1 -0
- package/lib/exercises/vea/numberVEA.js +11 -0
- package/lib/index.d.ts +20 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/parametricLine.d.ts +15 -0
- package/lib/math/geometry/parametricLine.d.ts.map +1 -0
- package/lib/math/geometry/parametricLine.js +46 -0
- package/lib/math/geometry/spacePoint.d.ts +3 -0
- package/lib/math/geometry/spacePoint.d.ts.map +1 -1
- package/lib/math/geometry/spacePoint.js +12 -0
- package/lib/math/geometry/spaceVector.d.ts +5 -0
- package/lib/math/geometry/spaceVector.d.ts.map +1 -1
- package/lib/math/geometry/spaceVector.js +20 -0
- package/lib/math/polynomials/affine.d.ts.map +1 -1
- package/lib/math/polynomials/affine.js +3 -1
- package/lib/math/polynomials/generalTrinom.d.ts +52 -0
- package/lib/math/polynomials/generalTrinom.d.ts.map +1 -0
- package/lib/math/polynomials/generalTrinom.js +102 -0
- package/lib/math/polynomials/trinom.d.ts +5 -1
- package/lib/math/polynomials/trinom.d.ts.map +1 -1
- package/lib/math/polynomials/trinom.js +9 -4
- package/lib/playground.js +5 -4
- package/lib/server.js +7 -3
- package/lib/tree/nodes/algebraicNode.d.ts +1 -1
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/absNode.d.ts +1 -1
- package/lib/tree/nodes/functions/absNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/arcSinNode.d.ts +1 -1
- package/lib/tree/nodes/functions/arcSinNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/arccosNode.d.ts +1 -1
- package/lib/tree/nodes/functions/arccosNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/arctanNode.d.ts +1 -1
- package/lib/tree/nodes/functions/arctanNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/cosNode.d.ts +1 -1
- package/lib/tree/nodes/functions/cosNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/expNode.d.ts +1 -1
- package/lib/tree/nodes/functions/expNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/log10Node.d.ts +1 -1
- package/lib/tree/nodes/functions/log10Node.d.ts.map +1 -1
- package/lib/tree/nodes/functions/logNode.d.ts +1 -1
- package/lib/tree/nodes/functions/logNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/oppositeNode.d.ts +2 -1
- package/lib/tree/nodes/functions/oppositeNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/oppositeNode.js +6 -1
- package/lib/tree/nodes/functions/sinNode.d.ts +1 -1
- package/lib/tree/nodes/functions/sinNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sqrtNode.d.ts +2 -1
- package/lib/tree/nodes/functions/sqrtNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sqrtNode.js +6 -1
- package/lib/tree/nodes/functions/tanNode.d.ts +1 -1
- package/lib/tree/nodes/functions/tanNode.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/degree.d.ts +1 -1
- package/lib/tree/nodes/geometry/degree.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/lengthNode.d.ts +1 -1
- package/lib/tree/nodes/geometry/lengthNode.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/lengthNode.js +2 -2
- package/lib/tree/nodes/node.d.ts +2 -1
- package/lib/tree/nodes/node.d.ts.map +1 -1
- package/lib/tree/nodes/node.js +1 -0
- package/lib/tree/nodes/nodeSuperset.d.ts +1 -0
- package/lib/tree/nodes/nodeSuperset.d.ts.map +1 -0
- package/lib/tree/nodes/nodeSuperset.js +1 -0
- package/lib/tree/nodes/numbers/constantNode.d.ts +1 -1
- package/lib/tree/nodes/numbers/constantNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/numberNode.d.ts +1 -1
- package/lib/tree/nodes/numbers/numberNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.d.ts +2 -1
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +7 -1
- package/lib/tree/nodes/operators/divideNode.d.ts +1 -1
- package/lib/tree/nodes/operators/divideNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.d.ts +2 -1
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +14 -1
- package/lib/tree/nodes/operators/limitNode.d.ts +1 -1
- package/lib/tree/nodes/operators/limitNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.d.ts +2 -1
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +7 -1
- package/lib/tree/nodes/operators/powerNode.d.ts +2 -1
- package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/powerNode.js +6 -1
- package/lib/tree/nodes/operators/substractNode.d.ts +2 -1
- package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/substractNode.js +7 -1
- package/lib/tree/nodes/variables/variableNode.d.ts +1 -1
- package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
- package/lib/tree/nodes/variables/variableNode.js +1 -1
- package/lib/tree/parsers/rationalParser.d.ts +2 -0
- package/lib/tree/parsers/rationalParser.d.ts.map +1 -1
- package/lib/tree/parsers/rationalParser.js +33 -8
- package/lib/tree/parsers/spacePointParser.d.ts +3 -0
- package/lib/tree/parsers/spacePointParser.d.ts.map +1 -0
- package/lib/tree/parsers/spacePointParser.js +18 -0
- package/lib/tree/parsers/spaceVectorParser.d.ts +3 -0
- package/lib/tree/parsers/spaceVectorParser.d.ts.map +1 -0
- package/lib/tree/parsers/spaceVectorParser.js +18 -0
- package/lib/tree/parsers/valueParser.d.ts +2 -0
- package/lib/tree/parsers/valueParser.d.ts.map +1 -0
- package/lib/tree/parsers/valueParser.js +10 -0
- package/lib/utils/alea/random.d.ts +1 -1
- package/lib/utils/alea/random.d.ts.map +1 -1
- package/lib/utils/alea/random.js +5 -1
- package/package.json +1 -1
|
@@ -17,13 +17,17 @@ export declare enum GeneratorOptionTarget {
|
|
|
17
17
|
}
|
|
18
18
|
export declare enum GeneratorOptionType {
|
|
19
19
|
checkbox = "checkbox",
|
|
20
|
-
select = "select"
|
|
20
|
+
select = "select",
|
|
21
|
+
multiSelect = "multiSelect"
|
|
21
22
|
}
|
|
22
|
-
export type GeneratorOption = {
|
|
23
|
+
export type GeneratorOption<TValue = any> = {
|
|
23
24
|
id: string;
|
|
24
25
|
label: string;
|
|
25
26
|
type: GeneratorOptionType;
|
|
26
27
|
target: GeneratorOptionTarget;
|
|
28
|
+
tooltipText?: string;
|
|
29
|
+
defaultValue?: TValue;
|
|
30
|
+
values?: TValue[];
|
|
27
31
|
};
|
|
28
32
|
export type Proposition = {
|
|
29
33
|
id: string;
|
|
@@ -63,6 +67,7 @@ export interface Question<TIdentifiers = {}, TOptions = {}> {
|
|
|
63
67
|
correction?: string;
|
|
64
68
|
startStatement?: string;
|
|
65
69
|
answer?: string;
|
|
70
|
+
answers?: string[];
|
|
66
71
|
answerFormat?: "tex" | "raw";
|
|
67
72
|
ggbAnswer?: string[];
|
|
68
73
|
keyboardOptions?: KeyboardOptions;
|
|
@@ -135,6 +140,10 @@ export interface Exercise<TIdentifiers = {}, TOptions = {}> {
|
|
|
135
140
|
rebuildIdentifiers?: RebuildIdentifiers<TIdentifiers, TOptions>;
|
|
136
141
|
getQuestionFromIdentifiers?: GetQuestionFromIdentifiers<TIdentifiers, TOptions>;
|
|
137
142
|
hotFix?: QuestionHotFix<TIdentifiers, TOptions>;
|
|
143
|
+
validateOptions?: (opts: TOptions) => {
|
|
144
|
+
message: string;
|
|
145
|
+
valid: boolean;
|
|
146
|
+
};
|
|
138
147
|
}
|
|
139
148
|
export type MathLevel = "6ème" | "5ème" | "4ème" | "3ème" | "2nde" | "1reTech" | "1reESM" | "1reSpé" | "TermSpé" | "TermTech" | "MathExp" | "MathComp" | "CAP" | "2ndPro" | "1rePro" | "TermPro";
|
|
140
149
|
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,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AM,SAAS,GACjB,mBAAmB,GACnB,sBAAsB,GACtB,QAAQ,GACR,kBAAkB,GAClB,WAAW,GACX,SAAS,GACT,cAAc,GACd,+CAA+C,GAC/C,OAAO,GACP,KAAK,GACL,wBAAwB,GACxB,SAAS,GACT,KAAK,GACL,aAAa,GACb,4BAA4B,GAC5B,oBAAoB,GACpB,WAAW,GACX,iBAAiB,GACjB,SAAS,CAAC"}
|
|
@@ -52,4 +52,5 @@ var GeneratorOptionType;
|
|
|
52
52
|
(function (GeneratorOptionType) {
|
|
53
53
|
GeneratorOptionType["checkbox"] = "checkbox";
|
|
54
54
|
GeneratorOptionType["select"] = "select";
|
|
55
|
+
GeneratorOptionType["multiSelect"] = "multiSelect";
|
|
55
56
|
})(GeneratorOptionType || (exports.GeneratorOptionType = GeneratorOptionType = {}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fractionsSum.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsSum.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"fractionsSum.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsSum.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,0BAA0B,CAAC;AAWlC,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,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAyFF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAevD,CAAC"}
|
|
@@ -5,7 +5,7 @@ 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
|
|
8
|
+
const rationalParser_1 = require("../../../../tree/parsers/rationalParser");
|
|
9
9
|
const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
10
10
|
const getFractionsSum = (opts) => {
|
|
11
11
|
const rational = rational_1.RationalConstructor.randomIrreductible();
|
|
@@ -14,7 +14,13 @@ const getFractionsSum = (opts) => {
|
|
|
14
14
|
const answerTree = rational.add(rational2).toTree();
|
|
15
15
|
const answer = answerTree.toTex();
|
|
16
16
|
const question = {
|
|
17
|
-
instruction: `Calculer
|
|
17
|
+
instruction: `Calculer ${opts?.allowNonIrreductible
|
|
18
|
+
? ""
|
|
19
|
+
: "et donner le résultat sous la forme d'une fraction irréductible"} :
|
|
20
|
+
|
|
21
|
+
$$
|
|
22
|
+
${statementTree.toTex()}
|
|
23
|
+
$$`,
|
|
18
24
|
startStatement: statementTree.toTex(),
|
|
19
25
|
answer,
|
|
20
26
|
keys: [],
|
|
@@ -47,8 +53,10 @@ const isAnswerValid = (ans, { rational, rational2 }, opts) => {
|
|
|
47
53
|
const texs = answerTree.toAllValidTexs();
|
|
48
54
|
if (allow)
|
|
49
55
|
try {
|
|
50
|
-
const parsed = (0,
|
|
51
|
-
|
|
56
|
+
const parsed = (0, rationalParser_1.rationalParser)(ans);
|
|
57
|
+
if (!parsed)
|
|
58
|
+
return false;
|
|
59
|
+
return texs.includes(parsed.simplify().toTex());
|
|
52
60
|
}
|
|
53
61
|
catch (err) {
|
|
54
62
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fractionsSumsMultiplesDenominators.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"fractionsSumsMultiplesDenominators.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA2FF,eAAO,MAAM,kCAAkC,EAAE,QAAQ,CAAC,WAAW,CAkBpE,CAAC"}
|
|
@@ -6,8 +6,9 @@ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQ
|
|
|
6
6
|
const rational_1 = require("../../../../math/numbers/rationals/rational");
|
|
7
7
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
8
8
|
const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
9
|
+
const rationalParser_1 = require("../../../../tree/parsers/rationalParser");
|
|
9
10
|
const coinFlip_1 = require("../../../../utils/alea/coinFlip");
|
|
10
|
-
const getFractionsSumsMultiplesDenominatorsQuestion = () => {
|
|
11
|
+
const getFractionsSumsMultiplesDenominatorsQuestion = (opts) => {
|
|
11
12
|
let denom1 = (0, randint_1.randint)(2, 10);
|
|
12
13
|
let denom2 = denom1 * (0, randint_1.randint)(2, 10);
|
|
13
14
|
if ((0, coinFlip_1.coinFlip)())
|
|
@@ -20,7 +21,13 @@ const getFractionsSumsMultiplesDenominatorsQuestion = () => {
|
|
|
20
21
|
const answer = ratio1.add(ratio2).toTree().toTex();
|
|
21
22
|
const question = {
|
|
22
23
|
answer,
|
|
23
|
-
instruction: `Calculer
|
|
24
|
+
instruction: `Calculer ${opts?.allowNonIrreductible
|
|
25
|
+
? ""
|
|
26
|
+
: "et donner le résultat sous la forme d'une fraction irréductible"} :
|
|
27
|
+
|
|
28
|
+
$$
|
|
29
|
+
${statement}
|
|
30
|
+
$$`,
|
|
24
31
|
keys: [],
|
|
25
32
|
answerFormat: "tex",
|
|
26
33
|
identifiers: { num1, num2, denom1, denom2 },
|
|
@@ -36,15 +43,35 @@ const getPropositions = (n, { answer, num1, num2, denom1, denom2 }) => {
|
|
|
36
43
|
}
|
|
37
44
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
38
45
|
};
|
|
39
|
-
const isAnswerValid = (ans, { answer, denom1, denom2, num1, num2 }) => {
|
|
46
|
+
const isAnswerValid = (ans, { answer, denom1, denom2, num1, num2 }, opts) => {
|
|
40
47
|
const rationalA = new rational_1.Rational(num1, denom1);
|
|
41
48
|
const rationalB = new rational_1.Rational(num2, denom2);
|
|
42
49
|
const answerTree = rationalA
|
|
43
50
|
.add(rationalB)
|
|
44
51
|
.toTree({ allowFractionToDecimal: true });
|
|
45
52
|
const texs = answerTree.toAllValidTexs();
|
|
46
|
-
|
|
53
|
+
if (opts?.allowNonIrreductible) {
|
|
54
|
+
try {
|
|
55
|
+
const parsed = (0, rationalParser_1.rationalParser)(ans);
|
|
56
|
+
if (!parsed)
|
|
57
|
+
return false;
|
|
58
|
+
return texs.includes(parsed.simplify().toTex());
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
else
|
|
65
|
+
return texs.includes(ans);
|
|
47
66
|
};
|
|
67
|
+
const options = [
|
|
68
|
+
{
|
|
69
|
+
id: "allowNonIrreductible",
|
|
70
|
+
label: "Autoriser les fractions non réduites",
|
|
71
|
+
target: exercise_1.GeneratorOptionTarget.vea,
|
|
72
|
+
type: exercise_1.GeneratorOptionType.checkbox,
|
|
73
|
+
},
|
|
74
|
+
];
|
|
48
75
|
exports.fractionsSumsMultiplesDenominators = {
|
|
49
76
|
id: "fractionsSumsMultiplesDenominators",
|
|
50
77
|
connector: "=",
|
|
@@ -52,10 +79,11 @@ exports.fractionsSumsMultiplesDenominators = {
|
|
|
52
79
|
levels: [],
|
|
53
80
|
isSingleStep: true,
|
|
54
81
|
sections: [],
|
|
55
|
-
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getFractionsSumsMultiplesDenominatorsQuestion, nb),
|
|
82
|
+
generator: (nb, opts) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getFractionsSumsMultiplesDenominatorsQuestion(opts), nb),
|
|
56
83
|
qcmTimer: 60,
|
|
57
84
|
freeTimer: 60,
|
|
58
85
|
getPropositions,
|
|
59
86
|
isAnswerValid,
|
|
60
87
|
subject: "Mathématiques",
|
|
88
|
+
options,
|
|
61
89
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fractionsSumsPrimeDenominators.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"fractionsSumsPrimeDenominators.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA6FF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,CAkBhE,CAAC"}
|
|
@@ -7,7 +7,8 @@ const rational_1 = require("../../../../math/numbers/rationals/rational");
|
|
|
7
7
|
const gcd_1 = require("../../../../math/utils/arithmetic/gcd");
|
|
8
8
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
9
9
|
const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
10
|
-
const
|
|
10
|
+
const rationalParser_1 = require("../../../../tree/parsers/rationalParser");
|
|
11
|
+
const getFractionsSumsPrimeDenominatorsQuestion = (opts) => {
|
|
11
12
|
const denom1 = (0, randint_1.randint)(2, 13);
|
|
12
13
|
let denom2 = 0;
|
|
13
14
|
do {
|
|
@@ -21,7 +22,13 @@ const getFractionsSumsPrimeDenominatorsQuestion = () => {
|
|
|
21
22
|
const answer = ratio1.add(ratio2).toTree().toTex();
|
|
22
23
|
const question = {
|
|
23
24
|
answer,
|
|
24
|
-
instruction: `Calculer
|
|
25
|
+
instruction: `Calculer ${opts?.allowNonIrreductible
|
|
26
|
+
? ""
|
|
27
|
+
: "et donner le résultat sous la forme d'une fraction irréductible"} :
|
|
28
|
+
|
|
29
|
+
$$
|
|
30
|
+
${statement}
|
|
31
|
+
$$`,
|
|
25
32
|
keys: [],
|
|
26
33
|
answerFormat: "tex",
|
|
27
34
|
identifiers: { num1, num2, denom1, denom2 },
|
|
@@ -37,9 +44,35 @@ const getPropositions = (n, { answer, num1, denom1, denom2, num2 }) => {
|
|
|
37
44
|
}
|
|
38
45
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
39
46
|
};
|
|
40
|
-
const isAnswerValid = (ans, { answer }) => {
|
|
41
|
-
|
|
47
|
+
const isAnswerValid = (ans, { answer, denom1, denom2, num1, num2 }, opts) => {
|
|
48
|
+
const rationalA = new rational_1.Rational(num1, denom1);
|
|
49
|
+
const rationalB = new rational_1.Rational(num2, denom2);
|
|
50
|
+
const answerTree = rationalA
|
|
51
|
+
.add(rationalB)
|
|
52
|
+
.toTree({ allowFractionToDecimal: true });
|
|
53
|
+
const texs = answerTree.toAllValidTexs();
|
|
54
|
+
if (opts?.allowNonIrreductible) {
|
|
55
|
+
try {
|
|
56
|
+
const parsed = (0, rationalParser_1.rationalParser)(ans);
|
|
57
|
+
if (!parsed)
|
|
58
|
+
return false;
|
|
59
|
+
return texs.includes(parsed.simplify().toTex());
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
else
|
|
66
|
+
return texs.includes(ans);
|
|
42
67
|
};
|
|
68
|
+
const options = [
|
|
69
|
+
{
|
|
70
|
+
id: "allowNonIrreductible",
|
|
71
|
+
label: "Autoriser les fractions non réduites",
|
|
72
|
+
target: exercise_1.GeneratorOptionTarget.vea,
|
|
73
|
+
type: exercise_1.GeneratorOptionType.checkbox,
|
|
74
|
+
},
|
|
75
|
+
];
|
|
43
76
|
exports.fractionsSumsPrimeDenominators = {
|
|
44
77
|
id: "fractionsSumsPrimeDenominators",
|
|
45
78
|
connector: "=",
|
|
@@ -47,10 +80,11 @@ exports.fractionsSumsPrimeDenominators = {
|
|
|
47
80
|
levels: [],
|
|
48
81
|
isSingleStep: true,
|
|
49
82
|
sections: [],
|
|
50
|
-
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getFractionsSumsPrimeDenominatorsQuestion, nb),
|
|
83
|
+
generator: (nb, opts) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getFractionsSumsPrimeDenominatorsQuestion(opts), nb),
|
|
51
84
|
qcmTimer: 60,
|
|
52
85
|
freeTimer: 60,
|
|
53
86
|
getPropositions,
|
|
54
87
|
isAnswerValid,
|
|
55
88
|
subject: "Mathématiques",
|
|
89
|
+
options,
|
|
56
90
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fractionsSumsSameDenominators.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsSumsSameDenominators.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"fractionsSumsSameDenominators.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsSumsSameDenominators.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,0BAA0B,CAAC;AAiBlC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAgIF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAmB/D,CAAC"}
|
|
@@ -9,9 +9,10 @@ const randint_1 = require("../../../../math/utils/random/randint");
|
|
|
9
9
|
const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
10
10
|
const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
|
|
11
11
|
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
12
|
+
const rationalParser_1 = require("../../../../tree/parsers/rationalParser");
|
|
12
13
|
const operatorComposition_1 = require("../../../../tree/utilities/operatorComposition");
|
|
13
14
|
const alignTex_1 = require("../../../../utils/latex/alignTex");
|
|
14
|
-
const getFractionsSumsSameDenominatorsQuestion = () => {
|
|
15
|
+
const getFractionsSumsSameDenominatorsQuestion = (opts) => {
|
|
15
16
|
const denom = (0, randint_1.randint)(2, 15);
|
|
16
17
|
const num1 = (0, randint_1.randint)(1, denom + 10);
|
|
17
18
|
const num2 = (0, randint_1.randint)(1, denom + 10);
|
|
@@ -22,14 +23,16 @@ const getFractionsSumsSameDenominatorsQuestion = () => {
|
|
|
22
23
|
const answer = answerRatio.simplify().toTree().toTex();
|
|
23
24
|
const question = {
|
|
24
25
|
answer,
|
|
25
|
-
instruction: `Calculer
|
|
26
|
+
instruction: `Calculer ${opts?.allowNonIrreductible
|
|
27
|
+
? ""
|
|
28
|
+
: "et donner le résultat sous la forme d'une fraction irréductible"} :
|
|
26
29
|
|
|
27
30
|
$$
|
|
28
31
|
${statement}
|
|
29
32
|
$$`,
|
|
30
33
|
keys: [],
|
|
31
|
-
hint: `Pour additionner deux fractions qui ont le même dénominateur, on peut additionner leurs
|
|
32
|
-
correction: `Les deux fractions ont bien le même dénominateur donc on additionne leurs numérateurs :
|
|
34
|
+
hint: `Pour additionner deux fractions qui ont le même dénominateur, on peut additionner leurs numérateurs.`,
|
|
35
|
+
correction: `Les deux fractions ont bien le même dénominateur, donc on additionne leurs numérateurs :
|
|
33
36
|
|
|
34
37
|
${(0, alignTex_1.alignTex)([
|
|
35
38
|
[
|
|
@@ -42,7 +45,7 @@ ${(0, alignTex_1.alignTex)([
|
|
|
42
45
|
|
|
43
46
|
${answerRatio.isSimplified && answerRatio.denum !== 1
|
|
44
47
|
? "Cette fraction est bien irréductible."
|
|
45
|
-
: `Puis on simplifie la fraction :
|
|
48
|
+
: `Puis, on simplifie la fraction :
|
|
46
49
|
|
|
47
50
|
${(0, alignTex_1.alignTex)([
|
|
48
51
|
[
|
|
@@ -67,15 +70,36 @@ const getPropositions = (n, { answer, denom, num1, num2 }) => {
|
|
|
67
70
|
}
|
|
68
71
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
69
72
|
};
|
|
70
|
-
const isAnswerValid = (ans, { answer, denom, num1, num2 }) => {
|
|
73
|
+
const isAnswerValid = (ans, { answer, denom, num1, num2 }, opts) => {
|
|
71
74
|
const rationalA = new rational_1.Rational(num1, denom);
|
|
72
75
|
const rationalB = new rational_1.Rational(num2, denom);
|
|
73
76
|
const answerTree = rationalA
|
|
74
77
|
.add(rationalB)
|
|
75
78
|
.toTree({ allowFractionToDecimal: true });
|
|
76
79
|
const texs = answerTree.toAllValidTexs();
|
|
77
|
-
|
|
80
|
+
if (opts?.allowNonIrreductible) {
|
|
81
|
+
try {
|
|
82
|
+
const parsed = (0, rationalParser_1.rationalParser)(ans);
|
|
83
|
+
if (!parsed)
|
|
84
|
+
return false;
|
|
85
|
+
return texs.includes(parsed.simplify().toTex());
|
|
86
|
+
}
|
|
87
|
+
catch (err) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
return texs.includes(ans);
|
|
93
|
+
}
|
|
78
94
|
};
|
|
95
|
+
const options = [
|
|
96
|
+
{
|
|
97
|
+
id: "allowNonIrreductible",
|
|
98
|
+
label: "Autoriser les fractions non réduites",
|
|
99
|
+
target: exercise_1.GeneratorOptionTarget.vea,
|
|
100
|
+
type: exercise_1.GeneratorOptionType.checkbox,
|
|
101
|
+
},
|
|
102
|
+
];
|
|
79
103
|
exports.fractionsSumsSameDenominators = {
|
|
80
104
|
id: "fractionsSumsSameDenominators",
|
|
81
105
|
connector: "=",
|
|
@@ -83,11 +107,12 @@ exports.fractionsSumsSameDenominators = {
|
|
|
83
107
|
levels: [],
|
|
84
108
|
isSingleStep: true,
|
|
85
109
|
sections: [],
|
|
86
|
-
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getFractionsSumsSameDenominatorsQuestion, nb),
|
|
110
|
+
generator: (nb, opts) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getFractionsSumsSameDenominatorsQuestion(opts), nb),
|
|
87
111
|
qcmTimer: 60,
|
|
88
112
|
freeTimer: 60,
|
|
89
113
|
getPropositions,
|
|
90
114
|
isAnswerValid,
|
|
91
115
|
subject: "Mathématiques",
|
|
92
116
|
hasHintAndCorrection: true,
|
|
117
|
+
options,
|
|
93
118
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mentalAddAndSubNoRelative.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/mentalCaluls/mentalAddAndSubNoRelative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"mentalAddAndSubNoRelative.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/mentalCaluls/mentalAddAndSubNoRelative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAgEF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAc3D,CAAC"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.mentalAddAndSubNoRelative = void 0;
|
|
4
4
|
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const numberVEA_1 = require("../../../../exercises/vea/numberVEA");
|
|
6
7
|
const randfloat_1 = require("../../../../math/utils/random/randfloat");
|
|
7
8
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
8
9
|
const round_1 = require("../../../../math/utils/round");
|
|
@@ -53,7 +54,7 @@ const getPropositions = (n, { answer }) => {
|
|
|
53
54
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
54
55
|
};
|
|
55
56
|
const isAnswerValid = (ans, { answer }) => {
|
|
56
|
-
return ans
|
|
57
|
+
return (0, numberVEA_1.numberVEA)(ans, answer);
|
|
57
58
|
};
|
|
58
59
|
exports.mentalAddAndSubNoRelative = {
|
|
59
60
|
id: "mentalAddAndSubNoRelative",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mentalPercentage.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/mentalCaluls/mentalPercentage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"mentalPercentage.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/mentalCaluls/mentalPercentage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AA0ElC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAoEF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAwBlD,CAAC"}
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.mentalPercentage = void 0;
|
|
4
4
|
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const numberVEA_1 = require("../../../../exercises/vea/numberVEA");
|
|
6
7
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
7
|
-
const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
|
|
8
8
|
const coinFlip_1 = require("../../../../utils/alea/coinFlip");
|
|
9
9
|
const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
10
10
|
const getMentalPercentage = () => {
|
|
@@ -110,9 +110,7 @@ const getPropositions = (n, { answer, rand }) => {
|
|
|
110
110
|
return (0, shuffle_1.shuffle)(propositions);
|
|
111
111
|
};
|
|
112
112
|
const isAnswerValid = (studentAns, { answer }) => {
|
|
113
|
-
|
|
114
|
-
const texs = answerTree.toAllValidTexs();
|
|
115
|
-
return texs.includes(studentAns);
|
|
113
|
+
return (0, numberVEA_1.numberVEA)(studentAns, answer);
|
|
116
114
|
};
|
|
117
115
|
exports.mentalPercentage = {
|
|
118
116
|
id: "mentalPercentage",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factoIdRmq1.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoIdRmq1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"factoIdRmq1.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoIdRmq1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAalC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAgGF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAc7C,CAAC"}
|
|
@@ -11,6 +11,7 @@ const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
|
11
11
|
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
12
12
|
const alignTex_1 = require("../../../../utils/latex/alignTex");
|
|
13
13
|
const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
14
|
+
const gcd_1 = require("../../../../math/utils/arithmetic/gcd");
|
|
14
15
|
const getFactoType1Question = () => {
|
|
15
16
|
const affine = affine_1.AffineConstructor.random({ min: 1, max: 10 }, {
|
|
16
17
|
min: 1,
|
|
@@ -68,6 +69,13 @@ const isAnswerValid = (ans, { a, b }) => {
|
|
|
68
69
|
const affine = new affine_1.Affine(a, b);
|
|
69
70
|
const answerTree = new powerNode_1.SquareNode(affine.toTree());
|
|
70
71
|
const validLatexs = answerTree.toAllValidTexs();
|
|
72
|
+
const pgcd = (0, gcd_1.gcd)(a, b);
|
|
73
|
+
if (pgcd !== 1) {
|
|
74
|
+
const affine2 = new affine_1.Affine(a / pgcd, b / pgcd);
|
|
75
|
+
const coeff = pgcd ** 2;
|
|
76
|
+
const answerTree2 = new multiplyNode_1.MultiplyNode(coeff.toTree(), affine2.toTree());
|
|
77
|
+
validLatexs.push(...answerTree2.toAllValidTexs());
|
|
78
|
+
}
|
|
71
79
|
return validLatexs.includes(ans);
|
|
72
80
|
};
|
|
73
81
|
exports.factoIdRmq1 = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factoIdRmq2.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoIdRmq2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"factoIdRmq2.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoIdRmq2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAclC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAgGF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAc7C,CAAC"}
|
|
@@ -12,6 +12,7 @@ const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
|
12
12
|
const substractNode_1 = require("../../../../tree/nodes/operators/substractNode");
|
|
13
13
|
const alignTex_1 = require("../../../../utils/latex/alignTex");
|
|
14
14
|
const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
15
|
+
const gcd_1 = require("../../../../math/utils/arithmetic/gcd");
|
|
15
16
|
const getFactoType1Question = () => {
|
|
16
17
|
const affine = affine_1.AffineConstructor.random({
|
|
17
18
|
min: 1,
|
|
@@ -70,6 +71,13 @@ const isAnswerValid = (ans, { a, b }) => {
|
|
|
70
71
|
const affine = new affine_1.Affine(a, b);
|
|
71
72
|
const answerTree = new powerNode_1.SquareNode(affine.toTree());
|
|
72
73
|
const validLatexs = answerTree.toAllValidTexs();
|
|
74
|
+
const pgcd = (0, gcd_1.gcd)(a, Math.abs(b));
|
|
75
|
+
if (pgcd !== 1) {
|
|
76
|
+
const affine2 = new affine_1.Affine(a / pgcd, b / pgcd);
|
|
77
|
+
const coeff = pgcd ** 2;
|
|
78
|
+
const answerTree2 = new multiplyNode_1.MultiplyNode(coeff.toTree(), affine2.toTree());
|
|
79
|
+
validLatexs.push(...answerTree2.toAllValidTexs());
|
|
80
|
+
}
|
|
73
81
|
return validLatexs.includes(ans);
|
|
74
82
|
};
|
|
75
83
|
exports.factoIdRmq2 = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factoIdRmq3.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoIdRmq3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"factoIdRmq3.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoIdRmq3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AA4HF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAc7C,CAAC"}
|
|
@@ -4,6 +4,7 @@ exports.factoIdRmq3 = void 0;
|
|
|
4
4
|
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
6
|
const affine_1 = require("../../../../math/polynomials/affine");
|
|
7
|
+
const gcd_1 = require("../../../../math/utils/arithmetic/gcd");
|
|
7
8
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
8
9
|
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
9
10
|
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
@@ -76,6 +77,15 @@ const isAnswerValid = (ans, { affine1Coeffs, affine2Coeffs }) => {
|
|
|
76
77
|
const affine2 = new affine_1.Affine(affine2Coeffs[1], affine2Coeffs[0]);
|
|
77
78
|
const answerTree = new multiplyNode_1.MultiplyNode(affine.toTree(), affine2.toTree());
|
|
78
79
|
const validLatexs = answerTree.toAllValidTexs();
|
|
80
|
+
const pgcd = (0, gcd_1.gcd)(Math.abs(affine1Coeffs[1]), Math.abs(affine1Coeffs[0]));
|
|
81
|
+
if (pgcd !== 1) {
|
|
82
|
+
const affineA = new affine_1.Affine(affine1Coeffs[1] / pgcd, affine1Coeffs[0] / pgcd);
|
|
83
|
+
const affineB = new affine_1.Affine(affine2Coeffs[1] / pgcd, affine2Coeffs[0] / pgcd);
|
|
84
|
+
const answer2 = new multiplyNode_1.MultiplyNode(affineA.toTree(), affineB.toTree());
|
|
85
|
+
const coeff = pgcd ** 2;
|
|
86
|
+
const answerTree2 = new multiplyNode_1.MultiplyNode(coeff.toTree(), answer2);
|
|
87
|
+
validLatexs.push(...answerTree2.toAllValidTexs());
|
|
88
|
+
}
|
|
79
89
|
return validLatexs.includes(ans);
|
|
80
90
|
};
|
|
81
91
|
exports.factoIdRmq3 = {
|
|
@@ -4,6 +4,9 @@ type Identifiers = {
|
|
|
4
4
|
randomUnitInstructionIndex: number;
|
|
5
5
|
randomLength: number;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
type Options = {
|
|
8
|
+
units: string[];
|
|
9
|
+
};
|
|
10
|
+
export declare const lengthConversion: Exercise<Identifiers, Options>;
|
|
8
11
|
export {};
|
|
9
12
|
//# sourceMappingURL=lengthConversion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lengthConversion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/lengthConversion.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lengthConversion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/lengthConversion.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,QAAQ,EAaT,MAAM,gBAAgB,CAAC;AAIxB,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,0BAA0B,EAAE,MAAM,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AACF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAqHF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkB3D,CAAC"}
|