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
|
@@ -1,190 +1,223 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
1
|
+
// import {
|
|
2
|
+
// Exercise,
|
|
3
|
+
// Proposition,
|
|
4
|
+
// QCMGenerator,
|
|
5
|
+
// Question,
|
|
6
|
+
// QuestionGenerator,
|
|
7
|
+
// VEA,
|
|
8
|
+
// addValidProp,
|
|
9
|
+
// shuffleProps,
|
|
10
|
+
// GetAnswer,
|
|
11
|
+
// GetHint,
|
|
12
|
+
// GetCorrection,
|
|
13
|
+
// GetInstruction,
|
|
14
|
+
// GetKeys,
|
|
15
|
+
// tryToAddWrongProp,
|
|
16
|
+
// GetQuestionFromIdentifiers,
|
|
17
|
+
// propWhile,
|
|
18
|
+
// } from "../../../../exercises/exercise.js";
|
|
19
|
+
// import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
20
|
+
// import { AffineConstructor } from "../../../../math/polynomials/affine.js";
|
|
21
|
+
export {};
|
|
22
|
+
// import { gcd } from "../../../../math/utils/arithmetic/gcd.js";
|
|
23
|
+
// import { randint } from "../../../../math/utils/random/randint.js";
|
|
24
|
+
// import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
25
|
+
// import {
|
|
26
|
+
// isMultiplyNode,
|
|
27
|
+
// multiply,
|
|
28
|
+
// } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
29
|
+
// import { power } from "../../../../tree/nodes/operators/powerNode.js";
|
|
30
|
+
// import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
31
|
+
// import { random } from "../../../../utils/alea/random.js";
|
|
32
|
+
// import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
33
|
+
// import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
34
|
+
// type Identifiers = {
|
|
35
|
+
// a: number;
|
|
36
|
+
// k1: number;
|
|
37
|
+
// b: number;
|
|
38
|
+
// k2: number;
|
|
39
|
+
// };
|
|
40
|
+
// const getHydrated = (identifiers: Identifiers) => {
|
|
41
|
+
// const { a, b, k1, k2 } = identifiers;
|
|
42
|
+
// const nodeMonomA = multiply(a, power("x".toTree(), k1)).simplify();
|
|
43
|
+
// const nodeMonomB = multiply(b, power("x".toTree(), k2)).simplify();
|
|
44
|
+
// const nodeSum = add(nodeMonomA, nodeMonomB);
|
|
45
|
+
// return {
|
|
46
|
+
// nodeMonomA,
|
|
47
|
+
// nodeMonomB,
|
|
48
|
+
// nodeSum,
|
|
49
|
+
// };
|
|
50
|
+
// };
|
|
51
|
+
// const getStatementNode = (identifiers: Identifiers) => {
|
|
52
|
+
// const { nodeSum } = getHydrated(identifiers);
|
|
53
|
+
// return nodeSum;
|
|
54
|
+
// };
|
|
55
|
+
// const getInstruction: GetInstruction<Identifiers> = (identifiers) => {
|
|
56
|
+
// const statement = getStatementNode(identifiers);
|
|
57
|
+
// return `Factoriser :
|
|
58
|
+
// $$
|
|
59
|
+
// ${statement.toTex()}
|
|
60
|
+
// $$`;
|
|
61
|
+
// };
|
|
62
|
+
// const getAnswerNode = (identifiers: Identifiers) => {
|
|
63
|
+
// const { a, b, k1, k2 } = identifiers;
|
|
64
|
+
// let pgcd = gcd(a, b);
|
|
65
|
+
// if (a < 0 && b < 0) pgcd = -pgcd;
|
|
66
|
+
// const strK1K2 = `${k1}${k2}`;
|
|
67
|
+
// switch (strK1K2) {
|
|
68
|
+
// case "11": {
|
|
69
|
+
// return multiply(a + b, "x");
|
|
70
|
+
// }
|
|
71
|
+
// case "12": {
|
|
72
|
+
// const affine = add(a / pgcd, multiply(b / pgcd, "x"));
|
|
73
|
+
// return multiply(multiply(pgcd, "x"), affine);
|
|
74
|
+
// }
|
|
75
|
+
// case "21": {
|
|
76
|
+
// const affine = add(multiply(a / pgcd, "x"), b / pgcd);
|
|
77
|
+
// return multiply(multiply(pgcd, "x"), affine);
|
|
78
|
+
// }
|
|
79
|
+
// case "22": {
|
|
80
|
+
// return multiply(a + b, power("x", 2));
|
|
81
|
+
// }
|
|
82
|
+
// default:
|
|
83
|
+
// throw new Error("Unsupported strK1K2: " + strK1K2);
|
|
84
|
+
// }
|
|
85
|
+
// };
|
|
86
|
+
// const getAnswer: GetAnswer<Identifiers> = (identifiers) => {
|
|
87
|
+
// return getAnswerNode(identifiers).toTex();
|
|
88
|
+
// };
|
|
89
|
+
// const getHint: GetHint<Identifiers> = (identifiers) => {
|
|
90
|
+
// const { nodeMonomA, nodeMonomB } = getHydrated(identifiers);
|
|
91
|
+
// return `Repère le facteur commun : c'est le terme qui apparaît à la fois dans $${nodeMonomA.toTex()}$ et dans $${nodeMonomB.toTex()}$.`;
|
|
92
|
+
// };
|
|
93
|
+
// const getCorrection: GetCorrection<Identifiers> = (identifiers) => {
|
|
94
|
+
// const { a, b, k1, k2 } = identifiers;
|
|
95
|
+
// const { nodeMonomA, nodeMonomB } = getHydrated(identifiers);
|
|
96
|
+
// const answer = getAnswer(identifiers);
|
|
97
|
+
// const statement = getStatementNode(identifiers).toTex();
|
|
98
|
+
// let pgcd = gcd(a, b);
|
|
99
|
+
// if (a < 0 && b < 0) pgcd = -pgcd;
|
|
100
|
+
// const [nodeCommon, nodeDetailed] = (() => {
|
|
101
|
+
// const strK1K2 = `${k1}${k2}`;
|
|
102
|
+
// switch (strK1K2) {
|
|
103
|
+
// case "11": {
|
|
104
|
+
// const nodeCommon = "x".toTree();
|
|
105
|
+
// const nodeDetailed = multiply(nodeCommon, add(a, b));
|
|
106
|
+
// return [nodeCommon, nodeDetailed];
|
|
107
|
+
// }
|
|
108
|
+
// case "12": {
|
|
109
|
+
// const nodeCommon = multiply(pgcd, "x");
|
|
110
|
+
// const nodeDetailed = add(
|
|
111
|
+
// multiply(nodeCommon, a / pgcd),
|
|
112
|
+
// multiply(nodeCommon, multiply(b / pgcd, "x").simplify(), {
|
|
113
|
+
// toTexOptions: { forceTimesSign: true, noPropagation: true },
|
|
114
|
+
// }),
|
|
115
|
+
// );
|
|
116
|
+
// return [nodeCommon, nodeDetailed];
|
|
117
|
+
// }
|
|
118
|
+
// case "21": {
|
|
119
|
+
// const nodeCommon = multiply(pgcd, "x");
|
|
120
|
+
// const nodeDetailed = add(
|
|
121
|
+
// multiply(nodeCommon, multiply(a / pgcd, "x").simplify(), {
|
|
122
|
+
// toTexOptions: { forceTimesSign: true, noPropagation: true },
|
|
123
|
+
// }),
|
|
124
|
+
// multiply(nodeCommon, b / pgcd),
|
|
125
|
+
// );
|
|
126
|
+
// return [nodeCommon, nodeDetailed];
|
|
127
|
+
// }
|
|
128
|
+
// case "22": {
|
|
129
|
+
// const nodeCommon = power("x", 2);
|
|
130
|
+
// const nodeDetailed = multiply(nodeCommon, add(a, b));
|
|
131
|
+
// return [nodeCommon, nodeDetailed];
|
|
132
|
+
// }
|
|
133
|
+
// default:
|
|
134
|
+
// throw new Error("Unsupported strK1K2: " + strK1K2);
|
|
135
|
+
// }
|
|
136
|
+
// })();
|
|
137
|
+
// const detailed = nodeDetailed.toTex();
|
|
138
|
+
// return `Le terme $${nodeCommon.toTex()}$ apparaît à la fois dans $${nodeMonomA.toTex()}$ et dans $${nodeMonomB.toTex()}$.
|
|
139
|
+
// On peut donc factoriser l'expression par $${nodeCommon.toTex()}$ :
|
|
140
|
+
// ${alignTex([
|
|
141
|
+
// ["", "", statement],
|
|
142
|
+
// ["", "=", detailed],
|
|
143
|
+
// ["", "=", answer],
|
|
144
|
+
// ])}
|
|
145
|
+
// `;
|
|
146
|
+
// };
|
|
147
|
+
// const getPropositions: QCMGenerator<Identifiers> = (
|
|
148
|
+
// n,
|
|
149
|
+
// { answer, ...identifiers },
|
|
150
|
+
// ) => {
|
|
151
|
+
// const propositions: Proposition[] = [];
|
|
152
|
+
// addValidProp(propositions, answer);
|
|
153
|
+
// [
|
|
154
|
+
// [1, 1],
|
|
155
|
+
// [1, 2],
|
|
156
|
+
// [2, 1],
|
|
157
|
+
// [2, 2],
|
|
158
|
+
// ].forEach(([k1, k2]) => {
|
|
159
|
+
// const identifiersWrong = { ...identifiers, k1, k2 };
|
|
160
|
+
// tryToAddWrongProp(propositions, getAnswer(identifiersWrong));
|
|
161
|
+
// });
|
|
162
|
+
// propWhile(propositions, n, () => {
|
|
163
|
+
// tryToAddWrongProp(
|
|
164
|
+
// propositions,
|
|
165
|
+
// multiply("x", AffineConstructor.random().toTree()).toTex(),
|
|
166
|
+
// );
|
|
167
|
+
// });
|
|
168
|
+
// return shuffleProps(propositions, n);
|
|
169
|
+
// };
|
|
170
|
+
// const getKeys: GetKeys<Identifiers> = () => {
|
|
171
|
+
// return ["x"];
|
|
172
|
+
// };
|
|
173
|
+
// const getFactoByXKQuestion: QuestionGenerator<Identifiers> = () => {
|
|
174
|
+
// const a = randint(-10, 10, [0], { favor: { value: 1, proba: 0.3 } });
|
|
175
|
+
// const b = randint(
|
|
176
|
+
// -10,
|
|
177
|
+
// 10,
|
|
178
|
+
// [0, -a, a],
|
|
179
|
+
// a !== 1 ? { favor: { value: 1, proba: 0.3 } } : undefined,
|
|
180
|
+
// );
|
|
181
|
+
// const [k1, k2] = random([
|
|
182
|
+
// [1, 1],
|
|
183
|
+
// [1, 2],
|
|
184
|
+
// [2, 1],
|
|
185
|
+
// [2, 2],
|
|
186
|
+
// ]);
|
|
187
|
+
// const identifiers: Identifiers = {
|
|
188
|
+
// a,
|
|
189
|
+
// b,
|
|
190
|
+
// k1,
|
|
191
|
+
// k2,
|
|
192
|
+
// };
|
|
193
|
+
// return getQuestionFromIdentifiers(identifiers);
|
|
194
|
+
// };
|
|
195
|
+
// const getQuestionFromIdentifiers: GetQuestionFromIdentifiers<Identifiers> = (
|
|
196
|
+
// identifiers,
|
|
197
|
+
// ) => {
|
|
198
|
+
// const question: Question<Identifiers> = {
|
|
199
|
+
// answer: getAnswer(identifiers),
|
|
200
|
+
// instruction: getInstruction(identifiers),
|
|
201
|
+
// keys: getKeys(identifiers),
|
|
202
|
+
// answerFormat: "tex",
|
|
203
|
+
// identifiers,
|
|
204
|
+
// hint: getHint(identifiers),
|
|
205
|
+
// correction: getCorrection(identifiers),
|
|
206
|
+
// };
|
|
207
|
+
// return question;
|
|
208
|
+
// };
|
|
209
|
+
// export const factoByXK: Exercise<Identifiers> = {
|
|
210
|
+
// id: "factoByXK",
|
|
211
|
+
// connector: "=",
|
|
212
|
+
// label: "Factorisation du type $ax^k + bx^{k'}$",
|
|
213
|
+
// isSingleStep: false,
|
|
214
|
+
// generator: (nb, opts) =>
|
|
215
|
+
// getDistinctQuestions(() => getFactoByXKQuestion(opts), nb),
|
|
216
|
+
// qcmTimer: 60,
|
|
217
|
+
// freeTimer: 60,
|
|
218
|
+
// getPropositions,
|
|
219
|
+
// isAnswerValid,
|
|
220
|
+
// subject: "Mathématiques",
|
|
221
|
+
// getQuestionFromIdentifiers,
|
|
222
|
+
// hasHintAndCorrection: true,
|
|
223
|
+
// };
|
package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalFormWithSqrt.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factorizeCanonicalFormWithSqrt.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factorizeCanonicalFormWithSqrt.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"factorizeCanonicalFormWithSqrt.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factorizeCanonicalFormWithSqrt.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAiJF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,CAehE,CAAC"}
|
|
@@ -3,10 +3,12 @@ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQue
|
|
|
3
3
|
import { SquareRoot, SquareRootConstructor, } from "../../../../math/numbers/reals/real.js";
|
|
4
4
|
import { Affine } from "../../../../math/polynomials/affine.js";
|
|
5
5
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
6
|
+
import { isFactorizedNode } from "../../../../tree/nodes/algebraicNode.js";
|
|
6
7
|
import { AddNode } from "../../../../tree/nodes/operators/addNode.js";
|
|
7
8
|
import { MultiplyNode } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
8
9
|
import { SquareNode } from "../../../../tree/nodes/operators/powerNode.js";
|
|
9
10
|
import { SubstractNode } from "../../../../tree/nodes/operators/substractNode.js";
|
|
11
|
+
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
10
12
|
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
11
13
|
//(x-a)^2-b^2 avec b irrational
|
|
12
14
|
const getStatementNode = (identifiers) => {
|
|
@@ -25,15 +27,16 @@ $$
|
|
|
25
27
|
${getStartStatement(identifiers)}
|
|
26
28
|
$$`;
|
|
27
29
|
};
|
|
28
|
-
const
|
|
30
|
+
const getAnswerNode = (identifiers) => {
|
|
29
31
|
const { a, bOperand } = identifiers;
|
|
30
32
|
const affine = new Affine(1, a);
|
|
31
33
|
const b = new SquareRoot(bOperand);
|
|
32
|
-
const answer = new MultiplyNode(new SubstractNode(affine.toTree(), b.toTree()), new AddNode(affine.toTree(), b.toTree()))
|
|
33
|
-
.simplify({ forbidFactorize: true })
|
|
34
|
-
.toTex();
|
|
34
|
+
const answer = new MultiplyNode(new SubstractNode(affine.toTree(), b.toTree()), new AddNode(affine.toTree(), b.toTree()));
|
|
35
35
|
return answer;
|
|
36
36
|
};
|
|
37
|
+
const getAnswer = (identifiers) => {
|
|
38
|
+
return getAnswerNode(identifiers).simplify({ forbidFactorize: true }).toTex();
|
|
39
|
+
};
|
|
37
40
|
const getHint = () => {
|
|
38
41
|
return `Utilise l'identité remarquable
|
|
39
42
|
|
|
@@ -95,11 +98,21 @@ const getPropositions = (n, { answer, a, bOperand }) => {
|
|
|
95
98
|
});
|
|
96
99
|
return shuffleProps(propositions, n);
|
|
97
100
|
};
|
|
98
|
-
const isAnswerValid = (ans, {
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
const isAnswerValid = (ans, { answer: _answer, ...identifiers }) => {
|
|
102
|
+
const parsed = parseAlgebraic(ans);
|
|
103
|
+
return (isFactorizedNode(parsed) &&
|
|
104
|
+
parsed
|
|
105
|
+
.simplify({
|
|
106
|
+
towardsDistribute: true,
|
|
107
|
+
forbidFactorize: true,
|
|
108
|
+
})
|
|
109
|
+
.toTex() ===
|
|
110
|
+
getAnswerNode(identifiers)
|
|
111
|
+
.simplify({
|
|
112
|
+
towardsDistribute: true,
|
|
113
|
+
forbidFactorize: true,
|
|
114
|
+
})
|
|
115
|
+
.toTex());
|
|
103
116
|
};
|
|
104
117
|
export const factorizeCanonicalFormWithSqrt = {
|
|
105
118
|
id: "factorizeCanonicalFormWithSqrt",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qCAAqC,CAAC;AACpD,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAE9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qCAAqC,CAAC;AACpD,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAE9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"argumentFromAlgebraicComplex.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/complex/argumentFromAlgebraicComplex.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAQrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"argumentFromAlgebraicComplex.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/complex/argumentFromAlgebraicComplex.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAQrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAW7C,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,EAAE,eAAe,CAAC;CACxB,CAAC;AAuJF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAc9D,CAAC"}
|
|
@@ -12,7 +12,9 @@ import { add } from "../../../tree/nodes/operators/addNode.js";
|
|
|
12
12
|
import { frac } from "../../../tree/nodes/operators/fractionNode.js";
|
|
13
13
|
import { MultiplyNode } from "../../../tree/nodes/operators/multiplyNode.js";
|
|
14
14
|
import { square } from "../../../tree/nodes/operators/powerNode.js";
|
|
15
|
+
import { parseAlgebraic } from "../../../tree/parsers/latexParser.js";
|
|
15
16
|
import { random } from "../../../utils/alea/random.js";
|
|
17
|
+
import { handleVEAError } from "../../../utils/errors/handleVEAError.js";
|
|
16
18
|
import { alignTex } from "../../../utils/latex/alignTex.js";
|
|
17
19
|
const getInstruction = (identifiers) => {
|
|
18
20
|
const zTex = identifiers.zTex;
|
|
@@ -141,10 +143,14 @@ const getPropositions = (n, { answer }) => {
|
|
|
141
143
|
});
|
|
142
144
|
return shuffleProps(propositions, n);
|
|
143
145
|
};
|
|
144
|
-
const isAnswerValid = (ans, {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
147
|
+
try {
|
|
148
|
+
const parsed = parseAlgebraic(ans);
|
|
149
|
+
return (parsed.simplify().toTex() === parseAlgebraic(answer).simplify().toTex());
|
|
150
|
+
}
|
|
151
|
+
catch (err) {
|
|
152
|
+
return handleVEAError(err);
|
|
153
|
+
}
|
|
148
154
|
};
|
|
149
155
|
export const argumentFromAlgebraicComplex = {
|
|
150
156
|
id: "argumentFromAlgebraicComplex",
|
|
@@ -388,10 +388,10 @@ const getPropositions = (n, { answer: _answer, ...identifiers }) => {
|
|
|
388
388
|
}
|
|
389
389
|
return shuffleProps(propositions, n);
|
|
390
390
|
};
|
|
391
|
-
const isAnswerValid = (ans, { answer
|
|
391
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
392
392
|
try {
|
|
393
393
|
const nodeAns = parseAlgebraic(ans);
|
|
394
|
-
const nodeAnswer =
|
|
394
|
+
const nodeAnswer = parseAlgebraic(answer);
|
|
395
395
|
return NodeComparator.isEqualViaRandomSubstitutions(nodeAns, nodeAnswer, 3);
|
|
396
396
|
}
|
|
397
397
|
catch (e) {
|
|
@@ -2,11 +2,10 @@ import { shuffleProps, tryToAddWrongProp, addValidProp, propWhile, } from "../..
|
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { Polynomial } from "../../../../math/polynomials/polynomial.js";
|
|
4
4
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
5
|
-
import {
|
|
6
|
-
import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
|
|
7
|
-
import { DiscreteSetNode } from "../../../../tree/nodes/sets/discreteSetNode.js";
|
|
5
|
+
import { discreteSetParser } from "../../../../tree/parsers/discreteSetParser.js";
|
|
8
6
|
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
9
7
|
import { probaFlip } from "../../../../utils/alea/probaFlip.js";
|
|
8
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
10
9
|
const getInstruction = (identifiers) => {
|
|
11
10
|
const { a, b } = identifiers;
|
|
12
11
|
const poly = new Polynomial([-b, 1]);
|
|
@@ -59,15 +58,16 @@ const getPropositions = (n, { answer, a, b }) => {
|
|
|
59
58
|
});
|
|
60
59
|
return shuffleProps(propositions, n);
|
|
61
60
|
};
|
|
62
|
-
const isAnswerValid = (ans, {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
61
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
62
|
+
try {
|
|
63
|
+
const parsed = discreteSetParser(ans);
|
|
64
|
+
if (!parsed)
|
|
65
|
+
return false;
|
|
66
|
+
return ("S=" + parsed.simplify({ decimalToFractions: true }).toTex() === answer);
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
return handleVEAError(err);
|
|
70
|
+
}
|
|
71
71
|
};
|
|
72
72
|
export const absoluteValueEquations = {
|
|
73
73
|
id: "absoluteValueEquation",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"affineAdjustmentRsquared.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/affines/adjustment/affineAdjustmentRsquared.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"affineAdjustmentRsquared.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/affines/adjustment/affineAdjustmentRsquared.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AA2GF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CAclE,CAAC"}
|