math-exercises 2.2.14 → 2.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/exercises/exercise.d.ts +28 -32
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/commonDivisorsList.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/commonDivisorsList.js +9 -3
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.js +12 -8
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerProduct.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerProduct.js +6 -2
- package/lib/exercises/math/calcul/fractions/fractionsDivision.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsDivision.js +10 -4
- package/lib/exercises/math/calcul/fractions/fractionsProduct.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsProduct.js +6 -2
- package/lib/exercises/math/calcul/ordering/framing.d.ts.map +1 -1
- package/lib/exercises/math/calcul/ordering/framing.js +0 -1
- package/lib/exercises/math/calcul/proportionality/scaleCalculation.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/scaleCalculation.js +4 -2
- package/lib/exercises/math/calcul/proportionality/scaleUsage.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/scaleUsage.js +4 -2
- package/lib/exercises/math/calcul/rounding/rounding.d.ts.map +1 -1
- package/lib/exercises/math/calcul/rounding/rounding.js +7 -3
- package/lib/exercises/math/calculLitteral/distributivity/canonicalFormDevelopment.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/canonicalFormDevelopment.js +11 -5
- package/lib/exercises/math/calculLitteral/distributivity/firstIdentity.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/firstIdentity.js +14 -2
- package/lib/exercises/math/calculLitteral/distributivity/secondIdentity.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/secondIdentity.js +14 -2
- package/lib/exercises/math/calculLitteral/distributivity/thirdIdentity.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/thirdIdentity.js +14 -2
- package/lib/exercises/math/calculLitteral/equation/equationSimpleSquare.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.js +12 -2
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.js +12 -2
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq3.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq3.js +12 -2
- package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalForm.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalForm.js +12 -2
- package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalFormWithSqrt.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalFormWithSqrt.js +12 -4
- package/lib/exercises/math/derivation/derivative/thirdDegreeFunctionVariation.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/thirdDegreeFunctionVariation.js +6 -6
- package/lib/exercises/math/derivation/derivativeNumberReading.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivativeNumberReading.js +5 -6
- package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.js +14 -2
- package/lib/exercises/math/functions/affines/affineExpressionReading.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineExpressionReading.js +5 -6
- package/lib/exercises/math/functions/affines/interceptReading.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/interceptReading.js +5 -6
- package/lib/exercises/math/functions/affines/leadingCoefficient.js +5 -5
- package/lib/exercises/math/functions/basics/graphicEquation.js +5 -5
- package/lib/exercises/math/functions/basics/graphicInequation.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/graphicInequation.js +4 -6
- package/lib/exercises/math/functions/basics/imageFunctionGeogebra.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/imageFunctionGeogebra.js +2 -4
- package/lib/exercises/math/functions/basics/inverseImageFunctionGeogebra.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/inverseImageFunctionGeogebra.js +4 -6
- package/lib/exercises/math/functions/basics/twoFunctionsEquation.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/twoFunctionsEquation.js +4 -6
- package/lib/exercises/math/functions/basics/twoFunctionsInequation.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/twoFunctionsInequation.js +4 -6
- package/lib/exercises/math/functions/parity/parityFromGraph.js +6 -6
- package/lib/exercises/math/functions/trinoms/rootsReading.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/rootsReading.js +4 -7
- package/lib/exercises/math/functions/trinoms/summitReading.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitReading.js +5 -4
- package/lib/exercises/math/geometry/areas/rightTriangleArea.d.ts.map +1 -1
- package/lib/exercises/math/geometry/areas/rightTriangleArea.js +5 -4
- package/lib/exercises/math/geometry/areas/triangleArea.d.ts.map +1 -1
- package/lib/exercises/math/geometry/areas/triangleArea.js +5 -4
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.js +8 -8
- package/lib/exercises/math/geometry/cartesian/directionVector.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/directionVector.js +6 -5
- package/lib/exercises/math/geometry/cartesian/drawAlineInGGB.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/drawAlineInGGB.js +9 -8
- package/lib/exercises/math/geometry/cartesian/placeAPoint.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/placeAPoint.js +9 -7
- package/lib/exercises/math/geometry/cartesian/pointCoordinates.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/pointCoordinates.js +12 -6
- package/lib/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.d.ts.map +1 -1
- package/lib/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.js +7 -6
- package/lib/exercises/math/geometry/convexity/convexityTrinomialsGeo.js +6 -6
- package/lib/exercises/math/geometry/pythagore/pythagore.d.ts.map +1 -1
- package/lib/exercises/math/geometry/pythagore/pythagore.js +5 -4
- package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts.map +1 -1
- package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.js +5 -4
- package/lib/exercises/math/geometry/thales/thales.d.ts.map +1 -1
- package/lib/exercises/math/geometry/thales/thales.js +5 -4
- package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts.map +1 -1
- package/lib/exercises/math/geometry/thales/thalesCalcul.js +5 -4
- package/lib/exercises/math/geometry/vectors/coordinatesReading.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/coordinatesReading.js +5 -6
- package/lib/exercises/math/geometry/vectors/drawAVectorInGGB.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/drawAVectorInGGB.js +10 -8
- package/lib/exercises/math/geometry/vectors/equalCaracteristicFromGraph.js +5 -5
- package/lib/exercises/math/geometry/vectors/scalarProductViaCoords.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProductViaCoords.js +5 -1
- package/lib/exercises/math/geometry/vectors/vectorCoordinatesFromTwoPoints.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/vectorCoordinatesFromTwoPoints.js +5 -3
- package/lib/exercises/math/geometry/volumes/coneVolume.js +6 -6
- package/lib/exercises/math/geometry/volumes/parallelepipedVolume.js +6 -6
- package/lib/exercises/math/geometry/volumes/sphereVolume.js +6 -6
- package/lib/exercises/math/geometry/volumes/volumeOfCube.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/volumeOfCube.js +5 -4
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithSquareOrRectBase.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithSquareOrRectBase.js +5 -4
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleBase.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleBase.js +12 -11
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleRectBase.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleRectBase.js +5 -4
- package/lib/exercises/math/limits/limitReading.js +6 -6
- package/lib/exercises/math/percent/applyPercent.d.ts.map +1 -1
- package/lib/exercises/math/percent/applyPercent.js +10 -2
- package/lib/exercises/math/percent/averageEvolutionRate.d.ts.map +1 -1
- package/lib/exercises/math/percent/averageEvolutionRate.js +9 -4
- package/lib/exercises/math/percent/cmToEvolution.d.ts.map +1 -1
- package/lib/exercises/math/percent/cmToEvolution.js +3 -1
- package/lib/exercises/math/percent/globalPercent.d.ts.map +1 -1
- package/lib/exercises/math/percent/globalPercent.js +5 -3
- package/lib/exercises/math/probaStat/probabilityTree.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probabilityTree.js +5 -4
- package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.js +5 -4
- package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromGraph.js +13 -13
- package/lib/exercises/math/sequences/arithmetic/recognizeReasonFromGraph.js +10 -10
- package/lib/exercises/math/sequences/sequencePlot.d.ts.map +1 -1
- package/lib/exercises/math/sequences/sequencePlot.js +10 -12
- package/lib/exercises/math/spaceGeometry/vectors/spaceVectorCoordinatesFromPoints.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/vectors/spaceVectorCoordinatesFromPoints.js +3 -1
- package/lib/exercises/math/trigonometry/trigonometry.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/trigonometry.js +5 -4
- package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.js +5 -4
- package/lib/exercises/math/trigonometry/trigonometrySideCalcul.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/trigonometrySideCalcul.js +5 -4
- package/lib/exercises/pc/calibrationCurveOfSolution.d.ts.map +1 -1
- package/lib/exercises/pc/calibrationCurveOfSolution.js +11 -8
- package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.d.ts.map +1 -1
- package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.js +15 -5
- package/lib/exercises/pc/forces/calculateNormalOrFrictionForce.d.ts.map +1 -1
- package/lib/exercises/pc/forces/calculateNormalOrFrictionForce.js +0 -1
- package/lib/exercises/pc/math/proportionnalityCoeffFromLine.d.ts.map +1 -1
- package/lib/exercises/pc/math/proportionnalityCoeffFromLine.js +7 -6
- package/lib/exercises/pc/mecanicalWaves/elongationReading.d.ts.map +1 -1
- package/lib/exercises/pc/mecanicalWaves/elongationReading.js +7 -6
- package/lib/exercises/pc/mole/concentrationReading.d.ts.map +1 -1
- package/lib/exercises/pc/mole/concentrationReading.js +8 -6
- package/lib/exercises/pc/motion/characteristicsOfVelocityVector.d.ts.map +1 -1
- package/lib/exercises/pc/motion/characteristicsOfVelocityVector.js +2 -3
- package/lib/exercises/pc/motion/typeOfAcceleration.d.ts.map +1 -1
- package/lib/exercises/pc/motion/typeOfAcceleration.js +5 -4
- package/lib/exercises/pc/motion/typeOfMovement.js +4 -4
- package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.d.ts.map +1 -1
- package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.js +5 -4
- package/lib/exercises/pc/sound/findPeriodFromGraph.d.ts.map +1 -1
- package/lib/exercises/pc/sound/findPeriodFromGraph.js +7 -5
- package/lib/exercises/pc/sound/findPeriodOrFrequencyFromGraph.d.ts.map +1 -1
- package/lib/exercises/pc/sound/findPeriodOrFrequencyFromGraph.js +7 -6
- package/lib/exercises/utils/getDistinctQuestions.d.ts.map +1 -1
- package/lib/exercises/utils/getDistinctQuestions.js +2 -1
- package/lib/geogebra/geogebraConstructor.d.ts +18 -23
- package/lib/geogebra/geogebraConstructor.d.ts.map +1 -1
- package/lib/geogebra/geogebraConstructor.js +23 -16
- package/lib/index.d.ts +1 -76
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -57
- package/lib/prototypesEnhancement.d.ts +14 -0
- package/lib/prototypesEnhancement.d.ts.map +1 -0
- package/lib/prototypesEnhancement.js +26 -0
- package/lib/server.d.ts +1 -12
- package/lib/server.d.ts.map +1 -1
- package/lib/server.js +1 -24
- package/lib/utils/alignTex.js +2 -2
- package/package.json +3 -2
package/lib/server.js
CHANGED
|
@@ -33,35 +33,12 @@ const express_1 = __importDefault(require("express"));
|
|
|
33
33
|
const body_parser_1 = __importDefault(require("body-parser"));
|
|
34
34
|
const dotenv_1 = __importDefault(require("dotenv"));
|
|
35
35
|
const cors_1 = __importDefault(require("cors"));
|
|
36
|
-
const numberNode_1 = require("./tree/nodes/numbers/numberNode");
|
|
37
|
-
const infiniteNode_1 = require("./tree/nodes/numbers/infiniteNode");
|
|
38
|
-
const toScientific_1 = require("./utils/numberPrototype/toScientific");
|
|
39
|
-
const variableNode_1 = require("./tree/nodes/variables/variableNode");
|
|
40
36
|
const playground_1 = require("./playground");
|
|
37
|
+
require("./prototypesEnhancement");
|
|
41
38
|
const jsonParser = body_parser_1.default.json();
|
|
42
39
|
const mathExercises = Object.values(MathExercises);
|
|
43
40
|
const pcExercises = Object.values(PCExercises);
|
|
44
41
|
const allExercises = [...mathExercises, ...pcExercises];
|
|
45
|
-
String.prototype.toTree = function () {
|
|
46
|
-
return new variableNode_1.VariableNode(this.valueOf());
|
|
47
|
-
};
|
|
48
|
-
String.prototype.unfrenchify = function () {
|
|
49
|
-
return Number(this.valueOf().replace(",", "."));
|
|
50
|
-
};
|
|
51
|
-
Number.prototype.toTree = function () {
|
|
52
|
-
const value = this.valueOf();
|
|
53
|
-
if (value === Infinity)
|
|
54
|
-
return infiniteNode_1.PlusInfinityNode;
|
|
55
|
-
if (value === -Infinity)
|
|
56
|
-
return infiniteNode_1.MinusInfinityNode;
|
|
57
|
-
return new numberNode_1.NumberNode(value);
|
|
58
|
-
};
|
|
59
|
-
Number.prototype.frenchify = function () {
|
|
60
|
-
return (this.valueOf() + "").replace(".", ",");
|
|
61
|
-
};
|
|
62
|
-
Number.prototype.toScientific = function (decimals) {
|
|
63
|
-
return (0, toScientific_1.toScientific)(this.valueOf(), decimals);
|
|
64
|
-
};
|
|
65
42
|
const runServer = () => {
|
|
66
43
|
dotenv_1.default.config();
|
|
67
44
|
const app = (0, express_1.default)();
|
package/lib/utils/alignTex.js
CHANGED
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.alignTex = void 0;
|
|
4
4
|
function alignTex(arr) {
|
|
5
5
|
let alignements = "r";
|
|
6
|
-
if (typeof arr !== "string") {
|
|
7
|
-
for (let i = 0; i < arr.length - 2; i++) {
|
|
6
|
+
if (typeof arr !== "string" && arr[0].length > 2) {
|
|
7
|
+
for (let i = 0; i < arr[0].length - 2; i++) {
|
|
8
8
|
alignements += "c";
|
|
9
9
|
}
|
|
10
10
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "math-exercises",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.16",
|
|
4
4
|
"description": "Math exercises generator for middle school and high school",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"files": [
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"scripts": {
|
|
10
10
|
"dev": "nodemon",
|
|
11
11
|
"start": "ts-node -r tsconfig-paths/register src/index.ts",
|
|
12
|
-
"test": "jest",
|
|
12
|
+
"test": "npx jest global.test.ts",
|
|
13
|
+
"testml": "npx jest ml.test.ts",
|
|
13
14
|
"prepublishOnly": "npm run build",
|
|
14
15
|
"build": "tsc && tsc-alias"
|
|
15
16
|
},
|