math-exercises 3.0.214 → 3.0.215
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/arithmetic/findLeftInHugeNumberDivision.d.ts +9 -0
- package/lib/exercises/math/arithmetic/findLeftInHugeNumberDivision.d.ts.map +1 -0
- package/lib/exercises/math/arithmetic/findLeftInHugeNumberDivision.js +194 -0
- package/lib/exercises/math/arithmetic/findMissingNumberToMakeNumberDivisibleBy9.d.ts +8 -0
- package/lib/exercises/math/arithmetic/findMissingNumberToMakeNumberDivisibleBy9.d.ts.map +1 -0
- package/lib/exercises/math/arithmetic/findMissingNumberToMakeNumberDivisibleBy9.js +121 -0
- package/lib/exercises/math/arithmetic/index.d.ts +7 -0
- package/lib/exercises/math/arithmetic/index.d.ts.map +1 -1
- package/lib/exercises/math/arithmetic/index.js +7 -0
- package/lib/exercises/math/arithmetic/isBigNumberPrime.d.ts +7 -0
- package/lib/exercises/math/arithmetic/isBigNumberPrime.d.ts.map +1 -0
- package/lib/exercises/math/arithmetic/isBigNumberPrime.js +107 -0
- package/lib/exercises/math/arithmetic/numberOfEndingZerosOfBigProduct.d.ts +8 -0
- package/lib/exercises/math/arithmetic/numberOfEndingZerosOfBigProduct.d.ts.map +1 -0
- package/lib/exercises/math/arithmetic/numberOfEndingZerosOfBigProduct.js +139 -0
- package/lib/exercises/math/arithmetic/pgcdFromEuclid.d.ts +8 -0
- package/lib/exercises/math/arithmetic/pgcdFromEuclid.d.ts.map +1 -0
- package/lib/exercises/math/arithmetic/pgcdFromEuclid.js +123 -0
- package/lib/exercises/math/arithmetic/solveDiophantianEquationByUsingPrimality.d.ts +7 -0
- package/lib/exercises/math/arithmetic/solveDiophantianEquationByUsingPrimality.d.ts.map +1 -0
- package/lib/exercises/math/arithmetic/solveDiophantianEquationByUsingPrimality.js +117 -0
- package/lib/exercises/math/arithmetic/whichDayInXDays.d.ts +8 -0
- package/lib/exercises/math/arithmetic/whichDayInXDays.d.ts.map +1 -0
- package/lib/exercises/math/arithmetic/whichDayInXDays.js +81 -0
- package/lib/exercises/math/calcul/fractions/fractionsSumFillInTheBlank.d.ts +15 -0
- package/lib/exercises/math/calcul/fractions/fractionsSumFillInTheBlank.d.ts.map +1 -0
- package/lib/exercises/math/calcul/fractions/fractionsSumFillInTheBlank.js +256 -0
- package/lib/exercises/math/calcul/fractions/index.d.ts +1 -0
- package/lib/exercises/math/calcul/fractions/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/index.js +1 -0
- package/lib/exercises/math/calcul/index.d.ts +1 -0
- package/lib/exercises/math/calcul/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/index.js +1 -0
- package/lib/exercises/math/calcul/mentalCaluls/index.d.ts +3 -0
- package/lib/exercises/math/calcul/mentalCaluls/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/mentalCaluls/index.js +3 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication101AndFriends.d.ts +10 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication101AndFriends.d.ts.map +1 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication101AndFriends.js +264 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication11AndFriends.d.ts +10 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication11AndFriends.d.ts.map +1 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication11AndFriends.js +264 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationTable.d.ts +11 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationTable.d.ts.map +1 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationTable.js +141 -0
- package/lib/exercises/math/calcul/ratio/index.d.ts +1 -0
- package/lib/exercises/math/calcul/ratio/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/ratio/index.js +1 -0
- package/lib/exercises/math/calcul/ratio/partsUsingRatio.d.ts +13 -0
- package/lib/exercises/math/calcul/ratio/partsUsingRatio.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ratio/partsUsingRatio.js +237 -0
- package/lib/exercises/math/calcul/relatives/index.d.ts +2 -0
- package/lib/exercises/math/calcul/relatives/index.d.ts.map +1 -0
- package/lib/exercises/math/calcul/relatives/index.js +1 -0
- package/lib/exercises/math/calcul/relatives/relativesAddAndSub.d.ts +17 -0
- package/lib/exercises/math/calcul/relatives/relativesAddAndSub.d.ts.map +1 -0
- package/lib/exercises/math/calcul/relatives/relativesAddAndSub.js +448 -0
- package/lib/exercises/math/calculLitteral/factorisation/factoByXK.d.ts +10 -0
- package/lib/exercises/math/calculLitteral/factorisation/factoByXK.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/factorisation/factoByXK.js +190 -0
- package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/index.js +1 -0
- package/lib/exercises/math/complex/algebraic/addComplex.d.ts +10 -0
- package/lib/exercises/math/complex/algebraic/addComplex.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/addComplex.js +125 -0
- package/lib/exercises/math/complex/algebraic/conjugateComplex.d.ts +8 -0
- package/lib/exercises/math/complex/algebraic/conjugateComplex.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/conjugateComplex.js +105 -0
- package/lib/exercises/math/complex/algebraic/conjugateDivideComplex.d.ts +8 -0
- package/lib/exercises/math/complex/algebraic/conjugateDivideComplex.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/conjugateDivideComplex.js +137 -0
- package/lib/exercises/math/complex/algebraic/conjugateMultiplyComplex.d.ts +8 -0
- package/lib/exercises/math/complex/algebraic/conjugateMultiplyComplex.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/conjugateMultiplyComplex.js +116 -0
- package/lib/exercises/math/complex/algebraic/divideComplex.d.ts +8 -0
- package/lib/exercises/math/complex/algebraic/divideComplex.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/divideComplex.js +128 -0
- package/lib/exercises/math/complex/algebraic/index.d.ts +11 -0
- package/lib/exercises/math/complex/algebraic/index.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/index.js +10 -0
- package/lib/exercises/math/complex/algebraic/inverseComplex.d.ts +8 -0
- package/lib/exercises/math/complex/algebraic/inverseComplex.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/inverseComplex.js +95 -0
- package/lib/exercises/math/complex/algebraic/linearCombinaisonComplex.d.ts +10 -0
- package/lib/exercises/math/complex/algebraic/linearCombinaisonComplex.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/linearCombinaisonComplex.js +105 -0
- package/lib/exercises/math/complex/algebraic/moduloFromAlgebraicComplex.d.ts +8 -0
- package/lib/exercises/math/complex/algebraic/moduloFromAlgebraicComplex.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/moduloFromAlgebraicComplex.js +93 -0
- package/lib/exercises/math/complex/algebraic/mutiplyComplex.d.ts +8 -0
- package/lib/exercises/math/complex/algebraic/mutiplyComplex.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/mutiplyComplex.js +106 -0
- package/lib/exercises/math/complex/algebraic/reAndIm.d.ts +9 -0
- package/lib/exercises/math/complex/algebraic/reAndIm.d.ts.map +1 -0
- package/lib/exercises/math/complex/algebraic/reAndIm.js +92 -0
- package/lib/exercises/math/complex/geometric/complexAlgebraicFromModuloAndArg.d.ts +9 -0
- package/lib/exercises/math/complex/geometric/complexAlgebraicFromModuloAndArg.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexAlgebraicFromModuloAndArg.js +151 -0
- package/lib/exercises/math/complex/geometric/complexDistance.d.ts +11 -0
- package/lib/exercises/math/complex/geometric/complexDistance.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexDistance.js +125 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixAlgFromPoint.d.ts +9 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixAlgFromPoint.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixAlgFromPoint.js +326 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromCenteredRegularPolygon.d.ts +10 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromCenteredRegularPolygon.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromCenteredRegularPolygon.js +459 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromPoint.d.ts +14 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromPoint.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromPoint.js +539 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixTrigFromPoint.d.ts +13 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixTrigFromPoint.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomAffixTrigFromPoint.js +485 -0
- package/lib/exercises/math/complex/geometric/complexGeomApproxOfCosArgOrSinArgFromPointAndAffixTrig.d.ts +12 -0
- package/lib/exercises/math/complex/geometric/complexGeomApproxOfCosArgOrSinArgFromPointAndAffixTrig.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomApproxOfCosArgOrSinArgFromPointAndAffixTrig.js +224 -0
- package/lib/exercises/math/complex/geometric/complexGeomArgumentOfFracCBABFromFigure.d.ts +11 -0
- package/lib/exercises/math/complex/geometric/complexGeomArgumentOfFracCBABFromFigure.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomArgumentOfFracCBABFromFigure.js +448 -0
- package/lib/exercises/math/complex/geometric/complexGeomFindPointFromAffixExp.d.ts +11 -0
- package/lib/exercises/math/complex/geometric/complexGeomFindPointFromAffixExp.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomFindPointFromAffixExp.js +223 -0
- package/lib/exercises/math/complex/geometric/complexGeomFindPointFromPowerOfUnitRootFromFigure.d.ts +11 -0
- package/lib/exercises/math/complex/geometric/complexGeomFindPointFromPowerOfUnitRootFromFigure.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomFindPointFromPowerOfUnitRootFromFigure.js +348 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlaceAffixPoint.d.ts +8 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlaceAffixPoint.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlaceAffixPoint.js +86 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZAPlusZ.d.ts +11 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZAPlusZ.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZAPlusZ.js +311 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATimesZ.d.ts +11 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATimesZ.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATimesZ.js +345 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATransformed.d.ts +16 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATransformed.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATransformed.js +729 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointWithAffixInU.d.ts +11 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointWithAffixInU.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/complexGeomPlacePointWithAffixInU.js +253 -0
- package/lib/exercises/math/complex/geometric/index.d.ts +12 -0
- package/lib/exercises/math/complex/geometric/index.d.ts.map +1 -0
- package/lib/exercises/math/complex/geometric/index.js +19 -0
- package/lib/exercises/math/complex/index.d.ts +4 -10
- package/lib/exercises/math/complex/index.d.ts.map +1 -1
- package/lib/exercises/math/complex/index.js +4 -11
- package/lib/exercises/math/complex/polynomials/factorizePolynomialInC.d.ts +10 -0
- package/lib/exercises/math/complex/polynomials/factorizePolynomialInC.d.ts.map +1 -0
- package/lib/exercises/math/complex/polynomials/factorizePolynomialInC.js +176 -0
- package/lib/exercises/math/complex/polynomials/index.d.ts +4 -0
- package/lib/exercises/math/complex/polynomials/index.d.ts.map +1 -0
- package/lib/exercises/math/complex/polynomials/index.js +3 -0
- package/lib/exercises/math/complex/polynomials/solveSecondDegreeInComplex.d.ts +10 -0
- package/lib/exercises/math/complex/polynomials/solveSecondDegreeInComplex.d.ts.map +1 -0
- package/lib/exercises/math/complex/polynomials/solveSecondDegreeInComplex.js +190 -0
- package/lib/exercises/math/complex/polynomials/solveZSquareEqualsA.d.ts +11 -0
- package/lib/exercises/math/complex/polynomials/solveZSquareEqualsA.d.ts.map +1 -0
- package/lib/exercises/math/complex/polynomials/solveZSquareEqualsA.js +158 -0
- package/lib/exercises/math/complex/unitRoots/giveNUnitRoot.d.ts +7 -0
- package/lib/exercises/math/complex/unitRoots/giveNUnitRoot.d.ts.map +1 -0
- package/lib/exercises/math/complex/unitRoots/giveNUnitRoot.js +122 -0
- package/lib/exercises/math/complex/unitRoots/giveOneSolutionToComplexPowNEqualsOne.d.ts +8 -0
- package/lib/exercises/math/complex/unitRoots/giveOneSolutionToComplexPowNEqualsOne.d.ts.map +1 -0
- package/lib/exercises/math/complex/unitRoots/giveOneSolutionToComplexPowNEqualsOne.js +138 -0
- package/lib/exercises/math/complex/unitRoots/index.d.ts +3 -0
- package/lib/exercises/math/complex/unitRoots/index.d.ts.map +1 -0
- package/lib/exercises/math/complex/unitRoots/index.js +2 -0
- package/lib/exercises/math/conversion/clock/clockReading.d.ts +12 -0
- package/lib/exercises/math/conversion/clock/clockReading.d.ts.map +1 -0
- package/lib/exercises/math/conversion/clock/clockReading.js +385 -0
- package/lib/exercises/math/conversion/clock/clockReadingPlusTimeOperation.d.ts +2 -0
- package/lib/exercises/math/conversion/clock/clockReadingPlusTimeOperation.d.ts.map +1 -0
- package/lib/exercises/math/conversion/clock/clockReadingPlusTimeOperation.js +521 -0
- package/lib/exercises/math/conversion/clock/clockWritingByManipulatingNeedles.d.ts +2 -0
- package/lib/exercises/math/conversion/clock/clockWritingByManipulatingNeedles.d.ts.map +1 -0
- package/lib/exercises/math/conversion/clock/clockWritingByManipulatingNeedles.js +359 -0
- package/lib/exercises/math/conversion/clock/dateTimeOperationAdd.d.ts +16 -0
- package/lib/exercises/math/conversion/clock/dateTimeOperationAdd.d.ts.map +1 -0
- package/lib/exercises/math/conversion/clock/dateTimeOperationAdd.js +319 -0
- package/lib/exercises/math/conversion/clock/index.d.ts +3 -0
- package/lib/exercises/math/conversion/clock/index.d.ts.map +1 -0
- package/lib/exercises/math/conversion/clock/index.js +4 -0
- package/lib/exercises/math/conversion/index.d.ts +1 -0
- package/lib/exercises/math/conversion/index.d.ts.map +1 -1
- package/lib/exercises/math/conversion/index.js +1 -0
- package/lib/exercises/math/geometry/angles/angleNatureFromFigure.d.ts +11 -0
- package/lib/exercises/math/geometry/angles/angleNatureFromFigure.d.ts.map +1 -0
- package/lib/exercises/math/geometry/angles/angleNatureFromFigure.js +233 -0
- package/lib/exercises/math/geometry/angles/angleNatureFromMeasure.d.ts +10 -0
- package/lib/exercises/math/geometry/angles/angleNatureFromMeasure.d.ts.map +1 -0
- package/lib/exercises/math/geometry/angles/angleNatureFromMeasure.js +137 -0
- package/lib/exercises/math/geometry/angles/index.d.ts +2 -0
- package/lib/exercises/math/geometry/angles/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/angles/index.js +2 -0
- package/lib/exercises/math/geometry/circles/buildCircleFromRadius.d.ts +9 -0
- package/lib/exercises/math/geometry/circles/buildCircleFromRadius.d.ts.map +1 -0
- package/lib/exercises/math/geometry/circles/buildCircleFromRadius.js +187 -0
- package/lib/exercises/math/geometry/circles/index.d.ts +1 -0
- package/lib/exercises/math/geometry/circles/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/circles/index.js +1 -0
- package/lib/exercises/math/geometry/lines/buildParallelFromLineAndPoint.d.ts +11 -0
- package/lib/exercises/math/geometry/lines/buildParallelFromLineAndPoint.d.ts.map +1 -0
- package/lib/exercises/math/geometry/lines/buildParallelFromLineAndPoint.js +154 -0
- package/lib/exercises/math/geometry/lines/buildPerpendicularFromLineAndPoint.d.ts +11 -0
- package/lib/exercises/math/geometry/lines/buildPerpendicularFromLineAndPoint.d.ts.map +1 -0
- package/lib/exercises/math/geometry/lines/buildPerpendicularFromLineAndPoint.js +157 -0
- package/lib/exercises/math/geometry/lines/index.d.ts +2 -0
- package/lib/exercises/math/geometry/lines/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/index.js +2 -0
- package/lib/exercises/math/geometry/triangles/index.d.ts +2 -0
- package/lib/exercises/math/geometry/triangles/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/triangles/index.js +2 -1
- package/lib/exercises/math/geometry/triangles/traceHeightInTriangle.d.ts +13 -0
- package/lib/exercises/math/geometry/triangles/traceHeightInTriangle.d.ts.map +1 -0
- package/lib/exercises/math/geometry/triangles/traceHeightInTriangle.js +271 -0
- package/lib/exercises/math/geometry/triangles/traceMedianInTriangle.d.ts +8 -0
- package/lib/exercises/math/geometry/triangles/traceMedianInTriangle.d.ts.map +1 -1
- package/lib/exercises/math/geometry/triangles/traceMedianInTriangle.js +284 -53
- package/lib/exercises/math/geometry/vectors/constructions/index.d.ts +1 -0
- package/lib/exercises/math/geometry/vectors/constructions/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/constructions/index.js +1 -0
- package/lib/exercises/math/geometry/vectors/constructions/traceVectorSumFromVecs.d.ts +8 -0
- package/lib/exercises/math/geometry/vectors/constructions/traceVectorSumFromVecs.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/constructions/traceVectorSumFromVecs.js +165 -0
- package/lib/exercises/math/geometry/volumes/index.d.ts +1 -0
- package/lib/exercises/math/geometry/volumes/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/index.js +1 -0
- package/lib/exercises/math/geometry/volumes/volumeOfCylinder.d.ts +8 -0
- package/lib/exercises/math/geometry/volumes/volumeOfCylinder.d.ts.map +1 -0
- package/lib/exercises/math/geometry/volumes/volumeOfCylinder.js +157 -0
- package/lib/exercises/math/spaceGeometry/basis/index.d.ts +1 -0
- package/lib/exercises/math/spaceGeometry/basis/index.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/basis/index.js +1 -0
- package/lib/exercises/math/spaceGeometry/basis/spaceSegmentLengthInRectangularPrism.d.ts +18 -0
- package/lib/exercises/math/spaceGeometry/basis/spaceSegmentLengthInRectangularPrism.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/basis/spaceSegmentLengthInRectangularPrism.js +538 -0
- package/lib/exercises/math/trigonometry/formulas/trigoAdditionFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/formulas/trigoAdditionFormulaUsage.js +6 -5
- package/lib/exercises/math/trigonometry/triangle/trigonometrySohcahtoaCalcul.js +1 -1
- package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts +1 -0
- package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts.map +1 -1
- package/lib/exercises/utils/geogebra/toolBarConstructor.js +2 -0
- package/lib/geogebra/parsers/geogebraParser.d.ts +3 -0
- package/lib/geogebra/parsers/geogebraParser.d.ts.map +1 -1
- package/lib/geogebra/parsers/geogebraParser.js +27 -0
- package/lib/index.d.ts +213 -23
- package/lib/index.d.ts.map +1 -1
- package/lib/latexTester.js +2 -0
- package/lib/math/geometry/angle.d.ts.map +1 -1
- package/lib/math/geometry/angle.js +3 -0
- package/lib/math/geometry/segment.d.ts +1 -1
- package/lib/math/geometry/segment.d.ts.map +1 -1
- package/lib/math/geometry/segment.js +5 -2
- package/lib/math/utils/geometry/angleBetweenPoints.d.ts +4 -0
- package/lib/math/utils/geometry/angleBetweenPoints.d.ts.map +1 -0
- package/lib/math/utils/geometry/angleBetweenPoints.js +58 -0
- package/lib/math/utils/geometry/angleNWSE.d.ts +3 -0
- package/lib/math/utils/geometry/angleNWSE.d.ts.map +1 -0
- package/lib/math/utils/geometry/angleNWSE.js +56 -0
- package/lib/tests/singleExo.test.d.ts.map +1 -1
- package/lib/tests/singleExo.test.js +2 -2
- package/lib/utils/strings/frenchDays.d.ts +2 -0
- package/lib/utils/strings/frenchDays.d.ts.map +1 -0
- package/lib/utils/strings/frenchDays.js +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, propWhile, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { numberVEA } from "../../../exercises/vea/numberVEA.js";
|
|
4
|
+
import { gcd } from "../../../math/utils/arithmetic/gcd.js";
|
|
5
|
+
import { randint } from "../../../math/utils/random/randint.js";
|
|
6
|
+
import { handleVEAError } from "../../../utils/errors/handleVEAError.js";
|
|
7
|
+
import { alignTex } from "../../../utils/latex/alignTex.js";
|
|
8
|
+
const getPropositions = (n, { answer, a, b }) => {
|
|
9
|
+
const propositions = [];
|
|
10
|
+
addValidProp(propositions, answer);
|
|
11
|
+
propWhile(propositions, n, () => {
|
|
12
|
+
tryToAddWrongProp(propositions, randint(2, Math.min(a, b)).frenchify());
|
|
13
|
+
});
|
|
14
|
+
return shuffleProps(propositions, n);
|
|
15
|
+
};
|
|
16
|
+
const getAnswer = (identifiers) => {
|
|
17
|
+
const { a, b } = identifiers;
|
|
18
|
+
return gcd(a, b).frenchify();
|
|
19
|
+
};
|
|
20
|
+
const getInstruction = (identifiers) => {
|
|
21
|
+
const { a, b } = identifiers;
|
|
22
|
+
return `À l'aide de l'algorithme d'Euclide, déterminer le PGCD de $${a}$ et $${b}$.`;
|
|
23
|
+
};
|
|
24
|
+
const getHint = () => {
|
|
25
|
+
return `Pour $a$ et $b$ deux entiers naturels non nuls, l'algorithme d'Euclide consiste à effectuer d'abord la division euclidienne de $a$ par $b$, puis successivement les divisions euclidiennes du diviseur et du reste de la division précedente, jusqu'à obtenir un reste nul.
|
|
26
|
+
|
|
27
|
+
Le PGCD de $a$ et $b$ est alors le dernier reste non nul de cette série de divisions.`;
|
|
28
|
+
};
|
|
29
|
+
const getCorrection = (identifiers) => {
|
|
30
|
+
const { a, b } = identifiers;
|
|
31
|
+
let dividend = a;
|
|
32
|
+
let divisor = b;
|
|
33
|
+
let q = Math.floor(dividend / divisor);
|
|
34
|
+
let r = a % b;
|
|
35
|
+
const coeffs = [[dividend, q, divisor, r]];
|
|
36
|
+
while (r !== 0) {
|
|
37
|
+
dividend = divisor;
|
|
38
|
+
divisor = r;
|
|
39
|
+
q = Math.floor(dividend / divisor);
|
|
40
|
+
r = dividend % divisor;
|
|
41
|
+
coeffs.push([dividend, divisor, q, r]);
|
|
42
|
+
}
|
|
43
|
+
return `On commence par écrire la division euclidienne de $${a}$ par $${b}$, puis les divisions euclidiennes successives du diviseur et du reste de la division précédent :
|
|
44
|
+
|
|
45
|
+
${alignTex(coeffs.map((arr) => [
|
|
46
|
+
`${arr[0]}`,
|
|
47
|
+
"=",
|
|
48
|
+
`${arr[1]} \\times ${arr[2]} + ${arr[3]}`,
|
|
49
|
+
]))}
|
|
50
|
+
|
|
51
|
+
Le dernier reste non nul étant $${getAnswer(identifiers)}$, c'est le PGCD de $${a}$ et $${b}$.`;
|
|
52
|
+
};
|
|
53
|
+
const getKeys = () => {
|
|
54
|
+
return [];
|
|
55
|
+
};
|
|
56
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
57
|
+
try {
|
|
58
|
+
return numberVEA(ans, answer);
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
return handleVEAError(err);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
const getPgcdFromEuclidQuestion = () => {
|
|
65
|
+
let a = 0;
|
|
66
|
+
let b = 0;
|
|
67
|
+
let counter = 0;
|
|
68
|
+
let pgcd = 0;
|
|
69
|
+
let iter = 0;
|
|
70
|
+
do {
|
|
71
|
+
counter++;
|
|
72
|
+
if (counter > 1000)
|
|
73
|
+
throw new Error("too many iterations in getPgcdFromEuclidQuestion");
|
|
74
|
+
a = randint(500, 2000);
|
|
75
|
+
b = randint(100, a);
|
|
76
|
+
iter = 1;
|
|
77
|
+
let dividend = a;
|
|
78
|
+
let divisor = b;
|
|
79
|
+
let q = Math.floor(dividend / divisor);
|
|
80
|
+
let r = a % b;
|
|
81
|
+
const coeffs = [[dividend, q, divisor, r]];
|
|
82
|
+
while (r !== 0) {
|
|
83
|
+
iter++;
|
|
84
|
+
dividend = divisor;
|
|
85
|
+
divisor = r;
|
|
86
|
+
q = Math.floor(dividend / divisor);
|
|
87
|
+
r = dividend % divisor;
|
|
88
|
+
coeffs.push([dividend, divisor, q, r]);
|
|
89
|
+
}
|
|
90
|
+
pgcd = gcd(a, b);
|
|
91
|
+
} while (pgcd === b || iter < 3 || iter > 5);
|
|
92
|
+
const identifiers = { a, b };
|
|
93
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
94
|
+
};
|
|
95
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
96
|
+
return {
|
|
97
|
+
answer: getAnswer(identifiers),
|
|
98
|
+
instruction: getInstruction(identifiers),
|
|
99
|
+
keys: getKeys(identifiers),
|
|
100
|
+
answerFormat: "tex",
|
|
101
|
+
identifiers,
|
|
102
|
+
hint: getHint(identifiers),
|
|
103
|
+
correction: getCorrection(identifiers),
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
export const pgcdFromEuclid = {
|
|
107
|
+
id: "pgcdFromEuclid",
|
|
108
|
+
connector: "=",
|
|
109
|
+
label: "Calculer un PGCD à l'aide de l'algorithme d'Euclide",
|
|
110
|
+
isSingleStep: true,
|
|
111
|
+
generator: (nb, opts) => getDistinctQuestions(() => getPgcdFromEuclidQuestion(opts), nb),
|
|
112
|
+
qcmTimer: 60,
|
|
113
|
+
freeTimer: 60,
|
|
114
|
+
getPropositions,
|
|
115
|
+
isAnswerValid,
|
|
116
|
+
subject: "Mathématiques",
|
|
117
|
+
getInstruction,
|
|
118
|
+
getHint,
|
|
119
|
+
getCorrection,
|
|
120
|
+
getAnswer,
|
|
121
|
+
getQuestionFromIdentifiers,
|
|
122
|
+
hasHintAndCorrection: true,
|
|
123
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
p: number;
|
|
4
|
+
};
|
|
5
|
+
export declare const solveDiophantianEquationByUsingPrimality: Exercise<Identifiers>;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=solveDiophantianEquationByUsingPrimality.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solveDiophantianEquationByUsingPrimality.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/arithmetic/solveDiophantianEquationByUsingPrimality.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;CAEX,CAAC;AA0GF,eAAO,MAAM,wCAAwC,EAAE,QAAQ,CAAC,WAAW,CAuB1E,CAAC"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, propWhile, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { pointVEA } from "../../../exercises/vea/pointVEA.js";
|
|
4
|
+
import { Point } from "../../../math/geometry/point.js";
|
|
5
|
+
import { isPrime } from "../../../math/utils/arithmetic/isPrime.js";
|
|
6
|
+
import { randint } from "../../../math/utils/random/randint.js";
|
|
7
|
+
import { doWhile } from "../../../utils/doWhile.js";
|
|
8
|
+
import { handleVEAError } from "../../../utils/errors/handleVEAError.js";
|
|
9
|
+
const getPropositions = (n, { answer }) => {
|
|
10
|
+
const propositions = [];
|
|
11
|
+
addValidProp(propositions, answer);
|
|
12
|
+
propWhile(propositions, n, () => {
|
|
13
|
+
const x = randint(50, 100);
|
|
14
|
+
const y = randint(50, 100, [x]);
|
|
15
|
+
tryToAddWrongProp(propositions, new Point("A", x, y).toCoords());
|
|
16
|
+
});
|
|
17
|
+
return shuffleProps(propositions, n);
|
|
18
|
+
};
|
|
19
|
+
const getAnswer = (identifiers) => {
|
|
20
|
+
//2x = p+1
|
|
21
|
+
const { p } = identifiers;
|
|
22
|
+
return new Point("A", (p + 1) / 2, (p + 1) / 2 - 1).toCoords();
|
|
23
|
+
};
|
|
24
|
+
const getInstruction = (identifiers) => {
|
|
25
|
+
const { p } = identifiers;
|
|
26
|
+
return `On admet que $${p}$ est premier.
|
|
27
|
+
|
|
28
|
+
Déterminer le couple $(x;y)$ d'entiers naturels qui vérifie :
|
|
29
|
+
|
|
30
|
+
$$
|
|
31
|
+
x^2-y^2 = ${p}
|
|
32
|
+
$$
|
|
33
|
+
|
|
34
|
+
On donnera la solution sous la forme $(x;y)$.
|
|
35
|
+
`;
|
|
36
|
+
};
|
|
37
|
+
const getHint = (identifiers) => {
|
|
38
|
+
const { p } = identifiers;
|
|
39
|
+
return `Puisque $${p}$ est premier, il n'admet que deux diviseurs : lesquels ?`;
|
|
40
|
+
};
|
|
41
|
+
const getCorrection = (identifiers) => {
|
|
42
|
+
const { p } = identifiers;
|
|
43
|
+
return `On commence par factoriser :
|
|
44
|
+
|
|
45
|
+
$$
|
|
46
|
+
x^2-y^2 = ${p}\\iff (x-y)(x+y) = ${p}
|
|
47
|
+
$$
|
|
48
|
+
|
|
49
|
+
Or, puisque $${p}$ est premier, il n'admet que deux diviseurs : $1$ et lui-même.
|
|
50
|
+
|
|
51
|
+
Cela n'implique que deux possibilités :
|
|
52
|
+
|
|
53
|
+
- soit $x-y = ${p}$ et $x+y = 1$
|
|
54
|
+
- soit $x-y = 1$ et $x+y = ${p}$
|
|
55
|
+
|
|
56
|
+
La première possibilité est à exclure, car si $x+y=1$, alors $(x;y) = (0;1)$ ou $(x;y)=(1;0)$, car $x$ et $y$ sont positifs, ce qui ne convient pas.
|
|
57
|
+
|
|
58
|
+
On a donc le système :
|
|
59
|
+
|
|
60
|
+
$$
|
|
61
|
+
\\left\\{\\begin{matrix}
|
|
62
|
+
x-y=1 \\\\
|
|
63
|
+
x+y=${p}
|
|
64
|
+
\\end{matrix}\\right.
|
|
65
|
+
$$
|
|
66
|
+
|
|
67
|
+
On résout ce système : on trouve $(x;y) = ${getAnswer(identifiers)}$.
|
|
68
|
+
`;
|
|
69
|
+
};
|
|
70
|
+
const getKeys = () => {
|
|
71
|
+
return ["semicolon"];
|
|
72
|
+
};
|
|
73
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
74
|
+
try {
|
|
75
|
+
return pointVEA(ans, answer);
|
|
76
|
+
}
|
|
77
|
+
catch (err) {
|
|
78
|
+
return handleVEAError(err);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
const getSolveDiophantianEquationByUsingPrimalityQuestion = () => {
|
|
82
|
+
const p = doWhile(() => randint(100, 500), (x) => !isPrime(x));
|
|
83
|
+
const identifiers = {
|
|
84
|
+
p,
|
|
85
|
+
};
|
|
86
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
87
|
+
};
|
|
88
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
89
|
+
return {
|
|
90
|
+
answer: getAnswer(identifiers),
|
|
91
|
+
instruction: getInstruction(identifiers),
|
|
92
|
+
keys: getKeys(identifiers),
|
|
93
|
+
answerFormat: "tex",
|
|
94
|
+
identifiers,
|
|
95
|
+
hint: getHint(identifiers),
|
|
96
|
+
correction: getCorrection(identifiers),
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
export const solveDiophantianEquationByUsingPrimality = {
|
|
100
|
+
id: "solveDiophantianEquationByUsingPrimality",
|
|
101
|
+
connector: "=",
|
|
102
|
+
label: "Résoudre $x^2-y^2 = p$ où $p$ est premier",
|
|
103
|
+
isSingleStep: true,
|
|
104
|
+
generator: (nb, opts) => getDistinctQuestions(() => getSolveDiophantianEquationByUsingPrimalityQuestion(opts), nb, 10),
|
|
105
|
+
qcmTimer: 60,
|
|
106
|
+
freeTimer: 60,
|
|
107
|
+
getPropositions,
|
|
108
|
+
isAnswerValid,
|
|
109
|
+
subject: "Mathématiques",
|
|
110
|
+
getInstruction,
|
|
111
|
+
getHint,
|
|
112
|
+
getCorrection,
|
|
113
|
+
getAnswer,
|
|
114
|
+
getQuestionFromIdentifiers,
|
|
115
|
+
hasHintAndCorrection: true,
|
|
116
|
+
maxAllowedQuestions: 10,
|
|
117
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whichDayInXDays.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/arithmetic/whichDayInXDays.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAyEF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAiBjD,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, propWhile, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { randint } from "../../../math/utils/random/randint.js";
|
|
4
|
+
import { random } from "../../../utils/alea/random.js";
|
|
5
|
+
import { doWhile } from "../../../utils/doWhile.js";
|
|
6
|
+
import { frenchDays } from "../../../utils/strings/frenchDays.js";
|
|
7
|
+
const getPropositions = (n, { answer }) => {
|
|
8
|
+
const propositions = [];
|
|
9
|
+
addValidProp(propositions, answer, "raw");
|
|
10
|
+
propWhile(propositions, n, () => {
|
|
11
|
+
tryToAddWrongProp(propositions, random(frenchDays), "raw");
|
|
12
|
+
});
|
|
13
|
+
return shuffleProps(propositions, n);
|
|
14
|
+
};
|
|
15
|
+
const getAnswer = (identifiers) => {
|
|
16
|
+
const { currentDay, step } = identifiers;
|
|
17
|
+
const left = step % 7;
|
|
18
|
+
return frenchDays[(currentDay + left) % 7];
|
|
19
|
+
};
|
|
20
|
+
const getInstruction = (identifiers) => {
|
|
21
|
+
const { currentDay, step } = identifiers;
|
|
22
|
+
const day = frenchDays[currentDay];
|
|
23
|
+
return `Nous sommes ${day}.
|
|
24
|
+
|
|
25
|
+
Quel jour serons-nous dans $${step}$ jours ?`;
|
|
26
|
+
};
|
|
27
|
+
const getHint = () => {
|
|
28
|
+
return `Il y a $7$ jours dans une semaine...`;
|
|
29
|
+
};
|
|
30
|
+
const getCorrection = (identifiers) => {
|
|
31
|
+
const { currentDay, step } = identifiers;
|
|
32
|
+
const day = frenchDays[currentDay];
|
|
33
|
+
const left = step % 7;
|
|
34
|
+
const quot = Math.floor(step / 7);
|
|
35
|
+
const answer = getAnswer(identifiers);
|
|
36
|
+
return `Il y a $7$ jours dans une semaine. On calcule donc le reste dans la division euclidienne de $${step}$ par $7$ :
|
|
37
|
+
|
|
38
|
+
$$
|
|
39
|
+
${step} = 7\\times ${quot} + ${left}
|
|
40
|
+
$$
|
|
41
|
+
|
|
42
|
+
En ajoutant $${left}$ jours à ${day}, on obtient ${answer}.
|
|
43
|
+
|
|
44
|
+
Dans $${step}$ jours, nous serons donc ${answer}.
|
|
45
|
+
`;
|
|
46
|
+
};
|
|
47
|
+
const getWhichDayInXDaysQuestion = () => {
|
|
48
|
+
const identifiers = {
|
|
49
|
+
currentDay: randint(0, 7),
|
|
50
|
+
step: doWhile(() => randint(100, 300), (x) => x % 7 === 0),
|
|
51
|
+
};
|
|
52
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
53
|
+
};
|
|
54
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
55
|
+
return {
|
|
56
|
+
answer: getAnswer(identifiers),
|
|
57
|
+
instruction: getInstruction(identifiers),
|
|
58
|
+
keys: [],
|
|
59
|
+
answerFormat: "raw",
|
|
60
|
+
identifiers,
|
|
61
|
+
hint: getHint(identifiers),
|
|
62
|
+
correction: getCorrection(identifiers),
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
export const whichDayInXDays = {
|
|
66
|
+
id: "whichDayInXDays",
|
|
67
|
+
label: "Déterminer le jour que nous serons dans $n$ jours",
|
|
68
|
+
isSingleStep: true,
|
|
69
|
+
generator: (nb, opts) => getDistinctQuestions(() => getWhichDayInXDaysQuestion(opts), nb),
|
|
70
|
+
qcmTimer: 60,
|
|
71
|
+
freeTimer: 60,
|
|
72
|
+
getPropositions,
|
|
73
|
+
subject: "Mathématiques",
|
|
74
|
+
getInstruction,
|
|
75
|
+
getHint,
|
|
76
|
+
getCorrection,
|
|
77
|
+
getAnswer,
|
|
78
|
+
getQuestionFromIdentifiers,
|
|
79
|
+
hasHintAndCorrection: true,
|
|
80
|
+
answerType: "QCU",
|
|
81
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
denomSrc: number;
|
|
4
|
+
denom: number;
|
|
5
|
+
numOperand: number;
|
|
6
|
+
numSum: number;
|
|
7
|
+
indexBlank: number;
|
|
8
|
+
};
|
|
9
|
+
type Options = {
|
|
10
|
+
allowNonIrreductible: boolean;
|
|
11
|
+
denom: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const fractionsSumFillInTheBlank: Exercise<Identifiers, Options>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=fractionsSumFillInTheBlank.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fractionsSumFillInTheBlank.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsSumFillInTheBlank.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAkBrC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AA8RF,KAAK,OAAO,GAAG;IACb,oBAAoB,EAAE,OAAO,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAiCF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAerE,CAAC"}
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, GeneratorOptionTarget, GeneratorOptionType, propWhile, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { defaultArrayedOptsWhereNeeded } from "../../../../exercises/utils/options/arrayedOptions.js";
|
|
4
|
+
import { RationalConstructor } from "../../../../math/numbers/rationals/rational.js";
|
|
5
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
6
|
+
import { EqualNode } from "../../../../tree/nodes/equations/equalNode.js";
|
|
7
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
8
|
+
import { frac, isFractionNode, } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
9
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
10
|
+
import { VariableNode } from "../../../../tree/nodes/variables/variableNode.js";
|
|
11
|
+
import { rationalParser } from "../../../../tree/parsers/rationalParser.js";
|
|
12
|
+
import { random } from "../../../../utils/alea/random.js";
|
|
13
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
14
|
+
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
15
|
+
const getHydrated = (identifiers) => {
|
|
16
|
+
const { numSum, numOperand, denom, indexBlank } = identifiers;
|
|
17
|
+
const [nodeOperand, nodeSum] = [numOperand, numSum].map((num) => frac(num, denom));
|
|
18
|
+
const nodeUnknown = new VariableNode("?");
|
|
19
|
+
const nodeInstructionSameDenom = new EqualNode(indexBlank === 0
|
|
20
|
+
? add(nodeUnknown, nodeOperand)
|
|
21
|
+
: add(nodeOperand, nodeUnknown), nodeSum);
|
|
22
|
+
const nodeOperandSimplified = nodeOperand.simplify({
|
|
23
|
+
towardsDistribute: false,
|
|
24
|
+
forceAddFractions: true,
|
|
25
|
+
});
|
|
26
|
+
const nodeSumSimplified = nodeSum.simplify({
|
|
27
|
+
towardsDistribute: false,
|
|
28
|
+
forceAddFractions: true,
|
|
29
|
+
});
|
|
30
|
+
const nodeInstruction = (() => {
|
|
31
|
+
return new EqualNode(indexBlank === 0
|
|
32
|
+
? add(nodeUnknown, nodeOperandSimplified)
|
|
33
|
+
: add(nodeOperandSimplified, nodeUnknown), nodeSumSimplified);
|
|
34
|
+
})();
|
|
35
|
+
const nodeAnswer = substract(nodeSum, nodeOperand).simplify({
|
|
36
|
+
towardsDistribute: false,
|
|
37
|
+
forceAddFractions: true,
|
|
38
|
+
});
|
|
39
|
+
const isSameDenomOperandAndSum = (() => {
|
|
40
|
+
if (isFractionNode(nodeOperandSimplified) &&
|
|
41
|
+
isFractionNode(nodeSumSimplified)) {
|
|
42
|
+
return (nodeOperandSimplified.rightChild.evaluate() ===
|
|
43
|
+
nodeSumSimplified.rightChild.evaluate());
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
})();
|
|
49
|
+
return {
|
|
50
|
+
nodeOperand,
|
|
51
|
+
nodeSum,
|
|
52
|
+
nodeInstruction,
|
|
53
|
+
nodeInstructionSameDenom,
|
|
54
|
+
nodeAnswer,
|
|
55
|
+
isSameDenomOperandAndSum,
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
const getInstruction = (identifiers, optsIn) => {
|
|
59
|
+
const opts = optsIn ?? optsDefault;
|
|
60
|
+
const { allowNonIrreductible } = opts;
|
|
61
|
+
const { nodeInstruction } = getHydrated(identifiers);
|
|
62
|
+
return `Compléter la somme à trou suivante ${allowNonIrreductible ? "" : "avec une fraction irréductible"}:
|
|
63
|
+
|
|
64
|
+
$$
|
|
65
|
+
${nodeInstruction.toTex()}
|
|
66
|
+
$$`;
|
|
67
|
+
};
|
|
68
|
+
const getAnswer = (identifiers) => {
|
|
69
|
+
const { nodeAnswer } = getHydrated(identifiers);
|
|
70
|
+
return nodeAnswer.toTex();
|
|
71
|
+
};
|
|
72
|
+
const getHint = (_, optsIn) => {
|
|
73
|
+
const opts = optsIn ?? optsDefault;
|
|
74
|
+
const { allowNonIrreductible } = opts;
|
|
75
|
+
return `Commence par réécrire les fractions pour qu'elle aient toutes le même dénominateur, si ce n'est pas déjà le cas,
|
|
76
|
+
puis cherche le numérateur qui convient pour la fraction manquante.
|
|
77
|
+
${allowNonIrreductible
|
|
78
|
+
? ""
|
|
79
|
+
: "Enfin, réécris la fraction que tu as trouvé sous forme irréductible."}`;
|
|
80
|
+
};
|
|
81
|
+
const getCorrection = (identifiers) => {
|
|
82
|
+
const { nodeInstruction, nodeInstructionSameDenom, isSameDenomOperandAndSum, } = getHydrated(identifiers);
|
|
83
|
+
const { numOperand, numSum, denom, indexBlank } = identifiers;
|
|
84
|
+
const [nodeOperand, nodeSum] = [numOperand, numSum].map((num) => frac(num, denom));
|
|
85
|
+
const nodeUnknown = new VariableNode("?");
|
|
86
|
+
const nodeFracUnknown = frac(nodeUnknown, denom);
|
|
87
|
+
const nodeCorrectionFractionSum = new EqualNode(indexBlank === 0
|
|
88
|
+
? add(nodeFracUnknown, nodeOperand)
|
|
89
|
+
: add(nodeOperand, nodeFracUnknown), nodeSum);
|
|
90
|
+
const nodeCorrectionIntegerSum = new EqualNode(indexBlank === 0
|
|
91
|
+
? add(nodeUnknown, numOperand.toTree())
|
|
92
|
+
: add(numOperand.toTree(), nodeUnknown), numSum.toTree());
|
|
93
|
+
const nodeAnswerRaw = frac(numSum - numOperand, denom);
|
|
94
|
+
return `${isSameDenomOperandAndSum
|
|
95
|
+
? `Toutes les fractions sont au même dénominateur.`
|
|
96
|
+
: `On commence par réécrire les fractions pour qu'elle aient toutes le même dénominateur :
|
|
97
|
+
|
|
98
|
+
${alignTex([
|
|
99
|
+
["", nodeInstruction.toTex()],
|
|
100
|
+
["\\Leftrightarrow", nodeInstructionSameDenom.toTex()],
|
|
101
|
+
])}
|
|
102
|
+
|
|
103
|
+
`}
|
|
104
|
+
|
|
105
|
+
On cherche le numérateur qui convient pour la fraction manquante :
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
${alignTex([
|
|
109
|
+
["", nodeCorrectionFractionSum.toTex()],
|
|
110
|
+
["\\Leftrightarrow", nodeCorrectionIntegerSum.toTex()],
|
|
111
|
+
])}
|
|
112
|
+
|
|
113
|
+
La fraction recherchée est donc $${nodeAnswerRaw.toTex()}$.
|
|
114
|
+
|
|
115
|
+
${(() => {
|
|
116
|
+
const texRaw = nodeAnswerRaw.toTex();
|
|
117
|
+
const texSimplified = nodeAnswerRaw
|
|
118
|
+
.simplify({ towardsDistribute: false, forceAddFractions: true })
|
|
119
|
+
.toTex();
|
|
120
|
+
if (texSimplified !== texRaw) {
|
|
121
|
+
return `La fraction peut être réduite :
|
|
122
|
+
|
|
123
|
+
$$
|
|
124
|
+
${texRaw} = ${texSimplified}
|
|
125
|
+
$$
|
|
126
|
+
|
|
127
|
+
`;
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
return ``;
|
|
131
|
+
}
|
|
132
|
+
})()}`;
|
|
133
|
+
};
|
|
134
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
135
|
+
const propositions = [];
|
|
136
|
+
addValidProp(propositions, answer);
|
|
137
|
+
const { denomSrc } = identifiers;
|
|
138
|
+
[...Array(denomSrc).keys()]
|
|
139
|
+
.map((i) => i + 1)
|
|
140
|
+
.map((v) => frac(v, denomSrc))
|
|
141
|
+
.forEach((node) => {
|
|
142
|
+
tryToAddWrongProp(propositions, node.simplify().toTex());
|
|
143
|
+
});
|
|
144
|
+
propWhile(propositions, n, () => {
|
|
145
|
+
tryToAddWrongProp(propositions, RationalConstructor.randomIrreductible().toTree().toTex());
|
|
146
|
+
});
|
|
147
|
+
return shuffleProps(propositions, n);
|
|
148
|
+
};
|
|
149
|
+
const isAnswerValid = (ans, { answer, ...identifiers }, opts) => {
|
|
150
|
+
const { nodeAnswer } = getHydrated(identifiers);
|
|
151
|
+
const texs = nodeAnswer.toAllValidTexs();
|
|
152
|
+
if (opts?.allowNonIrreductible) {
|
|
153
|
+
try {
|
|
154
|
+
const parsed = rationalParser(ans);
|
|
155
|
+
if (!parsed)
|
|
156
|
+
return false;
|
|
157
|
+
return texs.includes(parsed.simplify().toTex());
|
|
158
|
+
}
|
|
159
|
+
catch (err) {
|
|
160
|
+
return handleVEAError(err);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
return texs.includes(ans);
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
const createRandomIdentifiers = (opts) => {
|
|
168
|
+
const denomSrc = parseInt(opts.denom);
|
|
169
|
+
const numAnswer = randint(1, denomSrc + 1);
|
|
170
|
+
const indexBlank = randint(0, 2);
|
|
171
|
+
const [denom, numOperand, numSum] = (() => {
|
|
172
|
+
const numOperandSrc = randint(1, 2 * denomSrc + 1);
|
|
173
|
+
const numSumSrc = numAnswer + numOperandSrc;
|
|
174
|
+
const nodeOperand = frac(numOperandSrc, denomSrc).simplify();
|
|
175
|
+
const nodeSum = frac(numSumSrc, denomSrc).simplify();
|
|
176
|
+
const denom = [nodeOperand, nodeSum]
|
|
177
|
+
.filter((node) => isFractionNode(node))
|
|
178
|
+
.reduce((acc, node, i) => {
|
|
179
|
+
const den = node.rightChild.evaluate();
|
|
180
|
+
if (i === 0) {
|
|
181
|
+
return den;
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
return Math.min(den, acc);
|
|
185
|
+
}
|
|
186
|
+
}, -1);
|
|
187
|
+
const [numOperand, numSum] = [numOperandSrc, numSumSrc].map((num) => (num * denom) / denomSrc);
|
|
188
|
+
return [denom, numOperand, numSum];
|
|
189
|
+
})();
|
|
190
|
+
const identifiers = {
|
|
191
|
+
denomSrc,
|
|
192
|
+
denom,
|
|
193
|
+
numOperand,
|
|
194
|
+
numSum,
|
|
195
|
+
indexBlank,
|
|
196
|
+
};
|
|
197
|
+
return identifiers;
|
|
198
|
+
};
|
|
199
|
+
const getFractionsSumFillInTheBlankQuestion = (optsIn) => {
|
|
200
|
+
const arrayedOpts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
|
|
201
|
+
const opts = {
|
|
202
|
+
...(optsIn ?? optsDefault),
|
|
203
|
+
denom: random(arrayedOpts.denom),
|
|
204
|
+
};
|
|
205
|
+
const identifiers = createRandomIdentifiers(opts);
|
|
206
|
+
return getQuestionFromIdentifiers(identifiers, opts);
|
|
207
|
+
};
|
|
208
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
209
|
+
const question = {
|
|
210
|
+
answer: getAnswer(identifiers, opts),
|
|
211
|
+
instruction: getInstruction(identifiers, opts),
|
|
212
|
+
keys: [],
|
|
213
|
+
hint: getHint(identifiers, opts),
|
|
214
|
+
correction: getCorrection(identifiers, opts),
|
|
215
|
+
answerFormat: "tex",
|
|
216
|
+
identifiers,
|
|
217
|
+
};
|
|
218
|
+
return question;
|
|
219
|
+
};
|
|
220
|
+
const optsDefault = {
|
|
221
|
+
allowNonIrreductible: false,
|
|
222
|
+
};
|
|
223
|
+
const arrayedOptsDefault = {
|
|
224
|
+
denom: [4].map((v) => v.frenchify()),
|
|
225
|
+
};
|
|
226
|
+
const options = [
|
|
227
|
+
{
|
|
228
|
+
id: "allowNonIrreductible",
|
|
229
|
+
label: "Autoriser les fractions non réduites",
|
|
230
|
+
target: GeneratorOptionTarget.vea,
|
|
231
|
+
type: GeneratorOptionType.checkbox,
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
id: "denom",
|
|
235
|
+
label: "dénominateur de référence",
|
|
236
|
+
target: GeneratorOptionTarget.generation,
|
|
237
|
+
type: GeneratorOptionType.multiselect,
|
|
238
|
+
defaultValue: arrayedOptsDefault.denom,
|
|
239
|
+
values: [3, 4, 5, 6, 7, 8].map((v) => v.frenchify()),
|
|
240
|
+
},
|
|
241
|
+
];
|
|
242
|
+
export const fractionsSumFillInTheBlank = {
|
|
243
|
+
id: "fractionsSumFillInTheBlank",
|
|
244
|
+
connector: "=",
|
|
245
|
+
label: "Sommes à trou (fractions)",
|
|
246
|
+
isSingleStep: true,
|
|
247
|
+
generator: (nb, opts) => getDistinctQuestions(() => getFractionsSumFillInTheBlankQuestion(opts), nb),
|
|
248
|
+
options,
|
|
249
|
+
qcmTimer: 60,
|
|
250
|
+
freeTimer: 60,
|
|
251
|
+
getPropositions,
|
|
252
|
+
isAnswerValid,
|
|
253
|
+
subject: "Mathématiques",
|
|
254
|
+
hasHintAndCorrection: true,
|
|
255
|
+
getQuestionFromIdentifiers,
|
|
256
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,6CAA6C,CAAC;AAC5D,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,6CAA6C,CAAC;AAC5D,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/calcul/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AAEpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/calcul/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AAEpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC"}
|
|
@@ -8,4 +8,7 @@ export * from "./mentalProgramSolve.js";
|
|
|
8
8
|
export * from "./mentalFractionageOfInteger.js";
|
|
9
9
|
export * from "./mentalFractionageOfQuantity.js";
|
|
10
10
|
export * from "./mentalApplyPercentageEvolution.js";
|
|
11
|
+
export * from "./mentalMultiplicationTable.js";
|
|
12
|
+
export * from "./mentalMultiplication11AndFriends.js";
|
|
13
|
+
export * from "./mentalMultiplication101AndFriends.js";
|
|
11
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/mentalCaluls/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sCAAsC,CAAC;AACrD,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC;AACjD,cAAc,qCAAqC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/mentalCaluls/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sCAAsC,CAAC;AACrD,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC;AACjD,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uCAAuC,CAAC;AACtD,cAAc,wCAAwC,CAAC"}
|