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
|
@@ -9,7 +9,9 @@ const randint_1 = require("../../math/utils/random/randint");
|
|
|
9
9
|
const numberNode_1 = require("../../tree/nodes/numbers/numberNode");
|
|
10
10
|
const multiplyNode_1 = require("../../tree/nodes/operators/multiplyNode");
|
|
11
11
|
const powerNode_1 = require("../../tree/nodes/operators/powerNode");
|
|
12
|
+
const shuffle_1 = require("../../utils/shuffle");
|
|
12
13
|
const getDistinctQuestions_1 = require("../utils/getDistinctQuestions");
|
|
14
|
+
const uuid_1 = require("uuid");
|
|
13
15
|
exports.powersOfTenProduct = {
|
|
14
16
|
id: 'powersOfTenProduct',
|
|
15
17
|
connector: '=',
|
|
@@ -32,14 +34,40 @@ exports.powersProduct = {
|
|
|
32
34
|
keys: [],
|
|
33
35
|
};
|
|
34
36
|
function getPowersProductQuestion(useOnlyPowersOfTen = false) {
|
|
35
|
-
const a = useOnlyPowersOfTen ? 10 : (0, randint_1.randint)(-11, 11);
|
|
37
|
+
const a = useOnlyPowersOfTen ? 10 : (0, randint_1.randint)(-11, 11, [0]);
|
|
36
38
|
const [b, c] = [1, 2].map((el) => (0, randint_1.randint)(-11, 11));
|
|
37
39
|
const statement = new multiplyNode_1.MultiplyNode(new powerNode_1.PowerNode(new numberNode_1.NumberNode(a), new numberNode_1.NumberNode(b)), new powerNode_1.PowerNode(new numberNode_1.NumberNode(a), new numberNode_1.NumberNode(c)));
|
|
38
40
|
const answerTree = new power_1.Power(a, b + c).simplify();
|
|
41
|
+
const getPropositions = (n) => {
|
|
42
|
+
const res = [];
|
|
43
|
+
res.push({
|
|
44
|
+
id: (0, uuid_1.v4)() + '',
|
|
45
|
+
statement: answerTree.toTex(),
|
|
46
|
+
isRightAnswer: true,
|
|
47
|
+
});
|
|
48
|
+
for (let i = 0; i < n - 1; i++) {
|
|
49
|
+
let isDuplicate;
|
|
50
|
+
let proposition;
|
|
51
|
+
do {
|
|
52
|
+
const wrongExponent = b + c + (0, randint_1.randint)(-11, 11, [0, -b - c]);
|
|
53
|
+
const wrongAnswerTree = new power_1.Power(a === 1 || a === -1 ? (0, randint_1.randint)(-3, 4, [-1, 1]) : a, wrongExponent).simplify();
|
|
54
|
+
const wrongAnswer = wrongAnswerTree.toTex();
|
|
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
|
+
};
|
|
39
66
|
const question = {
|
|
40
67
|
startStatement: statement.toTex(),
|
|
41
68
|
answer: answerTree.toTex(),
|
|
42
69
|
keys: [],
|
|
70
|
+
getPropositions,
|
|
43
71
|
};
|
|
44
72
|
return question;
|
|
45
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scientificToDecimal.d.ts","sourceRoot":"","sources":["../../../src/exercises/powers/scientificToDecimal.ts"],"names":[],"mappings":"AAAA;;MAEM;
|
|
1
|
+
{"version":3,"file":"scientificToDecimal.d.ts","sourceRoot":"","sources":["../../../src/exercises/powers/scientificToDecimal.ts"],"names":[],"mappings":"AAAA;;MAEM;AASN,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,aAAa,CAAC;AAI9D,eAAO,MAAM,mBAAmB,EAAE,QAWjC,CAAC;AAEF,wBAAgB,8BAA8B,IAAI,QAAQ,CAkDzD"}
|
|
@@ -10,7 +10,9 @@ const randint_1 = require("../../math/utils/random/randint");
|
|
|
10
10
|
const numberNode_1 = require("../../tree/nodes/numbers/numberNode");
|
|
11
11
|
const multiplyNode_1 = require("../../tree/nodes/operators/multiplyNode");
|
|
12
12
|
const powerNode_1 = require("../../tree/nodes/operators/powerNode");
|
|
13
|
+
const shuffle_1 = require("../../utils/shuffle");
|
|
13
14
|
const getDistinctQuestions_1 = require("../utils/getDistinctQuestions");
|
|
15
|
+
const uuid_1 = require("uuid");
|
|
14
16
|
exports.scientificToDecimal = {
|
|
15
17
|
id: 'scientificToDecimal',
|
|
16
18
|
connector: '=',
|
|
@@ -29,10 +31,35 @@ function getScientificToDecimalQuestion() {
|
|
|
29
31
|
const randDecimal = decimal_1.DecimalConstructor.fromParts(int + '', fracPart);
|
|
30
32
|
const statement = new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(randDecimal.value), new powerNode_1.PowerNode(new numberNode_1.NumberNode(10), new numberNode_1.NumberNode(randPower)));
|
|
31
33
|
const answerTree = randDecimal.multiplyByPowerOfTen(randPower).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
|
+
for (let i = 0; i < n - 1; i++) {
|
|
42
|
+
let isDuplicate;
|
|
43
|
+
let proposition;
|
|
44
|
+
do {
|
|
45
|
+
const wrongAnswerTree = randDecimal.multiplyByPowerOfTen((0, randint_1.randint)(-6, 8, [randPower])).toTree();
|
|
46
|
+
const wrongAnswer = wrongAnswerTree.toTex();
|
|
47
|
+
proposition = {
|
|
48
|
+
id: (0, uuid_1.v4)() + '',
|
|
49
|
+
statement: wrongAnswer,
|
|
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
|
+
};
|
|
32
58
|
const question = {
|
|
33
59
|
startStatement: statement.toTex(),
|
|
34
60
|
answer: answerTree.toTex(),
|
|
35
61
|
keys: [],
|
|
62
|
+
getPropositions,
|
|
36
63
|
};
|
|
37
64
|
return question;
|
|
38
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conditionalProbability.d.ts","sourceRoot":"","sources":["../../../src/exercises/proba/conditionalProbability.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"conditionalProbability.d.ts","sourceRoot":"","sources":["../../../src/exercises/proba/conditionalProbability.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,aAAa,CAAC;AAM9D,eAAO,MAAM,sBAAsB,EAAE,QAUpC,CAAC;AAEF,wBAAgB,yBAAyB,IAAI,QAAQ,CA4GpD"}
|
|
@@ -4,6 +4,8 @@ exports.getConditionalProbability = exports.conditionalProbability = void 0;
|
|
|
4
4
|
const randint_1 = require("../../math/utils/random/randint");
|
|
5
5
|
const getDistinctQuestions_1 = require("../utils/getDistinctQuestions");
|
|
6
6
|
const round_1 = require("../../math/utils/round");
|
|
7
|
+
const shuffle_1 = require("../../utils/shuffle");
|
|
8
|
+
const uuid_1 = require("uuid");
|
|
7
9
|
exports.conditionalProbability = {
|
|
8
10
|
id: 'conditionalProbability',
|
|
9
11
|
connector: '=',
|
|
@@ -63,11 +65,34 @@ function getConditionalProbability() {
|
|
|
63
65
|
break;
|
|
64
66
|
}
|
|
65
67
|
}
|
|
68
|
+
const getPropositions = (n) => {
|
|
69
|
+
const res = [];
|
|
70
|
+
res.push({
|
|
71
|
+
id: (0, uuid_1.v4)() + '',
|
|
72
|
+
statement: answer,
|
|
73
|
+
isRightAnswer: true,
|
|
74
|
+
});
|
|
75
|
+
for (let i = 0; i < n - 1; i++) {
|
|
76
|
+
let isDuplicate;
|
|
77
|
+
let proposition;
|
|
78
|
+
do {
|
|
79
|
+
proposition = {
|
|
80
|
+
id: (0, uuid_1.v4)() + '',
|
|
81
|
+
statement: Math.floor(Math.random() * 100) / 100 + '',
|
|
82
|
+
isRightAnswer: false,
|
|
83
|
+
};
|
|
84
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
85
|
+
} while (isDuplicate);
|
|
86
|
+
res.push(proposition);
|
|
87
|
+
}
|
|
88
|
+
return (0, shuffle_1.shuffle)(res);
|
|
89
|
+
};
|
|
66
90
|
const question = {
|
|
67
91
|
instruction,
|
|
68
92
|
startStatement,
|
|
69
93
|
answer,
|
|
70
94
|
keys: ['p', 'cap', 'underscore'],
|
|
95
|
+
getPropositions,
|
|
71
96
|
};
|
|
72
97
|
return question;
|
|
73
98
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marginalAndConditionalFrequency.d.ts","sourceRoot":"","sources":["../../../src/exercises/proba/marginalAndConditionalFrequency.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"marginalAndConditionalFrequency.d.ts","sourceRoot":"","sources":["../../../src/exercises/proba/marginalAndConditionalFrequency.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,aAAa,CAAC;AAI9D,eAAO,MAAM,+BAA+B,EAAE,QAU7C,CAAC;AAEF,wBAAgB,kCAAkC,IAAI,QAAQ,CAiG7D"}
|
|
@@ -4,7 +4,9 @@ exports.getMarginalAndConditionalFrequency = exports.marginalAndConditionalFrequ
|
|
|
4
4
|
const randint_1 = require("../../math/utils/random/randint");
|
|
5
5
|
const numberNode_1 = require("../../tree/nodes/numbers/numberNode");
|
|
6
6
|
const simplify_1 = require("../../tree/parsers/simplify");
|
|
7
|
+
const shuffle_1 = require("../../utils/shuffle");
|
|
7
8
|
const getDistinctQuestions_1 = require("../utils/getDistinctQuestions");
|
|
9
|
+
const uuid_1 = require("uuid");
|
|
8
10
|
exports.marginalAndConditionalFrequency = {
|
|
9
11
|
id: 'marginalAndConditionalFrequency',
|
|
10
12
|
connector: '=',
|
|
@@ -63,6 +65,28 @@ function getMarginalAndConditionalFrequency() {
|
|
|
63
65
|
x4 / (x2 + x4),
|
|
64
66
|
];
|
|
65
67
|
const calculsNodes = Calculs.map((el) => (0, simplify_1.simplifyNode)(new numberNode_1.NumberNode(el)));
|
|
68
|
+
const getPropositions = (n) => {
|
|
69
|
+
const res = [];
|
|
70
|
+
res.push({
|
|
71
|
+
id: (0, uuid_1.v4)() + '',
|
|
72
|
+
statement: calculsNodes[rand].toTex(),
|
|
73
|
+
isRightAnswer: true,
|
|
74
|
+
});
|
|
75
|
+
for (let i = 0; i < n - 1; i++) {
|
|
76
|
+
let isDuplicate;
|
|
77
|
+
let proposition;
|
|
78
|
+
do {
|
|
79
|
+
proposition = {
|
|
80
|
+
id: (0, uuid_1.v4)() + '',
|
|
81
|
+
statement: calculsNodes[(0, randint_1.randint)(0, 12, [rand])].toTex(),
|
|
82
|
+
isRightAnswer: false,
|
|
83
|
+
};
|
|
84
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
85
|
+
} while (isDuplicate);
|
|
86
|
+
res.push(proposition);
|
|
87
|
+
}
|
|
88
|
+
return (0, shuffle_1.shuffle)(res);
|
|
89
|
+
};
|
|
66
90
|
const question = {
|
|
67
91
|
instruction: `On considère le tableau d'effectifs suivant :
|
|
68
92
|
|
|
@@ -75,6 +99,7 @@ Calculer la fréquence ${freqString[rand]}.`,
|
|
|
75
99
|
startStatement: `${frequences[rand]}`,
|
|
76
100
|
answer: calculsNodes[rand].toTex(),
|
|
77
101
|
keys: ['f', 'cap', 'underscore'],
|
|
102
|
+
getPropositions,
|
|
78
103
|
};
|
|
79
104
|
return question;
|
|
80
105
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"probabilityTree.d.ts","sourceRoot":"","sources":["../../../src/exercises/proba/probabilityTree.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"probabilityTree.d.ts","sourceRoot":"","sources":["../../../src/exercises/proba/probabilityTree.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,aAAa,CAAC;AAI9D,eAAO,MAAM,eAAe,EAAE,QAS7B,CAAC;AAOF,wBAAgB,kBAAkB,IAAI,QAAQ,CAwH7C"}
|
|
@@ -5,7 +5,9 @@ const randint_1 = require("../../math/utils/random/randint");
|
|
|
5
5
|
const numberNode_1 = require("../../tree/nodes/numbers/numberNode");
|
|
6
6
|
const multiplyNode_1 = require("../../tree/nodes/operators/multiplyNode");
|
|
7
7
|
const simplify_1 = require("../../tree/parsers/simplify");
|
|
8
|
+
const shuffle_1 = require("../../utils/shuffle");
|
|
8
9
|
const getDistinctQuestions_1 = require("../utils/getDistinctQuestions");
|
|
10
|
+
const uuid_1 = require("uuid");
|
|
9
11
|
exports.probabilityTree = {
|
|
10
12
|
id: 'probabilityTree',
|
|
11
13
|
connector: '=',
|
|
@@ -36,33 +38,35 @@ function getProbabilityTree() {
|
|
|
36
38
|
const pB_D = (0, simplify_1.simplifyNode)(new numberNode_1.NumberNode(BD / (BC + BD)));
|
|
37
39
|
let instruction = `En utilisant l'arbre de probabilité suivant, `;
|
|
38
40
|
let startStatement = '';
|
|
39
|
-
let answer
|
|
41
|
+
let answer;
|
|
40
42
|
const rand = (0, randint_1.randint)(1, 5);
|
|
41
43
|
switch (rand) {
|
|
42
44
|
case 1: {
|
|
43
45
|
instruction += `$\\\\$ Calculer $P(A \\cap C)$`;
|
|
44
46
|
startStatement = `P(A \\cap C)`;
|
|
45
|
-
answer = (0, simplify_1.simplifyNode)(new multiplyNode_1.MultiplyNode(pA, pA_C))
|
|
47
|
+
answer = (0, simplify_1.simplifyNode)(new multiplyNode_1.MultiplyNode(pA, pA_C));
|
|
46
48
|
break;
|
|
47
49
|
}
|
|
48
50
|
case 2: {
|
|
49
51
|
instruction += `$\\\\$ Calculer $P(A \\cap D)$`;
|
|
50
52
|
startStatement = `P(A \\cap D)`;
|
|
51
|
-
answer = (0, simplify_1.simplifyNode)(new multiplyNode_1.MultiplyNode(pA, pA_D))
|
|
53
|
+
answer = (0, simplify_1.simplifyNode)(new multiplyNode_1.MultiplyNode(pA, pA_D));
|
|
52
54
|
break;
|
|
53
55
|
}
|
|
54
56
|
case 3: {
|
|
55
57
|
instruction += `$\\\\$ Calculer $P(B \\cap C)$`;
|
|
56
58
|
startStatement = `P(B \\cap C)`;
|
|
57
|
-
answer = (0, simplify_1.simplifyNode)(new multiplyNode_1.MultiplyNode(pB, pB_C))
|
|
59
|
+
answer = (0, simplify_1.simplifyNode)(new multiplyNode_1.MultiplyNode(pB, pB_C));
|
|
58
60
|
break;
|
|
59
61
|
}
|
|
60
62
|
case 4: {
|
|
61
63
|
instruction += `$\\\\$ Calculer $P(B \\cap D)$`;
|
|
62
64
|
startStatement = `P(B \\cap D)`;
|
|
63
|
-
answer = (0, simplify_1.simplifyNode)(new multiplyNode_1.MultiplyNode(pB, pB_D))
|
|
65
|
+
answer = (0, simplify_1.simplifyNode)(new multiplyNode_1.MultiplyNode(pB, pB_D));
|
|
64
66
|
break;
|
|
65
67
|
}
|
|
68
|
+
default:
|
|
69
|
+
answer = (0, simplify_1.simplifyNode)(new multiplyNode_1.MultiplyNode(pB, pB_D)); // juste pour éviter l'erreur
|
|
66
70
|
}
|
|
67
71
|
let commands = [
|
|
68
72
|
'A = Point({2,2})',
|
|
@@ -92,13 +96,36 @@ function getProbabilityTree() {
|
|
|
92
96
|
'Text("C", (5.5 , -1.1))',
|
|
93
97
|
'Text("D", (5.5 , -3.1))',
|
|
94
98
|
];
|
|
99
|
+
const getPropositions = (n) => {
|
|
100
|
+
const res = [];
|
|
101
|
+
res.push({
|
|
102
|
+
id: (0, uuid_1.v4)() + '',
|
|
103
|
+
statement: answer.toTex(),
|
|
104
|
+
isRightAnswer: true,
|
|
105
|
+
});
|
|
106
|
+
for (let i = 0; i < n - 1; i++) {
|
|
107
|
+
let isDuplicate;
|
|
108
|
+
let proposition;
|
|
109
|
+
do {
|
|
110
|
+
proposition = {
|
|
111
|
+
id: (0, uuid_1.v4)() + '',
|
|
112
|
+
statement: (0, simplify_1.simplifyNode)(new multiplyNode_1.MultiplyNode(answer, new numberNode_1.NumberNode((0, randint_1.randint)(2, 11)))).toTex(),
|
|
113
|
+
isRightAnswer: false,
|
|
114
|
+
};
|
|
115
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
116
|
+
} while (isDuplicate);
|
|
117
|
+
res.push(proposition);
|
|
118
|
+
}
|
|
119
|
+
return (0, shuffle_1.shuffle)(res);
|
|
120
|
+
};
|
|
95
121
|
const question = {
|
|
96
122
|
instruction,
|
|
97
123
|
startStatement,
|
|
98
|
-
answer,
|
|
124
|
+
answer: answer.toTex(),
|
|
99
125
|
keys: [],
|
|
100
126
|
commands,
|
|
101
127
|
coords: [-2, 8, -5, 5],
|
|
128
|
+
getPropositions,
|
|
102
129
|
};
|
|
103
130
|
return question;
|
|
104
131
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arithmeticExplicitFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/arithmetic/arithmeticExplicitFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"arithmeticExplicitFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/arithmetic/arithmeticExplicitFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAO3E,eAAO,MAAM,8BAA8B,EAAE,QAU5C,CAAC;AAEF,wBAAgB,iCAAiC,IAAI,QAAQ,CA6C5D"}
|
|
@@ -4,6 +4,8 @@ exports.getArithmeticExplicitFormulaUsage = exports.arithmeticExplicitFormulaUsa
|
|
|
4
4
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
5
|
const polynomial_1 = require("../../../math/polynomials/polynomial");
|
|
6
6
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
8
|
+
const uuid_1 = require("uuid");
|
|
7
9
|
exports.arithmeticExplicitFormulaUsage = {
|
|
8
10
|
id: 'arithmeticExplicitFormulaUsage',
|
|
9
11
|
connector: '=',
|
|
@@ -20,11 +22,34 @@ function getArithmeticExplicitFormulaUsage() {
|
|
|
20
22
|
const firstValue = (0, randint_1.randint)(-10, 10);
|
|
21
23
|
const reason = (0, randint_1.randint)(-10, 10, [0]);
|
|
22
24
|
const polynomial = new polynomial_1.Polynomial([firstValue, reason], 'n');
|
|
25
|
+
const getPropositions = (n) => {
|
|
26
|
+
const res = [];
|
|
27
|
+
res.push({
|
|
28
|
+
id: (0, uuid_1.v4)() + '',
|
|
29
|
+
statement: (firstValue + askedRank * reason).toString(),
|
|
30
|
+
isRightAnswer: true,
|
|
31
|
+
});
|
|
32
|
+
for (let i = 0; i < n - 1; i++) {
|
|
33
|
+
let isDuplicate;
|
|
34
|
+
let proposition;
|
|
35
|
+
do {
|
|
36
|
+
proposition = {
|
|
37
|
+
id: (0, uuid_1.v4)() + '',
|
|
38
|
+
statement: ((0, randint_1.randint)(-5, 6, [firstValue]) + askedRank * reason).toString(),
|
|
39
|
+
isRightAnswer: false,
|
|
40
|
+
};
|
|
41
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
42
|
+
} while (isDuplicate);
|
|
43
|
+
res.push(proposition);
|
|
44
|
+
}
|
|
45
|
+
return (0, shuffle_1.shuffle)(res);
|
|
46
|
+
};
|
|
23
47
|
const question = {
|
|
24
48
|
instruction: `$(u_n)$ est une suite arithmétique définie par $u_n = ${polynomial.toString()}$. Calculer :`,
|
|
25
49
|
startStatement: `u_{${askedRank}}`,
|
|
26
50
|
answer: (firstValue + askedRank * reason).toString(),
|
|
27
51
|
keys: ['r', 'n', 'u', 'underscore'],
|
|
52
|
+
getPropositions,
|
|
28
53
|
};
|
|
29
54
|
return question;
|
|
30
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arithmeticFindExplicitFormula.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/arithmetic/arithmeticFindExplicitFormula.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"arithmeticFindExplicitFormula.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/arithmetic/arithmeticFindExplicitFormula.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAO3E,eAAO,MAAM,6BAA6B,EAAE,QAU3C,CAAC;AAEF,wBAAgB,gCAAgC,IAAI,QAAQ,CA6C3D"}
|
|
@@ -4,6 +4,8 @@ exports.getArithmeticFindExplicitFormula = exports.arithmeticFindExplicitFormula
|
|
|
4
4
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
5
|
const polynomial_1 = require("../../../math/polynomials/polynomial");
|
|
6
6
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
8
|
+
const uuid_1 = require("uuid");
|
|
7
9
|
exports.arithmeticFindExplicitFormula = {
|
|
8
10
|
id: 'arithmeticFindExplicitFormula',
|
|
9
11
|
connector: '=',
|
|
@@ -20,11 +22,34 @@ function getArithmeticFindExplicitFormula() {
|
|
|
20
22
|
const firstValue = (0, randint_1.randint)(-10, 10);
|
|
21
23
|
const reason = (0, randint_1.randint)(-10, 10, [0]);
|
|
22
24
|
const formula = new polynomial_1.Polynomial([firstValue, reason], 'n');
|
|
25
|
+
const getPropositions = (n) => {
|
|
26
|
+
const res = [];
|
|
27
|
+
res.push({
|
|
28
|
+
id: (0, uuid_1.v4)() + '',
|
|
29
|
+
statement: formula.toString(),
|
|
30
|
+
isRightAnswer: true,
|
|
31
|
+
});
|
|
32
|
+
for (let i = 0; i < n - 1; i++) {
|
|
33
|
+
let isDuplicate;
|
|
34
|
+
let proposition;
|
|
35
|
+
do {
|
|
36
|
+
proposition = {
|
|
37
|
+
id: (0, uuid_1.v4)() + '',
|
|
38
|
+
statement: new polynomial_1.Polynomial([firstValue + (0, randint_1.randint)(-3, 4), reason + (0, randint_1.randint)(-3, 4)], 'n').toString(),
|
|
39
|
+
isRightAnswer: false,
|
|
40
|
+
};
|
|
41
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
42
|
+
} while (isDuplicate);
|
|
43
|
+
res.push(proposition);
|
|
44
|
+
}
|
|
45
|
+
return (0, shuffle_1.shuffle)(res);
|
|
46
|
+
};
|
|
23
47
|
const question = {
|
|
24
48
|
instruction: `$(u_n)$ est une suite arithmétique de premier terme $u_{${firstRank}} = ${firstValue}$ et de raison $r = ${reason}$. $\\\\$ Donner l'expression de $u_n$ en fonction de $n$.`,
|
|
25
49
|
startStatement: 'u_n',
|
|
26
50
|
answer: formula.toString(),
|
|
27
51
|
keys: ['r', 'n', 'u', 'underscore'],
|
|
52
|
+
getPropositions,
|
|
28
53
|
};
|
|
29
54
|
return question;
|
|
30
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arithmeticFindReason.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/arithmetic/arithmeticFindReason.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"arithmeticFindReason.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/arithmetic/arithmeticFindReason.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAM3E,eAAO,MAAM,oBAAoB,EAAE,QAWlC,CAAC;AAEF,wBAAgB,uBAAuB,IAAI,QAAQ,CA4ClD"}
|
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getArithmeticFindReason = exports.arithmeticFindReason = void 0;
|
|
4
4
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
5
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
6
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
7
|
+
const uuid_1 = require("uuid");
|
|
6
8
|
exports.arithmeticFindReason = {
|
|
7
9
|
id: 'arithmeticFindReason',
|
|
8
10
|
connector: '=',
|
|
@@ -20,11 +22,34 @@ function getArithmeticFindReason() {
|
|
|
20
22
|
const reason = (0, randint_1.randint)(-10, 10, [0]);
|
|
21
23
|
const value1 = (0, randint_1.randint)(-10, 10);
|
|
22
24
|
const value2 = reason + value1;
|
|
25
|
+
const getPropositions = (n) => {
|
|
26
|
+
const res = [];
|
|
27
|
+
res.push({
|
|
28
|
+
id: (0, uuid_1.v4)() + '',
|
|
29
|
+
statement: reason + '',
|
|
30
|
+
isRightAnswer: true,
|
|
31
|
+
});
|
|
32
|
+
for (let i = 0; i < n - 1; i++) {
|
|
33
|
+
let isDuplicate;
|
|
34
|
+
let proposition;
|
|
35
|
+
do {
|
|
36
|
+
proposition = {
|
|
37
|
+
id: (0, uuid_1.v4)() + '',
|
|
38
|
+
statement: reason + (0, randint_1.randint)(-5, 6, [0]) + '',
|
|
39
|
+
isRightAnswer: false,
|
|
40
|
+
};
|
|
41
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
42
|
+
} while (isDuplicate);
|
|
43
|
+
res.push(proposition);
|
|
44
|
+
}
|
|
45
|
+
return (0, shuffle_1.shuffle)(res);
|
|
46
|
+
};
|
|
23
47
|
const question = {
|
|
24
48
|
instruction: `$(u_n)$ est une suite arithmétique. On sait que $u_{${rank1}} = ${value1}$ et $u_{${rank2}} = ${value2}$. Quelle est la raison de la suite $(u_n)$ ?`,
|
|
25
49
|
startStatement: 'r',
|
|
26
50
|
answer: reason.toString(),
|
|
27
51
|
keys: ['r', 'n', 'u', 'underscore'],
|
|
52
|
+
getPropositions,
|
|
28
53
|
};
|
|
29
54
|
return question;
|
|
30
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arithmeticReasonUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/arithmetic/arithmeticReasonUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"arithmeticReasonUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/arithmetic/arithmeticReasonUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAM3E,eAAO,MAAM,qBAAqB,EAAE,QAUnC,CAAC;AAEF,wBAAgB,wBAAwB,IAAI,QAAQ,CA2CnD"}
|
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getArithmeticReasonUsage = exports.arithmeticReasonUsage = void 0;
|
|
4
4
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
5
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
6
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
7
|
+
const uuid_1 = require("uuid");
|
|
6
8
|
exports.arithmeticReasonUsage = {
|
|
7
9
|
id: 'arithmeticReasonUsage',
|
|
8
10
|
connector: '=',
|
|
@@ -19,11 +21,34 @@ function getArithmeticReasonUsage() {
|
|
|
19
21
|
const startRank = (0, randint_1.randint)(0, 20);
|
|
20
22
|
const askedRank = startRank + 1;
|
|
21
23
|
const startValue = (0, randint_1.randint)(-10, 10);
|
|
24
|
+
const getPropositions = (n) => {
|
|
25
|
+
const res = [];
|
|
26
|
+
res.push({
|
|
27
|
+
id: (0, uuid_1.v4)() + '',
|
|
28
|
+
statement: (startValue + reason).toString(),
|
|
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: startValue + reason + (0, randint_1.randint)(-5, 6, [0]) + '',
|
|
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: `$(u_n)$ est une suite arithmétique de raison $r = ${reason}$ et on sait que $u_{${startRank}} = ${startValue}$. Calculer : `,
|
|
24
48
|
startStatement: `u_{${askedRank}}`,
|
|
25
49
|
answer: (startValue + reason).toString(),
|
|
26
50
|
keys: ['r', 'n', 'u', 'underscore'],
|
|
51
|
+
getPropositions,
|
|
27
52
|
};
|
|
28
53
|
return question;
|
|
29
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arithmeticRecurrenceFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/arithmetic/arithmeticRecurrenceFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"arithmeticRecurrenceFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/arithmetic/arithmeticRecurrenceFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAiC,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAM7F,eAAO,MAAM,gCAAgC,EAAE,QAU9C,CAAC;AAEF,wBAAgB,mCAAmC,IAAI,QAAQ,CA2C9D"}
|
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getArithmeticRecurrenceFormulaUsage = exports.arithmeticRecurrenceFormulaUsage = void 0;
|
|
4
4
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
5
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
6
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
7
|
+
const uuid_1 = require("uuid");
|
|
6
8
|
exports.arithmeticRecurrenceFormulaUsage = {
|
|
7
9
|
id: 'arithmeticRecurrenceFormulaUsage',
|
|
8
10
|
connector: '=',
|
|
@@ -19,11 +21,34 @@ function getArithmeticRecurrenceFormulaUsage() {
|
|
|
19
21
|
const firstValue = (0, randint_1.randint)(-10, 10);
|
|
20
22
|
const reason = (0, randint_1.randint)(-10, 10, [0]);
|
|
21
23
|
const askedRank = firstRank + 1;
|
|
24
|
+
const getPropositions = (n) => {
|
|
25
|
+
const res = [];
|
|
26
|
+
res.push({
|
|
27
|
+
id: (0, uuid_1.v4)() + '',
|
|
28
|
+
statement: (firstValue + reason).toString(),
|
|
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: firstValue + reason + (0, randint_1.randint)(-5, 6, [0]) + '',
|
|
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: `$(u_n)$ est une suite définie par $u_{n+1} = ${reason} + u_n$ et $u_{${firstRank}} = ${firstValue}$. Calculer :`,
|
|
24
48
|
startStatement: `u_{${askedRank}}`,
|
|
25
49
|
answer: (firstValue + reason).toString(),
|
|
26
50
|
keys: ['r', 'n', 'u', 'underscore'],
|
|
51
|
+
getPropositions,
|
|
27
52
|
};
|
|
28
53
|
return question;
|
|
29
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arithmeticThresholdFind.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/arithmetic/arithmeticThresholdFind.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"arithmeticThresholdFind.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/arithmetic/arithmeticThresholdFind.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAIjE,eAAO,MAAM,uBAAuB,EAAE,QAUrC,CAAC;AAEF,wBAAgB,0BAA0B,IAAI,QAAQ,CAuDrD"}
|
|
@@ -3,7 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getArithmeticThresholdFind = exports.arithmeticThresholdFind = void 0;
|
|
4
4
|
const polynomial_1 = require("../../../math/polynomials/polynomial");
|
|
5
5
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
6
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
6
7
|
const getDistinctQuestions_1 = require("../../utils/getDistinctQuestions");
|
|
8
|
+
const uuid_1 = require("uuid");
|
|
7
9
|
exports.arithmeticThresholdFind = {
|
|
8
10
|
id: 'arithmeticThresholdFind',
|
|
9
11
|
connector: '=',
|
|
@@ -29,11 +31,34 @@ function getArithmeticThresholdFind() {
|
|
|
29
31
|
randValue += (0, randint_1.randint)(-100, reason);
|
|
30
32
|
instruction += `À partir de quel rang a-t-on $u_n < ${randValue}$ ?`;
|
|
31
33
|
}
|
|
34
|
+
const getPropositions = (n) => {
|
|
35
|
+
const res = [];
|
|
36
|
+
res.push({
|
|
37
|
+
id: (0, uuid_1.v4)() + '',
|
|
38
|
+
statement: (Math.floor((randValue - firstValue) / reason) + 1).toString(),
|
|
39
|
+
isRightAnswer: true,
|
|
40
|
+
});
|
|
41
|
+
for (let i = 0; i < n - 1; i++) {
|
|
42
|
+
let isDuplicate;
|
|
43
|
+
let proposition;
|
|
44
|
+
do {
|
|
45
|
+
proposition = {
|
|
46
|
+
id: (0, uuid_1.v4)() + '',
|
|
47
|
+
statement: (Math.floor((randValue - firstValue) / reason) + (0, randint_1.randint)(-5, 6, [1])).toString(),
|
|
48
|
+
isRightAnswer: false,
|
|
49
|
+
};
|
|
50
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
51
|
+
} while (isDuplicate);
|
|
52
|
+
res.push(proposition);
|
|
53
|
+
}
|
|
54
|
+
return (0, shuffle_1.shuffle)(res);
|
|
55
|
+
};
|
|
32
56
|
const question = {
|
|
33
57
|
instruction,
|
|
34
58
|
startStatement: `n`,
|
|
35
59
|
answer: (Math.floor((randValue - firstValue) / reason) + 1).toString(),
|
|
36
60
|
keys: ['r', 'n', 'u', 'underscore', 'inf', 'sup', 'approx'],
|
|
61
|
+
getPropositions,
|
|
37
62
|
};
|
|
38
63
|
return question;
|
|
39
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometricExplicitFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/geometric/geometricExplicitFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"geometricExplicitFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/geometric/geometricExplicitFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAW3E,eAAO,MAAM,6BAA6B,EAAE,QAU3C,CAAC;AAEF,wBAAgB,gCAAgC,IAAI,QAAQ,CAgD3D"}
|
|
@@ -8,6 +8,8 @@ const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
|
|
|
8
8
|
const powerNode_1 = require("../../../tree/nodes/operators/powerNode");
|
|
9
9
|
const variableNode_1 = require("../../../tree/nodes/variables/variableNode");
|
|
10
10
|
const simplify_1 = require("../../../tree/parsers/simplify");
|
|
11
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
12
|
+
const uuid_1 = require("uuid");
|
|
11
13
|
exports.geometricExplicitFormulaUsage = {
|
|
12
14
|
id: 'geometricExplicitFormulaUsage',
|
|
13
15
|
connector: '=',
|
|
@@ -25,11 +27,34 @@ function getGeometricExplicitFormulaUsage() {
|
|
|
25
27
|
const reason = (0, randint_1.randint)(2, 10);
|
|
26
28
|
const formula = new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(firstValue), new powerNode_1.PowerNode(new numberNode_1.NumberNode(reason), new variableNode_1.VariableNode('n')));
|
|
27
29
|
const formulaTex = (0, simplify_1.simplifyNode)(formula).toTex();
|
|
30
|
+
const getPropositions = (n) => {
|
|
31
|
+
const res = [];
|
|
32
|
+
res.push({
|
|
33
|
+
id: (0, uuid_1.v4)() + '',
|
|
34
|
+
statement: (firstValue * Math.pow(reason, askedRank)).toString(),
|
|
35
|
+
isRightAnswer: true,
|
|
36
|
+
});
|
|
37
|
+
for (let i = 0; i < n - 1; i++) {
|
|
38
|
+
let isDuplicate;
|
|
39
|
+
let proposition;
|
|
40
|
+
do {
|
|
41
|
+
proposition = {
|
|
42
|
+
id: (0, uuid_1.v4)() + '',
|
|
43
|
+
statement: (firstValue * Math.pow(reason, (0, randint_1.randint)(0, 9, [askedRank]))).toString(),
|
|
44
|
+
isRightAnswer: false,
|
|
45
|
+
};
|
|
46
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
47
|
+
} while (isDuplicate);
|
|
48
|
+
res.push(proposition);
|
|
49
|
+
}
|
|
50
|
+
return (0, shuffle_1.shuffle)(res);
|
|
51
|
+
};
|
|
28
52
|
const question = {
|
|
29
53
|
instruction: `$(u_n)$ est une suite géométrique définie par $u_n = ${formulaTex}$. Calculer :`,
|
|
30
54
|
startStatement: `u_{${askedRank}}`,
|
|
31
55
|
answer: (firstValue * Math.pow(reason, askedRank)).toString(),
|
|
32
56
|
keys: ['n', 'u', 'underscore'],
|
|
57
|
+
getPropositions,
|
|
33
58
|
};
|
|
34
59
|
return question;
|
|
35
60
|
}
|