math-exercises 3.0.217 → 3.0.218
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/math/calcul/arithmetics/commonDivisorsList.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/commonDivisorsList.js +1 -0
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.js +5 -8
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerProduct.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerProduct.js +7 -17
- package/lib/exercises/math/calcul/fractions/fractionForbiddenValue.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionForbiddenValue.js +5 -6
- package/lib/exercises/math/calcul/fractions/fractionsDivision.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsDivision.js +7 -17
- package/lib/exercises/math/calcul/fractions/fractionsSum.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSum.js +7 -22
- package/lib/exercises/math/calcul/fractions/fractionsSumFillInTheBlank.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumFillInTheBlank.js +7 -19
- package/lib/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.js +7 -22
- package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.js +7 -22
- package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.d.ts +4 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.js +7 -23
- package/lib/exercises/math/calcul/fractions/periodicWritingToFraction.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/periodicWritingToFraction.js +3 -7
- package/lib/exercises/math/calcul/fractions/simplifyFraction.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/simplifyFraction.js +6 -7
- package/lib/exercises/math/calcul/mentalCaluls/mentalDivisions.d.ts.map +1 -1
- package/lib/exercises/math/calcul/mentalCaluls/mentalDivisions.js +3 -4
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication101AndFriends.d.ts.map +1 -1
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication101AndFriends.js +2 -4
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication11AndFriends.d.ts.map +1 -1
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication11AndFriends.js +2 -4
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationTable.d.ts.map +1 -1
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationTable.js +2 -4
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplications.d.ts.map +1 -1
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplications.js +2 -4
- package/lib/exercises/math/calcul/operations/operationsPrioritiesWithoutRelative.d.ts.map +1 -1
- package/lib/exercises/math/calcul/operations/operationsPrioritiesWithoutRelative.js +3 -4
- package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivityAdd.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivityAdd.js +14 -3
- package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivitySubstract.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivitySubstract.js +14 -3
- package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivityWithCoeff.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivityWithCoeff.js +8 -5
- package/lib/exercises/math/calculLitteral/distributivity/simpleDistriXCoeff.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/simpleDistriXCoeff.js +14 -5
- package/lib/exercises/math/calculLitteral/equation/fractionEquation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/fractionEquation.js +10 -10
- package/lib/exercises/math/calculLitteral/factorisation/factoByXK.d.ts +0 -8
- package/lib/exercises/math/calculLitteral/factorisation/factoByXK.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoByXK.js +223 -190
- package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalFormWithSqrt.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalFormWithSqrt.js +22 -9
- package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +0 -1
- package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/index.js +1 -1
- package/lib/exercises/math/complex/argumentFromAlgebraicComplex.d.ts.map +1 -1
- package/lib/exercises/math/complex/argumentFromAlgebraicComplex.js +10 -4
- package/lib/exercises/math/functions/absolute/absoluteValueEquations.js +12 -12
- package/lib/exercises/math/functions/affines/adjustment/affineAdjustmentRsquared.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/adjustment/affineAdjustmentRsquared.js +10 -18
- package/lib/exercises/math/functions/affines/affineMeanValue.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineMeanValue.js +3 -5
- package/lib/exercises/math/functions/basics/findZeroesProductQuotient.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/findZeroesProductQuotient.js +0 -1
- package/lib/exercises/math/functions/basics/twoFunctionsEquation.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/twoFunctionsEquation.js +12 -7
- package/lib/exercises/math/functions/integral/integralExpAxPlusB.d.ts.map +1 -1
- package/lib/exercises/math/functions/integral/integralExpAxPlusB.js +19 -3
- package/lib/exercises/math/functions/logarithm/log10Simplifying.d.ts.map +1 -1
- package/lib/exercises/math/functions/logarithm/log10Simplifying.js +20 -6
- package/lib/exercises/math/functions/logarithm/logSimplifiying.d.ts.map +1 -1
- package/lib/exercises/math/functions/logarithm/logSimplifiying.js +14 -9
- package/lib/exercises/math/functions/rationalFraction/rationalFractionForbiddenValue.d.ts.map +1 -1
- package/lib/exercises/math/functions/rationalFraction/rationalFractionForbiddenValue.js +9 -6
- package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationFromCano.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationFromCano.js +12 -8
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/canonicalFromDevForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/canonicalFromDevForm.js +21 -4
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumFromCanonicalForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumFromCanonicalForm.js +4 -7
- package/lib/exercises/math/functions/trinoms/trinomialMeanValue.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/trinomialMeanValue.js +3 -5
- package/lib/exercises/math/geometry/areas/circleArea.d.ts.map +1 -1
- package/lib/exercises/math/geometry/areas/circleArea.js +4 -2
- package/lib/exercises/math/geometry/areas/rectangleArea.d.ts.map +1 -1
- package/lib/exercises/math/geometry/areas/rectangleArea.js +4 -2
- package/lib/exercises/math/geometry/areas/rightTriangleArea.d.ts.map +1 -1
- package/lib/exercises/math/geometry/areas/rightTriangleArea.js +14 -11
- package/lib/exercises/math/geometry/areas/squareArea.d.ts.map +1 -1
- package/lib/exercises/math/geometry/areas/squareArea.js +4 -2
- package/lib/exercises/math/geometry/areas/squareSideFromArea.d.ts.map +1 -1
- package/lib/exercises/math/geometry/areas/squareSideFromArea.js +6 -4
- package/lib/exercises/math/geometry/areas/triangleArea.d.ts.map +1 -1
- package/lib/exercises/math/geometry/areas/triangleArea.js +3 -1
- package/lib/exercises/math/geometry/areas/triangleAreaV2.d.ts.map +1 -1
- package/lib/exercises/math/geometry/areas/triangleAreaV2.js +4 -2
- package/lib/exercises/math/geometry/cartesian/midpoint.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/midpoint.js +6 -11
- package/lib/exercises/math/geometry/perimeters/rectangleSideFromPerimeter.d.ts.map +1 -1
- package/lib/exercises/math/geometry/perimeters/rectangleSideFromPerimeter.js +3 -3
- package/lib/exercises/math/geometry/perimeters/squareSideFromPerimeter.d.ts.map +1 -1
- package/lib/exercises/math/geometry/perimeters/squareSideFromPerimeter.js +3 -3
- package/lib/exercises/math/geometry/vectors/vectorNormCalculation.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/vectorNormCalculation.js +3 -5
- package/lib/exercises/math/geometry/volumes/parallelepipedVolume.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/parallelepipedVolume.js +3 -4
- package/lib/exercises/math/geometry/volumes/sphereVolume.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/sphereVolume.js +3 -4
- package/lib/exercises/math/geometry/volumes/volumeOfCube.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/volumeOfCube.js +3 -4
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleBase.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleBase.js +3 -6
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleRectBase.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleRectBase.js +3 -6
- package/lib/exercises/math/graphs/graphsChainOrPathOfLengthN.d.ts.map +1 -1
- package/lib/exercises/math/graphs/graphsChainOrPathOfLengthN.js +3 -1
- package/lib/exercises/math/graphs/graphsCheckIsConnectedGraph.d.ts.map +1 -1
- package/lib/exercises/math/graphs/graphsCheckIsConnectedGraph.js +19 -42
- package/lib/exercises/math/graphs/graphsCheckIsSameGraph.d.ts +0 -2
- package/lib/exercises/math/graphs/graphsCheckIsSameGraph.d.ts.map +1 -1
- package/lib/exercises/math/graphs/graphsCheckIsSameGraph.js +4 -14
- package/lib/exercises/math/graphs/graphsCheckIsVerticesAdjacent.d.ts.map +1 -1
- package/lib/exercises/math/graphs/graphsCheckIsVerticesAdjacent.js +3 -1
- package/lib/exercises/math/graphs/graphsDegreeOfVertex.d.ts.map +1 -1
- package/lib/exercises/math/graphs/graphsDegreeOfVertex.js +3 -1
- package/lib/exercises/math/graphs/graphsOrderOfGraph.d.ts.map +1 -1
- package/lib/exercises/math/graphs/graphsOrderOfGraph.js +3 -1
- package/lib/exercises/math/limits/rationalFracLimit.d.ts.map +1 -1
- package/lib/exercises/math/limits/rationalFracLimit.js +9 -20
- package/lib/exercises/math/limits/sequences/sequenceRationalFracLimit.d.ts.map +1 -1
- package/lib/exercises/math/limits/sequences/sequenceRationalFracLimit.js +9 -20
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormula.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormula.js +11 -28
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstRankOne.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstRankOne.js +12 -27
- package/lib/exercises/math/spaceGeometry/vectors/spaceVectorNormCalculation.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/vectors/spaceVectorNormCalculation.js +3 -5
- package/lib/exercises/math/squareRoots/simpifySquareRoot.d.ts.map +1 -1
- package/lib/exercises/math/squareRoots/simpifySquareRoot.js +5 -4
- package/lib/exercises/math/squareRoots/squareRootEquation.d.ts.map +1 -1
- package/lib/exercises/math/squareRoots/squareRootEquation.js +9 -8
- package/lib/exercises/math/squareRoots/squareRootIdentities.d.ts.map +1 -1
- package/lib/exercises/math/squareRoots/squareRootIdentities.js +7 -4
- package/lib/exercises/math/squareRoots/squareRootsDistributivity.d.ts.map +1 -1
- package/lib/exercises/math/squareRoots/squareRootsDistributivity.js +7 -8
- package/lib/exercises/math/trigonometry/arcLength.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/arcLength.js +3 -8
- package/lib/exercises/pc/chemicalElements/findAtomEntitiesNumberFromMass.d.ts.map +1 -1
- package/lib/exercises/pc/chemicalElements/findAtomEntitiesNumberFromMass.js +0 -6
- package/lib/exercises/pc/dosage/beerLambertRandomValue.d.ts.map +1 -1
- package/lib/exercises/pc/dosage/beerLambertRandomValue.js +3 -4
- package/lib/exercises/pc/dosage/concentrationFromMassCalculation.d.ts.map +1 -1
- package/lib/exercises/pc/dosage/concentrationFromMassCalculation.js +3 -18
- package/lib/exercises/pc/energy/energyTransfer.d.ts.map +1 -1
- package/lib/exercises/pc/energy/energyTransfer.js +3 -8
- package/lib/exercises/pc/energy/thermalEnergyTransferCalculation.d.ts.map +1 -1
- package/lib/exercises/pc/energy/thermalEnergyTransferCalculation.js +3 -24
- package/lib/exercises/pc/math/proportionnalityCoeffFromLine.d.ts.map +1 -1
- package/lib/exercises/pc/math/proportionnalityCoeffFromLine.js +9 -6
- package/lib/exercises/vea/equationVEA.d.ts.map +1 -1
- package/lib/exercises/vea/equationVEA.js +2 -0
- package/lib/exercises/vea/rationalVEA.d.ts +2 -1
- package/lib/exercises/vea/rationalVEA.d.ts.map +1 -1
- package/lib/exercises/vea/rationalVEA.js +36 -2
- package/lib/index.d.ts +3 -8
- package/lib/index.d.ts.map +1 -1
- package/lib/math/utils/graphs/graphRenderer.d.ts +7 -9
- package/lib/math/utils/graphs/graphRenderer.d.ts.map +1 -1
- package/lib/math/utils/graphs/graphRenderer.js +25 -117
- package/lib/tree/nodes/algebraicNode.d.ts +2 -0
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/algebraicNode.js +11 -0
- package/lib/tree/nodes/functions/log10Node.d.ts +2 -2
- package/lib/tree/nodes/functions/log10Node.d.ts.map +1 -1
- package/lib/tree/nodes/functions/log10Node.js +3 -1
- package/lib/tree/nodes/functions/logNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/logNode.js +2 -0
- package/lib/tree/nodes/operators/addNode.js +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +1 -1
- package/package.json +1 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { defaultArrayedOptsWhereNeeded } from "../../../../exercises/utils/options/arrayedOptions.js";
|
|
4
|
-
import {
|
|
4
|
+
import { numberVEA } from "../../../../exercises/vea/numberVEA.js";
|
|
5
5
|
import { MultiplyNode } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
6
6
|
import { operatorComposition } from "../../../../tree/utilities/operatorComposition.js";
|
|
7
7
|
import { random } from "../../../../utils/alea/random.js";
|
|
@@ -74,9 +74,7 @@ const getPropositions = (n, { answer, ...identifiers }) => {
|
|
|
74
74
|
return shuffleProps(propositions, n);
|
|
75
75
|
};
|
|
76
76
|
const isAnswerValid = (studentAns, { answer }) => {
|
|
77
|
-
|
|
78
|
-
const texs = answerTree.toAllValidTexs();
|
|
79
|
-
return texs.includes(studentAns);
|
|
77
|
+
return numberVEA(studentAns, answer);
|
|
80
78
|
};
|
|
81
79
|
const getMentalMultiplicationTableQuestion = (optsIn) => {
|
|
82
80
|
const arrayedOptions = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mentalMultiplications.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/mentalCaluls/mentalMultiplications.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;
|
|
1
|
+
{"version":3,"file":"mentalMultiplications.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/mentalCaluls/mentalMultiplications.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AA4GF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAevD,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { addValidProp, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { numberVEA } from "../../../../exercises/vea/numberVEA.js";
|
|
3
4
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
4
5
|
import { round } from "../../../../math/utils/round.js";
|
|
5
|
-
import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
|
|
6
6
|
import { MultiplyNode } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
7
7
|
import { NodeSimplifier } from "../../../../tree/utilities/nodeSimplifier.js";
|
|
8
8
|
import { operatorComposition } from "../../../../tree/utilities/operatorComposition.js";
|
|
@@ -55,9 +55,7 @@ const getPropositions = (n, { answer }) => {
|
|
|
55
55
|
return shuffle(propositions);
|
|
56
56
|
};
|
|
57
57
|
const isAnswerValid = (studentAns, { answer }) => {
|
|
58
|
-
|
|
59
|
-
const texs = answerTree.toAllValidTexs();
|
|
60
|
-
return texs.includes(studentAns);
|
|
58
|
+
return numberVEA(studentAns, answer);
|
|
61
59
|
};
|
|
62
60
|
const getMentalMultiplications = () => {
|
|
63
61
|
let numbers = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operationsPrioritiesWithoutRelative.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/operations/operationsPrioritiesWithoutRelative.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"operationsPrioritiesWithoutRelative.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/operations/operationsPrioritiesWithoutRelative.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA8UF,eAAO,MAAM,mCAAmC,EAAE,QAAQ,CAAC,WAAW,CAarE,CAAC"}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { addValidProp, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
9
9
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
10
|
+
import { numberVEA } from "../../../../exercises/vea/numberVEA.js";
|
|
10
11
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
11
12
|
import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
|
|
12
13
|
import { AddNode } from "../../../../tree/nodes/operators/addNode.js";
|
|
@@ -249,10 +250,8 @@ const getPropositions = (n, { answer }) => {
|
|
|
249
250
|
});
|
|
250
251
|
return shuffle(propositions);
|
|
251
252
|
};
|
|
252
|
-
const isAnswerValid = (
|
|
253
|
-
|
|
254
|
-
const texs = answerTree.toAllValidTexs();
|
|
255
|
-
return texs.includes(studentAns);
|
|
253
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
254
|
+
return numberVEA(ans, answer);
|
|
256
255
|
};
|
|
257
256
|
export const operationsPrioritiesWithoutRelative = {
|
|
258
257
|
id: "operationsPrioritiesWithoutRelative",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doubleDistributivityAdd.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/doubleDistributivityAdd.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,wBAAwB,EACzB,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"doubleDistributivityAdd.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/doubleDistributivityAdd.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,wBAAwB,EACzB,MAAM,yCAAyC,CAAC;AAWjD,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IAEb,OAAO,EAAE,wBAAwB,CAAC;IAClC,OAAO,EAAE,wBAAwB,CAAC;IAElC,OAAO,EAAE,wBAAwB,CAAC;IAElC,OAAO,CAAC,EAAE,wBAAwB,CAAC;CACpC,CAAC;AA6LF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAczD,CAAC"}
|
|
@@ -7,6 +7,8 @@ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
|
7
7
|
import { square } from "../../../../tree/nodes/operators/powerNode.js";
|
|
8
8
|
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
9
9
|
import { TrinomNodeConstructor } from "../../../../tree/nodes/polynomials/trinomNode.js";
|
|
10
|
+
import { polynomialParser } from "../../../../tree/parsers/polynomialParser.js";
|
|
11
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
10
12
|
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
11
13
|
//(ax+b)(cx+d)+ex(gx+h)
|
|
12
14
|
//(ax+b)(cx+d)+(ex+f)(gx+h)
|
|
@@ -122,9 +124,18 @@ ${alignTex([
|
|
|
122
124
|
const getKeys = () => {
|
|
123
125
|
return ["x"];
|
|
124
126
|
};
|
|
125
|
-
const isAnswerValid = (ans, { answer
|
|
126
|
-
|
|
127
|
-
|
|
127
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
128
|
+
try {
|
|
129
|
+
const parsed = polynomialParser(ans);
|
|
130
|
+
if (!parsed)
|
|
131
|
+
return false;
|
|
132
|
+
return (parsed
|
|
133
|
+
.simplify({ towardsDistribute: true, forbidFactorize: true })
|
|
134
|
+
.toTex() === answer);
|
|
135
|
+
}
|
|
136
|
+
catch (err) {
|
|
137
|
+
return handleVEAError(err);
|
|
138
|
+
}
|
|
128
139
|
};
|
|
129
140
|
const getDoubleDistributivityAddQuestion = () => {
|
|
130
141
|
const type = randint(1, 4);
|
package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivitySubstract.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doubleDistributivitySubstract.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/doubleDistributivitySubstract.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,wBAAwB,EACzB,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"doubleDistributivitySubstract.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/doubleDistributivitySubstract.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,wBAAwB,EACzB,MAAM,yCAAyC,CAAC;AAWjD,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IAEb,OAAO,EAAE,wBAAwB,CAAC;IAClC,OAAO,EAAE,wBAAwB,CAAC;IAElC,OAAO,EAAE,wBAAwB,CAAC;IAElC,OAAO,CAAC,EAAE,wBAAwB,CAAC;CACpC,CAAC;AA6LF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAiB/D,CAAC"}
|
|
@@ -7,6 +7,8 @@ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
|
7
7
|
import { square } from "../../../../tree/nodes/operators/powerNode.js";
|
|
8
8
|
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
9
9
|
import { TrinomNodeConstructor } from "../../../../tree/nodes/polynomials/trinomNode.js";
|
|
10
|
+
import { polynomialParser } from "../../../../tree/parsers/polynomialParser.js";
|
|
11
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
10
12
|
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
11
13
|
//(ax+b)(cx+d)-ex(gx+h)
|
|
12
14
|
//(ax+b)(cx+d)-(ex+f)(gx+h)
|
|
@@ -122,9 +124,18 @@ ${alignTex([
|
|
|
122
124
|
const getKeys = () => {
|
|
123
125
|
return ["x"];
|
|
124
126
|
};
|
|
125
|
-
const isAnswerValid = (ans, { answer
|
|
126
|
-
|
|
127
|
-
|
|
127
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
128
|
+
try {
|
|
129
|
+
const parsed = polynomialParser(ans);
|
|
130
|
+
if (!parsed)
|
|
131
|
+
return false;
|
|
132
|
+
return (parsed
|
|
133
|
+
.simplify({ towardsDistribute: true, forbidFactorize: true })
|
|
134
|
+
.toTex() === answer);
|
|
135
|
+
}
|
|
136
|
+
catch (err) {
|
|
137
|
+
return handleVEAError(err);
|
|
138
|
+
}
|
|
128
139
|
};
|
|
129
140
|
const getDoubleDistributivitySubstractQuestion = () => {
|
|
130
141
|
const type = randint(1, 4);
|
package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivityWithCoeff.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doubleDistributivityWithCoeff.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/doubleDistributivityWithCoeff.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"doubleDistributivityWithCoeff.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/doubleDistributivityWithCoeff.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AA+IF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAc/D,CAAC"}
|
|
@@ -5,6 +5,7 @@ import { TrinomConstructor } from "../../../../math/polynomials/trinom.js";
|
|
|
5
5
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
6
6
|
import { AddNode } from "../../../../tree/nodes/operators/addNode.js";
|
|
7
7
|
import { MultiplyNode } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
8
|
+
import { polynomialParser } from "../../../../tree/parsers/polynomialParser.js";
|
|
8
9
|
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
9
10
|
const getHint = () => {
|
|
10
11
|
return `Choisis deux facteurs de ce produit et multiplie les entre eux. Puis multiplie le résultat obtenu par le troisième terme.`;
|
|
@@ -83,11 +84,13 @@ const getPropositions = (n, { answer }) => {
|
|
|
83
84
|
});
|
|
84
85
|
return shuffleProps(propositions, n);
|
|
85
86
|
};
|
|
86
|
-
const isAnswerValid = (ans, {
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
return
|
|
87
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
88
|
+
const parsed = polynomialParser(ans);
|
|
89
|
+
if (!parsed)
|
|
90
|
+
return false;
|
|
91
|
+
return (parsed
|
|
92
|
+
.simplify({ towardsDistribute: true, forbidFactorize: true })
|
|
93
|
+
.toTex() === answer);
|
|
91
94
|
};
|
|
92
95
|
export const doubleDistributivityWithCoeff = {
|
|
93
96
|
id: "doubleDistributivityWithCoeff",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simpleDistriXCoeff.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/simpleDistriXCoeff.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"simpleDistriXCoeff.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/simpleDistriXCoeff.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAarC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAwHF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAepD,CAAC"}
|
|
@@ -6,6 +6,8 @@ import { randint } from "../../../../math/utils/random/randint.js";
|
|
|
6
6
|
import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
|
|
7
7
|
import { AddNode } from "../../../../tree/nodes/operators/addNode.js";
|
|
8
8
|
import { MultiplyNode } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
9
|
+
import { polynomialParser } from "../../../../tree/parsers/polynomialParser.js";
|
|
10
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
9
11
|
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
10
12
|
const getPropositions = (n, { answer, a, b, c }) => {
|
|
11
13
|
const propositions = [];
|
|
@@ -68,11 +70,18 @@ const getCorrection = (identifiers) => {
|
|
|
68
70
|
const getKeys = () => {
|
|
69
71
|
return ["x"];
|
|
70
72
|
};
|
|
71
|
-
const isAnswerValid = (ans, {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
74
|
+
try {
|
|
75
|
+
const parsed = polynomialParser(ans);
|
|
76
|
+
if (!parsed)
|
|
77
|
+
return false;
|
|
78
|
+
return (parsed
|
|
79
|
+
.simplify({ towardsDistribute: true, forbidFactorize: true })
|
|
80
|
+
.toTex() === answer);
|
|
81
|
+
}
|
|
82
|
+
catch (err) {
|
|
83
|
+
return handleVEAError(err);
|
|
84
|
+
}
|
|
76
85
|
};
|
|
77
86
|
const getSimpleDistriXCoeffQuestion = () => {
|
|
78
87
|
const a = randint(-10, 11, [0]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fractionEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/fractionEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"fractionEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/fractionEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAcrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAoIF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAalD,CAAC"}
|
|
@@ -6,9 +6,11 @@ import { randint } from "../../../../math/utils/random/randint.js";
|
|
|
6
6
|
import { EqualNode } from "../../../../tree/nodes/equations/equalNode.js";
|
|
7
7
|
import { EquationSolutionNode } from "../../../../tree/nodes/equations/equationSolutionNode.js";
|
|
8
8
|
import { FractionNode } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
9
|
-
import { DiscreteSetNode
|
|
9
|
+
import { DiscreteSetNode } from "../../../../tree/nodes/sets/discreteSetNode.js";
|
|
10
10
|
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
11
11
|
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
12
|
+
import { equationVEA } from "../../../../exercises/vea/equationVEA.js";
|
|
13
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
12
14
|
const getStatementNode = (identifiers) => {
|
|
13
15
|
const { a, b, c, d } = identifiers;
|
|
14
16
|
const polynome1 = new Polynomial([b, a]);
|
|
@@ -110,15 +112,13 @@ const getPropositions = (n, { answer, c, d }) => {
|
|
|
110
112
|
});
|
|
111
113
|
return shuffle(propositions);
|
|
112
114
|
};
|
|
113
|
-
const isAnswerValid = (ans, {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
const validLatexs = answer.toAllValidTexs();
|
|
121
|
-
return validLatexs.includes(ans);
|
|
115
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
116
|
+
try {
|
|
117
|
+
return equationVEA(ans, answer.replace("S=", ""));
|
|
118
|
+
}
|
|
119
|
+
catch (err) {
|
|
120
|
+
return handleVEAError(err);
|
|
121
|
+
}
|
|
122
122
|
};
|
|
123
123
|
export const fractionEquation = {
|
|
124
124
|
id: "fractionEquation",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factoByXK.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoByXK.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"factoByXK.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoByXK.ts"],"names":[],"mappings":""}
|