math-exercises 3.0.214 → 3.0.216
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 +82 -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 +2 -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/graphs/adjacentMatrixPath.d.ts +10 -0
- package/lib/exercises/math/graphs/adjacentMatrixPath.d.ts.map +1 -0
- package/lib/exercises/math/graphs/adjacentMatrixPath.js +89 -0
- package/lib/exercises/math/graphs/edgesNumberFromSummitsDegrees.d.ts +7 -0
- package/lib/exercises/math/graphs/edgesNumberFromSummitsDegrees.d.ts.map +1 -0
- package/lib/exercises/math/graphs/edgesNumberFromSummitsDegrees.js +98 -0
- package/lib/exercises/math/graphs/eulerianChainFromAdjacentMatrix.d.ts +8 -0
- package/lib/exercises/math/graphs/eulerianChainFromAdjacentMatrix.d.ts.map +1 -0
- package/lib/exercises/math/graphs/eulerianChainFromAdjacentMatrix.js +96 -0
- package/lib/exercises/math/graphs/graphsChainOrPathOfLengthN.d.ts +15 -0
- package/lib/exercises/math/graphs/graphsChainOrPathOfLengthN.d.ts.map +1 -0
- package/lib/exercises/math/graphs/graphsChainOrPathOfLengthN.js +262 -0
- package/lib/exercises/math/graphs/graphsCheckIsConnectedUndirectedGraph.d.ts +11 -0
- package/lib/exercises/math/graphs/graphsCheckIsConnectedUndirectedGraph.d.ts.map +1 -0
- package/lib/exercises/math/graphs/graphsCheckIsConnectedUndirectedGraph.js +178 -0
- package/lib/exercises/math/graphs/graphsCheckIsSameGraph.d.ts +19 -0
- package/lib/exercises/math/graphs/graphsCheckIsSameGraph.d.ts.map +1 -0
- package/lib/exercises/math/graphs/graphsCheckIsSameGraph.js +301 -0
- package/lib/exercises/math/graphs/graphsCheckIsVerticesAdjacent.d.ts +16 -0
- package/lib/exercises/math/graphs/graphsCheckIsVerticesAdjacent.d.ts.map +1 -0
- package/lib/exercises/math/graphs/graphsCheckIsVerticesAdjacent.js +207 -0
- package/lib/exercises/math/graphs/graphsDegreeOfVertex.d.ts +15 -0
- package/lib/exercises/math/graphs/graphsDegreeOfVertex.d.ts.map +1 -0
- package/lib/exercises/math/graphs/graphsDegreeOfVertex.js +232 -0
- package/lib/exercises/math/graphs/graphsOrderOfGraph.d.ts +14 -0
- package/lib/exercises/math/graphs/graphsOrderOfGraph.d.ts.map +1 -0
- package/lib/exercises/math/graphs/graphsOrderOfGraph.js +222 -0
- package/lib/exercises/math/graphs/index.d.ts +10 -0
- package/lib/exercises/math/graphs/index.d.ts.map +1 -0
- package/lib/exercises/math/graphs/index.js +9 -0
- package/lib/exercises/math/index.d.ts +1 -0
- package/lib/exercises/math/index.d.ts.map +1 -1
- package/lib/exercises/math/index.js +1 -0
- package/lib/exercises/math/matrices/areMatricesInverse.d.ts +9 -0
- package/lib/exercises/math/matrices/areMatricesInverse.d.ts.map +1 -0
- package/lib/exercises/math/matrices/areMatricesInverse.js +106 -0
- package/lib/exercises/math/matrices/computeFixedMatrixInRecurrenceSequence.d.ts +9 -0
- package/lib/exercises/math/matrices/computeFixedMatrixInRecurrenceSequence.d.ts.map +1 -0
- package/lib/exercises/math/matrices/computeFixedMatrixInRecurrenceSequence.js +144 -0
- package/lib/exercises/math/matrices/findInversedMatrixFromSystem.d.ts +8 -0
- package/lib/exercises/math/matrices/findInversedMatrixFromSystem.d.ts.map +1 -0
- package/lib/exercises/math/matrices/findInversedMatrixFromSystem.js +148 -0
- package/lib/exercises/math/matrices/index.d.ts +12 -0
- package/lib/exercises/math/matrices/index.d.ts.map +1 -1
- package/lib/exercises/math/matrices/index.js +12 -0
- package/lib/exercises/math/matrices/isMatrixTransitionMatrix.d.ts +8 -0
- package/lib/exercises/math/matrices/isMatrixTransitionMatrix.d.ts.map +1 -0
- package/lib/exercises/math/matrices/isMatrixTransitionMatrix.js +132 -0
- package/lib/exercises/math/matrices/matrixBuildMatrixFromCoefficients.d.ts +8 -0
- package/lib/exercises/math/matrices/matrixBuildMatrixFromCoefficients.d.ts.map +1 -0
- package/lib/exercises/math/matrices/matrixBuildMatrixFromCoefficients.js +152 -0
- package/lib/exercises/math/matrices/matrixCheckIsSymmetrical.d.ts +8 -0
- package/lib/exercises/math/matrices/matrixCheckIsSymmetrical.d.ts.map +1 -0
- package/lib/exercises/math/matrices/matrixCheckIsSymmetrical.js +155 -0
- package/lib/exercises/math/matrices/matrixComputeDetOfMat2.d.ts +8 -0
- package/lib/exercises/math/matrices/matrixComputeDetOfMat2.d.ts.map +1 -0
- package/lib/exercises/math/matrices/matrixComputeDetOfMat2.js +142 -0
- package/lib/exercises/math/matrices/matrixComputeInverseOfMat2.d.ts +8 -0
- package/lib/exercises/math/matrices/matrixComputeInverseOfMat2.d.ts.map +1 -0
- package/lib/exercises/math/matrices/matrixComputeInverseOfMat2.js +237 -0
- package/lib/exercises/math/matrices/matrixComputeLinearCombination.d.ts +15 -0
- package/lib/exercises/math/matrices/matrixComputeLinearCombination.d.ts.map +1 -0
- package/lib/exercises/math/matrices/matrixComputeLinearCombination.js +232 -0
- package/lib/exercises/math/matrices/matrixComputePower.d.ts +12 -0
- package/lib/exercises/math/matrices/matrixComputePower.d.ts.map +1 -0
- package/lib/exercises/math/matrices/matrixComputePower.js +230 -0
- package/lib/exercises/math/matrices/matrixComputeProduct.d.ts +9 -0
- package/lib/exercises/math/matrices/matrixComputeProduct.d.ts.map +1 -0
- package/lib/exercises/math/matrices/matrixComputeProduct.js +178 -0
- package/lib/exercises/math/matrices/writeMatrixAssociatedToSystem.d.ts +8 -0
- package/lib/exercises/math/matrices/writeMatrixAssociatedToSystem.d.ts.map +1 -0
- package/lib/exercises/math/matrices/writeMatrixAssociatedToSystem.js +105 -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/exercises/vea/matrixVEA.d.ts +2 -0
- package/lib/exercises/vea/matrixVEA.d.ts.map +1 -0
- package/lib/exercises/vea/matrixVEA.js +1 -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 +286 -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/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +3 -1
- 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/graphs/graph.d.ts +43 -0
- package/lib/math/graphs/graph.d.ts.map +1 -0
- package/lib/math/graphs/graph.js +391 -0
- package/lib/math/matrices/matrix.d.ts +42 -3
- package/lib/math/matrices/matrix.d.ts.map +1 -1
- package/lib/math/matrices/matrix.js +173 -7
- package/lib/math/matrices/parseMatrix.d.ts +3 -0
- package/lib/math/matrices/parseMatrix.d.ts.map +1 -0
- package/lib/math/matrices/parseMatrix.js +22 -0
- package/lib/math/systems/generalSystem.d.ts +2 -0
- package/lib/math/systems/generalSystem.d.ts.map +1 -1
- package/lib/math/systems/generalSystem.js +5 -0
- 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/math/utils/graphs/graphRenderer.d.ts +25 -0
- package/lib/math/utils/graphs/graphRenderer.d.ts.map +1 -0
- package/lib/math/utils/graphs/graphRenderer.js +123 -0
- package/lib/playground.d.ts +6 -1
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +6 -5
- package/lib/tests/singleExo.test.d.ts.map +1 -1
- package/lib/tests/singleExo.test.js +2 -2
- package/lib/tree/parsers/latexParser.d.ts +1 -1
- package/lib/tree/utilities/nodeSimplifier.d.ts +1 -1
- package/lib/types/keyIds.d.ts +2 -0
- package/lib/types/keyIds.d.ts.map +1 -1
- package/lib/utils/arrays/arrayChunks.d.ts +9 -0
- package/lib/utils/arrays/arrayChunks.d.ts.map +1 -0
- package/lib/utils/arrays/arrayChunks.js +34 -0
- 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/lib/utils/strings/ordinalSuffixed.d.ts +2 -0
- package/lib/utils/strings/ordinalSuffixed.d.ts.map +1 -0
- package/lib/utils/strings/ordinalSuffixed.js +5 -0
- package/package.json +7 -1
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, propWhile, GeneratorOptionTarget, GeneratorOptionType, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { defaultArrayedOptsWhereNeeded } from "../../../../exercises/utils/options/arrayedOptions.js";
|
|
4
|
+
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
5
|
+
import { Point, PointConstructor } from "../../../../math/geometry/point.js";
|
|
6
|
+
import { Vector } from "../../../../math/geometry/vector.js";
|
|
7
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
8
|
+
import { round } from "../../../../math/utils/round.js";
|
|
9
|
+
import { PiNode } from "../../../../tree/nodes/numbers/piNode.js";
|
|
10
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
11
|
+
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
12
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
13
|
+
import { probaLawFlip } from "../../../../utils/alea/probaLawFlip.js";
|
|
14
|
+
import { random } from "../../../../utils/alea/random.js";
|
|
15
|
+
import { zip } from "../../../../utils/arrays/arrayZip.js";
|
|
16
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
17
|
+
const _degreesToRadians = (angleInDegrees, precision) => {
|
|
18
|
+
const oneOver180 = 0.00555555555555555;
|
|
19
|
+
return round(multiply(multiply(angleInDegrees, PiNode), oneOver180).evaluate(), precision);
|
|
20
|
+
};
|
|
21
|
+
const rotateVector = (vec, angle, name) => {
|
|
22
|
+
//x' = cos(t)*x -sin(t)*y
|
|
23
|
+
//y' = sin(t)*x + cos(t)*y
|
|
24
|
+
const cos = Math.cos(angle);
|
|
25
|
+
const sin = Math.sin(angle);
|
|
26
|
+
return new Vector(name, substract(multiply(cos, vec.x), multiply(sin, vec.y)).evaluate().toTree(), add(multiply(sin, vec.x), multiply(cos, vec.y)).evaluate().toTree());
|
|
27
|
+
};
|
|
28
|
+
const rotatePoint = (target, angle, center, name, precision = 2) => {
|
|
29
|
+
const vSrc = createVector(center, target, "vSrc", precision);
|
|
30
|
+
const vRotated = rotateVector(vSrc, angle, "vRotated");
|
|
31
|
+
return createPoint(add(center.x, vRotated.x).evaluate(), add(center.y, vRotated.y).evaluate(), name, precision);
|
|
32
|
+
};
|
|
33
|
+
const createVector = (from, to, name, precision = 5) => {
|
|
34
|
+
return new Vector(name, round(substract(to.x, from.x).evaluate(), precision).toTree(), round(substract(to.y, from.y).evaluate(), precision).toTree());
|
|
35
|
+
};
|
|
36
|
+
const createPoint = (x, y, name, precision = 5) => {
|
|
37
|
+
return new Point(name, round(x, precision), round(y, precision));
|
|
38
|
+
};
|
|
39
|
+
const getHydrated = (identifiers) => {
|
|
40
|
+
const { hours, minutes } = identifiers;
|
|
41
|
+
const isExactlyNoon = hours === 12 && minutes === 0;
|
|
42
|
+
const strAMPM = (() => {
|
|
43
|
+
if (minutes !== 0) {
|
|
44
|
+
if (hours < 12) {
|
|
45
|
+
return "Nous sommes avant midi";
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
return "Nous sommes après midi";
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
if (hours === 0) {
|
|
53
|
+
return "Nous sommes avant midi (il n'est pas midi).";
|
|
54
|
+
}
|
|
55
|
+
else if (hours === 24) {
|
|
56
|
+
return "Nous sommes après midi (il n'est pas midi).";
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
return "Nous sommes en pleine journée.";
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
})();
|
|
63
|
+
const duodecHours = hours > 12 ? hours - 12 : hours;
|
|
64
|
+
const duodecMinutes = minutes / 5;
|
|
65
|
+
const angleMinutes = (Math.PI / 6.0) * duodecMinutes;
|
|
66
|
+
const angleHours = 2 * Math.PI * (((hours + minutes / 60) / 12.0) % 1);
|
|
67
|
+
return {
|
|
68
|
+
strAMPM,
|
|
69
|
+
isExactlyNoon,
|
|
70
|
+
duodecHours,
|
|
71
|
+
duodecMinutes,
|
|
72
|
+
angleHours,
|
|
73
|
+
angleMinutes,
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
const getInstruction = (identifiers) => {
|
|
77
|
+
const { strAMPM, isExactlyNoon } = getHydrated(identifiers);
|
|
78
|
+
return `Quelle est l'heure affichée sur l'horloge ? ${(() => {
|
|
79
|
+
if (isExactlyNoon) {
|
|
80
|
+
return "";
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
return `Indication : ${strAMPM}`;
|
|
84
|
+
}
|
|
85
|
+
})()}`;
|
|
86
|
+
};
|
|
87
|
+
const getAnswer = (identifiers) => {
|
|
88
|
+
const { hours, minutes } = identifiers;
|
|
89
|
+
const strMinutes = (() => {
|
|
90
|
+
if (minutes < 10) {
|
|
91
|
+
return `0${minutes}`;
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
return `${minutes}`;
|
|
95
|
+
}
|
|
96
|
+
})();
|
|
97
|
+
return `${hours === 24 ? "0" : hours}h${strMinutes}`;
|
|
98
|
+
};
|
|
99
|
+
const getHint = () => {
|
|
100
|
+
return `L'aiguille des heures est l'aiguille la plus courte.
|
|
101
|
+
Avant midi, les heures vont de $0$ à $11$. Après midi, les heures vont de $12$ à $23$.
|
|
102
|
+
Les graduations des minutes vont de $0$ à $55$ (de $5$ en $5$).`;
|
|
103
|
+
};
|
|
104
|
+
const getCorrection = (identifiers) => {
|
|
105
|
+
const { hours, minutes } = identifiers;
|
|
106
|
+
const { duodecHours, duodecMinutes } = getHydrated(identifiers);
|
|
107
|
+
const strMinutes = (() => {
|
|
108
|
+
if (minutes < 10) {
|
|
109
|
+
return `0${minutes}`;
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
return `${minutes}`;
|
|
113
|
+
}
|
|
114
|
+
})();
|
|
115
|
+
if (minutes !== 0) {
|
|
116
|
+
if (hours < 12) {
|
|
117
|
+
return `Nous sommes avant midi.
|
|
118
|
+
L'aiguille des heures est entre $${duodecHours}$ et $${duodecHours + 1}$.
|
|
119
|
+
|
|
120
|
+
Il est donc $${hours}h...$
|
|
121
|
+
|
|
122
|
+
L'aiguille des minutes est sur la graduation $${duodecMinutes}$.
|
|
123
|
+
|
|
124
|
+
$$
|
|
125
|
+
${duodecMinutes} \\times 5 = ${minutes}
|
|
126
|
+
$$
|
|
127
|
+
|
|
128
|
+
Il est donc $${hours}h${strMinutes}$.
|
|
129
|
+
|
|
130
|
+
`;
|
|
131
|
+
}
|
|
132
|
+
else if (hours > 12) {
|
|
133
|
+
return `Nous sommes après midi.
|
|
134
|
+
L'aiguille des heures est entre $${duodecHours}$ et $${duodecHours + 1}$.
|
|
135
|
+
|
|
136
|
+
$$
|
|
137
|
+
12 + ${duodecHours} = ${hours}
|
|
138
|
+
$$
|
|
139
|
+
|
|
140
|
+
Il est donc $${hours}h...$
|
|
141
|
+
|
|
142
|
+
L'aiguille des minutes est sur la graduation $${duodecMinutes}$.
|
|
143
|
+
|
|
144
|
+
$$
|
|
145
|
+
${duodecMinutes} \\times 5 = ${minutes}
|
|
146
|
+
$$
|
|
147
|
+
|
|
148
|
+
Il est donc $${hours}h${strMinutes}$.
|
|
149
|
+
|
|
150
|
+
`;
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
return "Il est exactement midi ($12h00$).";
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
if (hours === 0) {
|
|
158
|
+
return `Il est exactement minuit ($0h00$).`;
|
|
159
|
+
}
|
|
160
|
+
else if (hours === 24) {
|
|
161
|
+
return `Il est exactement minuit ($0h00$) (on passe dans le jour suivant donc on n'écrit pas "$24h00$").`;
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
return `Il est exactement $${hours}h00$.`;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
const getGGBOptions = (identifiers) => {
|
|
169
|
+
const { angleHours, angleMinutes } = getHydrated(identifiers);
|
|
170
|
+
const pointOrigin = new Point("O", 0, 0);
|
|
171
|
+
//ticks
|
|
172
|
+
const arrPointTickTop = [
|
|
173
|
+
PointConstructor.fromCoords([0, 0.8], "tickTopA"),
|
|
174
|
+
PointConstructor.fromCoords([0, 1], "tickTopB"),
|
|
175
|
+
];
|
|
176
|
+
const arrArrPointTick = [...Array(12).keys()].map((i) => {
|
|
177
|
+
const angle = (i * Math.PI) / 6;
|
|
178
|
+
return arrPointTickTop.map((point, j) => rotatePoint(point, angle, pointOrigin, `tick${i}${j === 0 ? "A" : "B"}`));
|
|
179
|
+
});
|
|
180
|
+
//needles
|
|
181
|
+
const arrPointNeedleHours = [
|
|
182
|
+
PointConstructor.fromCoords([0, 0], "needleHoursTopA"),
|
|
183
|
+
PointConstructor.fromCoords([0, 0.5], "needleHoursTopB"),
|
|
184
|
+
].map((point, j) => rotatePoint(point, -angleHours, pointOrigin, `needleHours${j === 0 ? "A" : "B"}`));
|
|
185
|
+
const arrPointNeedleMinutes = [
|
|
186
|
+
PointConstructor.fromCoords([0, 0], "needleMinutesTopA"),
|
|
187
|
+
PointConstructor.fromCoords([0, 0.75], "needleMinutesTopB"),
|
|
188
|
+
].map((point, j) => rotatePoint(point, -angleMinutes, pointOrigin, `needleHours${j === 0 ? "A" : "B"}`));
|
|
189
|
+
const ggb = new GeogebraConstructor({
|
|
190
|
+
commands: [
|
|
191
|
+
`C = Circle((0,0), 1)`,
|
|
192
|
+
`SetFixed(C, true, false)`,
|
|
193
|
+
`SetLineThickness(C, 1)`,
|
|
194
|
+
//ticks
|
|
195
|
+
...arrArrPointTick.flatMap(([pointA, pointB], i) => [
|
|
196
|
+
`segTick${i} = Segment(${pointA.toMathString()}, ${pointB.toMathString()})`,
|
|
197
|
+
`SetLineThickness(segTick${i}, ${i === 0 ? "6" : "2"})`,
|
|
198
|
+
`SetFixed(segTick${i}, true, false)`,
|
|
199
|
+
]),
|
|
200
|
+
//needles
|
|
201
|
+
...(() => {
|
|
202
|
+
const [pointA, pointB] = arrPointNeedleHours;
|
|
203
|
+
return [
|
|
204
|
+
`segNeedleHours = Segment(${pointA.toMathString()}, ${pointB.toMathString()})`,
|
|
205
|
+
`SetLineThickness(segNeedleHours, 20)`,
|
|
206
|
+
`SetFixed(segNeedleHours, true, false)`,
|
|
207
|
+
];
|
|
208
|
+
})(),
|
|
209
|
+
...(() => {
|
|
210
|
+
const [pointA, pointB] = arrPointNeedleMinutes;
|
|
211
|
+
return [
|
|
212
|
+
`segNeedleMinutes = Segment(${pointA.toMathString()}, ${pointB.toMathString()})`,
|
|
213
|
+
`SetLineThickness(segNeedleMinutes, 10)`,
|
|
214
|
+
`SetFixed(segNeedleMinutes, true, false)`,
|
|
215
|
+
];
|
|
216
|
+
})(),
|
|
217
|
+
],
|
|
218
|
+
hideAxes: true,
|
|
219
|
+
hideGrid: true,
|
|
220
|
+
forbidShiftDragZoom: true,
|
|
221
|
+
});
|
|
222
|
+
return ggb.getOptions({
|
|
223
|
+
coords: [-1.4, 1.4, -1.4, 1.4],
|
|
224
|
+
});
|
|
225
|
+
};
|
|
226
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
227
|
+
const propositions = [];
|
|
228
|
+
addValidProp(propositions, answer);
|
|
229
|
+
//student: one hour more
|
|
230
|
+
{
|
|
231
|
+
if (identifiers.minutes >= 30) {
|
|
232
|
+
const identifiersWrong = {
|
|
233
|
+
hours: identifiers.hours + 1,
|
|
234
|
+
minutes: identifiers.minutes,
|
|
235
|
+
};
|
|
236
|
+
tryToAddWrongProp(propositions, getAnswer(identifiersWrong));
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
//student: hours<->minutes
|
|
240
|
+
{
|
|
241
|
+
const identifiersWrong = {
|
|
242
|
+
hours: identifiers.minutes / 5,
|
|
243
|
+
minutes: (identifiers.hours % 12) * 5,
|
|
244
|
+
};
|
|
245
|
+
tryToAddWrongProp(propositions, getAnswer(identifiersWrong));
|
|
246
|
+
}
|
|
247
|
+
//student: am<->pm
|
|
248
|
+
{
|
|
249
|
+
const identifiersWrong = {
|
|
250
|
+
hours: identifiers.hours < 12
|
|
251
|
+
? identifiers.hours + 12
|
|
252
|
+
: identifiers.hours - 12,
|
|
253
|
+
minutes: identifiers.minutes,
|
|
254
|
+
};
|
|
255
|
+
tryToAddWrongProp(propositions, getAnswer(identifiersWrong));
|
|
256
|
+
}
|
|
257
|
+
propWhile(propositions, n, () => {
|
|
258
|
+
const amPmType = random(["AM", "midi", "PM", "minuit"]);
|
|
259
|
+
const identifiersWrong = createRandomIdentifiers(amPmType);
|
|
260
|
+
tryToAddWrongProp(propositions, getAnswer(identifiersWrong));
|
|
261
|
+
});
|
|
262
|
+
return shuffleProps(propositions, n);
|
|
263
|
+
};
|
|
264
|
+
const getKeys = () => {
|
|
265
|
+
return ["h"];
|
|
266
|
+
};
|
|
267
|
+
const isAnswerValid = (ans, { answer, ...identifiers }) => {
|
|
268
|
+
try {
|
|
269
|
+
if (!ans.includes("h")) {
|
|
270
|
+
return false;
|
|
271
|
+
}
|
|
272
|
+
const [hoursAns, minutesAns] = ans.split("h").map((str) => parseInt(str));
|
|
273
|
+
const { hours, minutes } = identifiers;
|
|
274
|
+
return zip([hoursAns, minutesAns], [hours === 24 ? 0 : hours, minutes]).every(([ans, answer]) => ans === answer);
|
|
275
|
+
}
|
|
276
|
+
catch (err) {
|
|
277
|
+
return handleVEAError(err);
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
const createRandomIdentifiers = (amPmType) => {
|
|
281
|
+
const [hours, minutes] = (() => {
|
|
282
|
+
switch (amPmType) {
|
|
283
|
+
case "AM": {
|
|
284
|
+
const hours = randint(0, 12);
|
|
285
|
+
const minutes = randint(1, 12) * 5;
|
|
286
|
+
return [hours, minutes];
|
|
287
|
+
}
|
|
288
|
+
case "midi": {
|
|
289
|
+
return [12, 0];
|
|
290
|
+
}
|
|
291
|
+
case "PM": {
|
|
292
|
+
const hours = randint(12, 23);
|
|
293
|
+
const minutes = randint(1, 12) * 5;
|
|
294
|
+
return [hours, minutes];
|
|
295
|
+
}
|
|
296
|
+
case "minuit": {
|
|
297
|
+
return random([
|
|
298
|
+
[0, 0],
|
|
299
|
+
[24, 0],
|
|
300
|
+
]);
|
|
301
|
+
}
|
|
302
|
+
default:
|
|
303
|
+
throw new Error("Unsupported typeAMPM: " + amPmType);
|
|
304
|
+
}
|
|
305
|
+
})();
|
|
306
|
+
const identifiers = {
|
|
307
|
+
hours,
|
|
308
|
+
minutes,
|
|
309
|
+
};
|
|
310
|
+
return identifiers;
|
|
311
|
+
};
|
|
312
|
+
const getClockReadingQuestion = (optsIn) => {
|
|
313
|
+
const arrayedOpts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
|
|
314
|
+
const arrAMPMType = arrayedOpts.amPmType;
|
|
315
|
+
function drawAMPMType(arrAMPMType) {
|
|
316
|
+
if (arrAMPMType.length === 1) {
|
|
317
|
+
const [amPmType] = arrAMPMType;
|
|
318
|
+
return amPmType;
|
|
319
|
+
}
|
|
320
|
+
else {
|
|
321
|
+
let amPmType;
|
|
322
|
+
do {
|
|
323
|
+
const amPmTypeDrawn = probaLawFlip([
|
|
324
|
+
["AM", 0.4],
|
|
325
|
+
["midi", 0.1],
|
|
326
|
+
["PM", 0.4],
|
|
327
|
+
["minuit", 0.1],
|
|
328
|
+
]);
|
|
329
|
+
if (arrAMPMType.includes(amPmTypeDrawn)) {
|
|
330
|
+
amPmType = amPmTypeDrawn;
|
|
331
|
+
}
|
|
332
|
+
} while (!amPmType);
|
|
333
|
+
return amPmType;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
const amPmType = drawAMPMType(arrAMPMType);
|
|
337
|
+
const identifiers = createRandomIdentifiers(amPmType);
|
|
338
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
339
|
+
};
|
|
340
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
341
|
+
const question = {
|
|
342
|
+
answer: getAnswer(identifiers),
|
|
343
|
+
instruction: getInstruction(identifiers),
|
|
344
|
+
keys: getKeys(identifiers),
|
|
345
|
+
answerFormat: "tex",
|
|
346
|
+
identifiers,
|
|
347
|
+
hint: getHint(identifiers),
|
|
348
|
+
correction: getCorrection(identifiers),
|
|
349
|
+
ggbOptions: getGGBOptions(identifiers),
|
|
350
|
+
};
|
|
351
|
+
return question;
|
|
352
|
+
};
|
|
353
|
+
const arrayedOptsDefault = {
|
|
354
|
+
amPmType: ["AM", "midi"],
|
|
355
|
+
};
|
|
356
|
+
const options = [
|
|
357
|
+
{
|
|
358
|
+
id: "amPmType",
|
|
359
|
+
label: "Type de plage horaire",
|
|
360
|
+
target: GeneratorOptionTarget.generation,
|
|
361
|
+
type: GeneratorOptionType.multiselect,
|
|
362
|
+
values: ["AM", "midi", "PM", "minuit"],
|
|
363
|
+
defaultValue: arrayedOptsDefault.amPmType,
|
|
364
|
+
},
|
|
365
|
+
];
|
|
366
|
+
export const clockReading = {
|
|
367
|
+
id: "clockReading",
|
|
368
|
+
label: "Lire l'heure sur une horloge",
|
|
369
|
+
isSingleStep: true,
|
|
370
|
+
generator: (nb, opts) => getDistinctQuestions(() => getClockReadingQuestion(opts), nb),
|
|
371
|
+
options,
|
|
372
|
+
qcmTimer: 60,
|
|
373
|
+
freeTimer: 60,
|
|
374
|
+
getPropositions,
|
|
375
|
+
isAnswerValid,
|
|
376
|
+
subject: "Mathématiques",
|
|
377
|
+
getHint,
|
|
378
|
+
getCorrection,
|
|
379
|
+
hasHintAndCorrection: true,
|
|
380
|
+
getInstruction,
|
|
381
|
+
getAnswer,
|
|
382
|
+
getGGBOptions,
|
|
383
|
+
hasGeogebra: true,
|
|
384
|
+
getQuestionFromIdentifiers,
|
|
385
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clockReadingPlusTimeOperation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/conversion/clock/clockReadingPlusTimeOperation.ts"],"names":[],"mappings":""}
|