math-exercises 1.3.39 → 1.3.41
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/calcul/addAndSub.d.ts.map +1 -1
- package/lib/exercises/calcul/addAndSub.js +29 -2
- package/lib/exercises/calcul/addAndSubWithoutRelatives.d.ts.map +1 -1
- package/lib/exercises/calcul/addAndSubWithoutRelatives.js +26 -0
- package/lib/exercises/calcul/arithmetics/primeNumbers.d.ts.map +1 -1
- package/lib/exercises/calcul/arithmetics/primeNumbers.js +49 -10
- package/lib/exercises/calcul/fractions/fractionAndIntegerDivision.d.ts.map +1 -1
- package/lib/exercises/calcul/fractions/fractionAndIntegerDivision.js +29 -0
- package/lib/exercises/calcul/fractions/fractionAndIntegerProduct.d.ts.map +1 -1
- package/lib/exercises/calcul/fractions/fractionAndIntegerProduct.js +27 -0
- package/lib/exercises/calcul/fractions/fractionAndIntegerSum.d.ts.map +1 -1
- package/lib/exercises/calcul/fractions/fractionAndIntegerSum.js +27 -0
- package/lib/exercises/calcul/fractions/fractionToPercentToDecimal.d.ts.map +1 -1
- package/lib/exercises/calcul/fractions/fractionToPercentToDecimal.js +48 -1
- package/lib/exercises/calcul/fractions/fractionsDivision.d.ts.map +1 -1
- package/lib/exercises/calcul/fractions/fractionsDivision.js +27 -0
- package/lib/exercises/calcul/fractions/fractionsProduct.d.ts.map +1 -1
- package/lib/exercises/calcul/fractions/fractionsProduct.js +27 -0
- package/lib/exercises/calcul/fractions/fractionsSum.d.ts.map +1 -1
- package/lib/exercises/calcul/fractions/fractionsSum.js +27 -0
- package/lib/exercises/calcul/fractions/simplifyFraction.d.ts.map +1 -1
- package/lib/exercises/calcul/fractions/simplifyFraction.js +26 -0
- package/lib/exercises/calcul/mentalCaluls.ts/mentalAddAndSub.d.ts.map +1 -1
- package/lib/exercises/calcul/mentalCaluls.ts/mentalAddAndSub.js +30 -0
- package/lib/exercises/calcul/mentalCaluls.ts/mentalDivisions.d.ts.map +1 -1
- package/lib/exercises/calcul/mentalCaluls.ts/mentalDivisions.js +29 -0
- package/lib/exercises/calcul/mentalCaluls.ts/mentalMultiplications.d.ts.map +1 -1
- package/lib/exercises/calcul/mentalCaluls.ts/mentalMultiplications.js +26 -0
- package/lib/exercises/calcul/mentalCaluls.ts/mentalPercentage.d.ts.map +1 -1
- package/lib/exercises/calcul/mentalCaluls.ts/mentalPercentage.js +65 -0
- package/lib/exercises/calcul/operations/operationsPriorities.d.ts.map +1 -1
- package/lib/exercises/calcul/operations/operationsPriorities.js +25 -0
- package/lib/exercises/calcul/operations/operationsPrioritiesWithoutRelative.d.ts.map +1 -1
- package/lib/exercises/calcul/operations/operationsPrioritiesWithoutRelative.js +25 -0
- package/lib/exercises/calcul/proportionality/proportionalityTable.d.ts +4 -0
- package/lib/exercises/calcul/proportionality/proportionalityTable.d.ts.map +1 -0
- package/lib/exercises/calcul/proportionality/proportionalityTable.js +80 -0
- package/lib/exercises/calcul/rounding/rounding.d.ts.map +1 -1
- package/lib/exercises/calcul/rounding/rounding.js +49 -0
- package/lib/exercises/calculLitteral/distributivity/doubleDistributivity.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/distributivity/doubleDistributivity.js +45 -0
- package/lib/exercises/calculLitteral/distributivity/firstIdentity.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/distributivity/firstIdentity.js +45 -0
- package/lib/exercises/calculLitteral/distributivity/secondIdentity.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/distributivity/secondIdentity.js +45 -0
- package/lib/exercises/calculLitteral/distributivity/simpleDistributivity.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/distributivity/simpleDistributivity.js +45 -1
- package/lib/exercises/calculLitteral/distributivity/thirdIdentity.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/distributivity/thirdIdentity.js +45 -0
- package/lib/exercises/calculLitteral/equation/equationSimpleSquare.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/equationSimpleSquare.js +107 -1
- package/lib/exercises/calculLitteral/equation/equationType1Exercise.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/equationType1Exercise.js +27 -0
- package/lib/exercises/calculLitteral/equation/equationType2Exercise.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/equationType2Exercise.js +27 -0
- package/lib/exercises/calculLitteral/equation/equationType3Exercise.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/equationType3Exercise.js +27 -0
- package/lib/exercises/calculLitteral/equation/equationType4Exercise.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/equationType4Exercise.js +27 -0
- package/lib/exercises/calculLitteral/equation/evaluateExpression.d.ts +4 -0
- package/lib/exercises/calculLitteral/equation/evaluateExpression.d.ts.map +1 -0
- package/lib/exercises/calculLitteral/equation/evaluateExpression.js +61 -0
- package/lib/exercises/calculLitteral/equation/firstDegreeEquation.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/firstDegreeEquation.js +25 -0
- package/lib/exercises/calculLitteral/equation/fractionEquation.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/fractionEquation.js +32 -0
- package/lib/exercises/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/equation/multiplicationEquation.js +35 -0
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq1.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq1.js +32 -0
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq2.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq2.js +38 -0
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq3.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq3.js +44 -0
- package/lib/exercises/calculLitteral/factorisation/factoType1Exercise.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/factorisation/factoType1Exercise.js +42 -0
- package/lib/exercises/calculLitteral/simplifying/evaluateExpression.d.ts +4 -0
- package/lib/exercises/calculLitteral/simplifying/evaluateExpression.d.ts.map +1 -0
- package/lib/exercises/calculLitteral/simplifying/evaluateExpression.js +61 -0
- package/lib/exercises/calculLitteral/simplifying/reduceExpression.d.ts +4 -0
- package/lib/exercises/calculLitteral/simplifying/reduceExpression.d.ts.map +1 -0
- package/lib/exercises/calculLitteral/simplifying/reduceExpression.js +118 -0
- package/lib/exercises/conversion/aeraConversion.d.ts.map +1 -1
- package/lib/exercises/conversion/aeraConversion.js +27 -0
- package/lib/exercises/conversion/capacityConversion.d.ts.map +1 -1
- package/lib/exercises/conversion/capacityConversion.js +27 -0
- package/lib/exercises/conversion/lengthConversion.d.ts.map +1 -1
- package/lib/exercises/conversion/lengthConversion.js +26 -0
- package/lib/exercises/conversion/massConversion.d.ts.map +1 -1
- package/lib/exercises/conversion/massConversion.js +26 -0
- package/lib/exercises/conversion/volumeCapacityConversion.d.ts.map +1 -1
- package/lib/exercises/conversion/volumeCapacityConversion.js +29 -3
- package/lib/exercises/conversion/volumeConversion.d.ts.map +1 -1
- package/lib/exercises/conversion/volumeConversion.js +26 -0
- package/lib/exercises/derivation/derivative/constanteDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/constanteDerivative.js +26 -0
- package/lib/exercises/derivation/derivative/firstDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/firstDegreeDerivative.js +26 -0
- package/lib/exercises/derivation/derivative/inverseFunctionDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/inverseFunctionDerivative.js +26 -0
- package/lib/exercises/derivation/derivative/powerFunctionDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/powerFunctionDerivative.js +26 -0
- package/lib/exercises/derivation/derivative/rootFunctionDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/rootFunctionDerivative.js +36 -0
- package/lib/exercises/derivation/derivative/secondDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/secondDegreeDerivative.js +31 -0
- package/lib/exercises/derivation/derivative/thirdDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/thirdDegreeDerivative.js +30 -0
- package/lib/exercises/derivation/derivativeNumberReading.d.ts.map +1 -1
- package/lib/exercises/derivation/derivativeNumberReading.js +30 -0
- package/lib/exercises/exercise.d.ts +6 -0
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/exercises.d.ts.map +1 -1
- package/lib/exercises/exercises.js +8 -0
- package/lib/exercises/geometry/cartesian/distanceBetweenTwoPoints.d.ts +4 -0
- package/lib/exercises/geometry/cartesian/distanceBetweenTwoPoints.d.ts.map +1 -0
- package/lib/exercises/geometry/cartesian/distanceBetweenTwoPoints.js +101 -0
- package/lib/exercises/geometry/cartesian/leadingCoefficient.d.ts.map +1 -1
- package/lib/exercises/geometry/cartesian/leadingCoefficient.js +30 -0
- package/lib/exercises/geometry/cartesian/leadingCoefficientCalculV1.d.ts.map +1 -1
- package/lib/exercises/geometry/cartesian/leadingCoefficientCalculV1.js +26 -0
- package/lib/exercises/geometry/cartesian/leadingCoefficientCalculV2.d.ts.map +1 -1
- package/lib/exercises/geometry/cartesian/leadingCoefficientCalculV2.js +26 -0
- package/lib/exercises/geometry/cartesian/midpoint.d.ts.map +1 -1
- package/lib/exercises/geometry/cartesian/midpoint.js +29 -0
- package/lib/exercises/geometry/euclidean/circleArea.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/circleArea.js +28 -1
- package/lib/exercises/geometry/euclidean/circleCircumference.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/circleCircumference.js +28 -1
- package/lib/exercises/geometry/euclidean/pythagore.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/pythagore.js +47 -0
- package/lib/exercises/geometry/euclidean/pythagoreCalcul.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/pythagoreCalcul.js +28 -0
- package/lib/exercises/geometry/euclidean/rectangleArea.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/rectangleArea.js +25 -0
- package/lib/exercises/geometry/euclidean/rectanglePerimeter.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/rectanglePerimeter.js +25 -0
- package/lib/exercises/geometry/euclidean/rightTriangleArea.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/rightTriangleArea.js +25 -0
- package/lib/exercises/geometry/euclidean/squareArea.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/squareArea.js +25 -0
- package/lib/exercises/geometry/euclidean/squarePerimeter.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/squarePerimeter.js +25 -0
- package/lib/exercises/geometry/euclidean/thales.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/thales.js +44 -1
- package/lib/exercises/geometry/euclidean/thalesCalcul.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/thalesCalcul.js +25 -0
- package/lib/exercises/geometry/euclidean/triangleArea.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/triangleArea.js +24 -0
- package/lib/exercises/geometry/euclidean/triangleAreaV2.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/triangleAreaV2.js +32 -1
- package/lib/exercises/geometry/euclidean/trianglePerimeter.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/trianglePerimeter.js +26 -0
- package/lib/exercises/geometry/euclidean/trigonometry.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/trigonometry.js +39 -0
- package/lib/exercises/geometry/euclidean/trigonometryAngleCalcul.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/trigonometryAngleCalcul.js +24 -0
- package/lib/exercises/geometry/euclidean/trigonometrySideCalcul.d.ts.map +1 -1
- package/lib/exercises/geometry/euclidean/trigonometrySideCalcul.js +25 -0
- package/lib/exercises/geometry/vectors/scalarProductViaCoords.d.ts.map +1 -1
- package/lib/exercises/geometry/vectors/scalarProductViaCoords.js +28 -1
- package/lib/exercises/percent/applyPercent.d.ts.map +1 -1
- package/lib/exercises/percent/applyPercent.js +30 -0
- package/lib/exercises/percent/averageEvolutionRate.d.ts.map +1 -1
- package/lib/exercises/percent/averageEvolutionRate.js +32 -2
- package/lib/exercises/percent/globalPercent.d.ts.map +1 -1
- package/lib/exercises/percent/globalPercent.js +30 -0
- package/lib/exercises/percent/reciprocalPercentage.d.ts.map +1 -1
- package/lib/exercises/percent/reciprocalPercentage.js +30 -0
- package/lib/exercises/powers/powersDivision.d.ts.map +1 -1
- package/lib/exercises/powers/powersDivision.js +29 -1
- package/lib/exercises/powers/powersOfTenToDecimal.d.ts.map +1 -1
- package/lib/exercises/powers/powersOfTenToDecimal.js +28 -0
- package/lib/exercises/powers/powersPower.d.ts.map +1 -1
- package/lib/exercises/powers/powersPower.js +28 -0
- package/lib/exercises/powers/powersProduct.d.ts.map +1 -1
- package/lib/exercises/powers/powersProduct.js +29 -1
- package/lib/exercises/powers/scientificToDecimal.d.ts.map +1 -1
- package/lib/exercises/powers/scientificToDecimal.js +27 -0
- package/lib/exercises/proba/conditionalProbability.d.ts.map +1 -1
- package/lib/exercises/proba/conditionalProbability.js +25 -0
- package/lib/exercises/proba/marginalAndConditionalFrequency.d.ts.map +1 -1
- package/lib/exercises/proba/marginalAndConditionalFrequency.js +25 -0
- package/lib/exercises/proba/probabilityTree.d.ts.map +1 -1
- package/lib/exercises/proba/probabilityTree.js +33 -6
- package/lib/exercises/sequences/arithmetic/arithmeticExplicitFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/sequences/arithmetic/arithmeticExplicitFormulaUsage.js +25 -0
- package/lib/exercises/sequences/arithmetic/arithmeticFindExplicitFormula.d.ts.map +1 -1
- package/lib/exercises/sequences/arithmetic/arithmeticFindExplicitFormula.js +25 -0
- package/lib/exercises/sequences/arithmetic/arithmeticFindReason.d.ts.map +1 -1
- package/lib/exercises/sequences/arithmetic/arithmeticFindReason.js +25 -0
- package/lib/exercises/sequences/arithmetic/arithmeticReasonUsage.d.ts.map +1 -1
- package/lib/exercises/sequences/arithmetic/arithmeticReasonUsage.js +25 -0
- package/lib/exercises/sequences/arithmetic/arithmeticRecurrenceFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/sequences/arithmetic/arithmeticRecurrenceFormulaUsage.js +25 -0
- package/lib/exercises/sequences/arithmetic/arithmeticThresholdFind.d.ts.map +1 -1
- package/lib/exercises/sequences/arithmetic/arithmeticThresholdFind.js +25 -0
- package/lib/exercises/sequences/geometric/geometricExplicitFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/sequences/geometric/geometricExplicitFormulaUsage.js +25 -0
- package/lib/exercises/sequences/geometric/geometricFindExplicitFormula.d.ts.map +1 -1
- package/lib/exercises/sequences/geometric/geometricFindExplicitFormula.js +31 -0
- package/lib/exercises/sequences/geometric/geometricFindReason.d.ts.map +1 -1
- package/lib/exercises/sequences/geometric/geometricFindReason.js +31 -0
- package/lib/exercises/sequences/geometric/geometricReasonUsage.d.ts.map +1 -1
- package/lib/exercises/sequences/geometric/geometricReasonUsage.js +31 -0
- package/lib/exercises/sequences/geometric/geometricRecurrenceFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/sequences/geometric/geometricRecurrenceFormulaUsage.js +31 -0
- package/lib/exercises/squareRoots/simpifySquareRoot.d.ts.map +1 -1
- package/lib/exercises/squareRoots/simpifySquareRoot.js +29 -0
- package/lib/math/geometry/point.d.ts +1 -0
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +9 -0
- package/lib/math/polynomials/polynomial.d.ts +1 -0
- package/lib/math/polynomials/polynomial.d.ts.map +1 -1
- package/lib/math/polynomials/polynomial.js +8 -1
- package/lib/server.js +16 -20
- package/package.json +7 -6
|
@@ -5,6 +5,8 @@ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQues
|
|
|
5
5
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
6
6
|
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
7
7
|
const simplify_1 = require("../../../tree/parsers/simplify");
|
|
8
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
9
|
+
const uuid_1 = require("uuid");
|
|
8
10
|
exports.firstDegreeEquation = {
|
|
9
11
|
id: 'firstDegreeEquation',
|
|
10
12
|
connector: '=',
|
|
@@ -19,11 +21,34 @@ exports.firstDegreeEquation = {
|
|
|
19
21
|
function getFirstDegreeEquation() {
|
|
20
22
|
const a = (0, randint_1.randint)(-30, 30, [0]);
|
|
21
23
|
const b = (0, randint_1.randint)(-30, 30, [0]);
|
|
24
|
+
const getPropositions = (n) => {
|
|
25
|
+
const res = [];
|
|
26
|
+
res.push({
|
|
27
|
+
id: (0, uuid_1.v4)() + '',
|
|
28
|
+
statement: (0, simplify_1.simplifyNode)(new numberNode_1.NumberNode(a / b)).toTex(),
|
|
29
|
+
isRightAnswer: true,
|
|
30
|
+
});
|
|
31
|
+
for (let i = 0; i < n - 1; i++) {
|
|
32
|
+
let isDuplicate;
|
|
33
|
+
let proposition;
|
|
34
|
+
do {
|
|
35
|
+
proposition = {
|
|
36
|
+
id: (0, uuid_1.v4)() + '',
|
|
37
|
+
statement: (0, simplify_1.simplifyNode)(new numberNode_1.NumberNode((a + (0, randint_1.randint)(-7, 8, [-a])) / (b + (0, randint_1.randint)(-7, 8, [-b])))).toTex(),
|
|
38
|
+
isRightAnswer: false,
|
|
39
|
+
};
|
|
40
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
41
|
+
} while (isDuplicate);
|
|
42
|
+
res.push(proposition);
|
|
43
|
+
}
|
|
44
|
+
return (0, shuffle_1.shuffle)(res);
|
|
45
|
+
};
|
|
22
46
|
const question = {
|
|
23
47
|
instruction: `Résoudre l'équation suivante : $\\frac{${a}}{x} = ${b}$`,
|
|
24
48
|
startStatement: `x`,
|
|
25
49
|
answer: (0, simplify_1.simplifyNode)(new numberNode_1.NumberNode(a / b)).toTex(),
|
|
26
50
|
keys: ['x', 'S', 'equal', 'lbrace', 'rbrace', 'semicolon', 'emptyset'],
|
|
51
|
+
getPropositions,
|
|
27
52
|
};
|
|
28
53
|
return question;
|
|
29
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fractionEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/equation/fractionEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"fractionEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/equation/fractionEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAU3E,eAAO,MAAM,gBAAgB,EAAE,QAU9B,CAAC;AAEF,wBAAgB,mBAAmB,IAAI,QAAQ,CA8D9C"}
|
|
@@ -7,6 +7,8 @@ const randint_1 = require("../../../math/utils/random/randint");
|
|
|
7
7
|
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
8
8
|
const fractionNode_1 = require("../../../tree/nodes/operators/fractionNode");
|
|
9
9
|
const simplify_1 = require("../../../tree/parsers/simplify");
|
|
10
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
11
|
+
const uuid_1 = require("uuid");
|
|
10
12
|
exports.fractionEquation = {
|
|
11
13
|
id: 'fractionEquation',
|
|
12
14
|
connector: '\\iff',
|
|
@@ -29,10 +31,40 @@ function getFractionEquation() {
|
|
|
29
31
|
const answer = -d / c === -b / a
|
|
30
32
|
? `S = \\emptyset`
|
|
31
33
|
: `S = \\left\\{${(0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(-b), new numberNode_1.NumberNode(a))).toTex()}\\right\\}`;
|
|
34
|
+
const getPropositions = (n) => {
|
|
35
|
+
const res = [];
|
|
36
|
+
res.push({
|
|
37
|
+
id: (0, uuid_1.v4)() + '',
|
|
38
|
+
statement: answer,
|
|
39
|
+
isRightAnswer: true,
|
|
40
|
+
});
|
|
41
|
+
for (let i = 0; i < n - 1; i++) {
|
|
42
|
+
let isDuplicate;
|
|
43
|
+
let proposition;
|
|
44
|
+
do {
|
|
45
|
+
const a = (0, randint_1.randint)(-9, 10, [0]);
|
|
46
|
+
const b = (0, randint_1.randint)(-9, 10, [0]);
|
|
47
|
+
const c = (0, randint_1.randint)(-9, 10, [0]);
|
|
48
|
+
const d = (0, randint_1.randint)(-9, 10, [0]);
|
|
49
|
+
const wrongAnswer = -d / c === -b / a
|
|
50
|
+
? `S = \\emptyset`
|
|
51
|
+
: `S = \\left\\{${(0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(-b), new numberNode_1.NumberNode(a))).toTex()}\\right\\}`;
|
|
52
|
+
proposition = {
|
|
53
|
+
id: (0, uuid_1.v4)() + '',
|
|
54
|
+
statement: wrongAnswer,
|
|
55
|
+
isRightAnswer: false,
|
|
56
|
+
};
|
|
57
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
58
|
+
} while (isDuplicate);
|
|
59
|
+
res.push(proposition);
|
|
60
|
+
}
|
|
61
|
+
return (0, shuffle_1.shuffle)(res);
|
|
62
|
+
};
|
|
32
63
|
const question = {
|
|
33
64
|
startStatement: `\\frac{${polynome1.toTex()}}{${polynome2.toTex()}} = 0`,
|
|
34
65
|
answer,
|
|
35
66
|
keys: ['x', 'S', 'equal', 'lbrace', 'rbrace', 'semicolon', 'ou', 'emptyset'],
|
|
67
|
+
getPropositions,
|
|
36
68
|
};
|
|
37
69
|
return question;
|
|
38
70
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiplicationEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/equation/multiplicationEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"multiplicationEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/equation/multiplicationEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAU3E,eAAO,MAAM,sBAAsB,EAAE,QAUpC,CAAC;AAEF,wBAAgB,yBAAyB,IAAI,QAAQ,CAsEpD"}
|
|
@@ -7,6 +7,8 @@ const randint_1 = require("../../../math/utils/random/randint");
|
|
|
7
7
|
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
8
8
|
const fractionNode_1 = require("../../../tree/nodes/operators/fractionNode");
|
|
9
9
|
const simplify_1 = require("../../../tree/parsers/simplify");
|
|
10
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
11
|
+
const uuid_1 = require("uuid");
|
|
10
12
|
exports.multiplicationEquation = {
|
|
11
13
|
id: 'multiplicationEquation',
|
|
12
14
|
connector: '\\iff',
|
|
@@ -29,10 +31,43 @@ function getMultiplicationEquation() {
|
|
|
29
31
|
} while (a / c === b / d);
|
|
30
32
|
const polynome1 = new polynomial_1.Polynomial([b, a]);
|
|
31
33
|
const polynome2 = new polynomial_1.Polynomial([d, c]);
|
|
34
|
+
const answer = `S = \\left\\{${(0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(-b), new numberNode_1.NumberNode(a))).toTex()};${(0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(-d), new numberNode_1.NumberNode(c))).toTex()}\\right\\}`;
|
|
35
|
+
const getPropositions = (n) => {
|
|
36
|
+
const res = [];
|
|
37
|
+
res.push({
|
|
38
|
+
id: (0, uuid_1.v4)() + '',
|
|
39
|
+
statement: answer,
|
|
40
|
+
isRightAnswer: true,
|
|
41
|
+
});
|
|
42
|
+
for (let i = 0; i < n - 1; i++) {
|
|
43
|
+
let isDuplicate;
|
|
44
|
+
let proposition;
|
|
45
|
+
do {
|
|
46
|
+
do {
|
|
47
|
+
a = (0, randint_1.randint)(-9, 10, [0]);
|
|
48
|
+
b = (0, randint_1.randint)(-9, 10, [0]);
|
|
49
|
+
c = (0, randint_1.randint)(-9, 10, [0]);
|
|
50
|
+
d = (0, randint_1.randint)(-9, 10, [0]);
|
|
51
|
+
} while (a / c === b / d);
|
|
52
|
+
const polynome1 = new polynomial_1.Polynomial([b, a]);
|
|
53
|
+
const polynome2 = new polynomial_1.Polynomial([d, c]);
|
|
54
|
+
const wrongAnswer = `S = \\left\\{${(0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(-b), new numberNode_1.NumberNode(a))).toTex()};${(0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(-d), new numberNode_1.NumberNode(c))).toTex()}\\right\\}`;
|
|
55
|
+
proposition = {
|
|
56
|
+
id: (0, uuid_1.v4)() + '',
|
|
57
|
+
statement: wrongAnswer,
|
|
58
|
+
isRightAnswer: false,
|
|
59
|
+
};
|
|
60
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
61
|
+
} while (isDuplicate);
|
|
62
|
+
res.push(proposition);
|
|
63
|
+
}
|
|
64
|
+
return (0, shuffle_1.shuffle)(res);
|
|
65
|
+
};
|
|
32
66
|
const question = {
|
|
33
67
|
startStatement: `(${polynome1.toTex()})(${polynome2.toTex()}) = 0`,
|
|
34
68
|
answer: `S = \\left\\{${(0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(-b), new numberNode_1.NumberNode(a))).toTex()};${(0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(-d), new numberNode_1.NumberNode(c))).toTex()}\\right\\}`,
|
|
35
69
|
keys: ['x', 'S', 'equal', 'lbrace', 'rbrace', 'semicolon', 'ou'],
|
|
70
|
+
getPropositions,
|
|
36
71
|
};
|
|
37
72
|
return question;
|
|
38
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factoIdRmq1.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/factorisation/factoIdRmq1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"factoIdRmq1.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/factorisation/factoIdRmq1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAgB3E,eAAO,MAAM,WAAW,EAAE,QAUzB,CAAC;AAEF,wBAAgB,qBAAqB,IAAI,QAAQ,CAuDhD"}
|
|
@@ -6,8 +6,11 @@ const integer_1 = require("../../../math/numbers/integer/integer");
|
|
|
6
6
|
const affine_1 = require("../../../math/polynomials/affine");
|
|
7
7
|
const discreteSet_1 = require("../../../math/sets/discreteSet");
|
|
8
8
|
const intervals_1 = require("../../../math/sets/intervals/intervals");
|
|
9
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
9
10
|
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
10
11
|
const powerNode_1 = require("../../../tree/nodes/operators/powerNode");
|
|
12
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
13
|
+
const uuid_1 = require("uuid");
|
|
11
14
|
exports.factoIdRmq1 = {
|
|
12
15
|
id: 'factoIdRmq1',
|
|
13
16
|
connector: '=',
|
|
@@ -24,10 +27,39 @@ function getFactoType1Question() {
|
|
|
24
27
|
const affine = affine_1.AffineConstructor.random(interval, interval);
|
|
25
28
|
const statementTree = affine.multiply(affine).toTree();
|
|
26
29
|
const answerTree = new powerNode_1.PowerNode(affine.toTree(), new numberNode_1.NumberNode(2));
|
|
30
|
+
const getPropositions = (n) => {
|
|
31
|
+
const res = [];
|
|
32
|
+
res.push({
|
|
33
|
+
id: (0, uuid_1.v4)() + '',
|
|
34
|
+
statement: answerTree.toTex(),
|
|
35
|
+
isRightAnswer: true,
|
|
36
|
+
});
|
|
37
|
+
res.push({
|
|
38
|
+
id: (0, uuid_1.v4)() + '',
|
|
39
|
+
statement: new powerNode_1.PowerNode(new affine_1.Affine(affine.b, affine.a).toTree(), new numberNode_1.NumberNode(2)).toTex(),
|
|
40
|
+
isRightAnswer: false,
|
|
41
|
+
});
|
|
42
|
+
for (let i = 0; i < n - 2; i++) {
|
|
43
|
+
let isDuplicate;
|
|
44
|
+
let proposition;
|
|
45
|
+
do {
|
|
46
|
+
const wrongAnswer = new powerNode_1.PowerNode(new affine_1.Affine(affine.a + (0, randint_1.randint)(-affine.a + 1, 10 - affine.a), affine.b + (0, randint_1.randint)(-affine.b + 1, 10 - affine.b)).toTree(), new numberNode_1.NumberNode(2));
|
|
47
|
+
proposition = {
|
|
48
|
+
id: (0, uuid_1.v4)() + '',
|
|
49
|
+
statement: wrongAnswer.toTex(),
|
|
50
|
+
isRightAnswer: false,
|
|
51
|
+
};
|
|
52
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
53
|
+
} while (isDuplicate);
|
|
54
|
+
res.push(proposition);
|
|
55
|
+
}
|
|
56
|
+
return (0, shuffle_1.shuffle)(res);
|
|
57
|
+
};
|
|
27
58
|
const question = {
|
|
28
59
|
startStatement: statementTree.toTex(),
|
|
29
60
|
answer: answerTree.toTex(),
|
|
30
61
|
keys: ['x'],
|
|
62
|
+
getPropositions,
|
|
31
63
|
};
|
|
32
64
|
return question;
|
|
33
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factoIdRmq2.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/factorisation/factoIdRmq2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"factoIdRmq2.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/factorisation/factoIdRmq2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAgB3E,eAAO,MAAM,WAAW,EAAE,QAUzB,CAAC;AAEF,wBAAgB,qBAAqB,IAAI,QAAQ,CAgEhD"}
|
|
@@ -6,8 +6,11 @@ const integer_1 = require("../../../math/numbers/integer/integer");
|
|
|
6
6
|
const affine_1 = require("../../../math/polynomials/affine");
|
|
7
7
|
const discreteSet_1 = require("../../../math/sets/discreteSet");
|
|
8
8
|
const intervals_1 = require("../../../math/sets/intervals/intervals");
|
|
9
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
9
10
|
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
10
11
|
const powerNode_1 = require("../../../tree/nodes/operators/powerNode");
|
|
12
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
13
|
+
const uuid_1 = require("uuid");
|
|
11
14
|
exports.factoIdRmq2 = {
|
|
12
15
|
id: 'factoIdRmq2',
|
|
13
16
|
connector: '=',
|
|
@@ -25,10 +28,45 @@ function getFactoType1Question() {
|
|
|
25
28
|
const affine = affine_1.AffineConstructor.random(intervalA, intervalB);
|
|
26
29
|
const statementTree = affine.multiply(affine).toTree();
|
|
27
30
|
const answerTree = new powerNode_1.PowerNode(affine.toTree(), new numberNode_1.NumberNode(2));
|
|
31
|
+
const getPropositions = (n) => {
|
|
32
|
+
const res = [];
|
|
33
|
+
res.push({
|
|
34
|
+
id: (0, uuid_1.v4)() + '',
|
|
35
|
+
statement: answerTree.toTex(),
|
|
36
|
+
isRightAnswer: true,
|
|
37
|
+
});
|
|
38
|
+
res.push({
|
|
39
|
+
id: (0, uuid_1.v4)() + '',
|
|
40
|
+
statement: new powerNode_1.PowerNode(new affine_1.Affine(-affine.b, -affine.a).toTree(), new numberNode_1.NumberNode(2)).toTex(),
|
|
41
|
+
isRightAnswer: false,
|
|
42
|
+
});
|
|
43
|
+
if (n > 2)
|
|
44
|
+
res.push({
|
|
45
|
+
id: (0, uuid_1.v4)() + '',
|
|
46
|
+
statement: new powerNode_1.PowerNode(new affine_1.Affine(-affine.a, affine.b).toTree(), new numberNode_1.NumberNode(2)).toTex(),
|
|
47
|
+
isRightAnswer: false,
|
|
48
|
+
});
|
|
49
|
+
for (let i = 0; i < n - 3; i++) {
|
|
50
|
+
let isDuplicate;
|
|
51
|
+
let proposition;
|
|
52
|
+
do {
|
|
53
|
+
const wrongAnswer = new powerNode_1.PowerNode(new affine_1.Affine(affine.a + (0, randint_1.randint)(-affine.a + 1, 10 - affine.a), affine.b + (0, randint_1.randint)(-9 - affine.b, -affine.b)).toTree(), new numberNode_1.NumberNode(2));
|
|
54
|
+
proposition = {
|
|
55
|
+
id: (0, uuid_1.v4)() + '',
|
|
56
|
+
statement: wrongAnswer.toTex(),
|
|
57
|
+
isRightAnswer: false,
|
|
58
|
+
};
|
|
59
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
60
|
+
} while (isDuplicate);
|
|
61
|
+
res.push(proposition);
|
|
62
|
+
}
|
|
63
|
+
return (0, shuffle_1.shuffle)(res);
|
|
64
|
+
};
|
|
28
65
|
const question = {
|
|
29
66
|
startStatement: statementTree.toTex(),
|
|
30
67
|
answer: answerTree.toTex(),
|
|
31
68
|
keys: ['x'],
|
|
69
|
+
getPropositions,
|
|
32
70
|
};
|
|
33
71
|
return question;
|
|
34
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factoIdRmq3.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/factorisation/factoIdRmq3.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"factoIdRmq3.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/factorisation/factoIdRmq3.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAa3E,eAAO,MAAM,WAAW,EAAE,QAUzB,CAAC;AAEF,wBAAgB,qBAAqB,IAAI,QAAQ,CAqEhD"}
|
|
@@ -6,7 +6,10 @@ const integer_1 = require("../../../math/numbers/integer/integer");
|
|
|
6
6
|
const affine_1 = require("../../../math/polynomials/affine");
|
|
7
7
|
const discreteSet_1 = require("../../../math/sets/discreteSet");
|
|
8
8
|
const intervals_1 = require("../../../math/sets/intervals/intervals");
|
|
9
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
9
10
|
const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
|
|
11
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
12
|
+
const uuid_1 = require("uuid");
|
|
10
13
|
exports.factoIdRmq3 = {
|
|
11
14
|
id: 'factoIdRmq3',
|
|
12
15
|
connector: '=',
|
|
@@ -24,10 +27,51 @@ function getFactoType1Question() {
|
|
|
24
27
|
const affine2 = new affine_1.Affine(affine.a, -affine.b);
|
|
25
28
|
const statementTree = affine.multiply(affine2).toTree();
|
|
26
29
|
const answerTree = new multiplyNode_1.MultiplyNode(affine.toTree(), affine2.toTree());
|
|
30
|
+
const getPropositions = (n) => {
|
|
31
|
+
const res = [];
|
|
32
|
+
res.push({
|
|
33
|
+
id: (0, uuid_1.v4)() + '',
|
|
34
|
+
statement: answerTree.toTex(),
|
|
35
|
+
isRightAnswer: true,
|
|
36
|
+
});
|
|
37
|
+
res.push({
|
|
38
|
+
id: (0, uuid_1.v4)() + '',
|
|
39
|
+
statement: new multiplyNode_1.MultiplyNode(affine.toTree(), affine.toTree()).toTex(),
|
|
40
|
+
isRightAnswer: false,
|
|
41
|
+
});
|
|
42
|
+
if (n > 2)
|
|
43
|
+
res.push({
|
|
44
|
+
id: (0, uuid_1.v4)() + '',
|
|
45
|
+
statement: new multiplyNode_1.MultiplyNode(affine2.toTree(), affine2.toTree()).toTex(),
|
|
46
|
+
isRightAnswer: false,
|
|
47
|
+
});
|
|
48
|
+
if (n > 3)
|
|
49
|
+
res.push({
|
|
50
|
+
id: (0, uuid_1.v4)() + '',
|
|
51
|
+
statement: new multiplyNode_1.MultiplyNode(affine2.toTree(), new affine_1.Affine(-affine.b, affine.a).toTree()).toTex(),
|
|
52
|
+
isRightAnswer: false,
|
|
53
|
+
});
|
|
54
|
+
for (let i = 0; i < n - 4; i++) {
|
|
55
|
+
let isDuplicate;
|
|
56
|
+
let proposition;
|
|
57
|
+
do {
|
|
58
|
+
const wrongAnswer = new multiplyNode_1.MultiplyNode(new affine_1.Affine((0, randint_1.randint)(-9, 10, [0]), (0, randint_1.randint)(-9, 10, [0])).toTree(), new affine_1.Affine((0, randint_1.randint)(-9, 10, [0]), (0, randint_1.randint)(-9, 10, [0])).toTree());
|
|
59
|
+
proposition = {
|
|
60
|
+
id: (0, uuid_1.v4)() + '',
|
|
61
|
+
statement: wrongAnswer.toTex(),
|
|
62
|
+
isRightAnswer: false,
|
|
63
|
+
};
|
|
64
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
65
|
+
} while (isDuplicate);
|
|
66
|
+
res.push(proposition);
|
|
67
|
+
}
|
|
68
|
+
return (0, shuffle_1.shuffle)(res);
|
|
69
|
+
};
|
|
27
70
|
const question = {
|
|
28
71
|
startStatement: statementTree.toTex(),
|
|
29
72
|
answer: answerTree.toTex(),
|
|
30
73
|
keys: ['x'],
|
|
74
|
+
getPropositions,
|
|
31
75
|
};
|
|
32
76
|
return question;
|
|
33
77
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factoType1Exercise.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/factorisation/factoType1Exercise.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"factoType1Exercise.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/factorisation/factoType1Exercise.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAU3E,eAAO,MAAM,kBAAkB,EAAE,QAUhC,CAAC;AAEF,wBAAgB,qBAAqB,IAAI,QAAQ,CA6FhD"}
|
|
@@ -11,6 +11,7 @@ const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
|
|
|
11
11
|
const substractNode_1 = require("../../../tree/nodes/operators/substractNode");
|
|
12
12
|
const random_1 = require("../../../utils/random");
|
|
13
13
|
const shuffle_1 = require("../../../utils/shuffle");
|
|
14
|
+
const uuid_1 = require("uuid");
|
|
14
15
|
exports.factoType1Exercise = {
|
|
15
16
|
id: 'facto1',
|
|
16
17
|
connector: '=',
|
|
@@ -30,10 +31,51 @@ function getFactoType1Question() {
|
|
|
30
31
|
? new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(permut[0][0].toTree(), permut[0][1].toTree()), new multiplyNode_1.MultiplyNode(permut[1][0].toTree(), permut[1][1].toTree()))
|
|
31
32
|
: new substractNode_1.SubstractNode(new multiplyNode_1.MultiplyNode(permut[0][0].toTree(), permut[0][1].toTree()), new multiplyNode_1.MultiplyNode(permut[1][0].toTree(), permut[1][1].toTree()));
|
|
32
33
|
const answerTree = new multiplyNode_1.MultiplyNode(affines[0].toTree(), affines[1].add(operation === 'add' ? affines[2] : affines[2].opposite()).toTree());
|
|
34
|
+
const getPropositions = (n) => {
|
|
35
|
+
const res = [];
|
|
36
|
+
res.push({
|
|
37
|
+
id: (0, uuid_1.v4)() + '',
|
|
38
|
+
statement: answerTree.toTex(),
|
|
39
|
+
isRightAnswer: true,
|
|
40
|
+
});
|
|
41
|
+
res.push({
|
|
42
|
+
id: (0, uuid_1.v4)() + '',
|
|
43
|
+
statement: new multiplyNode_1.MultiplyNode(affines[0].toTree(), affines[1].add(operation !== 'add' ? affines[2] : affines[2].opposite()).toTree()).toTex(),
|
|
44
|
+
isRightAnswer: false,
|
|
45
|
+
});
|
|
46
|
+
if (n > 2)
|
|
47
|
+
res.push({
|
|
48
|
+
id: (0, uuid_1.v4)() + '',
|
|
49
|
+
statement: new multiplyNode_1.MultiplyNode(affines[1].toTree(), affines[0].add(operation === 'add' ? affines[2] : affines[2].opposite()).toTree()).toTex(),
|
|
50
|
+
isRightAnswer: false,
|
|
51
|
+
});
|
|
52
|
+
if (n > 3)
|
|
53
|
+
res.push({
|
|
54
|
+
id: (0, uuid_1.v4)() + '',
|
|
55
|
+
statement: new multiplyNode_1.MultiplyNode(affines[2].toTree(), affines[0].add(operation === 'add' ? affines[2] : affines[2].opposite()).toTree()).toTex(),
|
|
56
|
+
isRightAnswer: false,
|
|
57
|
+
});
|
|
58
|
+
for (let i = 0; i < n - 4; i++) {
|
|
59
|
+
let isDuplicate;
|
|
60
|
+
let proposition;
|
|
61
|
+
do {
|
|
62
|
+
const wrongAnswer = new multiplyNode_1.MultiplyNode(affines[0].toTree(), affines[1].add(affine_1.AffineConstructor.differentRandoms(1)[0]).toTree());
|
|
63
|
+
proposition = {
|
|
64
|
+
id: (0, uuid_1.v4)() + '',
|
|
65
|
+
statement: wrongAnswer.toTex(),
|
|
66
|
+
isRightAnswer: false,
|
|
67
|
+
};
|
|
68
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
69
|
+
} while (isDuplicate);
|
|
70
|
+
res.push(proposition);
|
|
71
|
+
}
|
|
72
|
+
return (0, shuffle_1.shuffle)(res);
|
|
73
|
+
};
|
|
33
74
|
const question = {
|
|
34
75
|
startStatement: statementTree.toTex(),
|
|
35
76
|
answer: answerTree.toTex(),
|
|
36
77
|
keys: ['x'],
|
|
78
|
+
getPropositions,
|
|
37
79
|
};
|
|
38
80
|
return question;
|
|
39
81
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evaluateExpression.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/simplifying/evaluateExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAQ3E,eAAO,MAAM,kBAAkB,EAAE,QAUhC,CAAC;AAEF,wBAAgB,qBAAqB,IAAI,QAAQ,CAiDhD"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getEvaluateExpression = exports.evaluateExpression = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const polynomial_1 = require("../../../math/polynomials/polynomial");
|
|
6
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
|
+
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
8
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
9
|
+
const uuid_1 = require("uuid");
|
|
10
|
+
exports.evaluateExpression = {
|
|
11
|
+
id: 'evaluateExpression',
|
|
12
|
+
connector: '=',
|
|
13
|
+
instruction: '',
|
|
14
|
+
label: 'Evaluer une expression',
|
|
15
|
+
levels: ['4', '3', '2'],
|
|
16
|
+
section: 'Calcul littéral',
|
|
17
|
+
isSingleStep: true,
|
|
18
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getEvaluateExpression, nb),
|
|
19
|
+
keys: ['x'],
|
|
20
|
+
};
|
|
21
|
+
function getEvaluateExpression() {
|
|
22
|
+
const rand = (0, coinFlip_1.coinFlip)();
|
|
23
|
+
const polynome1 = new polynomial_1.Polynomial([(0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-5, 6, [0])]);
|
|
24
|
+
const polynome2 = new polynomial_1.Polynomial([(0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-4, 5, [0])]);
|
|
25
|
+
const xValue = (0, randint_1.randint)(-9, 10);
|
|
26
|
+
const statement = rand
|
|
27
|
+
? `Calculer $${polynome1.toTree().toTex()}$ pour $x = ${xValue}$`
|
|
28
|
+
: `Calculer $${polynome2.toTree().toTex()}$ pour $x = ${xValue}$`;
|
|
29
|
+
const answer = rand ? polynome1.calculate(xValue) : polynome2.calculate(xValue);
|
|
30
|
+
const getPropositions = (n) => {
|
|
31
|
+
const res = [];
|
|
32
|
+
res.push({
|
|
33
|
+
id: (0, uuid_1.v4)() + '',
|
|
34
|
+
statement: answer + '',
|
|
35
|
+
isRightAnswer: true,
|
|
36
|
+
});
|
|
37
|
+
for (let i = 0; i < n - 1; i++) {
|
|
38
|
+
let isDuplicate;
|
|
39
|
+
let proposition;
|
|
40
|
+
do {
|
|
41
|
+
const wrongAnswer = answer + (0, randint_1.randint)(-10, 11, [0]);
|
|
42
|
+
proposition = {
|
|
43
|
+
id: (0, uuid_1.v4)() + '',
|
|
44
|
+
statement: wrongAnswer + '',
|
|
45
|
+
isRightAnswer: false,
|
|
46
|
+
};
|
|
47
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
48
|
+
} while (isDuplicate);
|
|
49
|
+
res.push(proposition);
|
|
50
|
+
}
|
|
51
|
+
return (0, shuffle_1.shuffle)(res);
|
|
52
|
+
};
|
|
53
|
+
const question = {
|
|
54
|
+
instruction: statement,
|
|
55
|
+
answer: answer + '',
|
|
56
|
+
keys: ['x'],
|
|
57
|
+
getPropositions,
|
|
58
|
+
};
|
|
59
|
+
return question;
|
|
60
|
+
}
|
|
61
|
+
exports.getEvaluateExpression = getEvaluateExpression;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reduceExpression.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/simplifying/reduceExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAQ3E,eAAO,MAAM,gBAAgB,EAAE,QAU9B,CAAC;AAEF,wBAAgB,mBAAmB,IAAI,QAAQ,CAgI9C"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getReduceExpression = exports.reduceExpression = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const polynomial_1 = require("../../../math/polynomials/polynomial");
|
|
6
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
|
+
const addNode_1 = require("../../../tree/nodes/operators/addNode");
|
|
8
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
9
|
+
const uuid_1 = require("uuid");
|
|
10
|
+
exports.reduceExpression = {
|
|
11
|
+
id: 'reduceExpression',
|
|
12
|
+
connector: '=',
|
|
13
|
+
instruction: "Réduire l'expression suivante :",
|
|
14
|
+
isSingleStep: false,
|
|
15
|
+
label: 'Réduire une expression',
|
|
16
|
+
levels: ['4', '3', '2'],
|
|
17
|
+
section: 'Calcul littéral',
|
|
18
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getReduceExpression, nb),
|
|
19
|
+
keys: ['x'],
|
|
20
|
+
};
|
|
21
|
+
function getReduceExpression() {
|
|
22
|
+
const rand = (0, randint_1.randint)(0, 7);
|
|
23
|
+
let statement;
|
|
24
|
+
let polynome1;
|
|
25
|
+
let polynome2;
|
|
26
|
+
let answer;
|
|
27
|
+
switch (rand) {
|
|
28
|
+
case 0: // ax + b + cx + d
|
|
29
|
+
polynome1 = new polynomial_1.Polynomial([(0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-9, 10, [0])]);
|
|
30
|
+
polynome2 = new polynomial_1.Polynomial([(0, randint_1.randint)(-5, 6), (0, randint_1.randint)(-5, 6, [0])]);
|
|
31
|
+
statement = new addNode_1.AddNode(polynome1.toTree(), polynome2.toTree());
|
|
32
|
+
statement.shuffle();
|
|
33
|
+
answer = polynome1.add(polynome2).toTree().toTex();
|
|
34
|
+
break;
|
|
35
|
+
case 1:
|
|
36
|
+
polynome1 = new polynomial_1.Polynomial([(0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-9, 10, [0])]);
|
|
37
|
+
polynome2 = new polynomial_1.Polynomial([0, (0, randint_1.randint)(-5, 6, [0])]);
|
|
38
|
+
statement = new addNode_1.AddNode(polynome1.toTree(), polynome2.toTree());
|
|
39
|
+
statement.shuffle();
|
|
40
|
+
answer = polynome1.add(polynome2).toTree().toTex();
|
|
41
|
+
break;
|
|
42
|
+
case 2:
|
|
43
|
+
polynome1 = new polynomial_1.Polynomial([(0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-9, 10, [0])]);
|
|
44
|
+
polynome2 = new polynomial_1.Polynomial([(0, randint_1.randint)(-5, 6, [0])]);
|
|
45
|
+
statement = new addNode_1.AddNode(polynome1.toTree(), polynome2.toTree());
|
|
46
|
+
statement.shuffle();
|
|
47
|
+
answer = polynome1.add(polynome2).toTree().toTex();
|
|
48
|
+
break;
|
|
49
|
+
case 3:
|
|
50
|
+
polynome1 = new polynomial_1.Polynomial([(0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-9, 10, [0])]);
|
|
51
|
+
polynome2 = new polynomial_1.Polynomial([0, (0, randint_1.randint)(-5, 6), (0, randint_1.randint)(-5, 6, [0])]);
|
|
52
|
+
statement = new addNode_1.AddNode(polynome1.toTree(), polynome2.toTree());
|
|
53
|
+
statement.shuffle();
|
|
54
|
+
answer = polynome1.add(polynome2).toTree().toTex();
|
|
55
|
+
break;
|
|
56
|
+
case 4:
|
|
57
|
+
polynome1 = new polynomial_1.Polynomial([(0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-9, 10, [0])]);
|
|
58
|
+
polynome2 = new polynomial_1.Polynomial([0, 0, (0, randint_1.randint)(-5, 6, [0])]);
|
|
59
|
+
statement = new addNode_1.AddNode(polynome1.toTree(), polynome2.toTree());
|
|
60
|
+
statement.shuffle();
|
|
61
|
+
answer = polynome1.add(polynome2).toTree().toTex();
|
|
62
|
+
break;
|
|
63
|
+
case 5:
|
|
64
|
+
polynome1 = new polynomial_1.Polynomial([(0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-9, 10, [0])]);
|
|
65
|
+
polynome2 = new polynomial_1.Polynomial([0, (0, randint_1.randint)(-5, 6, [0])]);
|
|
66
|
+
statement = new addNode_1.AddNode(polynome1.toTree(), polynome2.toTree());
|
|
67
|
+
statement.shuffle();
|
|
68
|
+
answer = polynome1.add(polynome2).toTree().toTex();
|
|
69
|
+
break;
|
|
70
|
+
case 6:
|
|
71
|
+
polynome1 = new polynomial_1.Polynomial([(0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-9, 10, [0])]);
|
|
72
|
+
polynome2 = new polynomial_1.Polynomial([(0, randint_1.randint)(-5, 6, [0])]);
|
|
73
|
+
statement = new addNode_1.AddNode(polynome1.toTree(), polynome2.toTree());
|
|
74
|
+
statement.shuffle();
|
|
75
|
+
answer = polynome1.add(polynome2).toTree().toTex();
|
|
76
|
+
break;
|
|
77
|
+
default:
|
|
78
|
+
polynome1 = new polynomial_1.Polynomial([(0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-9, 10, [0])]);
|
|
79
|
+
polynome2 = new polynomial_1.Polynomial([(0, randint_1.randint)(-5, 6, [0])]);
|
|
80
|
+
statement = new addNode_1.AddNode(new polynomial_1.Polynomial([1, 2]).toTree(), new polynomial_1.Polynomial([3, 4]).toTree());
|
|
81
|
+
statement.shuffle();
|
|
82
|
+
answer = polynome1.add(polynome2).toTree().toTex();
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
const getPropositions = (n) => {
|
|
86
|
+
const res = [];
|
|
87
|
+
res.push({
|
|
88
|
+
id: (0, uuid_1.v4)() + '',
|
|
89
|
+
statement: answer,
|
|
90
|
+
isRightAnswer: true,
|
|
91
|
+
});
|
|
92
|
+
for (let i = 0; i < n - 1; i++) {
|
|
93
|
+
let isDuplicate;
|
|
94
|
+
let proposition;
|
|
95
|
+
do {
|
|
96
|
+
polynome2 = new polynomial_1.Polynomial(rand < 3
|
|
97
|
+
? [(0, randint_1.randint)(-5, 6, [0]), (0, randint_1.randint)(-5, 6, [0])]
|
|
98
|
+
: [(0, randint_1.randint)(-5, 6, [0]), (0, randint_1.randint)(-5, 6, [0]), (0, randint_1.randint)(-5, 6, [0])]);
|
|
99
|
+
proposition = {
|
|
100
|
+
id: (0, uuid_1.v4)() + '',
|
|
101
|
+
statement: polynome1.add(polynome2).toTree().toTex(),
|
|
102
|
+
isRightAnswer: false,
|
|
103
|
+
};
|
|
104
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
105
|
+
} while (isDuplicate);
|
|
106
|
+
res.push(proposition);
|
|
107
|
+
}
|
|
108
|
+
return (0, shuffle_1.shuffle)(res);
|
|
109
|
+
};
|
|
110
|
+
const question = {
|
|
111
|
+
startStatement: statement.toTex(),
|
|
112
|
+
answer,
|
|
113
|
+
keys: ['x'],
|
|
114
|
+
getPropositions,
|
|
115
|
+
};
|
|
116
|
+
return question;
|
|
117
|
+
}
|
|
118
|
+
exports.getReduceExpression = getReduceExpression;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aeraConversion.d.ts","sourceRoot":"","sources":["../../../src/exercises/conversion/aeraConversion.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"aeraConversion.d.ts","sourceRoot":"","sources":["../../../src/exercises/conversion/aeraConversion.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,aAAa,CAAC;AAI9D,eAAO,MAAM,cAAc,EAAE,QAU5B,CAAC;AAEF,wBAAgB,iBAAiB,IAAI,QAAQ,CAoD5C"}
|