math-exercises 3.0.68 → 3.0.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/exercises/math/calcul/fractions/fractionToPercentToDecimal.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionToPercentToDecimal.js +55 -37
- package/lib/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.js +4 -4
- package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.js +31 -18
- package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.js +59 -35
- package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.js +1 -1
- package/lib/exercises/math/combinatory/anagrams.d.ts.map +1 -1
- package/lib/exercises/math/combinatory/anagrams.js +18 -7
- package/lib/exercises/math/combinatory/ballsCounting.d.ts.map +1 -1
- package/lib/exercises/math/combinatory/ballsCounting.js +8 -6
- package/lib/exercises/math/combinatory/diceCounting.d.ts.map +1 -1
- package/lib/exercises/math/combinatory/diceCounting.js +62 -27
- package/lib/exercises/math/functions/absolute/absolueValueAffineEquation.d.ts.map +1 -1
- package/lib/exercises/math/functions/absolute/absolueValueAffineEquation.js +4 -0
- package/lib/exercises/math/functions/absolute/absolueValueInequationsSup.d.ts.map +1 -1
- package/lib/exercises/math/functions/absolute/absolueValueInequationsSup.js +4 -4
- package/lib/exercises/math/functions/absolute/absoluteValueEquations.d.ts.map +1 -1
- package/lib/exercises/math/functions/absolute/absoluteValueEquations.js +22 -10
- package/lib/exercises/math/functions/absolute/absoluteValueInequations.d.ts.map +1 -1
- package/lib/exercises/math/functions/absolute/absoluteValueInequations.js +22 -8
- package/lib/exercises/math/functions/affines/affineAdjustment.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineAdjustment.js +4 -4
- package/lib/exercises/math/functions/affines/affineAdjustmentComplete.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineAdjustmentComplete.js +4 -4
- package/lib/exercises/math/functions/affines/affineAdjustmentRsquared.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineAdjustmentRsquared.js +4 -4
- package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.js +4 -4
- package/lib/exercises/math/functions/affines/affineExpressionReading.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineExpressionReading.js +1 -0
- package/lib/exercises/math/functions/affines/affineMeanValue.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineMeanValue.js +33 -14
- package/lib/exercises/math/functions/affines/algebricExpressionOfAffine.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/algebricExpressionOfAffine.js +4 -4
- package/lib/exercises/math/functions/affines/leadingCoeffAndOriginOrdinate.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/leadingCoeffAndOriginOrdinate.js +4 -0
- package/lib/exercises/math/functions/affines/leadingCoefficient.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/leadingCoefficient.js +4 -5
- package/lib/exercises/math/functions/affines/leadingCoefficientCalculV1.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/leadingCoefficientCalculV1.js +4 -2
- package/lib/exercises/math/functions/basics/graphicEquation.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/graphicEquation.js +4 -2
- package/lib/exercises/math/functions/basics/graphicInequation.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/graphicInequation.js +4 -2
- package/lib/exercises/math/functions/basics/graphicInequationAffine.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/graphicInequationAffine.js +4 -5
- package/lib/exercises/math/functions/basics/imageAntecedentFromSentence.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/imageAntecedentFromSentence.js +4 -3
- package/lib/exercises/math/functions/basics/inverseImageFunction.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/inverseImageFunction.js +4 -6
- package/lib/exercises/math/functions/basics/inverseImageFunctionGeogebra.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/inverseImageFunctionGeogebra.js +0 -2
- package/lib/exercises/math/functions/basics/inverseImageFunctionTable.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/inverseImageFunctionTable.js +16 -15
- package/lib/exercises/math/functions/basics/twoFunctionsEquation.d.ts +1 -0
- package/lib/exercises/math/functions/basics/twoFunctionsEquation.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/twoFunctionsEquation.js +46 -32
- package/lib/exercises/math/functions/basics/twoFunctionsInequation.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/twoFunctionsInequation.js +4 -2
- package/lib/exercises/math/functions/cube/cubicEquation.d.ts.map +1 -1
- package/lib/exercises/math/functions/cube/cubicEquation.js +4 -3
- package/lib/exercises/math/functions/exponentials/exponentialsVariations.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponentials/exponentialsVariations.js +4 -1
- package/lib/exercises/math/functions/integral/integralAffines.d.ts.map +1 -1
- package/lib/exercises/math/functions/integral/integralAffines.js +4 -2
- package/lib/exercises/math/functions/integral/integralDerivatedUCosU.d.ts.map +1 -1
- package/lib/exercises/math/functions/integral/integralDerivatedUCosU.js +27 -12
- package/lib/exercises/math/functions/integral/integralDerivatedUSinU.d.ts.map +1 -1
- package/lib/exercises/math/functions/integral/integralDerivatedUSinU.js +26 -11
- package/lib/exercises/math/functions/integral/integralExpAxPlusB.d.ts.map +1 -1
- package/lib/exercises/math/functions/integral/integralExpAxPlusB.js +26 -11
- package/lib/exercises/math/functions/integral/integralExpU.d.ts.map +1 -1
- package/lib/exercises/math/functions/integral/integralExpU.js +38 -20
- package/lib/exercises/math/functions/integral/integralFractions.d.ts.map +1 -1
- package/lib/exercises/math/functions/integral/integralFractions.js +40 -21
- package/lib/exercises/math/functions/integral/integralKCosinus.d.ts.map +1 -1
- package/lib/exercises/math/functions/integral/integralKCosinus.js +29 -12
- package/lib/exercises/math/functions/integral/integralKSinus.d.ts.map +1 -1
- package/lib/exercises/math/functions/integral/integralKSinus.js +29 -12
- package/lib/exercises/math/functions/integral/integralTrinomials.d.ts.map +1 -1
- package/lib/exercises/math/functions/integral/integralTrinomials.js +4 -2
- package/lib/exercises/math/functions/logarithm/log10PowerSimplifying.d.ts +0 -1
- package/lib/exercises/math/functions/logarithm/log10PowerSimplifying.d.ts.map +1 -1
- package/lib/exercises/math/functions/logarithm/log10PowerSimplifying.js +36 -15
- package/lib/exercises/math/functions/logarithm/log10Simplifying.d.ts.map +1 -1
- package/lib/exercises/math/functions/logarithm/log10Simplifying.js +43 -22
- package/lib/exercises/math/functions/logarithm/logEquation.d.ts.map +1 -1
- package/lib/exercises/math/functions/logarithm/logEquation.js +20 -11
- package/lib/exercises/math/functions/logarithm/logPowerEquation.d.ts.map +1 -1
- package/lib/exercises/math/functions/logarithm/logPowerEquation.js +26 -14
- package/lib/exercises/math/functions/logarithm/logSimplifiying.d.ts.map +1 -1
- package/lib/exercises/math/functions/logarithm/logSimplifiying.js +4 -3
- package/lib/exercises/math/functions/parity/parityFromAlgebra.d.ts.map +1 -1
- package/lib/exercises/math/functions/parity/parityFromAlgebra.js +29 -13
- package/lib/exercises/math/functions/parity/parityFromGraph.d.ts.map +1 -1
- package/lib/exercises/math/functions/parity/parityFromGraph.js +30 -12
- package/lib/exercises/math/functions/rationalFraction/rationalFractionForbiddenValue.d.ts.map +1 -1
- package/lib/exercises/math/functions/rationalFraction/rationalFractionForbiddenValue.js +27 -14
- package/lib/exercises/math/functions/sign/affineProductSign.d.ts.map +1 -1
- package/lib/exercises/math/functions/sign/affineProductSign.js +4 -4
- package/lib/exercises/math/functions/square/squareImageInterval.d.ts.map +1 -1
- package/lib/exercises/math/functions/square/squareImageInterval.js +39 -19
- package/lib/exercises/math/functions/trinoms/devForm/coefficientsIdentification.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/devForm/coefficientsIdentification.js +4 -3
- package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.d.ts +1 -0
- package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.js +26 -9
- package/lib/exercises/math/functions/trinoms/equation/deltaTrinom.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/equation/deltaTrinom.js +25 -10
- package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationByFactorisation.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationByFactorisation.js +4 -2
- package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationFromCano.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationFromCano.js +4 -2
- package/lib/exercises/math/functions/trinoms/factoForm/factorizedFormFromRoots.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/factoForm/factorizedFormFromRoots.js +4 -4
- package/lib/exercises/math/functions/trinoms/parabole/paraboleExpressionReading.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/parabole/paraboleExpressionReading.js +4 -5
- package/lib/exercises/math/functions/trinoms/parabole/trinomSymetryAxisFromFacto.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/parabole/trinomSymetryAxisFromFacto.js +4 -4
- package/lib/exercises/math/functions/trinoms/roots/findSecondRoot.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/findSecondRoot.js +4 -4
- package/lib/exercises/math/functions/trinoms/roots/niceRootsFromDevForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/niceRootsFromDevForm.js +4 -2
- package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.js +4 -2
- package/lib/exercises/math/functions/trinoms/roots/rootsFromFactorizedForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/rootsFromFactorizedForm.js +4 -2
- package/lib/exercises/math/functions/trinoms/roots/rootsProduct.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/rootsProduct.js +4 -4
- package/lib/exercises/math/functions/trinoms/roots/rootsReading.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/rootsReading.js +4 -3
- package/lib/exercises/math/functions/trinoms/roots/rootsSum.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/rootsSum.js +4 -4
- package/lib/exercises/math/functions/trinoms/sign/trinomSignFromFacto.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/sign/trinomSignFromFacto.js +4 -0
- package/lib/exercises/math/functions/trinoms/sign/trinomSignFromRoots.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/sign/trinomSignFromRoots.js +4 -0
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaFromDevForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaFromDevForm.js +32 -11
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/canonicalFromDevForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/canonicalFromDevForm.js +24 -9
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumFromCanonicalForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumFromCanonicalForm.js +24 -9
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.d.ts +1 -0
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.js +29 -12
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromDevForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromDevForm.js +4 -0
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromRoots.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromRoots.js +4 -0
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitReading.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitReading.js +3 -0
- package/lib/exercises/math/functions/trinoms/trinomialMeanValue.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/trinomialMeanValue.js +33 -14
- package/lib/exercises/math/geometry/cartesian/cartesianFromTwoPoints.js +1 -1
- package/lib/exercises/math/geometry/euclidianConstructions/buildMediatriceWithCompass.d.ts +2 -0
- package/lib/exercises/math/geometry/euclidianConstructions/buildMediatriceWithCompass.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidianConstructions/buildMediatriceWithCompass.js +55 -27
- package/lib/exercises/math/geometry/euclidianConstructions/buildPointFromAxialSymetry.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidianConstructions/buildPointFromAxialSymetry.js +4 -0
- package/lib/exercises/math/geometry/euclidianConstructions/buildTriangleWithSizes.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidianConstructions/buildTriangleWithSizes.js +4 -0
- package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.js +6 -2
- package/lib/exercises/math/geometry/lines/isPointOnCartesianLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/isPointOnCartesianLine.js +7 -5
- package/lib/exercises/math/geometry/lines/isPointOnLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/isPointOnLine.js +4 -0
- package/lib/exercises/math/geometry/parametric/extractPointFromParametricLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/parametric/extractPointFromParametricLine.js +4 -0
- package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.js +4 -0
- package/lib/exercises/math/geometry/parametric/pointFromParametricLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/parametric/pointFromParametricLine.js +4 -0
- package/lib/exercises/math/geometry/perimeters/circleRadiusFromPerimeter.d.ts.map +1 -1
- package/lib/exercises/math/geometry/perimeters/circleRadiusFromPerimeter.js +4 -0
- package/lib/exercises/math/geometry/perimeters/rectangleSideFromPerimeter.d.ts.map +1 -1
- package/lib/exercises/math/geometry/perimeters/rectangleSideFromPerimeter.js +4 -0
- package/lib/exercises/math/geometry/perimeters/squareSideFromPerimeter.d.ts.map +1 -1
- package/lib/exercises/math/geometry/perimeters/squareSideFromPerimeter.js +4 -0
- package/lib/exercises/math/geometry/pythagore/isTriangleRight.d.ts.map +1 -1
- package/lib/exercises/math/geometry/pythagore/isTriangleRight.js +4 -0
- package/lib/exercises/math/geometry/quadrilaterals/parallelogramAngles.d.ts.map +1 -1
- package/lib/exercises/math/geometry/quadrilaterals/parallelogramAngles.js +4 -0
- package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.d.ts.map +1 -1
- package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.js +4 -0
- package/lib/exercises/math/geometry/shapes/basicShapesRecognition.d.ts.map +1 -1
- package/lib/exercises/math/geometry/shapes/basicShapesRecognition.js +42 -23
- package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts.map +1 -1
- package/lib/exercises/math/geometry/thales/thalesCalcul.js +8 -4
- package/lib/exercises/math/geometry/vectors/chasles.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/chasles.js +36 -12
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.js +4 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCoords.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCoords.js +4 -2
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCos.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCos.js +4 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaNorms.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaNorms.js +4 -0
- package/lib/exercises/pc/energy/calorificValue.d.ts.map +1 -1
- package/lib/exercises/pc/energy/calorificValue.js +58 -29
- package/lib/exercises/pc/energy/combustionTransferEnergy.d.ts.map +1 -1
- package/lib/exercises/pc/energy/combustionTransferEnergy.js +52 -29
- package/lib/exercises/pc/energy/combustionTransferEnergy2.d.ts.map +1 -1
- package/lib/exercises/pc/energy/combustionTransferEnergy2.js +96 -67
- package/lib/exercises/pc/energy/efficencyOfConverter.d.ts.map +1 -1
- package/lib/exercises/pc/energy/efficencyOfConverter.js +53 -40
- package/lib/exercises/pc/energy/efficiencyCalculation.d.ts.map +1 -1
- package/lib/exercises/pc/energy/efficiencyCalculation.js +66 -38
- package/lib/exercises/pc/energy/energyTransfer.d.ts +0 -2
- package/lib/exercises/pc/energy/energyTransfer.d.ts.map +1 -1
- package/lib/exercises/pc/energy/energyTransfer.js +27 -11
- package/lib/exercises/pc/energy/kineticEnergyOrMassOrSpeed.d.ts.map +1 -1
- package/lib/exercises/pc/energy/kineticEnergyOrMassOrSpeed.js +111 -64
- package/lib/exercises/pc/energy/thermalEnergyTransferCalculation.d.ts.map +1 -1
- package/lib/exercises/pc/energy/thermalEnergyTransferCalculation.js +86 -38
- package/lib/exercises/pc/fluids/mariotte.d.ts.map +1 -1
- package/lib/exercises/pc/fluids/mariotte.js +40 -23
- package/lib/exercises/pc/forces/calculateNormalOrFrictionForce.d.ts.map +1 -1
- package/lib/exercises/pc/forces/calculateNormalOrFrictionForce.js +81 -52
- package/lib/exercises/pc/forces/electroStaticForce.d.ts.map +1 -1
- package/lib/exercises/pc/forces/electroStaticForce.js +73 -58
- package/lib/exercises/pc/forces/forceWork.d.ts.map +1 -1
- package/lib/exercises/pc/forces/forceWork.js +22 -7
- package/lib/exercises/pc/math/proportionnalityCoeffFromLine.d.ts.map +1 -1
- package/lib/exercises/pc/math/proportionnalityCoeffFromLine.js +0 -2
- package/lib/index.d.ts +5 -4
- package/lib/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fractionToPercentToDecimal.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionToPercentToDecimal.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"fractionToPercentToDecimal.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionToPercentToDecimal.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAarC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAkLF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAa5D,CAAC"}
|
|
@@ -9,67 +9,86 @@ import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
|
|
|
9
9
|
import { PercentNode } from "../../../../tree/nodes/numbers/percentNode.js";
|
|
10
10
|
import { FractionNode } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
11
11
|
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const numerator = denominator !== 1 ? randint(1, denominator) : randint(1, 100);
|
|
12
|
+
const getInstruction = (identifiers) => {
|
|
13
|
+
const { rand, numerator, denominator } = identifiers;
|
|
15
14
|
const fraction = new FractionNode(new NumberNode(numerator), new NumberNode(denominator));
|
|
16
15
|
const decimal = numerator / denominator;
|
|
17
16
|
const percent = round((numerator / denominator) * 100, 2);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
switch (rand) {
|
|
18
|
+
case 1: {
|
|
19
|
+
return `Écrire le nombre $${decimal.frenchify()}$ sous forme de pourcentage.`;
|
|
20
|
+
}
|
|
21
|
+
case 2: {
|
|
22
|
+
return `Écrire le nombre $${decimal.frenchify()}$ sous forme de fraction irréductible.`;
|
|
23
|
+
}
|
|
24
|
+
case 3: {
|
|
25
|
+
return `Écrire le nombre $${percent.frenchify()}\\%$ sous forme décimale.`;
|
|
26
|
+
}
|
|
27
|
+
case 4: {
|
|
28
|
+
return `Écrire le nombre $${percent.frenchify()}\\%$ sous forme de fraction irréductible.`;
|
|
29
|
+
}
|
|
30
|
+
case 5: {
|
|
31
|
+
return `Écrire le nombre $${fraction.toTex()}$ sous forme décimale.`;
|
|
32
|
+
}
|
|
33
|
+
case 6:
|
|
34
|
+
default: {
|
|
35
|
+
return `Écrire le nombre $${fraction.toTex()}$ sous forme de pourcentage.`;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const getAnswer = (identifiers) => {
|
|
40
|
+
const { rand, numerator, denominator } = identifiers;
|
|
41
|
+
const decimal = numerator / denominator;
|
|
42
|
+
const percent = round((numerator / denominator) * 100, 2);
|
|
43
|
+
const percentTex = `${percent.frenchify()}\\%`;
|
|
22
44
|
const fracTex = new Rational(numerator, denominator)
|
|
23
45
|
.simplify()
|
|
24
46
|
.toTree()
|
|
25
47
|
.toTex();
|
|
26
|
-
const decimalTex = `${decimal}`;
|
|
48
|
+
const decimalTex = `${decimal.frenchify()}`;
|
|
27
49
|
switch (rand) {
|
|
28
50
|
case 1: {
|
|
29
|
-
|
|
30
|
-
answer = percentTex;
|
|
31
|
-
break;
|
|
51
|
+
return percentTex;
|
|
32
52
|
}
|
|
33
53
|
case 2: {
|
|
34
|
-
|
|
35
|
-
answer = fracTex;
|
|
36
|
-
break;
|
|
54
|
+
return fracTex;
|
|
37
55
|
}
|
|
38
56
|
case 3: {
|
|
39
|
-
|
|
40
|
-
answer = decimalTex;
|
|
41
|
-
break;
|
|
57
|
+
return decimalTex;
|
|
42
58
|
}
|
|
43
59
|
case 4: {
|
|
44
|
-
|
|
45
|
-
answer = fracTex;
|
|
46
|
-
break;
|
|
60
|
+
return fracTex;
|
|
47
61
|
}
|
|
48
62
|
case 5: {
|
|
49
|
-
|
|
50
|
-
answer = decimalTex;
|
|
51
|
-
break;
|
|
63
|
+
return decimalTex;
|
|
52
64
|
}
|
|
53
|
-
case 6:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
break;
|
|
65
|
+
case 6:
|
|
66
|
+
default: {
|
|
67
|
+
return percentTex;
|
|
57
68
|
}
|
|
58
69
|
}
|
|
59
|
-
|
|
70
|
+
};
|
|
71
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
60
72
|
const question = {
|
|
61
|
-
instruction,
|
|
62
|
-
answer,
|
|
73
|
+
instruction: getInstruction(identifiers),
|
|
74
|
+
answer: getAnswer(identifiers),
|
|
63
75
|
keys: ["percent"],
|
|
64
76
|
answerFormat: "tex",
|
|
65
|
-
identifiers
|
|
66
|
-
rand,
|
|
67
|
-
numerator,
|
|
68
|
-
denominator,
|
|
69
|
-
},
|
|
77
|
+
identifiers,
|
|
70
78
|
};
|
|
71
79
|
return question;
|
|
72
80
|
};
|
|
81
|
+
const getFractionToPercentToDecimal = () => {
|
|
82
|
+
const denominator = 2 ** randint(0, 5) * 5 ** randint(0, 5);
|
|
83
|
+
const numerator = denominator !== 1 ? randint(1, denominator) : randint(1, 100);
|
|
84
|
+
const rand = randint(1, 7);
|
|
85
|
+
const identifiers = {
|
|
86
|
+
rand,
|
|
87
|
+
numerator,
|
|
88
|
+
denominator,
|
|
89
|
+
};
|
|
90
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
91
|
+
};
|
|
73
92
|
const getPropositions = (n, { answer, rand, numerator, denominator }) => {
|
|
74
93
|
const propositions = [];
|
|
75
94
|
addValidProp(propositions, answer);
|
|
@@ -142,8 +161,6 @@ export const fractionToPercentToDecimal = {
|
|
|
142
161
|
id: "fractionToPercentToDecimal",
|
|
143
162
|
connector: "\\iff",
|
|
144
163
|
label: "Passer d'une écriture d'un nombre à une autre",
|
|
145
|
-
levels: ["3ème", "2nde", "1reESM", "CAP", "2ndPro", "1rePro"],
|
|
146
|
-
sections: ["Fractions"],
|
|
147
164
|
isSingleStep: false,
|
|
148
165
|
generator: (nb) => getDistinctQuestions(getFractionToPercentToDecimal, nb),
|
|
149
166
|
qcmTimer: 60,
|
|
@@ -151,4 +168,5 @@ export const fractionToPercentToDecimal = {
|
|
|
151
168
|
getPropositions,
|
|
152
169
|
isAnswerValid,
|
|
153
170
|
subject: "Mathématiques",
|
|
171
|
+
getQuestionFromIdentifiers,
|
|
154
172
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fractionsSumsMultiplesDenominators.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"fractionsSumsMultiplesDenominators.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAkKF,eAAO,MAAM,kCAAkC,EAAE,QAAQ,CACvD,WAAW,EACX,OAAO,CAmBR,CAAC"}
|
|
@@ -73,6 +73,9 @@ const getFractionsSumsMultiplesDenominatorsQuestion = (opts) => {
|
|
|
73
73
|
const num1 = randint(1, 10, [denom1]);
|
|
74
74
|
const num2 = randint(1, 10, [denom2]);
|
|
75
75
|
const identifiers = { num1, num2, denom1, denom2 };
|
|
76
|
+
return getQuestionFromIdentifiers(identifiers, opts);
|
|
77
|
+
};
|
|
78
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
76
79
|
const question = {
|
|
77
80
|
answer: getAnswer(identifiers, opts),
|
|
78
81
|
instruction: getInstruction(identifiers, opts),
|
|
@@ -134,9 +137,6 @@ export const fractionsSumsMultiplesDenominators = {
|
|
|
134
137
|
isAnswerValid,
|
|
135
138
|
subject: "Mathématiques",
|
|
136
139
|
options,
|
|
137
|
-
|
|
138
|
-
getAnswer,
|
|
139
|
-
getHint,
|
|
140
|
-
getCorrection,
|
|
140
|
+
getQuestionFromIdentifiers,
|
|
141
141
|
hasHintAndCorrection: true,
|
|
142
142
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fractionsSumsPrimeDenominators.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"fractionsSumsPrimeDenominators.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAkHF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,CAiBhE,CAAC"}
|
|
@@ -6,33 +6,47 @@ import { randint } from "../../../../math/utils/random/randint.js";
|
|
|
6
6
|
import { AddNode } from "../../../../tree/nodes/operators/addNode.js";
|
|
7
7
|
import { rationalParser } from "../../../../tree/parsers/rationalParser.js";
|
|
8
8
|
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
9
|
-
const
|
|
10
|
-
const denom1 =
|
|
11
|
-
let denom2 = 0;
|
|
12
|
-
do {
|
|
13
|
-
denom2 = randint(2, 13);
|
|
14
|
-
} while (gcd(denom1, denom2) !== 1);
|
|
15
|
-
const num1 = randint(1, 10, [denom1]);
|
|
16
|
-
const num2 = randint(1, 10, [denom2]);
|
|
9
|
+
const getInstruction = (identifiers, opts) => {
|
|
10
|
+
const { num1, num2, denom1, denom2 } = identifiers;
|
|
17
11
|
const ratio1 = new Rational(num1, denom1);
|
|
18
12
|
const ratio2 = new Rational(num2, denom2);
|
|
19
13
|
const statement = new AddNode(ratio1.toTree(), ratio2.toTree()).toTex();
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
instruction: `Calculer ${opts?.allowNonIrreductible
|
|
24
|
-
? ""
|
|
25
|
-
: "et donner le résultat sous la forme la plus simplifiée possible"} :
|
|
14
|
+
return `Calculer ${opts?.allowNonIrreductible
|
|
15
|
+
? ""
|
|
16
|
+
: "et donner le résultat sous la forme la plus simplifiée possible"} :
|
|
26
17
|
|
|
27
18
|
$$
|
|
28
19
|
${statement}
|
|
29
|
-
|
|
20
|
+
$$`;
|
|
21
|
+
};
|
|
22
|
+
const getAnswer = (identifiers) => {
|
|
23
|
+
const { num1, num2, denom1, denom2 } = identifiers;
|
|
24
|
+
const ratio1 = new Rational(num1, denom1);
|
|
25
|
+
const ratio2 = new Rational(num2, denom2);
|
|
26
|
+
const answer = ratio1.add(ratio2).toTree().toTex();
|
|
27
|
+
return answer;
|
|
28
|
+
};
|
|
29
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
30
|
+
const question = {
|
|
31
|
+
answer: getAnswer(identifiers),
|
|
32
|
+
instruction: getInstruction(identifiers),
|
|
30
33
|
keys: [],
|
|
31
34
|
answerFormat: "tex",
|
|
32
|
-
identifiers
|
|
35
|
+
identifiers,
|
|
33
36
|
};
|
|
34
37
|
return question;
|
|
35
38
|
};
|
|
39
|
+
const getFractionsSumsPrimeDenominatorsQuestion = (opts) => {
|
|
40
|
+
const denom1 = randint(2, 13);
|
|
41
|
+
let denom2 = 0;
|
|
42
|
+
do {
|
|
43
|
+
denom2 = randint(2, 13);
|
|
44
|
+
} while (gcd(denom1, denom2) !== 1);
|
|
45
|
+
const num1 = randint(1, 10, [denom1]);
|
|
46
|
+
const num2 = randint(1, 10, [denom2]);
|
|
47
|
+
const identifiers = { num1, num2, denom1, denom2 };
|
|
48
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
49
|
+
};
|
|
36
50
|
const getPropositions = (n, { answer, num1, denom1, denom2, num2 }) => {
|
|
37
51
|
const propositions = [];
|
|
38
52
|
addValidProp(propositions, answer);
|
|
@@ -75,9 +89,7 @@ export const fractionsSumsPrimeDenominators = {
|
|
|
75
89
|
id: "fractionsSumsPrimeDenominators",
|
|
76
90
|
connector: "=",
|
|
77
91
|
label: "Sommes de fractions (avec dénominateurs premiers entre eux)",
|
|
78
|
-
levels: [],
|
|
79
92
|
isSingleStep: true,
|
|
80
|
-
sections: [],
|
|
81
93
|
generator: (nb, opts) => getDistinctQuestions(() => getFractionsSumsPrimeDenominatorsQuestion(opts), nb),
|
|
82
94
|
qcmTimer: 60,
|
|
83
95
|
freeTimer: 60,
|
|
@@ -85,4 +97,5 @@ export const fractionsSumsPrimeDenominators = {
|
|
|
85
97
|
isAnswerValid,
|
|
86
98
|
subject: "Mathématiques",
|
|
87
99
|
options,
|
|
100
|
+
getQuestionFromIdentifiers,
|
|
88
101
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fractionsSumsSameDenominators.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsSumsSameDenominators.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"fractionsSumsSameDenominators.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsSumsSameDenominators.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAoKF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAkB/D,CAAC"}
|
|
@@ -10,55 +10,80 @@ import { rationalParser } from "../../../../tree/parsers/rationalParser.js";
|
|
|
10
10
|
import { operatorComposition } from "../../../../tree/utilities/operatorComposition.js";
|
|
11
11
|
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
12
12
|
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
13
|
-
const
|
|
14
|
-
const denom =
|
|
15
|
-
const num1 = randint(1, denom + 10);
|
|
16
|
-
const num2 = randint(1, denom + 10);
|
|
13
|
+
const getInstruction = (identifiers, opts) => {
|
|
14
|
+
const { denom, num1, num2 } = identifiers;
|
|
17
15
|
const ratio1 = new Rational(num1, denom).toTree();
|
|
18
16
|
const ratio2 = new Rational(num2, denom).toTree();
|
|
19
17
|
const statement = new AddNode(ratio1, ratio2).toTex();
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
answer,
|
|
24
|
-
instruction: `Calculer ${opts?.allowNonIrreductible
|
|
25
|
-
? ""
|
|
26
|
-
: "et donner le résultat sous la forme la plus simplifiée possible"} :
|
|
18
|
+
return `Calculer ${opts?.allowNonIrreductible
|
|
19
|
+
? ""
|
|
20
|
+
: "et donner le résultat sous la forme la plus simplifiée possible"} :
|
|
27
21
|
|
|
28
22
|
$$
|
|
29
23
|
${statement}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
$$`;
|
|
25
|
+
};
|
|
26
|
+
const getAnswer = (identifiers, opts) => {
|
|
27
|
+
const { denom, num1, num2 } = identifiers;
|
|
28
|
+
const answerRatio = new Rational(num1 + num2, denom);
|
|
29
|
+
const answer = answerRatio.simplify().toTree().toTex();
|
|
30
|
+
return answer;
|
|
31
|
+
};
|
|
32
|
+
const getHint = (identifiers, opts) => {
|
|
33
|
+
const { denom, num1, num2 } = identifiers;
|
|
34
|
+
return `Pour additionner deux fractions qui ont le même dénominateur, on peut additionner leurs numérateurs.`;
|
|
35
|
+
};
|
|
36
|
+
const getCorrection = (identifiers, opts) => {
|
|
37
|
+
const { denom, num1, num2 } = identifiers;
|
|
38
|
+
const ratio1 = new Rational(num1, denom).toTree();
|
|
39
|
+
const ratio2 = new Rational(num2, denom).toTree();
|
|
40
|
+
const statement = new AddNode(ratio1, ratio2).toTex();
|
|
41
|
+
const answerRatio = new Rational(num1 + num2, denom);
|
|
42
|
+
const answer = answerRatio.simplify().toTree().toTex();
|
|
43
|
+
return `Les deux fractions ont bien le même dénominateur, donc on additionne leurs numérateurs :
|
|
34
44
|
|
|
35
45
|
${alignTex([
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
46
|
+
[
|
|
47
|
+
statement,
|
|
48
|
+
"=",
|
|
49
|
+
new FractionNode(new AddNode(num1.toTree(), num2.toTree()), denom.toTree()).toTex(),
|
|
50
|
+
],
|
|
51
|
+
["", "=", answerRatio.toTree().toTex()],
|
|
52
|
+
])}
|
|
43
53
|
|
|
44
54
|
${answerRatio.isSimplified && answerRatio.denum !== 1
|
|
45
|
-
|
|
46
|
-
|
|
55
|
+
? "Cette fraction est bien simplifiée."
|
|
56
|
+
: `Puis on simplifie la fraction :
|
|
47
57
|
|
|
48
58
|
${alignTex([
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
59
|
+
[
|
|
60
|
+
answerRatio.toTree().toTex(),
|
|
61
|
+
"=",
|
|
62
|
+
new FractionNode(operatorComposition(MultiplyNode, primeFactors(num1 + num2).map((e) => e.toTree())), operatorComposition(MultiplyNode, primeFactors(denom).map((e) => e.toTree()))).toTex(),
|
|
63
|
+
],
|
|
64
|
+
["", "=", answer],
|
|
65
|
+
])}`}
|
|
66
|
+
`;
|
|
67
|
+
};
|
|
68
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
69
|
+
const question = {
|
|
70
|
+
answer: getAnswer(identifiers, opts),
|
|
71
|
+
instruction: getInstruction(identifiers, opts),
|
|
72
|
+
keys: [],
|
|
73
|
+
hint: getHint(identifiers, opts),
|
|
74
|
+
correction: getCorrection(identifiers, opts),
|
|
57
75
|
answerFormat: "tex",
|
|
58
|
-
identifiers
|
|
76
|
+
identifiers,
|
|
59
77
|
};
|
|
60
78
|
return question;
|
|
61
79
|
};
|
|
80
|
+
const getFractionsSumsSameDenominatorsQuestion = (opts) => {
|
|
81
|
+
const denom = randint(2, 15);
|
|
82
|
+
const num1 = randint(1, denom + 10);
|
|
83
|
+
const num2 = randint(1, denom + 10);
|
|
84
|
+
const identifiers = { denom, num1, num2 };
|
|
85
|
+
return getQuestionFromIdentifiers(identifiers, opts);
|
|
86
|
+
};
|
|
62
87
|
const getPropositions = (n, { answer, denom, num1, num2 }) => {
|
|
63
88
|
const propositions = [];
|
|
64
89
|
addValidProp(propositions, answer);
|
|
@@ -102,9 +127,7 @@ export const fractionsSumsSameDenominators = {
|
|
|
102
127
|
id: "fractionsSumsSameDenominators",
|
|
103
128
|
connector: "=",
|
|
104
129
|
label: "Sommes de fractions (avec même dénominateur)",
|
|
105
|
-
levels: [],
|
|
106
130
|
isSingleStep: true,
|
|
107
|
-
sections: [],
|
|
108
131
|
generator: (nb, opts) => getDistinctQuestions(() => getFractionsSumsSameDenominatorsQuestion(opts), nb),
|
|
109
132
|
qcmTimer: 60,
|
|
110
133
|
freeTimer: 60,
|
|
@@ -113,4 +136,5 @@ export const fractionsSumsSameDenominators = {
|
|
|
113
136
|
subject: "Mathématiques",
|
|
114
137
|
hasHintAndCorrection: true,
|
|
115
138
|
options,
|
|
139
|
+
getQuestionFromIdentifiers,
|
|
116
140
|
};
|
|
@@ -23,7 +23,7 @@ $$
|
|
|
23
23
|
*Donner le couple solution sous la forme $\\left(x;y\\right)$ : par exemple, si la solution est $x=2$ et $y=3$, alors on écrira $\\left(2;3\\right)$.*`;
|
|
24
24
|
};
|
|
25
25
|
const getHint = (identifiers) => {
|
|
26
|
-
return `
|
|
26
|
+
return `Utilise la méthode par substitution ou bien celle par combinaison :
|
|
27
27
|
|
|
28
28
|
- Si une des variables est facile à isoler dans une des équations, alors on utilise la méthode par substitution : on isole cette variable, puis on injecte le résultat obtenu dans l'autre équation.
|
|
29
29
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anagrams.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/combinatory/anagrams.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,
|
|
1
|
+
{"version":3,"file":"anagrams.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/combinatory/anagrams.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAsGrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAoEF,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAY1C,CAAC"}
|
|
@@ -97,8 +97,12 @@ const letters = [
|
|
|
97
97
|
"à",
|
|
98
98
|
"ç",
|
|
99
99
|
];
|
|
100
|
-
const
|
|
101
|
-
const word =
|
|
100
|
+
const getInstruction = (identifiers) => {
|
|
101
|
+
const { word } = identifiers;
|
|
102
|
+
return `Combien d'anagrammes mathématiques du mot ${word} sont possibles ?`;
|
|
103
|
+
};
|
|
104
|
+
const getAnswer = (identifiers) => {
|
|
105
|
+
const { word } = identifiers;
|
|
102
106
|
const repeats = [];
|
|
103
107
|
const wordLetters = word.split("");
|
|
104
108
|
letters.forEach((letter) => {
|
|
@@ -120,12 +124,20 @@ const getAnagramsQuestion = () => {
|
|
|
120
124
|
arrangements *= getFacto(nbOfRepeats);
|
|
121
125
|
});
|
|
122
126
|
const answer = facto / arrangements + "";
|
|
127
|
+
return answer;
|
|
128
|
+
};
|
|
129
|
+
const getAnagramsQuestion = () => {
|
|
130
|
+
const word = random(words);
|
|
131
|
+
const identifiers = { word };
|
|
132
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
133
|
+
};
|
|
134
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
123
135
|
const question = {
|
|
124
|
-
answer,
|
|
125
|
-
instruction:
|
|
136
|
+
answer: getAnswer(identifiers),
|
|
137
|
+
instruction: getInstruction(identifiers),
|
|
126
138
|
keys: [],
|
|
127
139
|
answerFormat: "tex",
|
|
128
|
-
identifiers
|
|
140
|
+
identifiers,
|
|
129
141
|
};
|
|
130
142
|
return question;
|
|
131
143
|
};
|
|
@@ -147,13 +159,12 @@ export const anagrams = {
|
|
|
147
159
|
id: "anagrams",
|
|
148
160
|
connector: "=",
|
|
149
161
|
label: "Compter le nombre d'anagrammes d'un mot",
|
|
150
|
-
levels: ["TermSpé"],
|
|
151
162
|
isSingleStep: true,
|
|
152
|
-
sections: ["Combinatoire et dénombrement"],
|
|
153
163
|
generator: (nb) => getDistinctQuestions(getAnagramsQuestion, nb),
|
|
154
164
|
qcmTimer: 60,
|
|
155
165
|
freeTimer: 60,
|
|
156
166
|
getPropositions,
|
|
157
167
|
isAnswerValid,
|
|
158
168
|
subject: "Mathématiques",
|
|
169
|
+
getQuestionFromIdentifiers,
|
|
159
170
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ballsCounting.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/combinatory/ballsCounting.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,
|
|
1
|
+
{"version":3,"file":"ballsCounting.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/combinatory/ballsCounting.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAIrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAwJF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAY/C,CAAC"}
|
|
@@ -58,8 +58,10 @@ const getInstruction = (identifiers) => {
|
|
|
58
58
|
instruction = `comportant exactement une boule verte`;
|
|
59
59
|
}
|
|
60
60
|
return `Une urne contient $${blacks}$ boules noires numérotées de $1$ à $${blacks}$, $${reds}$ boules rouges numérotées de $1$ à $${reds}$ et $${greens}$ boules vertes numérotées de $1$ à $${greens}$.
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
|
|
62
|
+
On tire successivement et sans remise $3$ boules dans l'urne.
|
|
63
|
+
|
|
64
|
+
Combien de tirages ${instruction} sont possibles ?`;
|
|
63
65
|
};
|
|
64
66
|
const getBallsCountingQuestion = () => {
|
|
65
67
|
const type = randint(0, 6);
|
|
@@ -67,6 +69,9 @@ const getBallsCountingQuestion = () => {
|
|
|
67
69
|
const greens = randint(2, 6);
|
|
68
70
|
const reds = randint(3, 6);
|
|
69
71
|
const identifiers = { type, reds, greens, blacks };
|
|
72
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
73
|
+
};
|
|
74
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
70
75
|
const question = {
|
|
71
76
|
answer: getAnswer(identifiers),
|
|
72
77
|
instruction: getInstruction(identifiers),
|
|
@@ -122,15 +127,12 @@ export const ballsCounting = {
|
|
|
122
127
|
id: "ballsCounting",
|
|
123
128
|
connector: "=",
|
|
124
129
|
label: "Dénombrement avec des boules",
|
|
125
|
-
levels: ["TermSpé"],
|
|
126
130
|
isSingleStep: true,
|
|
127
|
-
sections: ["Combinatoire et dénombrement"],
|
|
128
131
|
generator: (nb) => getDistinctQuestions(getBallsCountingQuestion, nb),
|
|
129
132
|
qcmTimer: 60,
|
|
130
133
|
freeTimer: 60,
|
|
131
134
|
getPropositions,
|
|
132
135
|
isAnswerValid,
|
|
133
136
|
subject: "Mathématiques",
|
|
134
|
-
|
|
135
|
-
getInstruction,
|
|
137
|
+
getQuestionFromIdentifiers,
|
|
136
138
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diceCounting.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/combinatory/diceCounting.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,
|
|
1
|
+
{"version":3,"file":"diceCounting.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/combinatory/diceCounting.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAKrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAyJF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAY9C,CAAC"}
|
|
@@ -1,64 +1,100 @@
|
|
|
1
1
|
import { shuffleProps, tryToAddWrongProp, addValidProp, } from "../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { randint } from "../../../math/utils/random/randint.js";
|
|
4
|
-
const
|
|
5
|
-
const type
|
|
4
|
+
const getInstruction = (identifiers) => {
|
|
5
|
+
const { type, face1, face2, face3 } = identifiers;
|
|
6
6
|
let instruction = "";
|
|
7
|
-
let answer = "";
|
|
8
|
-
let face1;
|
|
9
|
-
let face2;
|
|
10
|
-
let face3;
|
|
11
7
|
switch (type) {
|
|
12
8
|
case 0:
|
|
13
9
|
instruction = `avec exactement deux chiffres identiques`;
|
|
14
|
-
answer = 6 * 3 * 5 + "";
|
|
15
10
|
break;
|
|
16
11
|
case 1:
|
|
17
12
|
instruction = `avec trois chiffres identiques`;
|
|
18
|
-
answer = 6 + "";
|
|
19
13
|
break;
|
|
20
14
|
case 2:
|
|
21
|
-
face1 = randint(1, 7);
|
|
22
15
|
instruction = `avec exactement une fois la face $${face1}$`;
|
|
23
|
-
answer = 3 * 5 * 5 + "";
|
|
24
16
|
break;
|
|
25
17
|
case 3:
|
|
26
|
-
face1 = randint(1, 7);
|
|
27
18
|
instruction = `avec exactement deux fois la face $${face1}$`;
|
|
28
|
-
answer = 3 * 5 + "";
|
|
29
19
|
break;
|
|
30
20
|
case 4:
|
|
31
|
-
face1 = randint(1, 7);
|
|
32
|
-
face2 = randint(1, 7, [face1]);
|
|
33
|
-
face3 = randint(1, 7, [face1, face2]);
|
|
34
21
|
instruction = `avec exactement les faces $${face1}$, $${face2}$ et $${face3}$`;
|
|
35
|
-
answer = 6 + "";
|
|
36
22
|
break;
|
|
37
23
|
case 5:
|
|
38
|
-
face1 = randint(1, 7);
|
|
39
|
-
face2 = randint(1, 7, [face1]);
|
|
40
|
-
face3 = randint(1, 7, [face1, face2]);
|
|
41
24
|
instruction = `avec exactement une fois la face $${face1}$ et une fois la face $${face2}$`;
|
|
42
|
-
answer = 3 * 5 + "";
|
|
43
25
|
break;
|
|
44
26
|
case 6:
|
|
45
27
|
instruction = `dans lesquels toutes les faces sont différentes`;
|
|
46
|
-
answer = 6 * 5 * 4 + "";
|
|
47
28
|
break;
|
|
48
29
|
case 7:
|
|
30
|
+
default:
|
|
49
31
|
instruction = "";
|
|
50
|
-
answer = 6 * 6 * 6 + "";
|
|
51
32
|
break;
|
|
52
33
|
}
|
|
34
|
+
return `On tire $3$ fois consécutivement un dé à six faces numérotées de $1$ à $6$.
|
|
35
|
+
|
|
36
|
+
Combien de tirages ${instruction} sont possibles ?`;
|
|
37
|
+
};
|
|
38
|
+
const getAnswer = (identifiers) => {
|
|
39
|
+
const { type, face1, face2, face3 } = identifiers;
|
|
40
|
+
switch (type) {
|
|
41
|
+
case 0:
|
|
42
|
+
return 6 * 3 * 5 + "";
|
|
43
|
+
case 1:
|
|
44
|
+
return 6 + "";
|
|
45
|
+
case 2:
|
|
46
|
+
return 3 * 5 * 5 + "";
|
|
47
|
+
case 3:
|
|
48
|
+
return 3 * 5 + "";
|
|
49
|
+
case 4:
|
|
50
|
+
return 6 + "";
|
|
51
|
+
case 5:
|
|
52
|
+
return 3 * 5 + "";
|
|
53
|
+
case 6:
|
|
54
|
+
return 6 * 5 * 4 + "";
|
|
55
|
+
case 7:
|
|
56
|
+
default:
|
|
57
|
+
return 6 * 6 * 6 + "";
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
53
61
|
const question = {
|
|
54
|
-
answer:
|
|
55
|
-
instruction:
|
|
62
|
+
answer: getAnswer(identifiers),
|
|
63
|
+
instruction: getInstruction(identifiers),
|
|
56
64
|
keys: [],
|
|
57
65
|
answerFormat: "tex",
|
|
58
|
-
identifiers
|
|
66
|
+
identifiers,
|
|
59
67
|
};
|
|
60
68
|
return question;
|
|
61
69
|
};
|
|
70
|
+
const getDiceCountingQuestion = () => {
|
|
71
|
+
const type = randint(0, 8);
|
|
72
|
+
let face1;
|
|
73
|
+
let face2;
|
|
74
|
+
let face3;
|
|
75
|
+
switch (type) {
|
|
76
|
+
case 2:
|
|
77
|
+
face1 = randint(1, 7);
|
|
78
|
+
break;
|
|
79
|
+
case 3:
|
|
80
|
+
face1 = randint(1, 7);
|
|
81
|
+
break;
|
|
82
|
+
case 4:
|
|
83
|
+
face1 = randint(1, 7);
|
|
84
|
+
face2 = randint(1, 7, [face1]);
|
|
85
|
+
face3 = randint(1, 7, [face1, face2]);
|
|
86
|
+
break;
|
|
87
|
+
case 5:
|
|
88
|
+
face1 = randint(1, 7);
|
|
89
|
+
face2 = randint(1, 7, [face1]);
|
|
90
|
+
face3 = randint(1, 7, [face1, face2]);
|
|
91
|
+
break;
|
|
92
|
+
default:
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
const identifiers = { type, face1, face2, face3 };
|
|
96
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
97
|
+
};
|
|
62
98
|
const getPropositions = (n, { answer, type }) => {
|
|
63
99
|
const propositions = [];
|
|
64
100
|
addValidProp(propositions, answer);
|
|
@@ -110,13 +146,12 @@ export const diceCounting = {
|
|
|
110
146
|
id: "diceCounting",
|
|
111
147
|
connector: "=",
|
|
112
148
|
label: "Dénombrement avec des dés",
|
|
113
|
-
levels: ["TermSpé"],
|
|
114
149
|
isSingleStep: true,
|
|
115
|
-
sections: ["Combinatoire et dénombrement"],
|
|
116
150
|
generator: (nb) => getDistinctQuestions(getDiceCountingQuestion, nb),
|
|
117
151
|
qcmTimer: 60,
|
|
118
152
|
freeTimer: 60,
|
|
119
153
|
getPropositions,
|
|
120
154
|
isAnswerValid,
|
|
121
155
|
subject: "Mathématiques",
|
|
156
|
+
getQuestionFromIdentifiers,
|
|
122
157
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"absolueValueAffineEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/absolute/absolueValueAffineEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"absolueValueAffineEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/absolute/absolueValueAffineEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAGL,wBAAwB,EACzB,MAAM,yCAAyC,CAAC;AAOjD,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,wBAAwB,CAAC;IACtC,YAAY,EAAE,wBAAwB,CAAC;CACxC,CAAC;AA+KF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAkB5D,CAAC"}
|