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,359 @@
|
|
|
1
|
+
// import {
|
|
2
|
+
// Exercise,
|
|
3
|
+
// Question,
|
|
4
|
+
// QuestionGenerator,
|
|
5
|
+
// GetHint,
|
|
6
|
+
// GetCorrection,
|
|
7
|
+
// GetInstruction,
|
|
8
|
+
// GetGGBOptions,
|
|
9
|
+
// GetQuestionFromIdentifiers,
|
|
10
|
+
// GeneratorOption,
|
|
11
|
+
// GeneratorOptionTarget,
|
|
12
|
+
// GeneratorOptionType,
|
|
13
|
+
// GGBVEA,
|
|
14
|
+
// GetGGBAnswer,
|
|
15
|
+
// } from "../../../../exercises/exercise.js";
|
|
16
|
+
// import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
17
|
+
// import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
18
|
+
// import { Point, PointConstructor } from "../../../../math/geometry/point.js";
|
|
19
|
+
// import { Vector } from "../../../../math/geometry/vector.js";
|
|
20
|
+
// import { randint } from "../../../../math/utils/random/randint.js";
|
|
21
|
+
// import { round } from "../../../../math/utils/round.js";
|
|
22
|
+
// import { PiNode } from "../../../../tree/nodes/numbers/piNode.js";
|
|
23
|
+
// import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
24
|
+
// import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
25
|
+
// import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
26
|
+
// import { probaLawFlip } from "../../../../utils/alea/probaLawFlip.js";
|
|
27
|
+
// import { random } from "../../../../utils/alea/random.js";
|
|
28
|
+
export {};
|
|
29
|
+
// const _degreesToRadians = (angleInDegrees: number, precision: number) => {
|
|
30
|
+
// const oneOver180 = 0.00555555555555555;
|
|
31
|
+
// return round(
|
|
32
|
+
// multiply(multiply(angleInDegrees, PiNode), oneOver180).evaluate(),
|
|
33
|
+
// precision,
|
|
34
|
+
// );
|
|
35
|
+
// };
|
|
36
|
+
// const rotateVector = (vec: Vector, angle: number, name: string) => {
|
|
37
|
+
// //x' = cos(t)*x -sin(t)*y
|
|
38
|
+
// //y' = sin(t)*x + cos(t)*y
|
|
39
|
+
// const cos = Math.cos(angle);
|
|
40
|
+
// const sin = Math.sin(angle);
|
|
41
|
+
// return new Vector(
|
|
42
|
+
// name,
|
|
43
|
+
// substract(multiply(cos, vec.x), multiply(sin, vec.y)).evaluate().toTree(),
|
|
44
|
+
// add(multiply(sin, vec.x), multiply(cos, vec.y)).evaluate().toTree(),
|
|
45
|
+
// );
|
|
46
|
+
// };
|
|
47
|
+
// const rotatePoint = (
|
|
48
|
+
// target: Point,
|
|
49
|
+
// angle: number,
|
|
50
|
+
// center: Point,
|
|
51
|
+
// name: string,
|
|
52
|
+
// precision: number | undefined = 2,
|
|
53
|
+
// ) => {
|
|
54
|
+
// const vSrc = createVector(center, target, "vSrc", precision);
|
|
55
|
+
// const vRotated = rotateVector(vSrc, angle, "vRotated");
|
|
56
|
+
// return createPoint(
|
|
57
|
+
// add(center.x, vRotated.x).evaluate(),
|
|
58
|
+
// add(center.y, vRotated.y).evaluate(),
|
|
59
|
+
// name,
|
|
60
|
+
// precision,
|
|
61
|
+
// );
|
|
62
|
+
// };
|
|
63
|
+
// const createVector = (
|
|
64
|
+
// from: Point,
|
|
65
|
+
// to: Point,
|
|
66
|
+
// name: string,
|
|
67
|
+
// precision: number | undefined = 5,
|
|
68
|
+
// ) => {
|
|
69
|
+
// return new Vector(
|
|
70
|
+
// name,
|
|
71
|
+
// round(substract(to.x, from.x).evaluate(), precision).toTree(),
|
|
72
|
+
// round(substract(to.y, from.y).evaluate(), precision).toTree(),
|
|
73
|
+
// );
|
|
74
|
+
// };
|
|
75
|
+
// const createPoint = (
|
|
76
|
+
// x: number,
|
|
77
|
+
// y: number,
|
|
78
|
+
// name: string,
|
|
79
|
+
// precision: number | undefined = 5,
|
|
80
|
+
// ) => {
|
|
81
|
+
// return new Point(name, round(x, precision), round(y, precision));
|
|
82
|
+
// };
|
|
83
|
+
// /************/
|
|
84
|
+
// type Identifiers = {
|
|
85
|
+
// hours: number;
|
|
86
|
+
// minutes: number;
|
|
87
|
+
// };
|
|
88
|
+
// const getHydrated = (identifiers: Identifiers) => {
|
|
89
|
+
// const { hours, minutes } = identifiers;
|
|
90
|
+
// const isExactlyNoon = hours === 12 && minutes === 0;
|
|
91
|
+
// const strAMPM = (() => {
|
|
92
|
+
// if (minutes !== 0) {
|
|
93
|
+
// if (hours < 12) {
|
|
94
|
+
// return "Nous sommes avant midi";
|
|
95
|
+
// } else {
|
|
96
|
+
// return "Nous sommes après midi";
|
|
97
|
+
// }
|
|
98
|
+
// } else {
|
|
99
|
+
// if (hours === 0) {
|
|
100
|
+
// return "Nous sommes avant midi (il n'est pas midi).";
|
|
101
|
+
// } else if (hours === 24) {
|
|
102
|
+
// return "Nous sommes après midi (il n'est pas midi).";
|
|
103
|
+
// } else {
|
|
104
|
+
// return "Nous sommes en pleine journée.";
|
|
105
|
+
// }
|
|
106
|
+
// }
|
|
107
|
+
// })();
|
|
108
|
+
// const duodecHours = hours > 12 ? hours - 12 : hours;
|
|
109
|
+
// const duodecMinutes = minutes / 5;
|
|
110
|
+
// const angleMinutes = (Math.PI / 6.0) * duodecMinutes;
|
|
111
|
+
// const angleHours = 2 * Math.PI * (((hours + minutes / 60) / 12.0) % 1);
|
|
112
|
+
// return {
|
|
113
|
+
// strAMPM,
|
|
114
|
+
// isExactlyNoon,
|
|
115
|
+
// duodecHours,
|
|
116
|
+
// duodecMinutes,
|
|
117
|
+
// angleHours,
|
|
118
|
+
// angleMinutes,
|
|
119
|
+
// };
|
|
120
|
+
// };
|
|
121
|
+
// const getInstruction: GetInstruction<Identifiers> = (identifiers) => {
|
|
122
|
+
// const { hours, minutes } = identifiers;
|
|
123
|
+
// const strMinutes = (() => {
|
|
124
|
+
// if (minutes < 10) {
|
|
125
|
+
// return `0${minutes}`;
|
|
126
|
+
// } else {
|
|
127
|
+
// return `${minutes}`;
|
|
128
|
+
// }
|
|
129
|
+
// })();
|
|
130
|
+
// const strTime = `${hours}h${strMinutes}`;
|
|
131
|
+
// return `Manipuler les aiguilles de l'horloge pour indiquer $${strTime}$.`;
|
|
132
|
+
// };
|
|
133
|
+
// const getGGBAnswer: GetGGBAnswer<Identifiers> = (identifiers) => {
|
|
134
|
+
// // const { triangle, point, segment } = getHydrated(identifiers);
|
|
135
|
+
// const ggbAnswer = [`Ptest = Point({1,4})`];
|
|
136
|
+
// return ggbAnswer;
|
|
137
|
+
// };
|
|
138
|
+
// const getHint: GetHint<Identifiers> = () => {
|
|
139
|
+
// return `L'aiguille des heures est l'aiguille la plus courte.
|
|
140
|
+
// Avant midi, les heures vont de $0$ à $11$. Après midi, les heures vont de $12$ à $23$.
|
|
141
|
+
// Les graduations des minutes vont de $0$ à $55$ (de $5$ en $5$).
|
|
142
|
+
// L'aiguille des heures se déplace continument.
|
|
143
|
+
// Quand il est la demi, l'aiguille des heures est entre les deux marqueurs.
|
|
144
|
+
// Il faut placer l'aiguille des heures `;
|
|
145
|
+
// };
|
|
146
|
+
// const getCorrection: GetCorrection<Identifiers> = (identifiers) => {
|
|
147
|
+
// const { hours, minutes } = identifiers;
|
|
148
|
+
// const { duodecHours, duodecMinutes } = getHydrated(identifiers);
|
|
149
|
+
// const strMinutes = (() => {
|
|
150
|
+
// if (minutes < 10) {
|
|
151
|
+
// return `0${minutes}`;
|
|
152
|
+
// } else {
|
|
153
|
+
// return `${minutes}`;
|
|
154
|
+
// }
|
|
155
|
+
// })();
|
|
156
|
+
// if (minutes !== 0) {
|
|
157
|
+
// if (hours < 12) {
|
|
158
|
+
// return `Nous sommes avant midi.
|
|
159
|
+
// L'aiguille des heures est entre $${duodecHours}$ et $${duodecHours + 1}$.
|
|
160
|
+
// Il est donc $${hours}h...$
|
|
161
|
+
// L'aiguille des minutes est sur la graduation $${duodecMinutes}$.
|
|
162
|
+
// $$
|
|
163
|
+
// ${duodecMinutes} \\times 5 = ${minutes}
|
|
164
|
+
// $$
|
|
165
|
+
// Il est donc $${hours}h${strMinutes}$.
|
|
166
|
+
// `;
|
|
167
|
+
// } else if (hours > 12) {
|
|
168
|
+
// return `Nous sommes après midi.
|
|
169
|
+
// L'aiguille des heures est entre $${duodecHours}$ et $${duodecHours + 1}$.
|
|
170
|
+
// $$
|
|
171
|
+
// 12 + ${duodecHours} = ${hours}
|
|
172
|
+
// $$
|
|
173
|
+
// Il est donc $${hours}h...$
|
|
174
|
+
// L'aiguille des minutes est sur la graduation $${duodecMinutes}$.
|
|
175
|
+
// $$
|
|
176
|
+
// ${duodecMinutes} \\times 5 = ${minutes}
|
|
177
|
+
// $$
|
|
178
|
+
// Il est donc $${hours}h${strMinutes}$.
|
|
179
|
+
// `;
|
|
180
|
+
// } else {
|
|
181
|
+
// return "Il est exactement midi ($12h00$).";
|
|
182
|
+
// }
|
|
183
|
+
// } else {
|
|
184
|
+
// if (hours === 0) {
|
|
185
|
+
// return `Il est exactement minuit ($0h00$).`;
|
|
186
|
+
// } else if (hours === 24) {
|
|
187
|
+
// return `Il est exactement minuit ($0h00$) (on passe dans le jour suivant donc on n'écrit pas "$24h00$").`;
|
|
188
|
+
// } else {
|
|
189
|
+
// return `Il est exactement $${hours}h00$.`;
|
|
190
|
+
// }
|
|
191
|
+
// }
|
|
192
|
+
// };
|
|
193
|
+
// const getStudentGGBOptions: GetGGBOptions<Identifiers> = () => {
|
|
194
|
+
// const pointOrigin = new Point("O", 0, 0);
|
|
195
|
+
// //ticks
|
|
196
|
+
// const arrPointTickTop = [
|
|
197
|
+
// PointConstructor.fromCoords([0, 0.8], "tickTopA"),
|
|
198
|
+
// PointConstructor.fromCoords([0, 1], "tickTopB"),
|
|
199
|
+
// ];
|
|
200
|
+
// const arrArrPointTick = [...Array(12).keys()].map((i) => {
|
|
201
|
+
// const angle = (i * Math.PI) / 6;
|
|
202
|
+
// return arrPointTickTop.map((point, j) =>
|
|
203
|
+
// rotatePoint(point, angle, pointOrigin, `tick${i}${j === 0 ? "A" : "B"}`),
|
|
204
|
+
// );
|
|
205
|
+
// });
|
|
206
|
+
// const studentGGB = new GeogebraConstructor({
|
|
207
|
+
// commands: [
|
|
208
|
+
// `C = Circle((0,0), 1)`,
|
|
209
|
+
// `SetFixed(C, true, false)`,
|
|
210
|
+
// `SetLineThickness(C, 1)`,
|
|
211
|
+
// //ticks
|
|
212
|
+
// ...arrArrPointTick.flatMap(([pointA, pointB], i) => [
|
|
213
|
+
// `segTick${i} = Segment(${pointA.toMathString()}, ${pointB.toMathString()})`,
|
|
214
|
+
// `SetLineThickness(segTick${i}, ${i === 0 ? "6" : "2"})`,
|
|
215
|
+
// `SetFixed(segTick${i}, true, false)`,
|
|
216
|
+
// ]),
|
|
217
|
+
// //needles
|
|
218
|
+
// ...[
|
|
219
|
+
// `Chours = Circle((0,0), 0.5)`,
|
|
220
|
+
// `SetFixed(Chours, true, false)`,
|
|
221
|
+
// `SetVisibleInView(Chours, 1, false)`,
|
|
222
|
+
// `Bhours = Point(Chours)`,
|
|
223
|
+
// `SetPointStyle(Bhours, 2)`,
|
|
224
|
+
// `segNeedleHours = Segment(Center(Chours), Bhours)`,
|
|
225
|
+
// `SetLineThickness(segNeedleHours, 20)`,
|
|
226
|
+
// ],
|
|
227
|
+
// ...[
|
|
228
|
+
// `Cminutes = Circle((0,0), 0.75)`,
|
|
229
|
+
// `SetFixed(Cminutes, true, false)`,
|
|
230
|
+
// `SetVisibleInView(Cminutes, 1, false)`,
|
|
231
|
+
// `Bminutes = Point(Cminutes)`,
|
|
232
|
+
// `SetPointStyle(Bminutes, 2)`,
|
|
233
|
+
// `segNeedleMinutes = Segment(Center(Cminutes), Bminutes)`,
|
|
234
|
+
// `SetLineThickness(segNeedleMinutes, 10)`,
|
|
235
|
+
// ],
|
|
236
|
+
// ],
|
|
237
|
+
// hideAxes: true,
|
|
238
|
+
// hideGrid: true,
|
|
239
|
+
// forbidShiftDragZoom: true,
|
|
240
|
+
// interactiveObjects: ["Bhours", "Bminutes"],
|
|
241
|
+
// });
|
|
242
|
+
// return studentGGB.getOptions({
|
|
243
|
+
// coords: [-1.4, 1.4, -1.4, 1.4],
|
|
244
|
+
// });
|
|
245
|
+
// };
|
|
246
|
+
// const isGGBAnswerValid: GGBVEA<Identifiers> = (
|
|
247
|
+
// ggbAns,
|
|
248
|
+
// { ggbAnswer: _ggbAnswer, ...identifiers },
|
|
249
|
+
// ) => {
|
|
250
|
+
// return false;
|
|
251
|
+
// };
|
|
252
|
+
// const createRandomIdentifiers = () => {
|
|
253
|
+
// const amPmType = probaLawFlip([
|
|
254
|
+
// ["AM", 0.4],
|
|
255
|
+
// ["midi", 0.1],
|
|
256
|
+
// ["PM", 0.4],
|
|
257
|
+
// ["minuit", 0.1],
|
|
258
|
+
// ]);
|
|
259
|
+
// const [hours, minutes] = (() => {
|
|
260
|
+
// switch (amPmType) {
|
|
261
|
+
// case "AM": {
|
|
262
|
+
// const hours = randint(0, 12);
|
|
263
|
+
// const minutes = randint(1, 12) * 5;
|
|
264
|
+
// return [hours, minutes];
|
|
265
|
+
// }
|
|
266
|
+
// case "midi": {
|
|
267
|
+
// return [12, 0];
|
|
268
|
+
// }
|
|
269
|
+
// case "PM": {
|
|
270
|
+
// const hours = randint(12, 23);
|
|
271
|
+
// const minutes = randint(1, 12) * 5;
|
|
272
|
+
// return [hours, minutes];
|
|
273
|
+
// }
|
|
274
|
+
// case "minuit": {
|
|
275
|
+
// return random([
|
|
276
|
+
// [0, 0],
|
|
277
|
+
// [24, 0],
|
|
278
|
+
// ]);
|
|
279
|
+
// }
|
|
280
|
+
// default:
|
|
281
|
+
// throw new Error("Unsupported typeAMPM: " + amPmType);
|
|
282
|
+
// }
|
|
283
|
+
// })();
|
|
284
|
+
// const identifiers: Identifiers = {
|
|
285
|
+
// hours,
|
|
286
|
+
// minutes,
|
|
287
|
+
// };
|
|
288
|
+
// return identifiers;
|
|
289
|
+
// };
|
|
290
|
+
// const getClockWritingByManipulatingNeedlesQuestion: QuestionGenerator<
|
|
291
|
+
// Identifiers,
|
|
292
|
+
// Options
|
|
293
|
+
// > = (optsIn) => {
|
|
294
|
+
// const opts: Options = optsIn ?? arrayedOptsDefault;
|
|
295
|
+
// const identifiers = createRandomIdentifiers();
|
|
296
|
+
// return getQuestionFromIdentifiers(identifiers, opts);
|
|
297
|
+
// };
|
|
298
|
+
// const getQuestionFromIdentifiers: GetQuestionFromIdentifiers<
|
|
299
|
+
// Identifiers,
|
|
300
|
+
// Options
|
|
301
|
+
// > = (identifiers) => {
|
|
302
|
+
// const question: Question<Identifiers, Options> = {
|
|
303
|
+
// ggbAnswer: getGGBAnswer(identifiers),
|
|
304
|
+
// instruction: getInstruction(identifiers),
|
|
305
|
+
// keys: [],
|
|
306
|
+
// answerFormat: "tex",
|
|
307
|
+
// identifiers,
|
|
308
|
+
// hint: getHint(identifiers),
|
|
309
|
+
// correction: getCorrection(identifiers),
|
|
310
|
+
// studentGgbOptions: getStudentGGBOptions(identifiers),
|
|
311
|
+
// };
|
|
312
|
+
// return question;
|
|
313
|
+
// };
|
|
314
|
+
// type Options = {
|
|
315
|
+
// acceptedInputType: string[];
|
|
316
|
+
// };
|
|
317
|
+
// type ArrayedOptions = {
|
|
318
|
+
// readonly [K in keyof Options]: Options[K] extends unknown[]
|
|
319
|
+
// ? Options[K]
|
|
320
|
+
// : Options[K][];
|
|
321
|
+
// };
|
|
322
|
+
// const arrayedOptsDefault: ArrayedOptions = {
|
|
323
|
+
// acceptedInputType: ["réaliste"],
|
|
324
|
+
// };
|
|
325
|
+
// const options: GeneratorOption[] = [
|
|
326
|
+
// {
|
|
327
|
+
// id: "acceptedInputType",
|
|
328
|
+
// label: "Position acceptée pour l'aiguille des heures",
|
|
329
|
+
// target: GeneratorOptionTarget.generation,
|
|
330
|
+
// type: GeneratorOptionType.multiselect,
|
|
331
|
+
// values: ["réaliste", "simpliste"],
|
|
332
|
+
// defaultValue: arrayedOptsDefault.acceptedInputType,
|
|
333
|
+
// },
|
|
334
|
+
// ];
|
|
335
|
+
// export const clockWritingByManipulatingNeedles: Exercise<Identifiers, Options> =
|
|
336
|
+
// {
|
|
337
|
+
// id: "clockWritingByManipulatingNeedles",
|
|
338
|
+
// label: "Inscrire l'heure sur une horloge",
|
|
339
|
+
// isSingleStep: true,
|
|
340
|
+
// generator: (nb, opts) =>
|
|
341
|
+
// getDistinctQuestions(
|
|
342
|
+
// () => getClockWritingByManipulatingNeedlesQuestion(opts),
|
|
343
|
+
// nb,
|
|
344
|
+
// ),
|
|
345
|
+
// options,
|
|
346
|
+
// qcmTimer: 60,
|
|
347
|
+
// freeTimer: 60,
|
|
348
|
+
// getGGBAnswer,
|
|
349
|
+
// isGGBAnswerValid,
|
|
350
|
+
// subject: "Mathématiques",
|
|
351
|
+
// getHint,
|
|
352
|
+
// getCorrection,
|
|
353
|
+
// hasHintAndCorrection: true,
|
|
354
|
+
// getInstruction,
|
|
355
|
+
// getStudentGGBOptions,
|
|
356
|
+
// hasGeogebra: true,
|
|
357
|
+
// getQuestionFromIdentifiers,
|
|
358
|
+
// answerType: "GGB",
|
|
359
|
+
// };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type DateTime = {
|
|
3
|
+
day: number;
|
|
4
|
+
hours: number;
|
|
5
|
+
minutes: number;
|
|
6
|
+
};
|
|
7
|
+
type Identifiers = {
|
|
8
|
+
dateTimeStart: DateTime;
|
|
9
|
+
dateTimeDuration: DateTime;
|
|
10
|
+
};
|
|
11
|
+
type Options = {
|
|
12
|
+
hoursMinutesType: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const dateTimeOperationAdd: Exercise<Identifiers, Options>;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=dateTimeOperationAdd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateTimeOperationAdd.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/conversion/clock/dateTimeOperationAdd.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AASrC,KAAK,QAAQ,GAAG;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAsFF,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,QAAQ,CAAC;IACxB,gBAAgB,EAAE,QAAQ,CAAC;CAC5B,CAAC;AAyQF,KAAK,OAAO,GAAG;IACb,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAgBF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkB/D,CAAC"}
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, propWhile, GeneratorOptionTarget, GeneratorOptionType, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
4
|
+
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
5
|
+
import { zip } from "../../../../utils/arrays/arrayZip.js";
|
|
6
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
7
|
+
import { mdTable } from "../../../../utils/markdown/mdTable.js";
|
|
8
|
+
const arrTexDay = [
|
|
9
|
+
"lundi",
|
|
10
|
+
"mardi",
|
|
11
|
+
"mercredi",
|
|
12
|
+
"jeudi",
|
|
13
|
+
"vendredi",
|
|
14
|
+
"samedi",
|
|
15
|
+
"dimanche",
|
|
16
|
+
].map((str) => `\\text{${str}}`);
|
|
17
|
+
const createStrDateTime = (dateTime) => {
|
|
18
|
+
const { day, hours, minutes } = dateTime;
|
|
19
|
+
const strDay = arrTexDay[day % 7];
|
|
20
|
+
const strHours = `${hours}`;
|
|
21
|
+
const strMinutes = (() => {
|
|
22
|
+
if (minutes < 10) {
|
|
23
|
+
return `0${minutes}`;
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
return `${minutes}`;
|
|
27
|
+
}
|
|
28
|
+
})();
|
|
29
|
+
return `${strDay},${strHours}h${strMinutes}`;
|
|
30
|
+
};
|
|
31
|
+
const createStrDuration = (dateTime) => {
|
|
32
|
+
const { day, hours, minutes } = dateTime;
|
|
33
|
+
const strDay = day > 0 ? `${day}j` : ``;
|
|
34
|
+
const strHours = (() => {
|
|
35
|
+
if (hours < 10) {
|
|
36
|
+
return `0${hours}h`;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
return `${hours}h`;
|
|
40
|
+
}
|
|
41
|
+
})();
|
|
42
|
+
const strMinutes = (() => {
|
|
43
|
+
if (minutes < 10) {
|
|
44
|
+
return `0${minutes}min`;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
return `${minutes}min`;
|
|
48
|
+
}
|
|
49
|
+
})();
|
|
50
|
+
return `${strDay}${strHours}${strMinutes}`;
|
|
51
|
+
};
|
|
52
|
+
const carryAddMod = (v1, v2, mod) => {
|
|
53
|
+
const vRaw = v1 + v2;
|
|
54
|
+
const vRefined = vRaw % mod;
|
|
55
|
+
const carry = (vRaw - vRefined) / mod;
|
|
56
|
+
return [carry, vRefined];
|
|
57
|
+
};
|
|
58
|
+
const dateTimeAdd = (dateTimeStart, dateTimeDuration) => {
|
|
59
|
+
const [carryHours, minutes] = carryAddMod(dateTimeStart.minutes, dateTimeDuration.minutes, 60);
|
|
60
|
+
const [carryDays, hours] = carryAddMod(dateTimeStart.hours, dateTimeDuration.hours + carryHours, 24);
|
|
61
|
+
const [carryWeeks, day] = carryAddMod(dateTimeStart.day, dateTimeDuration.day + carryDays, 7);
|
|
62
|
+
const dateTimeResult = {
|
|
63
|
+
day,
|
|
64
|
+
hours,
|
|
65
|
+
minutes,
|
|
66
|
+
};
|
|
67
|
+
return {
|
|
68
|
+
carryHours,
|
|
69
|
+
carryDays,
|
|
70
|
+
carryWeeks,
|
|
71
|
+
dateTimeResult,
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
const getHydrated = (identifiers) => {
|
|
75
|
+
const { dateTimeStart, dateTimeDuration } = identifiers;
|
|
76
|
+
const { carryHours, carryDays, carryWeeks, dateTimeResult: dateTimeEnd, } = dateTimeAdd(dateTimeStart, dateTimeDuration);
|
|
77
|
+
const [strDateTimeStart, strDateTimeEnd] = [dateTimeStart, dateTimeEnd].map(createStrDateTime);
|
|
78
|
+
const strDateTimeDuration = createStrDuration(dateTimeDuration);
|
|
79
|
+
return {
|
|
80
|
+
carryHours,
|
|
81
|
+
carryDays,
|
|
82
|
+
carryWeeks,
|
|
83
|
+
dateTimeEnd,
|
|
84
|
+
strDateTimeStart,
|
|
85
|
+
strDateTimeEnd,
|
|
86
|
+
strDateTimeDuration,
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
const getInstruction = (identifiers) => {
|
|
90
|
+
const { strDateTimeStart, strDateTimeDuration } = getHydrated(identifiers);
|
|
91
|
+
return `La date de début d'un évènement est : $${strDateTimeStart}$. Sa durée est : $${strDateTimeDuration}$.
|
|
92
|
+
Quelle sera la date de fin ?
|
|
93
|
+
|
|
94
|
+
*La réponse est attendue sous le format : {jour},{heures}h{minutes}.*`;
|
|
95
|
+
};
|
|
96
|
+
const getAnswer = (identifiers) => {
|
|
97
|
+
const { strDateTimeEnd } = getHydrated(identifiers);
|
|
98
|
+
return strDateTimeEnd;
|
|
99
|
+
};
|
|
100
|
+
const getHint = (identifiers) => {
|
|
101
|
+
const { dateTimeStart, dateTimeDuration } = identifiers;
|
|
102
|
+
return `Une heure est composée de $60$ minutes. Un jour est composé de $24$ heures.
|
|
103
|
+
|
|
104
|
+
Si on pose $0 = lundi$, $1 = mardi$, $2 = mercredi$, $3 = jeudi$, $4 = vendredi$, $5 = samedi$, $6 = dimanche$.
|
|
105
|
+
|
|
106
|
+
Tu peux poser l'addition :
|
|
107
|
+
|
|
108
|
+
${mdTable([
|
|
109
|
+
["\\text{}", "\\text{j}", "\\text{h}", "\\text{min}"],
|
|
110
|
+
[
|
|
111
|
+
"\\text{début}",
|
|
112
|
+
dateTimeStart.day,
|
|
113
|
+
dateTimeStart.hours,
|
|
114
|
+
dateTimeStart.minutes,
|
|
115
|
+
],
|
|
116
|
+
[
|
|
117
|
+
"\\text{durée}",
|
|
118
|
+
dateTimeDuration.day,
|
|
119
|
+
dateTimeDuration.hours,
|
|
120
|
+
dateTimeDuration.minutes,
|
|
121
|
+
],
|
|
122
|
+
["\\text{-----}", "\\text{------}", "\\text{--}", "\\text{--}"],
|
|
123
|
+
["\\text{fin}", "\\text{}", "\\text{}", "\\text{}"],
|
|
124
|
+
], true)}
|
|
125
|
+
|
|
126
|
+
et compter les retenues toutes les $60$ minutes excédentaires,
|
|
127
|
+
puis compter les retenues toutes les $24$ heures excédentaires,
|
|
128
|
+
puis compter les retenues tous les $7$ jours excédentaires.
|
|
129
|
+
`;
|
|
130
|
+
};
|
|
131
|
+
const getCorrection = (identifiers) => {
|
|
132
|
+
const { dateTimeStart, dateTimeDuration } = identifiers;
|
|
133
|
+
const { dateTimeEnd, carryDays, carryHours, carryWeeks } = getHydrated(identifiers);
|
|
134
|
+
return `Une heure est composée de $60$ minutes. Un jour est composé de $24$ heures.
|
|
135
|
+
|
|
136
|
+
Si on pose $0 = lundi$, $1 = mardi$, $2 = mercredi$, $3 = jeudi$, $4 = vendredi$, $5 = samedi$, $6 = dimanche$.
|
|
137
|
+
|
|
138
|
+
On pose l'addition :
|
|
139
|
+
|
|
140
|
+
${mdTable([
|
|
141
|
+
["\\text{}", "\\text{sem}", "\\text{j}", "\\text{h}", "\\text{min}"],
|
|
142
|
+
["retenue", carryWeeks, carryDays, carryHours, "\\text{}"],
|
|
143
|
+
[
|
|
144
|
+
"\\text{début}",
|
|
145
|
+
"\\text{}",
|
|
146
|
+
dateTimeStart.day,
|
|
147
|
+
dateTimeStart.hours,
|
|
148
|
+
dateTimeStart.minutes,
|
|
149
|
+
],
|
|
150
|
+
[
|
|
151
|
+
"\\text{durée}",
|
|
152
|
+
"\\text{}",
|
|
153
|
+
dateTimeDuration.day,
|
|
154
|
+
dateTimeDuration.hours,
|
|
155
|
+
dateTimeDuration.minutes,
|
|
156
|
+
],
|
|
157
|
+
[
|
|
158
|
+
"\\text{-----}",
|
|
159
|
+
"\\text{--}",
|
|
160
|
+
"\\text{------}",
|
|
161
|
+
"\\text{--}",
|
|
162
|
+
"\\text{--}",
|
|
163
|
+
],
|
|
164
|
+
[
|
|
165
|
+
"\\text{fin}",
|
|
166
|
+
carryWeeks,
|
|
167
|
+
dateTimeEnd.day,
|
|
168
|
+
dateTimeEnd.hours,
|
|
169
|
+
dateTimeEnd.minutes,
|
|
170
|
+
],
|
|
171
|
+
], true)}
|
|
172
|
+
|
|
173
|
+
L'évènement s'arrête donc le $${getAnswer(identifiers)}$.`;
|
|
174
|
+
};
|
|
175
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
176
|
+
const propositions = [];
|
|
177
|
+
addValidProp(propositions, answer);
|
|
178
|
+
//hour: around, minutes: around
|
|
179
|
+
propWhile(propositions, n, () => {
|
|
180
|
+
const [hoursWrong, minutesWrong] = (() => {
|
|
181
|
+
const isWrongifyH = coinFlip();
|
|
182
|
+
const isWrongifyM = !isWrongifyH || coinFlip();
|
|
183
|
+
const hoursWrong = (() => {
|
|
184
|
+
if (isWrongifyH) {
|
|
185
|
+
return (identifiers.dateTimeDuration.hours +
|
|
186
|
+
randint(-identifiers.dateTimeDuration.hours + 1, 10));
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
return identifiers.dateTimeDuration.hours;
|
|
190
|
+
}
|
|
191
|
+
})();
|
|
192
|
+
const minutesWrong = (() => {
|
|
193
|
+
if (isWrongifyM) {
|
|
194
|
+
const uM = identifiers.dateTimeDuration.minutes % 10;
|
|
195
|
+
return uM + randint(0, 6) * 10;
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
return identifiers.dateTimeDuration.minutes;
|
|
199
|
+
}
|
|
200
|
+
})();
|
|
201
|
+
return [hoursWrong, minutesWrong];
|
|
202
|
+
})();
|
|
203
|
+
const identifiersWrong = {
|
|
204
|
+
dateTimeStart: identifiers.dateTimeStart,
|
|
205
|
+
dateTimeDuration: {
|
|
206
|
+
day: identifiers.dateTimeDuration.day,
|
|
207
|
+
hours: hoursWrong,
|
|
208
|
+
minutes: minutesWrong,
|
|
209
|
+
},
|
|
210
|
+
};
|
|
211
|
+
tryToAddWrongProp(propositions, getAnswer(identifiersWrong));
|
|
212
|
+
});
|
|
213
|
+
return shuffleProps(propositions, n);
|
|
214
|
+
};
|
|
215
|
+
const getKeys = () => {
|
|
216
|
+
return [
|
|
217
|
+
"h",
|
|
218
|
+
"comma",
|
|
219
|
+
...arrTexDay.map((tex) => {
|
|
220
|
+
return {
|
|
221
|
+
id: "custom",
|
|
222
|
+
label: tex,
|
|
223
|
+
labelType: "tex",
|
|
224
|
+
mathfieldInstructions: {
|
|
225
|
+
method: "write",
|
|
226
|
+
content: tex,
|
|
227
|
+
},
|
|
228
|
+
};
|
|
229
|
+
}),
|
|
230
|
+
];
|
|
231
|
+
};
|
|
232
|
+
const isAnswerValid = (ans, { answer, ...identifiers }) => {
|
|
233
|
+
try {
|
|
234
|
+
if (!ans.includes(",")) {
|
|
235
|
+
return false;
|
|
236
|
+
}
|
|
237
|
+
if (!ans.includes("h")) {
|
|
238
|
+
return false;
|
|
239
|
+
}
|
|
240
|
+
const [strDayAns, strTimeAns] = ans.split(",");
|
|
241
|
+
const [hoursAns, minutesAns] = strTimeAns
|
|
242
|
+
.split("h")
|
|
243
|
+
.map((str) => parseInt(str));
|
|
244
|
+
const { dateTimeEnd } = getHydrated(identifiers);
|
|
245
|
+
const { day: dayAnswer, hours: hoursAnswer, minutes: minutesAnswer, } = dateTimeEnd;
|
|
246
|
+
const strDayAnswer = arrTexDay[dayAnswer % 7];
|
|
247
|
+
return zip([strDayAns, hoursAns, minutesAns], [strDayAnswer, hoursAnswer, minutesAnswer]).every(([ans, answer]) => ans === answer);
|
|
248
|
+
}
|
|
249
|
+
catch (err) {
|
|
250
|
+
return handleVEAError(err);
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
const createRandomIdentifiers = (opts) => {
|
|
254
|
+
const { hoursMinutesType } = opts;
|
|
255
|
+
const isZeroMinutes = hoursMinutesType === "heures uniquement";
|
|
256
|
+
const dateTimeStart = {
|
|
257
|
+
day: randint(0, 7),
|
|
258
|
+
hours: randint(0, 7),
|
|
259
|
+
minutes: isZeroMinutes ? 0 : randint(0, 7),
|
|
260
|
+
};
|
|
261
|
+
const dateTimeDuration = {
|
|
262
|
+
day: randint(0, 4),
|
|
263
|
+
hours: randint(0, 24),
|
|
264
|
+
minutes: isZeroMinutes ? 0 : randint(0, 12) * 5,
|
|
265
|
+
};
|
|
266
|
+
const identifiers = {
|
|
267
|
+
dateTimeStart,
|
|
268
|
+
dateTimeDuration,
|
|
269
|
+
};
|
|
270
|
+
return identifiers;
|
|
271
|
+
};
|
|
272
|
+
const getDateTimeOperationAddQuestion = (optsIn) => {
|
|
273
|
+
const opts = optsIn ?? optsDefault;
|
|
274
|
+
const identifiers = createRandomIdentifiers(opts);
|
|
275
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
276
|
+
};
|
|
277
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
278
|
+
const question = {
|
|
279
|
+
answer: getAnswer(identifiers),
|
|
280
|
+
instruction: getInstruction(identifiers),
|
|
281
|
+
keys: getKeys(identifiers),
|
|
282
|
+
answerFormat: "tex",
|
|
283
|
+
identifiers,
|
|
284
|
+
hint: getHint(identifiers),
|
|
285
|
+
correction: getCorrection(identifiers),
|
|
286
|
+
};
|
|
287
|
+
return question;
|
|
288
|
+
};
|
|
289
|
+
const optsDefault = {
|
|
290
|
+
hoursMinutesType: "heures et minutes",
|
|
291
|
+
};
|
|
292
|
+
const options = [
|
|
293
|
+
{
|
|
294
|
+
id: "hoursMinutesType",
|
|
295
|
+
label: "Méthode de résolution",
|
|
296
|
+
target: GeneratorOptionTarget.generation,
|
|
297
|
+
type: GeneratorOptionType.select,
|
|
298
|
+
values: ["heures et minutes", "heures uniquement"],
|
|
299
|
+
defaultValue: optsDefault.hoursMinutesType,
|
|
300
|
+
},
|
|
301
|
+
];
|
|
302
|
+
export const dateTimeOperationAdd = {
|
|
303
|
+
id: "dateTimeOperationAdd",
|
|
304
|
+
label: "Opérations sur les heures : addition (sur plusieurs jours)",
|
|
305
|
+
isSingleStep: true,
|
|
306
|
+
generator: (nb, opts) => getDistinctQuestions(() => getDateTimeOperationAddQuestion(opts), nb),
|
|
307
|
+
options,
|
|
308
|
+
qcmTimer: 60,
|
|
309
|
+
freeTimer: 60,
|
|
310
|
+
getPropositions,
|
|
311
|
+
isAnswerValid,
|
|
312
|
+
subject: "Mathématiques",
|
|
313
|
+
getHint,
|
|
314
|
+
getCorrection,
|
|
315
|
+
hasHintAndCorrection: true,
|
|
316
|
+
getInstruction,
|
|
317
|
+
getAnswer,
|
|
318
|
+
getQuestionFromIdentifiers,
|
|
319
|
+
};
|