math-exercises 1.3.38 → 1.3.40
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 +48 -9
- 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 +78 -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 +106 -0
- 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/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 -0
- package/lib/exercises/geometry/euclidean/{TriangleArea.js → 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
- package/lib/exercises/geometry/cartesian/derivativeNumberReading.d.ts +0 -4
- package/lib/exercises/geometry/cartesian/derivativeNumberReading.d.ts.map +0 -1
- package/lib/exercises/geometry/cartesian/derivativeNumberReading.js +0 -51
- package/lib/exercises/geometry/cartesian/derivativeNumberReading2.d.ts +0 -1
- package/lib/exercises/geometry/cartesian/derivativeNumberReading2.d.ts.map +0 -1
- package/lib/exercises/geometry/cartesian/derivativeNumberReading2.js +0 -91
- package/lib/exercises/geometry/euclidean/TriangleArea.d.ts.map +0 -1
- /package/lib/exercises/geometry/euclidean/{TriangleArea.d.ts → triangleArea.d.ts} +0 -0
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
export type GeneratorOptions = {};
|
|
2
|
+
export type Proposition = {
|
|
3
|
+
id: string;
|
|
4
|
+
statement: string;
|
|
5
|
+
isRightAnswer: boolean;
|
|
6
|
+
};
|
|
2
7
|
export interface Question {
|
|
3
8
|
instruction?: string;
|
|
4
9
|
startStatement?: string;
|
|
@@ -7,6 +12,7 @@ export interface Question {
|
|
|
7
12
|
commands?: string[];
|
|
8
13
|
coords?: number[];
|
|
9
14
|
options?: any;
|
|
15
|
+
getPropositions?: (n: number) => Proposition[];
|
|
10
16
|
}
|
|
11
17
|
export interface Exercise {
|
|
12
18
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAElC,MAAM,WAAW,QAAQ;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAElC,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AACF,MAAM,WAAW,QAAQ;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,WAAW,EAAE,CAAC;CAChD;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,GAAG,GAAG,OAAO,GAAG,UAAU,CAAC;IACtC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,QAAQ,EAAE,CAAC;CAC/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exercises.d.ts","sourceRoot":"","sources":["../../src/exercises/exercises.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"exercises.d.ts","sourceRoot":"","sources":["../../src/exercises/exercises.ts"],"names":[],"mappings":"AA+GA,eAAO,MAAM,SAAS,iCA6JrB,CAAC"}
|
|
@@ -98,6 +98,10 @@ const triangleAreaV2_1 = require("./geometry/euclidean/triangleAreaV2");
|
|
|
98
98
|
const circleArea_1 = require("./geometry/euclidean/circleArea");
|
|
99
99
|
const circleCircumference_1 = require("./geometry/euclidean/circleCircumference");
|
|
100
100
|
const triangleArea_1 = require("./geometry/euclidean/triangleArea");
|
|
101
|
+
const distanceBetweenTwoPoints_1 = require("./geometry/cartesian/distanceBetweenTwoPoints");
|
|
102
|
+
const reduceExpression_1 = require("./calculLitteral/simplifying/reduceExpression");
|
|
103
|
+
const evaluateExpression_1 = require("./calculLitteral/equation/evaluateExpression");
|
|
104
|
+
const proportionalityTable_1 = require("./calcul/proportionality/proportionalityTable");
|
|
101
105
|
exports.exercises = [
|
|
102
106
|
/**
|
|
103
107
|
* calcul litteral
|
|
@@ -239,4 +243,8 @@ exports.exercises = [
|
|
|
239
243
|
trianglePerimeter_1.trianglePerimeter,
|
|
240
244
|
circleArea_1.circleArea,
|
|
241
245
|
circleCircumference_1.circleCircumference,
|
|
246
|
+
distanceBetweenTwoPoints_1.distanceBetweenTwoPoints,
|
|
247
|
+
reduceExpression_1.reduceExpression,
|
|
248
|
+
evaluateExpression_1.evaluateExpression,
|
|
249
|
+
proportionalityTable_1.proportionalityTable,
|
|
242
250
|
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"distanceBetweenTwoPoints.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/cartesian/distanceBetweenTwoPoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAU3E,eAAO,MAAM,wBAAwB,EAAE,QAUtC,CAAC;AAEF,wBAAgB,2BAA2B,IAAI,QAAQ,CA4FtD"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDistanceBetweenTwoPoints = exports.distanceBetweenTwoPoints = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const point_1 = require("../../../math/geometry/point");
|
|
6
|
+
const squareRoot_1 = require("../../../math/numbers/reals/squareRoot");
|
|
7
|
+
const randTupleInt_1 = require("../../../math/utils/random/randTupleInt");
|
|
8
|
+
const round_1 = require("../../../math/utils/round");
|
|
9
|
+
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
10
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
11
|
+
const uuid_1 = require("uuid");
|
|
12
|
+
exports.distanceBetweenTwoPoints = {
|
|
13
|
+
id: 'distanceBetweenTwoPoints',
|
|
14
|
+
connector: '=',
|
|
15
|
+
instruction: '',
|
|
16
|
+
label: 'Distance entre deux points',
|
|
17
|
+
levels: ['2', '1'],
|
|
18
|
+
isSingleStep: false,
|
|
19
|
+
section: 'Géométrie cartésienne',
|
|
20
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getDistanceBetweenTwoPoints, nb),
|
|
21
|
+
keys: [],
|
|
22
|
+
};
|
|
23
|
+
function getDistanceBetweenTwoPoints() {
|
|
24
|
+
const [coords1, coords2] = (0, randTupleInt_1.distinctRandTupleInt)(2, 2, { from: -9, to: 10 });
|
|
25
|
+
let A = new point_1.Point('A', new numberNode_1.NumberNode(coords1[0]), new numberNode_1.NumberNode(coords1[1]));
|
|
26
|
+
let B = new point_1.Point('B', new numberNode_1.NumberNode(coords2[0]), new numberNode_1.NumberNode(coords2[1]));
|
|
27
|
+
const answer = new squareRoot_1.SquareRoot((0, round_1.round)(A.distanceTo(B) ** 2, 0)).simplify().toTree().toTex();
|
|
28
|
+
const getPropositions = (n) => {
|
|
29
|
+
const res = [];
|
|
30
|
+
let isDuplicate;
|
|
31
|
+
let temp = n;
|
|
32
|
+
res.push({
|
|
33
|
+
id: (0, uuid_1.v4)() + '',
|
|
34
|
+
statement: answer,
|
|
35
|
+
isRightAnswer: true,
|
|
36
|
+
});
|
|
37
|
+
temp--;
|
|
38
|
+
A = new point_1.Point('A', new numberNode_1.NumberNode(coords1[0]), new numberNode_1.NumberNode(coords1[1]));
|
|
39
|
+
B = new point_1.Point('B', new numberNode_1.NumberNode(-coords2[0]), new numberNode_1.NumberNode(-coords2[1]));
|
|
40
|
+
let wrongStatement = new squareRoot_1.SquareRoot((0, round_1.round)(A.distanceTo(B) ** 2, 0)).simplify().toTree().toTex();
|
|
41
|
+
isDuplicate = res.some((p) => p.statement === wrongStatement);
|
|
42
|
+
if (!isDuplicate) {
|
|
43
|
+
res.push({
|
|
44
|
+
id: (0, uuid_1.v4)() + '',
|
|
45
|
+
statement: wrongStatement,
|
|
46
|
+
isRightAnswer: false,
|
|
47
|
+
});
|
|
48
|
+
temp--;
|
|
49
|
+
}
|
|
50
|
+
A = new point_1.Point('A', new numberNode_1.NumberNode(coords1[1]), new numberNode_1.NumberNode(coords1[0]));
|
|
51
|
+
B = new point_1.Point('B', new numberNode_1.NumberNode(coords2[0]), new numberNode_1.NumberNode(coords2[1]));
|
|
52
|
+
wrongStatement = new squareRoot_1.SquareRoot((0, round_1.round)(A.distanceTo(B) ** 2, 0)).simplify().toTree().toTex();
|
|
53
|
+
isDuplicate = res.some((p) => p.statement === wrongStatement);
|
|
54
|
+
if (n > 0 && !isDuplicate) {
|
|
55
|
+
res.push({
|
|
56
|
+
id: (0, uuid_1.v4)() + '',
|
|
57
|
+
statement: wrongStatement,
|
|
58
|
+
isRightAnswer: false,
|
|
59
|
+
});
|
|
60
|
+
temp--;
|
|
61
|
+
}
|
|
62
|
+
A = new point_1.Point('A', new numberNode_1.NumberNode(coords1[0]), new numberNode_1.NumberNode(coords2[0]));
|
|
63
|
+
B = new point_1.Point('B', new numberNode_1.NumberNode(coords1[1]), new numberNode_1.NumberNode(coords2[1]));
|
|
64
|
+
wrongStatement = new squareRoot_1.SquareRoot((0, round_1.round)(A.distanceTo(B) ** 2, 0)).simplify().toTree().toTex();
|
|
65
|
+
isDuplicate = res.some((p) => p.statement === wrongStatement);
|
|
66
|
+
if (n > 0 && !isDuplicate) {
|
|
67
|
+
res.push({
|
|
68
|
+
id: (0, uuid_1.v4)() + '',
|
|
69
|
+
statement: wrongStatement,
|
|
70
|
+
isRightAnswer: false,
|
|
71
|
+
});
|
|
72
|
+
temp--;
|
|
73
|
+
}
|
|
74
|
+
for (let i = 0; i < temp; i++) {
|
|
75
|
+
let proposition;
|
|
76
|
+
do {
|
|
77
|
+
const [tempCoords1, tempsCoords2] = (0, randTupleInt_1.distinctRandTupleInt)(2, 2, { from: -9, to: 10 });
|
|
78
|
+
const A = new point_1.Point('A', new numberNode_1.NumberNode(tempCoords1[0]), new numberNode_1.NumberNode(tempCoords1[1]));
|
|
79
|
+
const B = new point_1.Point('B', new numberNode_1.NumberNode(tempsCoords2[0]), new numberNode_1.NumberNode(tempsCoords2[1]));
|
|
80
|
+
proposition = {
|
|
81
|
+
id: (0, uuid_1.v4)() + '',
|
|
82
|
+
statement: new squareRoot_1.SquareRoot((0, round_1.round)(A.distanceTo(B) ** 2, 0)).simplify().toTree().toTex(),
|
|
83
|
+
isRightAnswer: false,
|
|
84
|
+
};
|
|
85
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
86
|
+
} while (isDuplicate);
|
|
87
|
+
res.push(proposition);
|
|
88
|
+
temp--;
|
|
89
|
+
}
|
|
90
|
+
return (0, shuffle_1.shuffle)(res);
|
|
91
|
+
};
|
|
92
|
+
const question = {
|
|
93
|
+
instruction: `Soit $${A.toTexWithCoords()}$ et $${B.toTexWithCoords()}$. Calculer la distance AB.`,
|
|
94
|
+
startStatement: 'AB',
|
|
95
|
+
answer,
|
|
96
|
+
keys: [],
|
|
97
|
+
getPropositions,
|
|
98
|
+
};
|
|
99
|
+
return question;
|
|
100
|
+
}
|
|
101
|
+
exports.getDistanceBetweenTwoPoints = getDistanceBetweenTwoPoints;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leadingCoefficient.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/cartesian/leadingCoefficient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"leadingCoefficient.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/cartesian/leadingCoefficient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAY3E,eAAO,MAAM,kBAAkB,EAAE,QAShC,CAAC;AAEF,wBAAgB,6BAA6B,IAAI,QAAQ,CA8ExD"}
|
|
@@ -6,7 +6,11 @@ const droite_1 = require("../../../math/geometry/droite");
|
|
|
6
6
|
const point_1 = require("../../../math/geometry/point");
|
|
7
7
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
8
|
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
9
|
+
const fractionNode_1 = require("../../../tree/nodes/operators/fractionNode");
|
|
10
|
+
const simplify_1 = require("../../../tree/parsers/simplify");
|
|
11
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
9
12
|
const mathjs_1 = require("mathjs");
|
|
13
|
+
const uuid_1 = require("uuid");
|
|
10
14
|
exports.leadingCoefficient = {
|
|
11
15
|
id: 'leadingCoefficient',
|
|
12
16
|
connector: '=',
|
|
@@ -49,11 +53,37 @@ function getLeadingCoefficientQuestion() {
|
|
|
49
53
|
xmin = -bValue / aValue - 1;
|
|
50
54
|
xmax = 1;
|
|
51
55
|
}
|
|
56
|
+
const getPropositions = (n) => {
|
|
57
|
+
const res = [];
|
|
58
|
+
res.push({
|
|
59
|
+
id: (0, uuid_1.v4)() + '',
|
|
60
|
+
statement: droite.getLeadingCoefficient(),
|
|
61
|
+
isRightAnswer: true,
|
|
62
|
+
});
|
|
63
|
+
for (let i = 0; i < n - 1; i++) {
|
|
64
|
+
let isDuplicate;
|
|
65
|
+
let proposition;
|
|
66
|
+
do {
|
|
67
|
+
const wrongAnswer = droite.getLeadingCoefficient() !== '0'
|
|
68
|
+
? (0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(droite.a, new numberNode_1.NumberNode((0, randint_1.randint)(-4, 5, [0, 1]))))
|
|
69
|
+
: new numberNode_1.NumberNode((0, randint_1.randint)(-4, 5, [0]));
|
|
70
|
+
proposition = {
|
|
71
|
+
id: (0, uuid_1.v4)() + '',
|
|
72
|
+
statement: wrongAnswer.toTex(),
|
|
73
|
+
isRightAnswer: false,
|
|
74
|
+
};
|
|
75
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
76
|
+
} while (isDuplicate);
|
|
77
|
+
res.push(proposition);
|
|
78
|
+
}
|
|
79
|
+
return (0, shuffle_1.shuffle)(res);
|
|
80
|
+
};
|
|
52
81
|
const question = {
|
|
53
82
|
answer: droite.getLeadingCoefficient(),
|
|
54
83
|
keys: [],
|
|
55
84
|
commands: [`f(x) = (${a}) * x + (${b})`],
|
|
56
85
|
coords: [xmin, xmax, ymin, ymax],
|
|
86
|
+
getPropositions,
|
|
57
87
|
};
|
|
58
88
|
return question;
|
|
59
89
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leadingCoefficientCalculV1.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/cartesian/leadingCoefficientCalculV1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"leadingCoefficientCalculV1.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/cartesian/leadingCoefficientCalculV1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAS3E,eAAO,MAAM,0BAA0B,EAAE,QASxC,CAAC;AAEF,wBAAgB,qCAAqC,IAAI,QAAQ,CAgDhE"}
|
|
@@ -6,6 +6,8 @@ const randint_1 = require("../../../math/utils/random/randint");
|
|
|
6
6
|
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
7
7
|
const fractionNode_1 = require("../../../tree/nodes/operators/fractionNode");
|
|
8
8
|
const simplify_1 = require("../../../tree/parsers/simplify");
|
|
9
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
10
|
+
const uuid_1 = require("uuid");
|
|
9
11
|
exports.leadingCoefficientCalculV1 = {
|
|
10
12
|
id: 'leadingCoefficientCalculV1',
|
|
11
13
|
connector: '=',
|
|
@@ -20,10 +22,34 @@ function getLeadingCoefficientCalculV1Question() {
|
|
|
20
22
|
const [xA, yA] = [1, 2].map((el) => (0, randint_1.randint)(-9, 10));
|
|
21
23
|
const xB = (0, randint_1.randint)(-9, 10, [xA]);
|
|
22
24
|
const yB = (0, randint_1.randint)(-9, 10);
|
|
25
|
+
const getPropositions = (n) => {
|
|
26
|
+
const res = [];
|
|
27
|
+
res.push({
|
|
28
|
+
id: (0, uuid_1.v4)() + '',
|
|
29
|
+
statement: (0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(yB - yA), new numberNode_1.NumberNode(xB - xA))).toTex(),
|
|
30
|
+
isRightAnswer: true,
|
|
31
|
+
});
|
|
32
|
+
for (let i = 0; i < n - 1; i++) {
|
|
33
|
+
let isDuplicate;
|
|
34
|
+
let proposition;
|
|
35
|
+
do {
|
|
36
|
+
const wrongAnswer = (0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(yB - yA + (0, randint_1.randint)(-3, 4, [0])), new numberNode_1.NumberNode(xB - xA + (0, randint_1.randint)(-3, 4, [0])))).toTex();
|
|
37
|
+
proposition = {
|
|
38
|
+
id: (0, uuid_1.v4)() + '',
|
|
39
|
+
statement: wrongAnswer,
|
|
40
|
+
isRightAnswer: false,
|
|
41
|
+
};
|
|
42
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
43
|
+
} while (isDuplicate);
|
|
44
|
+
res.push(proposition);
|
|
45
|
+
}
|
|
46
|
+
return (0, shuffle_1.shuffle)(res);
|
|
47
|
+
};
|
|
23
48
|
const question = {
|
|
24
49
|
instruction: `Soit $f$ une fonction affine telle que $f(${xA})$ = $${yA}$ et $f(${xB})$ = $${yB}$.$\\\\$Quel est le coefficient directeur de $f$ ?`,
|
|
25
50
|
startStatement: 'a',
|
|
26
51
|
answer: (0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(yB - yA), new numberNode_1.NumberNode(xB - xA))).toTex(),
|
|
52
|
+
getPropositions,
|
|
27
53
|
};
|
|
28
54
|
return question;
|
|
29
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leadingCoefficientCalculV2.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/cartesian/leadingCoefficientCalculV2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"leadingCoefficientCalculV2.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/cartesian/leadingCoefficientCalculV2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAS3E,eAAO,MAAM,0BAA0B,EAAE,QASxC,CAAC;AAEF,wBAAgB,qCAAqC,IAAI,QAAQ,CA+ChE"}
|
|
@@ -6,6 +6,8 @@ const randint_1 = require("../../../math/utils/random/randint");
|
|
|
6
6
|
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
7
7
|
const fractionNode_1 = require("../../../tree/nodes/operators/fractionNode");
|
|
8
8
|
const simplify_1 = require("../../../tree/parsers/simplify");
|
|
9
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
10
|
+
const uuid_1 = require("uuid");
|
|
9
11
|
exports.leadingCoefficientCalculV2 = {
|
|
10
12
|
id: 'leadingCoefficientCalculV2',
|
|
11
13
|
connector: '=',
|
|
@@ -20,9 +22,33 @@ function getLeadingCoefficientCalculV1Question() {
|
|
|
20
22
|
const [xA, yA] = [1, 2].map((el) => (0, randint_1.randint)(-9, 10));
|
|
21
23
|
const xB = (0, randint_1.randint)(-9, 10, [xA]);
|
|
22
24
|
const yB = (0, randint_1.randint)(-9, 10);
|
|
25
|
+
const getPropositions = (n) => {
|
|
26
|
+
const res = [];
|
|
27
|
+
res.push({
|
|
28
|
+
id: (0, uuid_1.v4)() + '',
|
|
29
|
+
statement: (0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(yB - yA), new numberNode_1.NumberNode(xB - xA))).toTex(),
|
|
30
|
+
isRightAnswer: true,
|
|
31
|
+
});
|
|
32
|
+
for (let i = 0; i < n - 1; i++) {
|
|
33
|
+
let isDuplicate;
|
|
34
|
+
let proposition;
|
|
35
|
+
do {
|
|
36
|
+
const wrongAnswer = (0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(yB - yA + (0, randint_1.randint)(-3, 4, [0])), new numberNode_1.NumberNode(xB - xA + (0, randint_1.randint)(-3, 4, [0])))).toTex();
|
|
37
|
+
proposition = {
|
|
38
|
+
id: (0, uuid_1.v4)() + '',
|
|
39
|
+
statement: wrongAnswer,
|
|
40
|
+
isRightAnswer: false,
|
|
41
|
+
};
|
|
42
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
43
|
+
} while (isDuplicate);
|
|
44
|
+
res.push(proposition);
|
|
45
|
+
}
|
|
46
|
+
return (0, shuffle_1.shuffle)(res);
|
|
47
|
+
};
|
|
23
48
|
const question = {
|
|
24
49
|
instruction: `Soit $d$ une droite passant par les points $A(${xA};${yA})$ et $B(${xB};${yB})$.$\\\\$Déterminer le coefficient directeur de $d$.`,
|
|
25
50
|
answer: (0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(yB - yA), new numberNode_1.NumberNode(xB - xA))).toTex(),
|
|
51
|
+
getPropositions,
|
|
26
52
|
};
|
|
27
53
|
return question;
|
|
28
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"midpoint.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/cartesian/midpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"midpoint.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/cartesian/midpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAQ3E,eAAO,MAAM,QAAQ,EAAE,QAUtB,CAAC;AAEF,wBAAgB,mBAAmB,IAAI,QAAQ,CA8C9C"}
|
|
@@ -5,6 +5,8 @@ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQues
|
|
|
5
5
|
const point_1 = require("../../../math/geometry/point");
|
|
6
6
|
const randTupleInt_1 = require("../../../math/utils/random/randTupleInt");
|
|
7
7
|
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
8
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
9
|
+
const uuid_1 = require("uuid");
|
|
8
10
|
exports.midpoint = {
|
|
9
11
|
id: 'midpoint',
|
|
10
12
|
connector: '=',
|
|
@@ -20,11 +22,38 @@ function getMidpointQuestion() {
|
|
|
20
22
|
const [coords1, coords2] = (0, randTupleInt_1.distinctRandTupleInt)(2, 2, { from: -9, to: 10 });
|
|
21
23
|
const A = new point_1.Point('A', new numberNode_1.NumberNode(coords1[0]), new numberNode_1.NumberNode(coords1[1]));
|
|
22
24
|
const B = new point_1.Point('B', new numberNode_1.NumberNode(coords2[0]), new numberNode_1.NumberNode(coords2[1]));
|
|
25
|
+
const getPropositions = (n) => {
|
|
26
|
+
const res = [];
|
|
27
|
+
res.push({
|
|
28
|
+
id: (0, uuid_1.v4)() + '',
|
|
29
|
+
statement: A.midpoint(B).toTexWithCoords(),
|
|
30
|
+
isRightAnswer: true,
|
|
31
|
+
});
|
|
32
|
+
for (let i = 0; i < n - 1; i++) {
|
|
33
|
+
let isDuplicate;
|
|
34
|
+
let proposition;
|
|
35
|
+
do {
|
|
36
|
+
const [tempCoords1, tempsCoords2] = (0, randTupleInt_1.distinctRandTupleInt)(2, 2, { from: -9, to: 10 });
|
|
37
|
+
const temps1 = new point_1.Point('A', new numberNode_1.NumberNode(tempCoords1[0]), new numberNode_1.NumberNode(tempCoords1[1]));
|
|
38
|
+
const temps2 = new point_1.Point('B', new numberNode_1.NumberNode(tempsCoords2[0]), new numberNode_1.NumberNode(tempsCoords2[1]));
|
|
39
|
+
const wrongAnswer = temps1.midpoint(temps2);
|
|
40
|
+
proposition = {
|
|
41
|
+
id: (0, uuid_1.v4)() + '',
|
|
42
|
+
statement: wrongAnswer.toTexWithCoords(),
|
|
43
|
+
isRightAnswer: false,
|
|
44
|
+
};
|
|
45
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
46
|
+
} while (isDuplicate);
|
|
47
|
+
res.push(proposition);
|
|
48
|
+
}
|
|
49
|
+
return (0, shuffle_1.shuffle)(res);
|
|
50
|
+
};
|
|
23
51
|
const question = {
|
|
24
52
|
instruction: `Soit $${A.toTexWithCoords()}$ et $${B.toTexWithCoords()}$. Quelles sont les coordonnées du milieu $I$ de $[AB]$ ?`,
|
|
25
53
|
startStatement: 'I',
|
|
26
54
|
answer: A.midpoint(B).toTexWithCoords(),
|
|
27
55
|
keys: ['semicolon'],
|
|
56
|
+
getPropositions,
|
|
28
57
|
};
|
|
29
58
|
return question;
|
|
30
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"circleArea.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/euclidean/circleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"circleArea.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/euclidean/circleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAe,MAAM,0BAA0B,CAAC;AAQ3E,eAAO,MAAM,UAAU,EAAE,QASxB,CAAC;AAEF,wBAAgB,aAAa,IAAI,QAAQ,CA4CxC"}
|
|
@@ -5,6 +5,8 @@ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQues
|
|
|
5
5
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
6
6
|
const round_1 = require("../../../math/utils/round");
|
|
7
7
|
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
8
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
9
|
+
const uuid_1 = require("uuid");
|
|
8
10
|
exports.circleArea = {
|
|
9
11
|
id: 'circleArea',
|
|
10
12
|
connector: '=',
|
|
@@ -19,9 +21,34 @@ function getCircleArea() {
|
|
|
19
21
|
const radius = (0, randint_1.randint)(1, 13);
|
|
20
22
|
const diametre = (0, randint_1.randint)(1, 21);
|
|
21
23
|
const coin = (0, coinFlip_1.coinFlip)();
|
|
24
|
+
const correctAnswer = coin ? (0, round_1.round)(Math.PI * radius ** 2, 2) + '' : (0, round_1.round)(Math.PI * (diametre / 2) ** 2, 2) + '';
|
|
25
|
+
const getPropositions = (n) => {
|
|
26
|
+
const res = [];
|
|
27
|
+
res.push({
|
|
28
|
+
id: (0, uuid_1.v4)() + '',
|
|
29
|
+
statement: correctAnswer,
|
|
30
|
+
isRightAnswer: true,
|
|
31
|
+
});
|
|
32
|
+
for (let i = 0; i < n - 1; i++) {
|
|
33
|
+
let isDuplicate;
|
|
34
|
+
let proposition;
|
|
35
|
+
do {
|
|
36
|
+
const wrongAnswer = (0, round_1.round)(Math.random() * 100, 2) + '';
|
|
37
|
+
proposition = {
|
|
38
|
+
id: (0, uuid_1.v4)() + '',
|
|
39
|
+
statement: wrongAnswer,
|
|
40
|
+
isRightAnswer: false,
|
|
41
|
+
};
|
|
42
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
43
|
+
} while (isDuplicate);
|
|
44
|
+
res.push(proposition);
|
|
45
|
+
}
|
|
46
|
+
return (0, shuffle_1.shuffle)(res);
|
|
47
|
+
};
|
|
22
48
|
const question = {
|
|
23
49
|
instruction: `Calculer l'aire d'un cercle de ${coin ? 'rayon ' + radius : 'diamètre ' + diametre} cm.`,
|
|
24
|
-
answer:
|
|
50
|
+
answer: correctAnswer,
|
|
51
|
+
getPropositions,
|
|
25
52
|
};
|
|
26
53
|
return question;
|
|
27
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"circleCircumference.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/euclidean/circleCircumference.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"circleCircumference.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/euclidean/circleCircumference.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAe,MAAM,0BAA0B,CAAC;AAQ3E,eAAO,MAAM,mBAAmB,EAAE,QASjC,CAAC;AAEF,wBAAgB,sBAAsB,IAAI,QAAQ,CA4CjD"}
|
|
@@ -5,6 +5,8 @@ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQues
|
|
|
5
5
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
6
6
|
const round_1 = require("../../../math/utils/round");
|
|
7
7
|
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
8
|
+
const shuffle_1 = require("../../../utils/shuffle");
|
|
9
|
+
const uuid_1 = require("uuid");
|
|
8
10
|
exports.circleCircumference = {
|
|
9
11
|
id: 'circleCircumference',
|
|
10
12
|
connector: '=',
|
|
@@ -19,9 +21,34 @@ function getCircleCircumference() {
|
|
|
19
21
|
const radius = (0, randint_1.randint)(1, 13);
|
|
20
22
|
const diametre = (0, randint_1.randint)(1, 21);
|
|
21
23
|
const coin = (0, coinFlip_1.coinFlip)();
|
|
24
|
+
const correctAnswer = coin ? (0, round_1.round)(2 * Math.PI * radius, 2) + '' : (0, round_1.round)(Math.PI * diametre, 2) + '';
|
|
25
|
+
const getPropositions = (n) => {
|
|
26
|
+
const res = [];
|
|
27
|
+
res.push({
|
|
28
|
+
id: (0, uuid_1.v4)() + '',
|
|
29
|
+
statement: correctAnswer,
|
|
30
|
+
isRightAnswer: true,
|
|
31
|
+
});
|
|
32
|
+
for (let i = 0; i < n - 1; i++) {
|
|
33
|
+
let isDuplicate;
|
|
34
|
+
let proposition;
|
|
35
|
+
do {
|
|
36
|
+
const wrongAnswer = (0, round_1.round)(Math.random() * 100, 2) + '';
|
|
37
|
+
proposition = {
|
|
38
|
+
id: (0, uuid_1.v4)() + '',
|
|
39
|
+
statement: wrongAnswer,
|
|
40
|
+
isRightAnswer: false,
|
|
41
|
+
};
|
|
42
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
43
|
+
} while (isDuplicate);
|
|
44
|
+
res.push(proposition);
|
|
45
|
+
}
|
|
46
|
+
return (0, shuffle_1.shuffle)(res);
|
|
47
|
+
};
|
|
22
48
|
const question = {
|
|
23
49
|
instruction: `Calculer la circonférence d'un cercle de ${coin ? 'rayon ' + radius : 'diamètre ' + diametre} cm.`,
|
|
24
|
-
answer:
|
|
50
|
+
answer: correctAnswer,
|
|
51
|
+
getPropositions,
|
|
25
52
|
};
|
|
26
53
|
return question;
|
|
27
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pythagore.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/euclidean/pythagore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"pythagore.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/euclidean/pythagore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAO3E,eAAO,MAAM,SAAS,EAAE,QASvB,CAAC;AAEF,wBAAgB,YAAY,IAAI,QAAQ,CAqEvC"}
|
|
@@ -4,6 +4,8 @@ exports.getPythagore = exports.pythagore = void 0;
|
|
|
4
4
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
5
|
const triangles_1 = require("../../../math/geometry/triangles");
|
|
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.pythagore = {
|
|
8
10
|
id: 'pythagore',
|
|
9
11
|
connector: '=',
|
|
@@ -20,11 +22,56 @@ function getPythagore() {
|
|
|
20
22
|
for (let i = 0; i < 3; i++)
|
|
21
23
|
vertices.push(String.fromCharCode(code + i));
|
|
22
24
|
const triangle = triangles_1.TriangleConstructor.createRandomRightTriangle({ minRapport: 0.7, maxRapport: 1.3, names: vertices });
|
|
25
|
+
const getPropositions = (n) => {
|
|
26
|
+
const res = [];
|
|
27
|
+
res.push({
|
|
28
|
+
id: (0, uuid_1.v4)() + '',
|
|
29
|
+
statement: `${triangle.getSideAName()}^2 = ${triangle.getSideBName()}^2 + ${triangle.getSideCName()}^2`,
|
|
30
|
+
isRightAnswer: true,
|
|
31
|
+
});
|
|
32
|
+
res.push({
|
|
33
|
+
id: (0, uuid_1.v4)() + '',
|
|
34
|
+
statement: `${triangle.getSideAName()} = ${triangle.getSideBName()} + ${triangle.getSideCName()}`,
|
|
35
|
+
isRightAnswer: false,
|
|
36
|
+
});
|
|
37
|
+
if (n > 2)
|
|
38
|
+
res.push({
|
|
39
|
+
id: (0, uuid_1.v4)() + '',
|
|
40
|
+
statement: `${triangle.getSideAName()}^2 = ${triangle.getSideBName()}^2 - ${triangle.getSideCName()}^2`,
|
|
41
|
+
isRightAnswer: false,
|
|
42
|
+
});
|
|
43
|
+
if (n > 3)
|
|
44
|
+
res.push({
|
|
45
|
+
id: (0, uuid_1.v4)() + '',
|
|
46
|
+
statement: `${triangle.getSideBName()}^2 = ${triangle.getSideAName()}^2 + ${triangle.getSideCName()}^2`,
|
|
47
|
+
isRightAnswer: false,
|
|
48
|
+
});
|
|
49
|
+
if (n > 4)
|
|
50
|
+
res.push({
|
|
51
|
+
id: (0, uuid_1.v4)() + '',
|
|
52
|
+
statement: `${triangle.getSideCName()}^2 = ${triangle.getSideAName()}^2 + ${triangle.getSideBName()}^2`,
|
|
53
|
+
isRightAnswer: false,
|
|
54
|
+
});
|
|
55
|
+
if (n > 5)
|
|
56
|
+
res.push({
|
|
57
|
+
id: (0, uuid_1.v4)() + '',
|
|
58
|
+
statement: `${triangle.getSideAName()}^2 = ${triangle.getSideBName()} + ${triangle.getSideCName()}^2`,
|
|
59
|
+
isRightAnswer: false,
|
|
60
|
+
});
|
|
61
|
+
if (n > 6)
|
|
62
|
+
res.push({
|
|
63
|
+
id: (0, uuid_1.v4)() + '',
|
|
64
|
+
statement: `${triangle.getSideAName()}^2 = ${triangle.getSideBName()}^2 + ${triangle.getSideCName()}`,
|
|
65
|
+
isRightAnswer: false,
|
|
66
|
+
});
|
|
67
|
+
return (0, shuffle_1.shuffle)(res);
|
|
68
|
+
};
|
|
23
69
|
const question = {
|
|
24
70
|
answer: `${triangle.getSideAName()}^2 = ${triangle.getSideBName()}^2 + ${triangle.getSideCName()}^2`,
|
|
25
71
|
keys: [...vertices, 'equal'],
|
|
26
72
|
commands: triangle.generateCommands({}),
|
|
27
73
|
coords: triangle.generateCoords(),
|
|
74
|
+
getPropositions,
|
|
28
75
|
};
|
|
29
76
|
return question;
|
|
30
77
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pythagoreCalcul.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/euclidean/pythagoreCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"pythagoreCalcul.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/euclidean/pythagoreCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAS3E,eAAO,MAAM,eAAe,EAAE,QAS7B,CAAC;AAEF,wBAAgB,kBAAkB,IAAI,QAAQ,CAuF7C"}
|
|
@@ -3,9 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getPythagoreCalcul = exports.pythagoreCalcul = void 0;
|
|
4
4
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
5
|
const triangles_1 = require("../../../math/geometry/triangles");
|
|
6
|
+
const squareRoot_1 = require("../../../math/numbers/reals/squareRoot");
|
|
6
7
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
8
|
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
8
9
|
const shuffle_1 = require("../../../utils/shuffle");
|
|
10
|
+
const uuid_1 = require("uuid");
|
|
9
11
|
exports.pythagoreCalcul = {
|
|
10
12
|
id: 'pythagoreCalcul',
|
|
11
13
|
connector: '=',
|
|
@@ -48,12 +50,38 @@ function getPythagoreCalcul() {
|
|
|
48
50
|
highlightedSide: sides[randoms[2]],
|
|
49
51
|
}),
|
|
50
52
|
];
|
|
53
|
+
const getPropositions = (n) => {
|
|
54
|
+
const res = [];
|
|
55
|
+
res.push({
|
|
56
|
+
id: (0, uuid_1.v4)() + '',
|
|
57
|
+
statement: answer + '',
|
|
58
|
+
isRightAnswer: true,
|
|
59
|
+
});
|
|
60
|
+
for (let i = 0; i < n - 1; i++) {
|
|
61
|
+
let isDuplicate;
|
|
62
|
+
let proposition;
|
|
63
|
+
do {
|
|
64
|
+
const temp = (0, randint_1.randint)(2, 300);
|
|
65
|
+
const squareRoot = new squareRoot_1.SquareRoot(temp);
|
|
66
|
+
const wrongAnswer = Math.sqrt(temp) === Math.floor(Math.sqrt(temp)) ? Math.sqrt(temp).toString() : squareRoot.toTree().toTex();
|
|
67
|
+
proposition = {
|
|
68
|
+
id: (0, uuid_1.v4)() + '',
|
|
69
|
+
statement: wrongAnswer,
|
|
70
|
+
isRightAnswer: false,
|
|
71
|
+
};
|
|
72
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
73
|
+
} while (isDuplicate);
|
|
74
|
+
res.push(proposition);
|
|
75
|
+
}
|
|
76
|
+
return (0, shuffle_1.shuffle)(res);
|
|
77
|
+
};
|
|
51
78
|
const question = {
|
|
52
79
|
instruction: `Dans le triangle ${triangle.getTriangleName()} ci-dessous rectangle en ${triangle.getRightAngle()}, on sait que ${sides[randoms[0]]} = $${sideLengths[randoms[0]]}$ et que ${sides[randoms[1]]} = $${sideLengths[randoms[1]]}$.$\\\\$Calculer la longueur exacte ${sides[randoms[2]]}`,
|
|
53
80
|
answer: answer + '',
|
|
54
81
|
keys: [...vertices, 'equal'],
|
|
55
82
|
commands,
|
|
56
83
|
coords: triangle.generateCoords(),
|
|
84
|
+
getPropositions,
|
|
57
85
|
};
|
|
58
86
|
return question;
|
|
59
87
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rectangleArea.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/euclidean/rectangleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"rectangleArea.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/euclidean/rectangleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAM3E,eAAO,MAAM,aAAa,EAAE,QAS3B,CAAC;AAEF,wBAAgB,gBAAgB,IAAI,QAAQ,CAwC3C"}
|