math-exercises 3.0.216 → 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/exp/expOfFEqualsExpOfGEquation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/exp/expOfFEqualsExpOfGEquation.js +19 -32
- 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/derivation/derivative/trigo/sinCosDerivativeRewriteUsingCos2PlusSin2Equals1.js +2 -2
- 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 +11 -0
- package/lib/exercises/math/graphs/graphsCheckIsConnectedGraph.d.ts.map +1 -0
- package/lib/exercises/math/graphs/graphsCheckIsConnectedGraph.js +155 -0
- package/lib/exercises/math/graphs/graphsCheckIsConnectedUndirectedGraph.js +1 -1
- 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/graphs/index.d.ts +1 -1
- package/lib/exercises/math/graphs/index.d.ts.map +1 -1
- package/lib/exercises/math/graphs/index.js +1 -1
- package/lib/exercises/math/integration/fromExpr/integralFromExpr.d.ts.map +1 -1
- package/lib/exercises/math/integration/fromExpr/integralFromExpr.js +2 -0
- 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/parametricLine/lineLineRelativePositionsFromParametricLines.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/parametricLine/lineLineRelativePositionsFromParametricLines.js +56 -3
- package/lib/exercises/math/spaceGeometry/planes/findNormalVectorFromPlaneEquation.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/planes/findNormalVectorFromPlaneEquation.js +6 -0
- 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/exercises/vea/treeTableVEA.d.ts.map +1 -1
- package/lib/exercises/vea/treeTableVEA.js +2 -0
- package/lib/index.d.ts +3 -8
- package/lib/index.d.ts.map +1 -1
- package/lib/math/graphs/graph.d.ts +1 -1
- package/lib/math/graphs/graph.d.ts.map +1 -1
- package/lib/math/graphs/graph.js +86 -30
- 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
|
@@ -10,7 +10,6 @@ import { randint } from "../../../math/utils/random/randint.js";
|
|
|
10
10
|
import { coinFlip } from "../../../utils/alea/coinFlip.js";
|
|
11
11
|
import { probaLawFlip } from "../../../utils/alea/probaLawFlip.js";
|
|
12
12
|
import { random, randomMany } from "../../../utils/alea/random.js";
|
|
13
|
-
import { shuffle } from "../../../utils/alea/shuffle.js";
|
|
14
13
|
const getHydrated = (identifiers) => {
|
|
15
14
|
const { graphIds1, graphIds2, graphNodes1, graphEdges1, graphNodes2, graphEdges2, } = identifiers;
|
|
16
15
|
const [graph1, graph2] = [graphIds1, graphIds2].map((graphIds) => GraphConstructor.fromIdentifiers(graphIds));
|
|
@@ -90,7 +89,7 @@ Ce sont donc des graphes différents.`;
|
|
|
90
89
|
// });
|
|
91
90
|
// };
|
|
92
91
|
const getGGBOptions = (identifiers) => {
|
|
93
|
-
const { graphNodes1, graphEdges1,
|
|
92
|
+
const { graphNodes1, graphEdges1, graphNodes2, graphEdges2 } = identifiers;
|
|
94
93
|
const { graph1, graph2 } = getHydrated(identifiers);
|
|
95
94
|
function createDisplayObjForGraph(graph, graphNodes, graphEdges, scale, index, vecOffset = new Vector("offset", (0).toTree(), (0).toTree())) {
|
|
96
95
|
const arrDictPoint = graphNodes
|
|
@@ -121,12 +120,12 @@ const getGGBOptions = (identifiers) => {
|
|
|
121
120
|
arrGGBCommandForGraph,
|
|
122
121
|
};
|
|
123
122
|
}
|
|
124
|
-
const { arrPoint: arrPoint1, arrGGBCommandForGraph: arrGGBCommandForGraph1 } = createDisplayObjForGraph(graph1, graphNodes1, graphEdges1,
|
|
123
|
+
const { arrPoint: arrPoint1, arrGGBCommandForGraph: arrGGBCommandForGraph1 } = createDisplayObjForGraph(graph1, graphNodes1, graphEdges1, 1, 1);
|
|
125
124
|
const xMin1 = Math.min(...arrPoint1.map((point) => point.x.evaluate()));
|
|
126
125
|
const xMax1 = Math.max(...arrPoint1.map((point) => point.x.evaluate()));
|
|
127
126
|
const width1 = xMax1 - xMin1;
|
|
128
127
|
const vecOffset = new Vector("offset", (xMax1 + 0.1 * width1).toTree(), (0).toTree());
|
|
129
|
-
const { arrPoint: arrPoint2, arrGGBCommandForGraph: arrGGBCommandForGraph2 } = createDisplayObjForGraph(graph2, graphNodes2, graphEdges2,
|
|
128
|
+
const { arrPoint: arrPoint2, arrGGBCommandForGraph: arrGGBCommandForGraph2 } = createDisplayObjForGraph(graph2, graphNodes2, graphEdges2, 1, 2, vecOffset);
|
|
130
129
|
const ggb = new GeogebraConstructor({
|
|
131
130
|
commands: [...arrGGBCommandForGraph1, ...arrGGBCommandForGraph2],
|
|
132
131
|
fontSize: 16,
|
|
@@ -230,23 +229,14 @@ const createRandomIdentifiers = (isDirected) => {
|
|
|
230
229
|
}
|
|
231
230
|
}
|
|
232
231
|
})();
|
|
233
|
-
const [
|
|
234
|
-
["fdp", 1.5],
|
|
235
|
-
["circo", 1.0],
|
|
236
|
-
]);
|
|
237
|
-
const [{ nodes: graphNodes1, edges: graphEdges1 }, { nodes: graphNodes2, edges: graphEdges2 },] = [
|
|
238
|
-
{ graph: graph1, layoutEngine: layoutEngine1 },
|
|
239
|
-
{ graph: graph2, layoutEngine: layoutEngine2 },
|
|
240
|
-
].map(({ graph, layoutEngine }) => GraphRenderer.renderToNodesAndEdges(graph, layoutEngine));
|
|
232
|
+
const [{ nodes: graphNodes1, edges: graphEdges1 }, { nodes: graphNodes2, edges: graphEdges2 },] = [{ graph: graph1 }, { graph: graph2 }].map(({ graph }) => GraphRenderer.renderToNodesAndEdges(graph));
|
|
241
233
|
const identifiers = {
|
|
242
234
|
graphIds1: graph1.toIdentifiers(),
|
|
243
235
|
graphIds2: graph2.toIdentifiers(),
|
|
244
236
|
graphNodes1,
|
|
245
237
|
graphEdges1,
|
|
246
|
-
scale1,
|
|
247
238
|
graphNodes2,
|
|
248
239
|
graphEdges2,
|
|
249
|
-
scale2,
|
|
250
240
|
};
|
|
251
241
|
return identifiers;
|
|
252
242
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphsCheckIsVerticesAdjacent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/graphs/graphsCheckIsVerticesAdjacent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAAoB,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAChF,OAAO,EACL,SAAS,EACT,SAAS,EAEV,MAAM,0CAA0C,CAAC;AAMlD,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IAGpB,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,UAAU,EAAE,SAAS,EAAE,CAAC;CACzB,CAAC;
|
|
1
|
+
{"version":3,"file":"graphsCheckIsVerticesAdjacent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/graphs/graphsCheckIsVerticesAdjacent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAAoB,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAChF,OAAO,EACL,SAAS,EACT,SAAS,EAEV,MAAM,0CAA0C,CAAC;AAMlD,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IAGpB,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,UAAU,EAAE,SAAS,EAAE,CAAC;CACzB,CAAC;AAoOF,KAAK,OAAO,GAAG;IACb,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAsBF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkBxE,CAAC"}
|
|
@@ -24,7 +24,9 @@ const getHydrated = (identifiers) => {
|
|
|
24
24
|
const getInstruction = (identifiers) => {
|
|
25
25
|
const { nameVertex1, nameVertex2 } = identifiers;
|
|
26
26
|
return `Un graphe est représenté ci-dessous.
|
|
27
|
-
Les sommets $${nameVertex1}$ et $${nameVertex2}$ sont-ils adjacents
|
|
27
|
+
Les sommets $${nameVertex1}$ et $${nameVertex2}$ sont-ils adjacents ?
|
|
28
|
+
|
|
29
|
+
*On peut déplacer les points sur la figure.*`;
|
|
28
30
|
};
|
|
29
31
|
const getAnswer = (identifiers) => {
|
|
30
32
|
const { isAdjacent } = getHydrated(identifiers);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphsDegreeOfVertex.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/graphs/graphsDegreeOfVertex.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAoBT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAAoB,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAChF,OAAO,EACL,SAAS,EACT,SAAS,EAEV,MAAM,0CAA0C,CAAC;AASlD,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IAGnB,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,UAAU,EAAE,SAAS,EAAE,CAAC;CACzB,CAAC;
|
|
1
|
+
{"version":3,"file":"graphsDegreeOfVertex.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/graphs/graphsDegreeOfVertex.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAoBT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAAoB,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAChF,OAAO,EACL,SAAS,EACT,SAAS,EAEV,MAAM,0CAA0C,CAAC;AASlD,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IAGnB,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,UAAU,EAAE,SAAS,EAAE,CAAC;CACzB,CAAC;AAqQF,KAAK,OAAO,GAAG;IACb,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAsBF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAe/D,CAAC"}
|
|
@@ -27,7 +27,9 @@ const getHydrated = (identifiers) => {
|
|
|
27
27
|
const getInstruction = (identifiers) => {
|
|
28
28
|
const { nameVertexAsked } = getHydrated(identifiers);
|
|
29
29
|
return `Un graphe est représenté ci-dessous.
|
|
30
|
-
Quel est le degré du sommet $${nameVertexAsked}$
|
|
30
|
+
Quel est le degré du sommet $${nameVertexAsked}$ ?
|
|
31
|
+
|
|
32
|
+
*On peut déplacer les points sur la figure.*`;
|
|
31
33
|
};
|
|
32
34
|
const getAnswerNode = (identifiers) => {
|
|
33
35
|
const { arrNameVertexAdjacent } = getHydrated(identifiers);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphsOrderOfGraph.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/graphs/graphsOrderOfGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAoBT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAAoB,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAChF,OAAO,EACL,SAAS,EACT,SAAS,EAEV,MAAM,0CAA0C,CAAC;AAUlD,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,gBAAgB,CAAC;IAG3B,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,UAAU,EAAE,SAAS,EAAE,CAAC;CACzB,CAAC;
|
|
1
|
+
{"version":3,"file":"graphsOrderOfGraph.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/graphs/graphsOrderOfGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAoBT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAAoB,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAChF,OAAO,EACL,SAAS,EACT,SAAS,EAEV,MAAM,0CAA0C,CAAC;AAUlD,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,gBAAgB,CAAC;IAG3B,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,UAAU,EAAE,SAAS,EAAE,CAAC;CACzB,CAAC;AAsPF,KAAK,OAAO,GAAG;IACb,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAsBF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAe7D,CAAC"}
|
|
@@ -23,7 +23,9 @@ const getHydrated = (identifiers) => {
|
|
|
23
23
|
};
|
|
24
24
|
const getInstruction = () => {
|
|
25
25
|
return `Un graphe est représenté ci-dessous.
|
|
26
|
-
Quel est son ordre
|
|
26
|
+
Quel est son ordre ?
|
|
27
|
+
|
|
28
|
+
*On peut déplacer les points sur la figure.*`;
|
|
27
29
|
};
|
|
28
30
|
const getAnswerNode = (identifiers) => {
|
|
29
31
|
const { graph } = getHydrated(identifiers);
|
|
@@ -2,7 +2,7 @@ export * from "./graphsOrderOfGraph.js";
|
|
|
2
2
|
export * from "./graphsDegreeOfVertex.js";
|
|
3
3
|
export * from "./graphsCheckIsVerticesAdjacent.js";
|
|
4
4
|
export * from "./graphsCheckIsSameGraph.js";
|
|
5
|
-
export * from "./
|
|
5
|
+
export * from "./graphsCheckIsConnectedGraph.js";
|
|
6
6
|
export * from "./graphsChainOrPathOfLengthN.js";
|
|
7
7
|
export * from "./edgesNumberFromSummitsDegrees.js";
|
|
8
8
|
export * from "./adjacentMatrixPath.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/graphs/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/graphs/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,oCAAoC,CAAC;AACnD,cAAc,yBAAyB,CAAC;AACxC,cAAc,sCAAsC,CAAC"}
|
|
@@ -2,7 +2,7 @@ export * from "./graphsOrderOfGraph.js";
|
|
|
2
2
|
export * from "./graphsDegreeOfVertex.js";
|
|
3
3
|
export * from "./graphsCheckIsVerticesAdjacent.js";
|
|
4
4
|
export * from "./graphsCheckIsSameGraph.js";
|
|
5
|
-
export * from "./
|
|
5
|
+
export * from "./graphsCheckIsConnectedGraph.js";
|
|
6
6
|
export * from "./graphsChainOrPathOfLengthN.js";
|
|
7
7
|
export * from "./edgesNumberFromSummitsDegrees.js";
|
|
8
8
|
export * from "./adjacentMatrixPath.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integralFromExpr.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/integration/fromExpr/integralFromExpr.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAcrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAe7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,aAAa,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC;IAClD,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;
|
|
1
|
+
{"version":3,"file":"integralFromExpr.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/integration/fromExpr/integralFromExpr.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAcrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAe7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,aAAa,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC;IAClD,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAuWF,KAAK,OAAO,GAAG;IACb,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AA2CF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAe3D,CAAC"}
|
|
@@ -252,7 +252,9 @@ const isIdentifiersQCPassed = (identifiers) => {
|
|
|
252
252
|
const isExploding = (identifiers) => {
|
|
253
253
|
let isExploding = false;
|
|
254
254
|
try {
|
|
255
|
+
//anything that contain exploding simplify()
|
|
255
256
|
getAnswer(identifiers);
|
|
257
|
+
getCorrection(identifiers);
|
|
256
258
|
}
|
|
257
259
|
catch (_) {
|
|
258
260
|
isExploding = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rationalFracLimit.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/limits/rationalFracLimit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAcrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,UAAU,GAAG,UAAU,CAAC;IACjC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;
|
|
1
|
+
{"version":3,"file":"rationalFracLimit.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/limits/rationalFracLimit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAcrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,UAAU,GAAG,UAAU,CAAC;IACjC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAoGF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAanD,CAAC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { addValidProp, propWhile, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { rationalVEA } from "../../../exercises/vea/rationalVEA.js";
|
|
3
4
|
import { Rational } from "../../../math/numbers/rationals/rational.js";
|
|
4
5
|
import { Monom } from "../../../math/polynomials/monom.js";
|
|
5
6
|
import { Polynomial, PolynomialConstructor, } from "../../../math/polynomials/polynomial.js";
|
|
6
7
|
import { randint } from "../../../math/utils/random/randint.js";
|
|
7
|
-
import { NumberNode } from "../../../tree/nodes/numbers/numberNode.js";
|
|
8
8
|
import { coinFlip } from "../../../utils/alea/coinFlip.js";
|
|
9
9
|
import { shuffle } from "../../../utils/alea/shuffle.js";
|
|
10
|
+
import { handleVEAError } from "../../../utils/errors/handleVEAError.js";
|
|
10
11
|
const getInstruction = (identifiers) => {
|
|
11
12
|
const { numCoeffs, denumCoeffs, limitTo: to } = identifiers;
|
|
12
13
|
const polyNum = new Polynomial(numCoeffs);
|
|
@@ -79,27 +80,15 @@ const getPropositions = (n, { answer, denumCoeffs, numCoeffs }) => {
|
|
|
79
80
|
});
|
|
80
81
|
return shuffle(propositions);
|
|
81
82
|
};
|
|
82
|
-
const isAnswerValid = (ans, {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
const leadingCoeffsRational = new Rational(numLeadingCoeff, denumLeadingCoeff)
|
|
88
|
-
.simplify()
|
|
89
|
-
.toTree({ allowFractionToDecimal: true });
|
|
90
|
-
let answer;
|
|
91
|
-
if (denumDegree === numDegree) {
|
|
92
|
-
answer = leadingCoeffsRational;
|
|
83
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
84
|
+
try {
|
|
85
|
+
if (answer.includes("infty"))
|
|
86
|
+
return ans === answer;
|
|
87
|
+
return rationalVEA(ans, answer);
|
|
93
88
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
const tempPoly = new Monom(numDegree - denumDegree, numLeadingCoeff * denumLeadingCoeff > 0 ? 1 : -1);
|
|
99
|
-
answer = tempPoly.getLimitNode(limitTo);
|
|
89
|
+
catch (err) {
|
|
90
|
+
return handleVEAError(err);
|
|
100
91
|
}
|
|
101
|
-
const texs = answer.toAllValidTexs();
|
|
102
|
-
return texs.includes(ans);
|
|
103
92
|
};
|
|
104
93
|
export const rationalFracLimit = {
|
|
105
94
|
id: "rationalFracLimit",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequenceRationalFracLimit.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/limits/sequences/sequenceRationalFracLimit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAarC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;
|
|
1
|
+
{"version":3,"file":"sequenceRationalFracLimit.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/limits/sequences/sequenceRationalFracLimit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAarC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AA+GF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAa3D,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { addValidProp, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { rationalVEA } from "../../../../exercises/vea/rationalVEA.js";
|
|
3
4
|
import { Rational } from "../../../../math/numbers/rationals/rational.js";
|
|
4
5
|
import { Monom } from "../../../../math/polynomials/monom.js";
|
|
5
6
|
import { Polynomial, PolynomialConstructor, } from "../../../../math/polynomials/polynomial.js";
|
|
6
7
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
7
|
-
import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
|
|
8
8
|
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
9
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
9
10
|
const getInstruction = (identifiers) => {
|
|
10
11
|
const { numCoeffs, denumCoeffs } = identifiers;
|
|
11
12
|
const polyNum = new Polynomial(numCoeffs, "n");
|
|
@@ -77,27 +78,15 @@ const getPropositions = (n, { answer, numCoeffs, denumCoeffs }) => {
|
|
|
77
78
|
});
|
|
78
79
|
return shuffle(propositions);
|
|
79
80
|
};
|
|
80
|
-
const isAnswerValid = (ans, {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
const leadingCoeffsRational = new Rational(numLeadingCoeff, denumLeadingCoeff)
|
|
86
|
-
.simplify()
|
|
87
|
-
.toTree({ allowFractionToDecimal: true });
|
|
88
|
-
let answer;
|
|
89
|
-
if (denumDegree === numDegree) {
|
|
90
|
-
answer = leadingCoeffsRational;
|
|
81
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
82
|
+
try {
|
|
83
|
+
if (answer.includes("infty"))
|
|
84
|
+
return ans === answer;
|
|
85
|
+
return rationalVEA(ans, answer);
|
|
91
86
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
const tempPoly = new Monom(numDegree - denumDegree, numLeadingCoeff * denumLeadingCoeff > 0 ? 1 : -1);
|
|
97
|
-
answer = tempPoly.getLimitNode("+\\infty");
|
|
87
|
+
catch (err) {
|
|
88
|
+
return handleVEAError(err);
|
|
98
89
|
}
|
|
99
|
-
const texs = answer.toAllValidTexs();
|
|
100
|
-
return texs.includes(ans);
|
|
101
90
|
};
|
|
102
91
|
export const sequenceRationalFracLimit = {
|
|
103
92
|
id: "sequenceRationalFracLimit",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometricFindExplicitFormula.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/geometric/geometricFindExplicitFormula.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"geometricFindExplicitFormula.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/geometric/geometricFindExplicitFormula.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AA4GF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAe9D,CAAC"}
|
|
@@ -2,13 +2,11 @@ import { addValidProp, propWhile, tryToAddWrongProp, } from "../../../../exercis
|
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
4
4
|
import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
|
|
5
|
-
import { EqualNode, isEqualNode, } from "../../../../tree/nodes/equations/equalNode.js";
|
|
6
5
|
import { MultiplyNode } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
7
6
|
import { PowerNode } from "../../../../tree/nodes/operators/powerNode.js";
|
|
8
7
|
import { VariableNode } from "../../../../tree/nodes/variables/variableNode.js";
|
|
9
8
|
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
10
|
-
import {
|
|
11
|
-
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
9
|
+
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
12
10
|
const getInstruction = (identifiers) => {
|
|
13
11
|
const { firstValue, reason } = identifiers;
|
|
14
12
|
const firstRank = 0;
|
|
@@ -19,7 +17,7 @@ Donner l'expression de $u_n$ en fonction de $n$.`;
|
|
|
19
17
|
const getAnswer = (identifiers) => {
|
|
20
18
|
const { firstValue, reason } = identifiers;
|
|
21
19
|
const formula = new MultiplyNode(new NumberNode(firstValue), new PowerNode(new NumberNode(reason), new VariableNode("n")));
|
|
22
|
-
const answer =
|
|
20
|
+
const answer = formula.toTex();
|
|
23
21
|
return answer;
|
|
24
22
|
};
|
|
25
23
|
const getHint = () => {
|
|
@@ -45,14 +43,14 @@ où $u_0$ est le premier terme et $r$ la raison.
|
|
|
45
43
|
Ici, puisque $u_0 = ${firstValue}$ et $r = ${reason}$, on a :
|
|
46
44
|
|
|
47
45
|
$$
|
|
48
|
-
${answer}
|
|
46
|
+
u_n = ${answer}
|
|
49
47
|
$$`;
|
|
50
48
|
};
|
|
51
49
|
const getQuestionFromIdentifiers = (identifiers) => {
|
|
52
50
|
const question = {
|
|
53
51
|
instruction: getInstruction(identifiers),
|
|
54
52
|
answer: getAnswer(identifiers),
|
|
55
|
-
keys: ["
|
|
53
|
+
keys: ["n"],
|
|
56
54
|
answerFormat: "tex",
|
|
57
55
|
identifiers,
|
|
58
56
|
hint: getHint(identifiers),
|
|
@@ -62,39 +60,24 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
62
60
|
};
|
|
63
61
|
const getGeometricFindExplicitFormula = () => {
|
|
64
62
|
const firstValue = randint(1, 10);
|
|
65
|
-
const reason = randint(2, 10);
|
|
63
|
+
const reason = randint(2, 10, [firstValue]);
|
|
66
64
|
const identifiers = { reason, firstValue };
|
|
67
65
|
return getQuestionFromIdentifiers(identifiers);
|
|
68
66
|
};
|
|
69
67
|
const getPropositions = (n, { answer, reason, firstValue }) => {
|
|
70
68
|
const propositions = [];
|
|
71
69
|
addValidProp(propositions, answer);
|
|
72
|
-
tryToAddWrongProp(propositions, "
|
|
73
|
-
new MultiplyNode(new NumberNode(reason), new PowerNode(new NumberNode(firstValue), new VariableNode("n"))).toTex());
|
|
70
|
+
tryToAddWrongProp(propositions, new MultiplyNode(new NumberNode(reason), new PowerNode(new NumberNode(firstValue), new VariableNode("n"))).toTex());
|
|
74
71
|
propWhile(propositions, n, () => {
|
|
75
72
|
const wrongAnswer = new MultiplyNode(new NumberNode(firstValue + randint(-firstValue, 2 * firstValue + 1)), new PowerNode(new NumberNode(reason + +randint(-reason + 1, 2 * reason + 1)), new VariableNode("n")));
|
|
76
|
-
tryToAddWrongProp(propositions,
|
|
73
|
+
tryToAddWrongProp(propositions, wrongAnswer.toTex());
|
|
77
74
|
});
|
|
78
75
|
return shuffle(propositions);
|
|
79
76
|
};
|
|
80
|
-
const isAnswerValid = (ans, {
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
});
|
|
85
|
-
const texs = equal.toAllValidTexs();
|
|
86
|
-
return (texs.includes(ans) ||
|
|
87
|
-
(() => {
|
|
88
|
-
const refinedAns = ans.replace("u_n", "").replace("=", "");
|
|
89
|
-
let nodeAns = parseLatex(refinedAns);
|
|
90
|
-
if (isEqualNode(nodeAns)) {
|
|
91
|
-
nodeAns = nodeAns.rightChild;
|
|
92
|
-
}
|
|
93
|
-
const differenceNode = substract(nodeAns, formula);
|
|
94
|
-
return (differenceNode.evaluate({ n: 0 }) === 0 &&
|
|
95
|
-
differenceNode.evaluate({ n: 1 }) === 0 &&
|
|
96
|
-
differenceNode.evaluate({ n: 5 }) === 0);
|
|
97
|
-
})());
|
|
77
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
78
|
+
const trimed = ans.replace("u_n=", "").replace("u_{n}=", "");
|
|
79
|
+
return (parseAlgebraic(trimed).simplify({}).toTex() ===
|
|
80
|
+
parseAlgebraic(answer.replace("u_n=", "")).simplify().toTex());
|
|
98
81
|
};
|
|
99
82
|
export const geometricFindExplicitFormula = {
|
|
100
83
|
id: "geometricFindExplicitFormula",
|
package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstRankOne.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometricFindExplicitFormulaFirstRankOne.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstRankOne.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"geometricFindExplicitFormulaFirstRankOne.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstRankOne.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAmHF,eAAO,MAAM,wCAAwC,EAAE,QAAQ,CAAC,WAAW,CAe1E,CAAC"}
|
|
@@ -2,12 +2,11 @@ import { addValidProp, propWhile, tryToAddWrongProp, } from "../../../../exercis
|
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
4
4
|
import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
|
|
5
|
-
import { EqualNode } from "../../../../tree/nodes/equations/equalNode.js";
|
|
6
5
|
import { MultiplyNode } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
7
6
|
import { PowerNode } from "../../../../tree/nodes/operators/powerNode.js";
|
|
8
7
|
import { VariableNode } from "../../../../tree/nodes/variables/variableNode.js";
|
|
9
8
|
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
10
|
-
import {
|
|
9
|
+
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
11
10
|
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
12
11
|
const getInstruction = (identifiers) => {
|
|
13
12
|
const { firstValue, reason } = identifiers;
|
|
@@ -19,7 +18,7 @@ Donner l'expression de $u_n$ en fonction de $n$.`;
|
|
|
19
18
|
const getAnswer = (identifiers) => {
|
|
20
19
|
const { firstValue, reason } = identifiers;
|
|
21
20
|
const formula = new MultiplyNode(new NumberNode(firstValue), new PowerNode(new NumberNode(reason), substract("n", 1)));
|
|
22
|
-
const answer =
|
|
21
|
+
const answer = formula.toTex();
|
|
23
22
|
return answer;
|
|
24
23
|
};
|
|
25
24
|
const getHint = () => {
|
|
@@ -45,14 +44,14 @@ où $u_1$ est le premier terme et $q$ la raison.
|
|
|
45
44
|
Ici, puisque $u_1 = ${firstValue}$ et $q = ${reason}$, on a :
|
|
46
45
|
|
|
47
46
|
$$
|
|
48
|
-
${answer}
|
|
47
|
+
u_n = ${answer}
|
|
49
48
|
$$`;
|
|
50
49
|
};
|
|
51
50
|
const getQuestionFromIdentifiers = (identifiers) => {
|
|
52
51
|
const question = {
|
|
53
52
|
instruction: getInstruction(identifiers),
|
|
54
53
|
answer: getAnswer(identifiers),
|
|
55
|
-
keys: ["
|
|
54
|
+
keys: ["n"],
|
|
56
55
|
answerFormat: "tex",
|
|
57
56
|
identifiers,
|
|
58
57
|
hint: getHint(identifiers),
|
|
@@ -62,39 +61,25 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
62
61
|
};
|
|
63
62
|
const getGeometricFindExplicitFormula = () => {
|
|
64
63
|
const firstValue = randint(1, 10);
|
|
65
|
-
const reason = randint(2, 10);
|
|
64
|
+
const reason = randint(2, 10, [firstValue]);
|
|
66
65
|
const identifiers = { reason, firstValue };
|
|
67
66
|
return getQuestionFromIdentifiers(identifiers);
|
|
68
67
|
};
|
|
69
68
|
const getPropositions = (n, { answer, reason, firstValue }) => {
|
|
70
69
|
const propositions = [];
|
|
71
70
|
addValidProp(propositions, answer);
|
|
72
|
-
tryToAddWrongProp(propositions, "
|
|
73
|
-
|
|
74
|
-
tryToAddWrongProp(propositions, "u_n=" +
|
|
75
|
-
new MultiplyNode(new NumberNode(reason), new PowerNode(new NumberNode(firstValue), substract("n", 1))).toTex());
|
|
71
|
+
tryToAddWrongProp(propositions, new MultiplyNode(new NumberNode(firstValue), new PowerNode(new NumberNode(reason), new VariableNode("n"))).toTex());
|
|
72
|
+
tryToAddWrongProp(propositions, new MultiplyNode(new NumberNode(reason), new PowerNode(new NumberNode(firstValue), substract("n", 1))).toTex());
|
|
76
73
|
propWhile(propositions, n, () => {
|
|
77
74
|
const wrongAnswer = new MultiplyNode(new NumberNode(firstValue + randint(-firstValue, 2 * firstValue + 1)), new PowerNode(new NumberNode(reason + +randint(-reason + 1, 2 * reason + 1)), substract("n", 1)));
|
|
78
|
-
tryToAddWrongProp(propositions,
|
|
75
|
+
tryToAddWrongProp(propositions, wrongAnswer.toTex());
|
|
79
76
|
});
|
|
80
77
|
return shuffle(propositions);
|
|
81
78
|
};
|
|
82
|
-
const isAnswerValid = (ans, {
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
});
|
|
87
|
-
const texs = equal.toAllValidTexs();
|
|
88
|
-
return (texs.includes(ans) ||
|
|
89
|
-
(() => {
|
|
90
|
-
const splitted = ans.split("=");
|
|
91
|
-
const rightTerm = splitted[1] ?? splitted[0];
|
|
92
|
-
const nodeAns = parseLatex(rightTerm);
|
|
93
|
-
const differenceNode = substract(nodeAns, formula);
|
|
94
|
-
return (differenceNode.evaluate({ n: 0 }) === 0 &&
|
|
95
|
-
differenceNode.evaluate({ n: 1 }) === 0 &&
|
|
96
|
-
differenceNode.evaluate({ n: 5 }) === 0);
|
|
97
|
-
})());
|
|
79
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
80
|
+
const trimed = ans.replace("u_n=", "").replace("u_{n}=", "");
|
|
81
|
+
return (parseAlgebraic(trimed).simplify({}).toTex() ===
|
|
82
|
+
parseAlgebraic(answer.replace("u_n=", "")).simplify().toTex());
|
|
98
83
|
};
|
|
99
84
|
export const geometricFindExplicitFormulaFirstRankOne = {
|
|
100
85
|
id: "geometricFindExplicitFormulaFirstRankOne",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lineLineRelativePositionsFromParametricLines.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/parametricLine/lineLineRelativePositionsFromParametricLines.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAGL,qBAAqB,EACtB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAGL,sBAAsB,EACvB,MAAM,oCAAoC,CAAC;AAgH5C,KAAK,YAAY,GAAG;IAClB,aAAa,EAAE,qBAAqB,CAAC;IACrC,cAAc,EAAE,sBAAsB,CAAC;CACxC,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,qBAAqB,EAAE,CAAC;IACzC,YAAY,EAAE,YAAY,EAAE,CAAC;CAC9B,CAAC;
|
|
1
|
+
{"version":3,"file":"lineLineRelativePositionsFromParametricLines.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/parametricLine/lineLineRelativePositionsFromParametricLines.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAGL,qBAAqB,EACtB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAGL,sBAAsB,EACvB,MAAM,oCAAoC,CAAC;AAgH5C,KAAK,YAAY,GAAG;IAClB,aAAa,EAAE,qBAAqB,CAAC;IACrC,cAAc,EAAE,sBAAsB,CAAC;CACxC,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,qBAAqB,EAAE,CAAC;IACzC,YAAY,EAAE,YAAY,EAAE,CAAC;CAC9B,CAAC;AA6XF,eAAO,MAAM,4CAA4C,EAAE,QAAQ,CAAC,WAAW,CAoB5E,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { ParametricLine } from "../../../../math/geometry/parametricLine.js";
|
|
4
|
-
import { SpacePointConstructor, } from "../../../../math/geometry/spacePoint.js";
|
|
5
|
-
import { SpaceVectorConstructor, } from "../../../../math/geometry/spaceVector.js";
|
|
4
|
+
import { SpacePoint, SpacePointConstructor, } from "../../../../math/geometry/spacePoint.js";
|
|
5
|
+
import { SpaceVector, SpaceVectorConstructor, } from "../../../../math/geometry/spaceVector.js";
|
|
6
6
|
import { nodeBySubstitutingVar } from "../../../../math/utils/functions/functionComposition.js";
|
|
7
7
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
8
8
|
import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
@@ -293,8 +293,61 @@ const createRandomIdentifiers = () => {
|
|
|
293
293
|
};
|
|
294
294
|
return identifiers;
|
|
295
295
|
};
|
|
296
|
+
const isIdentifiersQCPassed = (identifiers) => {
|
|
297
|
+
const isExploding = (identifiers) => {
|
|
298
|
+
let isExploding = false;
|
|
299
|
+
try {
|
|
300
|
+
//ensure only one valid proposition
|
|
301
|
+
const n = 4;
|
|
302
|
+
const answer = getAnswer(identifiers);
|
|
303
|
+
const propositions = getPropositions(n, { answer, ...identifiers });
|
|
304
|
+
const nbRightAnswers = propositions.filter((proposition) => proposition.isRightAnswer).length;
|
|
305
|
+
if (nbRightAnswers !== 1) {
|
|
306
|
+
throw new Error("nbRightAnswers !== 1");
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
catch (_) {
|
|
310
|
+
isExploding = true;
|
|
311
|
+
}
|
|
312
|
+
return isExploding;
|
|
313
|
+
};
|
|
314
|
+
return !isExploding(identifiers);
|
|
315
|
+
};
|
|
316
|
+
const createQCPassedIdentifiers = () => {
|
|
317
|
+
let identifiers;
|
|
318
|
+
let counter = -1;
|
|
319
|
+
let isValid = false;
|
|
320
|
+
while (!isValid && counter < 100) {
|
|
321
|
+
counter++;
|
|
322
|
+
const identifiersCandidate = createRandomIdentifiers();
|
|
323
|
+
isValid = isIdentifiersQCPassed(identifiersCandidate);
|
|
324
|
+
if (isValid) {
|
|
325
|
+
identifiers = identifiersCandidate;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
if (!isValid) {
|
|
329
|
+
const vec1 = new SpaceVector("v1", (1).toTree(), (0).toTree(), (0).toTree());
|
|
330
|
+
const vec2 = new SpaceVector("v2", (2).toTree(), (0).toTree(), (0).toTree());
|
|
331
|
+
const A = new SpacePoint("A", (0).toTree(), (1).toTree(), (0).toTree());
|
|
332
|
+
const B = new SpacePoint("B", (0).toTree(), (0).toTree(), (2).toTree());
|
|
333
|
+
const identifiersDefault = {
|
|
334
|
+
spacePointIdsAB: [A, B].map((spacePoint) => spacePoint.toIdentifiers()),
|
|
335
|
+
spaceLineIds: [
|
|
336
|
+
[A, vec1],
|
|
337
|
+
[B, vec2],
|
|
338
|
+
].map(([spacePoint, spaceVector]) => {
|
|
339
|
+
return {
|
|
340
|
+
spacePointIds: spacePoint.toIdentifiers(),
|
|
341
|
+
spaceVectorIds: spaceVector.toIdentifiers(),
|
|
342
|
+
};
|
|
343
|
+
}),
|
|
344
|
+
};
|
|
345
|
+
identifiers = identifiersDefault;
|
|
346
|
+
}
|
|
347
|
+
return identifiers;
|
|
348
|
+
};
|
|
296
349
|
const getLineLineRelativePositionsFromParametricLinesQuestion = () => {
|
|
297
|
-
const identifiers =
|
|
350
|
+
const identifiers = createQCPassedIdentifiers();
|
|
298
351
|
return getQuestionFromIdentifiers(identifiers);
|
|
299
352
|
};
|
|
300
353
|
const getQuestionFromIdentifiers = (identifiers, _opts) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findNormalVectorFromPlaneEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/planes/findNormalVectorFromPlaneEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAsF7C,KAAK,WAAW,GAAG;IACjB,oBAAoB,EAAE,eAAe,CAAC;CACvC,CAAC;
|
|
1
|
+
{"version":3,"file":"findNormalVectorFromPlaneEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/planes/findNormalVectorFromPlaneEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAsF7C,KAAK,WAAW,GAAG;IACjB,oBAAoB,EAAE,eAAe,CAAC;CACvC,CAAC;AAuRF,eAAO,MAAM,iCAAiC,EAAE,QAAQ,CAAC,WAAW,CAmBnE,CAAC"}
|
|
@@ -140,7 +140,9 @@ const getPropositions = (n, { answer, ...identifiers }) => {
|
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
+
let counter = -1;
|
|
143
144
|
propWhile(propositions, n, () => {
|
|
145
|
+
counter++;
|
|
144
146
|
const nodeFactorW = randint(-4, 5, [0, 1]).toTree();
|
|
145
147
|
const arr = [nodeA, nodeB, nodeC, nodeD].map((node) => multiply(nodeFactorW, node).simplify({ towardsDistribute: true }));
|
|
146
148
|
{
|
|
@@ -160,6 +162,10 @@ const getPropositions = (n, { answer, ...identifiers }) => {
|
|
|
160
162
|
}
|
|
161
163
|
}
|
|
162
164
|
}
|
|
165
|
+
if (counter > 50) {
|
|
166
|
+
const identifiersWrong = createRandomIdentifiers();
|
|
167
|
+
tryToAddWrongProp(propositions, getAnswer(identifiersWrong));
|
|
168
|
+
}
|
|
163
169
|
});
|
|
164
170
|
return shuffleProps(propositions, n);
|
|
165
171
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spaceVectorNormCalculation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/vectors/spaceVectorNormCalculation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"spaceVectorNormCalculation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/vectors/spaceVectorNormCalculation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAarC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAkGF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAa5D,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { addValidProp, propWhile, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { sqrtVEA } from "../../../../exercises/vea/sqrtVEA.js";
|
|
3
4
|
import { SpaceVector, SpaceVectorConstructor, } from "../../../../math/geometry/spaceVector.js";
|
|
4
5
|
import { SquareRootConstructor } from "../../../../math/numbers/reals/real.js";
|
|
5
6
|
import { SqrtNode } from "../../../../tree/nodes/functions/sqrtNode.js";
|
|
@@ -70,11 +71,8 @@ const getPropositions = (n, { answer, x, y, z }) => {
|
|
|
70
71
|
});
|
|
71
72
|
return shuffleProps(propositions, n);
|
|
72
73
|
};
|
|
73
|
-
const isAnswerValid = (ans, {
|
|
74
|
-
|
|
75
|
-
return correctAnswer
|
|
76
|
-
.toAllValidTexs({ allowSimplifySqrt: true })
|
|
77
|
-
.includes(ans);
|
|
74
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
75
|
+
return sqrtVEA(ans, answer);
|
|
78
76
|
};
|
|
79
77
|
export const spaceVectorNormCalculation = {
|
|
80
78
|
id: "spaceVectorNormCalculation",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simpifySquareRoot.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/squareRoots/simpifySquareRoot.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"simpifySquareRoot.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/squareRoots/simpifySquareRoot.ts"],"names":[],"mappings":"AASA,OAAO,EACL,QAAQ,EAeT,MAAM,mBAAmB,CAAC;AAE3B,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAwGF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAcpD,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { sqrtVEA } from "../../../exercises/vea/sqrtVEA.js";
|
|
1
2
|
import { SquareRoot, SquareRootConstructor, } from "../../../math/numbers/reals/real.js";
|
|
2
3
|
import { sqrt } from "../../../tree/nodes/functions/sqrtNode.js";
|
|
3
4
|
import { multiply } from "../../../tree/nodes/operators/multiplyNode.js";
|
|
@@ -92,10 +93,10 @@ const getPropositions = (n, { answer }) => {
|
|
|
92
93
|
});
|
|
93
94
|
return shuffle(propositions);
|
|
94
95
|
};
|
|
95
|
-
const isAnswerValid = (ans, {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
97
|
+
return sqrtVEA(ans, answer, {
|
|
98
|
+
allowNonIrreductible: false,
|
|
99
|
+
});
|
|
99
100
|
};
|
|
100
101
|
export const simplifySquareRoot = {
|
|
101
102
|
id: "simplifySqrt",
|