math-exercises 2.2.4 → 2.2.6
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/exercise.d.ts +1 -1
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/math/calcul/digitDecimalRank.js +4 -4
- package/lib/exercises/math/calcul/digitDecimalRankNumber.d.ts +8 -0
- package/lib/exercises/math/calcul/digitDecimalRankNumber.d.ts.map +1 -0
- package/lib/exercises/math/calcul/digitDecimalRankNumber.js +60 -0
- package/lib/exercises/math/calcul/digitRank.js +4 -4
- package/lib/exercises/math/calcul/digitRankNumber.d.ts +8 -0
- package/lib/exercises/math/calcul/digitRankNumber.d.ts.map +1 -0
- package/lib/exercises/math/calcul/digitRankNumber.js +56 -0
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.js +34 -0
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerProduct.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerProduct.js +17 -0
- package/lib/exercises/math/calcul/fractions/fractionsDivision.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsDivision.js +23 -0
- package/lib/exercises/math/calcul/fractions/fractionsProduct.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsProduct.js +15 -0
- package/lib/exercises/math/calcul/index.d.ts +2 -0
- package/lib/exercises/math/calcul/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/index.js +2 -0
- package/lib/exercises/math/calcul/proportionality/scaleUsage.js +1 -1
- package/lib/exercises/math/calcul/rounding/rounding.d.ts.map +1 -1
- package/lib/exercises/math/calcul/rounding/rounding.js +18 -0
- package/lib/exercises/math/calculLitteral/distributivity/allIdentities.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/allIdentities.js +1 -0
- package/lib/exercises/math/calculLitteral/distributivity/canonicalFormDevelopment.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/canonicalFormDevelopment.js +1 -0
- package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivity.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivity.js +31 -1
- package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivityWithCoeff.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivityWithCoeff.js +11 -2
- package/lib/exercises/math/calculLitteral/distributivity/firstIdentity.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/firstIdentity.js +21 -2
- package/lib/exercises/math/calculLitteral/distributivity/secondIdentity.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/secondIdentity.js +23 -2
- package/lib/exercises/math/calculLitteral/distributivity/simpleDistributivity.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/simpleDistributivity.js +17 -2
- package/lib/exercises/math/calculLitteral/distributivity/thirdIdentity.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/thirdIdentity.js +21 -2
- package/lib/exercises/math/calculLitteral/equation/equationSimpleSquare.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationSimpleSquare.js +26 -1
- package/lib/exercises/math/calculLitteral/equation/equationType1Exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType1Exercise.js +18 -2
- package/lib/exercises/math/calculLitteral/equation/equationType2Exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType2Exercise.js +19 -2
- package/lib/exercises/math/calculLitteral/equation/equationType3Exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType3Exercise.js +15 -2
- package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.js +20 -5
- package/lib/exercises/math/calculLitteral/equation/firstDegreeEquation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/firstDegreeEquation.js +24 -1
- package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType1.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType1.js +20 -1
- package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType2.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType2.js +19 -3
- package/lib/exercises/math/calculLitteral/equation/fractionEquation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/fractionEquation.js +24 -8
- package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +21 -2
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.js +24 -4
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.js +25 -5
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq3.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq3.js +19 -0
- package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.js +1 -0
- package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalForm.d.ts +8 -0
- package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalForm.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalForm.js +77 -0
- package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalFormWithSqrt.d.ts +8 -0
- package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalFormWithSqrt.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalFormWithSqrt.js +80 -0
- package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +2 -0
- package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/index.js +2 -0
- package/lib/exercises/math/equaDiff/equaDiffGeneralForme.d.ts.map +1 -1
- package/lib/exercises/math/equaDiff/equaDiffGeneralForme.js +1 -0
- package/lib/exercises/math/functions/basics/inverseImageFunctionTable.d.ts +2 -0
- package/lib/exercises/math/functions/basics/inverseImageFunctionTable.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/inverseImageFunctionTable.js +46 -66
- package/lib/exercises/math/functions/logarithm/log10PowerSimplifying.d.ts.map +1 -1
- package/lib/exercises/math/functions/logarithm/log10PowerSimplifying.js +12 -2
- package/lib/exercises/math/functions/trinoms/index.d.ts +2 -0
- package/lib/exercises/math/functions/trinoms/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/index.js +2 -0
- package/lib/exercises/math/functions/trinoms/solveEquationByFactorisation.d.ts +5 -0
- package/lib/exercises/math/functions/trinoms/solveEquationByFactorisation.d.ts.map +1 -0
- package/lib/exercises/math/functions/trinoms/solveEquationByFactorisation.js +44 -0
- package/lib/exercises/math/functions/trinoms/solveSecondDegreeEquationByFactorisation.d.ts +9 -0
- package/lib/exercises/math/functions/trinoms/solveSecondDegreeEquationByFactorisation.d.ts.map +1 -0
- package/lib/exercises/math/functions/trinoms/solveSecondDegreeEquationByFactorisation.js +134 -0
- package/lib/exercises/math/functions/trinoms/solveSecondDegreeEquationFromCano.d.ts +7 -0
- package/lib/exercises/math/functions/trinoms/solveSecondDegreeEquationFromCano.d.ts.map +1 -0
- package/lib/exercises/math/functions/trinoms/solveSecondDegreeEquationFromCano.js +59 -0
- package/lib/exercises/math/geometry/vectors/scalarProductViaCoords.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProductViaCoords.js +1 -0
- package/lib/exercises/math/index.d.ts +1 -0
- package/lib/exercises/math/index.d.ts.map +1 -1
- package/lib/exercises/math/index.js +1 -0
- package/lib/exercises/math/percent/applyPercent.d.ts.map +1 -1
- package/lib/exercises/math/percent/applyPercent.js +20 -2
- package/lib/exercises/math/probaStat/probaFromTableNoContext.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaFromTableNoContext.js +5 -4
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindRandomTermFromTwoTerms.d.ts +11 -0
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindRandomTermFromTwoTerms.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindRandomTermFromTwoTerms.js +49 -0
- package/lib/exercises/math/sequences/arithmetic/index.d.ts +1 -0
- package/lib/exercises/math/sequences/arithmetic/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/index.js +1 -0
- package/lib/exercises/math/spaceGeometry/index.d.ts +2 -0
- package/lib/exercises/math/spaceGeometry/index.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/index.js +17 -0
- package/lib/exercises/math/spaceGeometry/vectors/index.d.ts +4 -0
- package/lib/exercises/math/spaceGeometry/vectors/index.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/vectors/index.js +19 -0
- package/lib/exercises/math/spaceGeometry/vectors/spaceVectorCoordinatesFromPoints.d.ts +5 -0
- package/lib/exercises/math/spaceGeometry/vectors/spaceVectorCoordinatesFromPoints.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/vectors/spaceVectorCoordinatesFromPoints.js +52 -0
- package/lib/exercises/math/spaceGeometry/vectors/spaceVectorLinearCombinationCoords.d.ts +5 -0
- package/lib/exercises/math/spaceGeometry/vectors/spaceVectorLinearCombinationCoords.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/vectors/spaceVectorLinearCombinationCoords.js +62 -0
- package/lib/exercises/math/spaceGeometry/vectors/spaceVectorNormCalculation.d.ts +9 -0
- package/lib/exercises/math/spaceGeometry/vectors/spaceVectorNormCalculation.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/vectors/spaceVectorNormCalculation.js +54 -0
- package/lib/exercises/math/squareRoots/squareRootIdentities.js +3 -3
- package/lib/exercises/math/suites/sequencePlot.d.ts.map +1 -1
- package/lib/exercises/math/suites/sequencePlot.js +1 -2
- package/lib/exercises/math/trigonometry/trigonometrySideCalcul.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/trigonometrySideCalcul.js +1 -0
- package/lib/exercises/pc/calibrationCurveOfSolution.d.ts.map +1 -1
- package/lib/exercises/pc/calibrationCurveOfSolution.js +1 -0
- package/lib/exercises/pc/chemicalElements/findAtomicStructureElement.d.ts.map +1 -1
- package/lib/exercises/pc/chemicalElements/findAtomicStructureElement.js +1 -0
- package/lib/exercises/pc/chemicalElements/massOrVolumeProportion.d.ts.map +1 -1
- package/lib/exercises/pc/chemicalElements/massOrVolumeProportion.js +1 -0
- package/lib/exercises/pc/chemicalReactions/calculateSynthesisEfficiency.d.ts.map +1 -1
- package/lib/exercises/pc/chemicalReactions/calculateSynthesisEfficiency.js +1 -0
- package/lib/exercises/pc/chemicalReactions/titrationEquivalenceRelation.d.ts.map +1 -1
- package/lib/exercises/pc/chemicalReactions/titrationEquivalenceRelation.js +1 -0
- package/lib/exercises/pc/dosage/beerLambertRandomValue.d.ts.map +1 -1
- package/lib/exercises/pc/dosage/beerLambertRandomValue.js +1 -0
- package/lib/exercises/pc/dosage/concentrationCalculation.d.ts.map +1 -1
- package/lib/exercises/pc/dosage/concentrationCalculation.js +1 -0
- package/lib/exercises/pc/dosage/concentrationFromMassCalculation.d.ts.map +1 -1
- package/lib/exercises/pc/dosage/concentrationFromMassCalculation.js +1 -0
- package/lib/exercises/pc/electricity/calculateIntensity.js +1 -1
- package/lib/exercises/pc/electricity/calculateVoltage.d.ts.map +1 -1
- package/lib/exercises/pc/electricity/calculateVoltage.js +1 -0
- package/lib/exercises/pc/electricity/electricPowerOrEnergyCalculation.d.ts.map +1 -1
- package/lib/exercises/pc/electricity/electricPowerOrEnergyCalculation.js +1 -0
- package/lib/exercises/pc/electricity/ohmLaw.d.ts.map +1 -1
- package/lib/exercises/pc/electricity/ohmLaw.js +1 -0
- package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.d.ts.map +1 -1
- package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.js +1 -0
- package/lib/exercises/pc/energy/calorificValue.d.ts.map +1 -1
- package/lib/exercises/pc/energy/calorificValue.js +1 -0
- package/lib/exercises/pc/energy/combustionTransferEnergy.d.ts.map +1 -1
- package/lib/exercises/pc/energy/combustionTransferEnergy.js +1 -0
- package/lib/exercises/pc/energy/combustionTransferEnergy2.d.ts.map +1 -1
- package/lib/exercises/pc/energy/combustionTransferEnergy2.js +1 -0
- package/lib/exercises/pc/energy/efficencyOfConverter.d.ts.map +1 -1
- package/lib/exercises/pc/energy/efficencyOfConverter.js +1 -0
- package/lib/exercises/pc/energy/efficiencyCalculation.d.ts.map +1 -1
- package/lib/exercises/pc/energy/efficiencyCalculation.js +1 -0
- package/lib/exercises/pc/energy/kineticEnergyOrMassOrSpeed.d.ts.map +1 -1
- package/lib/exercises/pc/energy/kineticEnergyOrMassOrSpeed.js +1 -0
- package/lib/exercises/pc/energy/thermalEnergyTransferCalculation.d.ts.map +1 -1
- package/lib/exercises/pc/energy/thermalEnergyTransferCalculation.js +1 -0
- package/lib/exercises/pc/forces/calculateNormalOrFrictionForce.d.ts.map +1 -1
- package/lib/exercises/pc/forces/calculateNormalOrFrictionForce.js +1 -0
- package/lib/exercises/pc/forces/electroStaticForce.d.ts.map +1 -1
- package/lib/exercises/pc/forces/electroStaticForce.js +1 -0
- package/lib/exercises/pc/forces/gravitationalAttractionObjectHeight.d.ts.map +1 -1
- package/lib/exercises/pc/forces/gravitationalAttractionObjectHeight.js +1 -0
- package/lib/exercises/pc/forces/gravitationalForcePlanets.d.ts.map +1 -1
- package/lib/exercises/pc/forces/gravitationalForcePlanets.js +1 -0
- package/lib/exercises/pc/forces/massWeight.d.ts.map +1 -1
- package/lib/exercises/pc/forces/massWeight.js +1 -0
- package/lib/exercises/pc/motion/averageSpeed.d.ts.map +1 -1
- package/lib/exercises/pc/motion/averageSpeed.js +1 -0
- package/lib/exercises/pc/motion/averageSpeedCalculation.d.ts.map +1 -1
- package/lib/exercises/pc/motion/averageSpeedCalculation.js +1 -0
- package/lib/exercises/pc/motion/motionReference.d.ts.map +1 -1
- package/lib/exercises/pc/motion/motionReference.js +1 -0
- package/lib/exercises/pc/pH.d.ts.map +1 -1
- package/lib/exercises/pc/pH.js +1 -0
- package/lib/exercises/pc/power/calculatePowerOfLight.d.ts.map +1 -1
- package/lib/exercises/pc/power/calculatePowerOfLight.js +1 -0
- package/lib/exercises/pc/spectral/spectralEnergy.d.ts.map +1 -1
- package/lib/exercises/pc/spectral/spectralEnergy.js +1 -0
- package/lib/exercises/pc/waves/lightDistanceConversion.d.ts.map +1 -1
- package/lib/exercises/pc/waves/lightDistanceConversion.js +1 -0
- package/lib/exercises/pc/waves/periodicWaveCelerity.d.ts.map +1 -1
- package/lib/exercises/pc/waves/periodicWaveCelerity.js +1 -0
- package/lib/exercises/pc/weight/calculateWeight.d.ts.map +1 -1
- package/lib/exercises/pc/weight/calculateWeight.js +1 -0
- package/lib/exercises/pc/weight/weightOnTheMoon.d.ts.map +1 -1
- package/lib/exercises/pc/weight/weightOnTheMoon.js +1 -0
- package/lib/index.d.ts +33 -64
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -0
- package/lib/math/geometry/spacePoint.d.ts +27 -0
- package/lib/math/geometry/spacePoint.d.ts.map +1 -0
- package/lib/math/geometry/spacePoint.js +80 -0
- package/lib/math/geometry/spaceVector.d.ts +28 -0
- package/lib/math/geometry/spaceVector.d.ts.map +1 -0
- package/lib/math/geometry/spaceVector.js +83 -0
- package/lib/math/numbers/decimals/decimal.d.ts +1 -0
- package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
- package/lib/math/numbers/decimals/decimal.js +8 -0
- package/lib/math/numbers/rationals/rational.d.ts +1 -0
- package/lib/math/numbers/rationals/rational.d.ts.map +1 -1
- package/lib/math/numbers/rationals/rational.js +4 -0
- package/lib/math/utils/random/randTupleInt.d.ts +1 -0
- package/lib/math/utils/random/randTupleInt.d.ts.map +1 -1
- package/lib/math/utils/random/randTupleInt.js +5 -1
- package/lib/playground.d.ts +2 -0
- package/lib/playground.d.ts.map +1 -0
- package/lib/playground.js +20 -0
- package/lib/server.d.ts +3 -0
- package/lib/server.d.ts.map +1 -1
- package/lib/server.js +7 -0
- package/lib/tree/nodes/equations/equationSolutionNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equationSolutionNode.js +8 -0
- package/lib/tree/nodes/node.d.ts +1 -0
- package/lib/tree/nodes/node.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +8 -2
- package/lib/tree/nodes/operators/powerNode.js +1 -1
- package/lib/utils/alignTex.d.ts +2 -0
- package/lib/utils/alignTex.d.ts.map +1 -0
- package/lib/utils/alignTex.js +18 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inverseImageFunctionTable.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/inverseImageFunctionTable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"inverseImageFunctionTable.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/inverseImageFunctionTable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,aAAa,EAAE,OAAO,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAgFF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAc3D,CAAC"}
|
|
@@ -3,91 +3,71 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.inverseImageFunctionTable = void 0;
|
|
4
4
|
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
-
const
|
|
6
|
+
const randTupleInt_1 = require("../../../../math/utils/random/randTupleInt");
|
|
7
7
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
8
|
+
const arrayHasSameElement_1 = require("../../../../utils/arrayHasSameElement");
|
|
8
9
|
const coinFlip_1 = require("../../../../utils/coinFlip");
|
|
9
10
|
const random_1 = require("../../../../utils/random");
|
|
10
11
|
const getInverseImageFunctionTableQuestion = () => {
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
const xValues = (0, randTupleInt_1.randTupleInt)(5, {
|
|
13
|
+
from: -10,
|
|
14
|
+
to: 10,
|
|
15
|
+
allDifferent: true,
|
|
16
|
+
}).sort((a, b) => a - b);
|
|
17
|
+
const yValues = (0, randTupleInt_1.randTupleInt)(5, { from: -10, to: 10 });
|
|
18
|
+
let indexAsked = (0, randint_1.randint)(0, 5);
|
|
19
|
+
const valueAsked = xValues[indexAsked];
|
|
20
|
+
//on force un meme nombre dans les deux lignes pour complexifier
|
|
21
|
+
if (!yValues.includes(valueAsked) || yValues[indexAsked] === valueAsked) {
|
|
22
|
+
yValues[(0, randint_1.randint)(0, 5, [indexAsked])] = valueAsked;
|
|
23
|
+
}
|
|
24
|
+
const isAskingImage = (0, coinFlip_1.coinFlip)();
|
|
25
|
+
const answer = (isAskingImage
|
|
26
|
+
? yValues[indexAsked]
|
|
27
|
+
: xValues
|
|
28
|
+
.filter((el, index) => yValues[index] === valueAsked)
|
|
29
|
+
.join("\\text{ et }")) + "";
|
|
30
|
+
const instruction = `Ci-dessous est donné le tableau de valeurs d'une fonction $f$. Déterminer ${isAskingImage ? `l'image de` : `le ou les antécédents de`} $${valueAsked}$ par $f$.
|
|
31
|
+
|
|
32
|
+
|$x$|${xValues.map((value) => `$${value}$`).join("|")}|
|
|
33
|
+
|-|-|-|-|-|-|
|
|
34
|
+
|$f(x)$|${yValues.map((value) => `$${value}$`).join("|")}|
|
|
35
|
+
`;
|
|
14
36
|
const question = {
|
|
15
|
-
answer
|
|
37
|
+
answer,
|
|
16
38
|
instruction,
|
|
17
|
-
keys: ["
|
|
39
|
+
keys: ["et"],
|
|
18
40
|
answerFormat: "tex",
|
|
19
41
|
style: { tableHasNoHeader: true },
|
|
20
42
|
identifiers: {
|
|
21
|
-
xValues
|
|
22
|
-
imageValues:
|
|
43
|
+
xValues,
|
|
44
|
+
imageValues: yValues,
|
|
45
|
+
isAskingImage,
|
|
46
|
+
value: valueAsked,
|
|
23
47
|
},
|
|
24
48
|
};
|
|
25
49
|
return question;
|
|
26
50
|
};
|
|
27
|
-
const getPropositions = (n, { answer, xValues, imageValues }) => {
|
|
51
|
+
const getPropositions = (n, { answer, xValues, imageValues, isAskingImage, value }) => {
|
|
28
52
|
const propositions = [];
|
|
29
53
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
30
|
-
|
|
54
|
+
if (isAskingImage) {
|
|
55
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, xValues[imageValues.indexOf(value)] + "");
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, imageValues[xValues.indexOf(value)] + "");
|
|
59
|
+
}
|
|
31
60
|
while (propositions.length < n) {
|
|
32
|
-
|
|
33
|
-
(0, exercise_1.tryToAddWrongProp)(propositions, randProp + "");
|
|
61
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, ((0, coinFlip_1.coinFlip)() ? (0, random_1.random)(xValues) : (0, random_1.random)(imageValues)) + "");
|
|
34
62
|
}
|
|
35
63
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
36
64
|
};
|
|
37
|
-
const isAnswerValid = (ans, { answer }) => {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
return {
|
|
44
|
-
xValues,
|
|
45
|
-
imageValues,
|
|
46
|
-
table: `
|
|
47
|
-
|$x$|${xValues
|
|
48
|
-
.map((value) => `$${value}$`)
|
|
49
|
-
.reduce((prev, curr) => prev + "|" + curr)}|
|
|
50
|
-
|-|-|-|-|-|-|
|
|
51
|
-
|$f(x)$|${imageValues
|
|
52
|
-
.map((value) => `$${value}$`)
|
|
53
|
-
.reduce((prev, curr) => prev + "|" + curr)}|
|
|
54
|
-
`,
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
const generateXValues = () => {
|
|
58
|
-
const xValues = [];
|
|
59
|
-
for (let i = 0; i < 5; i++) {
|
|
60
|
-
let value;
|
|
61
|
-
do {
|
|
62
|
-
value = (0, randint_1.randint)(-11, 11);
|
|
63
|
-
} while (xValues.includes(value));
|
|
64
|
-
xValues.push(value);
|
|
65
|
-
}
|
|
66
|
-
xValues.sort((a, b) => {
|
|
67
|
-
return a - b;
|
|
68
|
-
});
|
|
69
|
-
return xValues;
|
|
70
|
-
};
|
|
71
|
-
const generateExercise = () => {
|
|
72
|
-
const polynom = new polynomial_1.Polynomial([(0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-5, 6, [0])]);
|
|
73
|
-
const exoTable = generateTable(polynom);
|
|
74
|
-
const isAskingImage = (0, coinFlip_1.coinFlip)();
|
|
75
|
-
const questionValue = isAskingImage
|
|
76
|
-
? (0, random_1.random)(exoTable.xValues)
|
|
77
|
-
: (0, random_1.random)(exoTable.imageValues);
|
|
78
|
-
const answer = isAskingImage
|
|
79
|
-
? polynom.calculate(questionValue)
|
|
80
|
-
: exoTable.xValues.find((value, index) => exoTable.imageValues[index] === questionValue);
|
|
81
|
-
return { polynom, exoTable, isAskingImage, questionValue, answer };
|
|
82
|
-
};
|
|
83
|
-
const generatePropositions = (xValues, imageValues, answer) => {
|
|
84
|
-
const filteredXValues = xValues.filter((value) => value !== +answer);
|
|
85
|
-
const firstProp = (0, random_1.random)(filteredXValues);
|
|
86
|
-
const secondProp = (0, random_1.random)(filteredXValues
|
|
87
|
-
.concat(imageValues)
|
|
88
|
-
.filter((value) => ![firstProp, +answer].includes(value)));
|
|
89
|
-
const thirdProp = (0, random_1.random)(imageValues.filter((value) => value !== secondProp));
|
|
90
|
-
return [firstProp + "", secondProp + "", thirdProp + ""];
|
|
65
|
+
const isAnswerValid = (ans, { answer, xValues, imageValues, isAskingImage, value }) => {
|
|
66
|
+
const numbers = ans.split("\\text{ et }").map((el) => Number(el));
|
|
67
|
+
if (numbers.some((n) => isNaN(n)))
|
|
68
|
+
return false;
|
|
69
|
+
const answerNumbers = answer.split("\\text{ et }").map((el) => Number(el));
|
|
70
|
+
return ans === answer || (0, arrayHasSameElement_1.arrayHasSameElements)(numbers, answerNumbers);
|
|
91
71
|
};
|
|
92
72
|
exports.inverseImageFunctionTable = {
|
|
93
73
|
id: "inverseImageFunctionTable",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log10PowerSimplifying.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/log10PowerSimplifying.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"log10PowerSimplifying.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/log10PowerSimplifying.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAWlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAuDF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAgBvD,CAAC"}
|
|
@@ -7,6 +7,7 @@ const decimal_1 = require("../../../../math/numbers/decimals/decimal");
|
|
|
7
7
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
8
8
|
const log10Node_1 = require("../../../../tree/nodes/functions/log10Node");
|
|
9
9
|
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
10
|
+
const alignTex_1 = require("../../../../utils/alignTex");
|
|
10
11
|
const getLog10PowerSimplifyingQuestion = () => {
|
|
11
12
|
const tenthPower = (0, randint_1.randint)(-6, 8, [1]);
|
|
12
13
|
console.log("log10 power simp q");
|
|
@@ -38,8 +39,16 @@ const getHint = (nb) => {
|
|
|
38
39
|
};
|
|
39
40
|
const getCorrection = (tenthPower, nb) => {
|
|
40
41
|
const powerTen = new powerNode_1.PowerNode((10).toTree(), tenthPower.toTree());
|
|
41
|
-
return `
|
|
42
|
-
|
|
42
|
+
return `On exprime $${nb.toTex()}$ en puissance de $10$ :
|
|
43
|
+
${(0, alignTex_1.alignTex)(`${nb.toTex()} = ${powerTen.toTex()}`)}
|
|
44
|
+
On utilise la propriété $\\log(a^{b}) = b\\times \\log(a)$.
|
|
45
|
+
|
|
46
|
+
On a alors
|
|
47
|
+
${(0, alignTex_1.alignTex)([
|
|
48
|
+
[`\\log(${nb.toTex()})`, `= \\log(${powerTen.toTex()})`],
|
|
49
|
+
["", `= ${tenthPower}\\times \\log(10)`],
|
|
50
|
+
["", `= ${tenthPower}`],
|
|
51
|
+
])}
|
|
43
52
|
`;
|
|
44
53
|
};
|
|
45
54
|
const isAnswerValid = (ans, { answer, tenthPower }) => {
|
|
@@ -59,4 +68,5 @@ exports.log10PowerSimplifying = {
|
|
|
59
68
|
isAnswerValid,
|
|
60
69
|
maxAllowedQuestions: 10,
|
|
61
70
|
subject: "Mathématiques",
|
|
71
|
+
hasHintAndCorrection: true,
|
|
62
72
|
};
|
|
@@ -15,4 +15,6 @@ export * from "./summitReading";
|
|
|
15
15
|
export * from "./summitAbscissFromRoots";
|
|
16
16
|
export * from "./summitAbscissFromDevForm";
|
|
17
17
|
export * from "./trinomialMeanValue";
|
|
18
|
+
export * from "./solveSecondDegreeEquationByFactorisation";
|
|
19
|
+
export * from "./solveSecondDegreeEquationFromCano";
|
|
18
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC;AAC9B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC;AAC9B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC"}
|
|
@@ -31,3 +31,5 @@ __exportStar(require("./summitReading"), exports);
|
|
|
31
31
|
__exportStar(require("./summitAbscissFromRoots"), exports);
|
|
32
32
|
__exportStar(require("./summitAbscissFromDevForm"), exports);
|
|
33
33
|
__exportStar(require("./trinomialMeanValue"), exports);
|
|
34
|
+
__exportStar(require("./solveSecondDegreeEquationByFactorisation"), exports);
|
|
35
|
+
__exportStar(require("./solveSecondDegreeEquationFromCano"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solveEquationByFactorisation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/solveEquationByFactorisation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAGlC,KAAK,WAAW,GAAG,EAClB,CAAC;AA+BF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAc9D,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.solveEquationByFactorisation = void 0;
|
|
4
|
+
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const getSolveEquationByFactorisationQuestion = () => {
|
|
7
|
+
const question = {
|
|
8
|
+
answer,
|
|
9
|
+
instruction: ``,
|
|
10
|
+
keys: [],
|
|
11
|
+
answerFormat: 'tex',
|
|
12
|
+
identifiers: {}
|
|
13
|
+
};
|
|
14
|
+
return question;
|
|
15
|
+
};
|
|
16
|
+
const getPropositions = (n, { answer }) => {
|
|
17
|
+
const propositions = [];
|
|
18
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
19
|
+
while (propositions.length < n) {
|
|
20
|
+
throw Error("QCM not implemented");
|
|
21
|
+
}
|
|
22
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
23
|
+
};
|
|
24
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
25
|
+
throw Error("VEA not implemented");
|
|
26
|
+
};
|
|
27
|
+
const isGGBAnswerValid = (ans, { ggbAnswer }) => {
|
|
28
|
+
throw Error("GGBVea not implemented");
|
|
29
|
+
};
|
|
30
|
+
exports.solveEquationByFactorisation = {
|
|
31
|
+
id: 'solveEquationByFactorisation',
|
|
32
|
+
connector: "",
|
|
33
|
+
label: "",
|
|
34
|
+
levels: [],
|
|
35
|
+
isSingleStep: true,
|
|
36
|
+
sections: [],
|
|
37
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getSolveEquationByFactorisationQuestion, nb),
|
|
38
|
+
qcmTimer: 60,
|
|
39
|
+
freeTimer: 60,
|
|
40
|
+
getPropositions,
|
|
41
|
+
isAnswerValid,
|
|
42
|
+
isGGBAnswerValid,
|
|
43
|
+
subject: "Mathématiques"
|
|
44
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
a: number;
|
|
4
|
+
b: number;
|
|
5
|
+
type: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const solveSecondDegreeEquationByFactorisation: Exercise<Identifiers>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=solveSecondDegreeEquationByFactorisation.d.ts.map
|
package/lib/exercises/math/functions/trinoms/solveSecondDegreeEquationByFactorisation.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solveSecondDegreeEquationByFactorisation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/solveSecondDegreeEquationByFactorisation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAgBlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAgIF,eAAO,MAAM,wCAAwC,EAAE,QAAQ,CAAC,WAAW,CAiB1E,CAAC"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.solveSecondDegreeEquationByFactorisation = void 0;
|
|
4
|
+
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const equationKeys_1 = require("../../../../exercises/utils/keys/equationKeys");
|
|
7
|
+
const rational_1 = require("../../../../math/numbers/rationals/rational");
|
|
8
|
+
const trinom_1 = require("../../../../math/polynomials/trinom");
|
|
9
|
+
const randint_1 = require("../../../../math/utils/random/randint");
|
|
10
|
+
const equationSolutionNode_1 = require("../../../../tree/nodes/equations/equationSolutionNode");
|
|
11
|
+
const discreteSetNode_1 = require("../../../../tree/nodes/sets/discreteSetNode");
|
|
12
|
+
const coinFlip_1 = require("../../../../utils/coinFlip");
|
|
13
|
+
/**
|
|
14
|
+
* Equation donnée sous forme ax^2 + bx ou bien forme développée d'une identité remarquable
|
|
15
|
+
* type 1 ax^2 + bx
|
|
16
|
+
* type 2 (ax+b)^2
|
|
17
|
+
* type 3 (ax-b)^2
|
|
18
|
+
* type 4 (ax+b)(ax-b)
|
|
19
|
+
*/
|
|
20
|
+
const getSolveSecondDegreeEquationByFactorisationQuestion = () => {
|
|
21
|
+
const type = (0, randint_1.randint)(1, 4);
|
|
22
|
+
let statement = "";
|
|
23
|
+
let roots = [];
|
|
24
|
+
let answer = "";
|
|
25
|
+
let a;
|
|
26
|
+
let b;
|
|
27
|
+
switch (type) {
|
|
28
|
+
case 1:
|
|
29
|
+
{
|
|
30
|
+
//ax^2 + bx
|
|
31
|
+
const trinom = new trinom_1.Trinom((0, randint_1.randint)(-9, 10, [0]), (0, randint_1.randint)(-9, 10), 0);
|
|
32
|
+
a = trinom.a;
|
|
33
|
+
b = trinom.b;
|
|
34
|
+
statement = trinom.toTex();
|
|
35
|
+
roots = trinom.getRootsNode();
|
|
36
|
+
}
|
|
37
|
+
break;
|
|
38
|
+
case 2:
|
|
39
|
+
{
|
|
40
|
+
//(ax+b)^2
|
|
41
|
+
a = (0, randint_1.randint)(-9, 10, [0]);
|
|
42
|
+
b = (0, randint_1.randint)(1, 10);
|
|
43
|
+
statement = new trinom_1.Trinom(a ** 2, 2 * a * b, b ** 2).toTex();
|
|
44
|
+
roots = [new rational_1.Rational(-b, a).simplify().toTree()];
|
|
45
|
+
}
|
|
46
|
+
break;
|
|
47
|
+
case 3:
|
|
48
|
+
{
|
|
49
|
+
//(ax-b)^2
|
|
50
|
+
a = (0, randint_1.randint)(-9, 10, [0]);
|
|
51
|
+
b = (0, randint_1.randint)(-9, 0, [0]);
|
|
52
|
+
statement = new trinom_1.Trinom(a ** 2, -2 * a * b, b ** 2).toTex();
|
|
53
|
+
roots = [new rational_1.Rational(b, a).simplify().toTree()];
|
|
54
|
+
}
|
|
55
|
+
break;
|
|
56
|
+
case 4:
|
|
57
|
+
default:
|
|
58
|
+
{
|
|
59
|
+
//(ax+b)(ax-b)
|
|
60
|
+
a = (0, randint_1.randint)(-9, 10, [0]);
|
|
61
|
+
b = (0, randint_1.randint)(1, 10);
|
|
62
|
+
statement = new trinom_1.Trinom(a ** 2, 0, -(b ** 2)).toTex();
|
|
63
|
+
roots = [b, -b].sort((a, b) => a - b).map((x) => x.toTree());
|
|
64
|
+
}
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
const instruction = `Soit $f(x) = ${statement}$. Résoudre l'équation $f(x) = 0$.`;
|
|
68
|
+
answer = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode(roots)).toTex();
|
|
69
|
+
const question = {
|
|
70
|
+
answer,
|
|
71
|
+
instruction,
|
|
72
|
+
keys: [...equationKeys_1.equationKeys],
|
|
73
|
+
answerFormat: "tex",
|
|
74
|
+
identifiers: { a, b, type },
|
|
75
|
+
};
|
|
76
|
+
return question;
|
|
77
|
+
};
|
|
78
|
+
const getPropositions = (n, { answer }) => {
|
|
79
|
+
const propositions = [];
|
|
80
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
81
|
+
while (propositions.length < n) {
|
|
82
|
+
const firstRoot = (0, randint_1.randint)(-10, 10);
|
|
83
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode((0, coinFlip_1.coinFlip)()
|
|
84
|
+
? [firstRoot.toTree()]
|
|
85
|
+
: [firstRoot, (0, randint_1.randint)(-10, 10, [firstRoot])]
|
|
86
|
+
.sort((a, b) => a - b)
|
|
87
|
+
.map((x) => x.toTree()))).toTex());
|
|
88
|
+
}
|
|
89
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
90
|
+
};
|
|
91
|
+
const isAnswerValid = (ans, { answer, type, a, b }) => {
|
|
92
|
+
let roots = [];
|
|
93
|
+
switch (type) {
|
|
94
|
+
case 1:
|
|
95
|
+
{
|
|
96
|
+
const trinom = new trinom_1.Trinom(a, b, 0);
|
|
97
|
+
roots = trinom.getRootsNode();
|
|
98
|
+
}
|
|
99
|
+
break;
|
|
100
|
+
case 2:
|
|
101
|
+
{
|
|
102
|
+
roots = [new rational_1.Rational(-b, a).simplify().toTree()];
|
|
103
|
+
}
|
|
104
|
+
break;
|
|
105
|
+
case 3:
|
|
106
|
+
{
|
|
107
|
+
roots = [new rational_1.Rational(b, a).simplify().toTree()];
|
|
108
|
+
}
|
|
109
|
+
break;
|
|
110
|
+
case 4:
|
|
111
|
+
{
|
|
112
|
+
roots = [b, -b].sort((a, b) => a - b).map((x) => x.toTree());
|
|
113
|
+
}
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
const answerTree = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode(roots), {
|
|
117
|
+
opts: { allowFractionToDecimal: true, allowRawRightChildAsSolution: true },
|
|
118
|
+
});
|
|
119
|
+
return answerTree.toAllValidTexs().includes(ans);
|
|
120
|
+
};
|
|
121
|
+
exports.solveSecondDegreeEquationByFactorisation = {
|
|
122
|
+
id: "solveSecondDegreeEquationByFactorisation",
|
|
123
|
+
connector: "\\iff",
|
|
124
|
+
label: "Résoudre une équation du second degré par factorisation",
|
|
125
|
+
levels: [],
|
|
126
|
+
isSingleStep: true,
|
|
127
|
+
sections: [],
|
|
128
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getSolveSecondDegreeEquationByFactorisationQuestion, nb),
|
|
129
|
+
qcmTimer: 60,
|
|
130
|
+
freeTimer: 60,
|
|
131
|
+
getPropositions,
|
|
132
|
+
isAnswerValid,
|
|
133
|
+
subject: "Mathématiques",
|
|
134
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solveSecondDegreeEquationFromCano.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/solveSecondDegreeEquationFromCano.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAkDF,eAAO,MAAM,iCAAiC,EAAE,QAAQ,CAAC,WAAW,CAenE,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.solveSecondDegreeEquationFromCano = void 0;
|
|
4
|
+
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const equationKeys_1 = require("../../../../exercises/utils/keys/equationKeys");
|
|
7
|
+
const trinom_1 = require("../../../../math/polynomials/trinom");
|
|
8
|
+
const randint_1 = require("../../../../math/utils/random/randint");
|
|
9
|
+
const equationSolutionNode_1 = require("../../../../tree/nodes/equations/equationSolutionNode");
|
|
10
|
+
const discreteSetNode_1 = require("../../../../tree/nodes/sets/discreteSetNode");
|
|
11
|
+
const getSolveSecondDegreeEquationFromCanoQuestion = () => {
|
|
12
|
+
const trinom = trinom_1.TrinomConstructor.randomCanonical();
|
|
13
|
+
const statement = trinom.getCanonicalForm().toTex();
|
|
14
|
+
const roots = trinom.getRootsNode();
|
|
15
|
+
const answer = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode(roots)).toTex();
|
|
16
|
+
const question = {
|
|
17
|
+
answer,
|
|
18
|
+
instruction: `Soit $f(x) = ${statement}$. Résoudre l'équation $f(x) = 0$.`,
|
|
19
|
+
keys: [...equationKeys_1.equationKeys],
|
|
20
|
+
answerFormat: "tex",
|
|
21
|
+
identifiers: { coeffs: trinom.coefficients },
|
|
22
|
+
};
|
|
23
|
+
return question;
|
|
24
|
+
};
|
|
25
|
+
const getPropositions = (n, { answer }) => {
|
|
26
|
+
const propositions = [];
|
|
27
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
28
|
+
while (propositions.length < n) {
|
|
29
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode([(0, randint_1.randint)(-9, 0), (0, randint_1.randint)(1, 10)].map((e) => e.toTree()))).toTex());
|
|
30
|
+
}
|
|
31
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
32
|
+
};
|
|
33
|
+
const isAnswerValid = (ans, { answer, coeffs }) => {
|
|
34
|
+
const trinom = trinom_1.TrinomConstructor.fromCoeffs(coeffs);
|
|
35
|
+
const roots = trinom.getRootsNode();
|
|
36
|
+
const answerTree = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode(roots), {
|
|
37
|
+
opts: { allowFractionToDecimal: true, allowRawRightChildAsSolution: true },
|
|
38
|
+
});
|
|
39
|
+
const texs = answerTree.toAllValidTexs();
|
|
40
|
+
return texs.includes(ans);
|
|
41
|
+
};
|
|
42
|
+
const isGGBAnswerValid = (ans, { ggbAnswer }) => {
|
|
43
|
+
throw Error("GGBVea not implemented");
|
|
44
|
+
};
|
|
45
|
+
exports.solveSecondDegreeEquationFromCano = {
|
|
46
|
+
id: "solveSecondDegreeEquationFromCano",
|
|
47
|
+
connector: "\\iff",
|
|
48
|
+
label: "Résoudre une équation du type $a(x-b)^2 + c = 0$",
|
|
49
|
+
levels: [],
|
|
50
|
+
isSingleStep: true,
|
|
51
|
+
sections: [],
|
|
52
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getSolveSecondDegreeEquationFromCanoQuestion, nb),
|
|
53
|
+
qcmTimer: 60,
|
|
54
|
+
freeTimer: 60,
|
|
55
|
+
getPropositions,
|
|
56
|
+
isAnswerValid,
|
|
57
|
+
isGGBAnswerValid,
|
|
58
|
+
subject: "Mathématiques",
|
|
59
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scalarProductViaCoords.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/scalarProductViaCoords.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAgDF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"scalarProductViaCoords.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/scalarProductViaCoords.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAgDF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAexD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/math/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/math/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
|
|
@@ -31,6 +31,7 @@ __exportStar(require("./primitive"), exports);
|
|
|
31
31
|
__exportStar(require("./probaStat"), exports);
|
|
32
32
|
__exportStar(require("./sequences"), exports);
|
|
33
33
|
__exportStar(require("./sets"), exports);
|
|
34
|
+
__exportStar(require("./spaceGeometry"), exports);
|
|
34
35
|
__exportStar(require("./squareRoots"), exports);
|
|
35
36
|
__exportStar(require("./trigonometry"), exports);
|
|
36
37
|
__exportStar(require("./python"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applyPercent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/applyPercent.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAGxB,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;
|
|
1
|
+
{"version":3,"file":"applyPercent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/applyPercent.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAGxB,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AA6EF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAwB9C,CAAC"}
|
|
@@ -14,14 +14,17 @@ const getApplyPercentQuestion = () => {
|
|
|
14
14
|
let instruction = "";
|
|
15
15
|
let ans = "";
|
|
16
16
|
let ansNb = 0;
|
|
17
|
+
let cm = 0;
|
|
17
18
|
const isUp = (0, coinFlip_1.coinFlip)();
|
|
18
19
|
if (isUp) {
|
|
19
|
-
|
|
20
|
+
cm = 1 + randPercent / 100;
|
|
21
|
+
ansNb = (0, round_1.round)(randNbr * cm, 2);
|
|
20
22
|
ans = (ansNb + "").replace(".", ",");
|
|
21
23
|
instruction = `Appliquer une hausse de $${randPercent}\\%$ à $${randNbr}$.`;
|
|
22
24
|
}
|
|
23
25
|
else {
|
|
24
|
-
|
|
26
|
+
cm = 1 - randPercent / 100;
|
|
27
|
+
ansNb = (0, round_1.round)(randNbr * cm, 2);
|
|
25
28
|
ans = (ansNb + "").replace(".", ",");
|
|
26
29
|
instruction = `Appliquer une baisse de $${randPercent}\\%$ à $${randNbr}$.`;
|
|
27
30
|
}
|
|
@@ -31,6 +34,20 @@ const getApplyPercentQuestion = () => {
|
|
|
31
34
|
answer,
|
|
32
35
|
keys: ["percent"],
|
|
33
36
|
answerFormat: "tex",
|
|
37
|
+
hint: isUp
|
|
38
|
+
? `Augmenter un nombre de $x\\%$ revient à le multiplier par $1 + \\frac{x}{100}$.`
|
|
39
|
+
: `Baisser un nombre de $x\\%$ revient à le multiplier par $1 - \\frac{x}{100}$.`,
|
|
40
|
+
correction: isUp
|
|
41
|
+
? `Augmenter un nombre de $${randPercent}\\%$ revient à le multiplier par $1 + \\frac{${randPercent}}{100}$, c'est à dire par $${(0, round_1.round)(cm, 2).frenchify()}$.
|
|
42
|
+
|
|
43
|
+
On a donc $${randNbr}\\times ${(0, round_1.round)(cm, 2).frenchify()} = ${answer}$.
|
|
44
|
+
|
|
45
|
+
`
|
|
46
|
+
: `Baisser un nombre de $${randPercent}\\%$ revient à le multiplier par $1 - \\frac{${randPercent}}{100}$, c'est à dire par $${(0, round_1.round)(cm, 2).frenchify()}$.
|
|
47
|
+
|
|
48
|
+
On a donc $${randNbr}\\times ${(0, round_1.round)(cm, 2).frenchify()} = ${answer}$.
|
|
49
|
+
|
|
50
|
+
`,
|
|
34
51
|
identifiers: { isUp, randNbr, randPercent },
|
|
35
52
|
};
|
|
36
53
|
return question;
|
|
@@ -76,4 +93,5 @@ exports.applyPercent = {
|
|
|
76
93
|
getPropositions,
|
|
77
94
|
isAnswerValid,
|
|
78
95
|
subject: "Mathématiques",
|
|
96
|
+
hasHintAndCorrection: true,
|
|
79
97
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"probaFromTableNoContext.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/probaFromTableNoContext.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;
|
|
1
|
+
{"version":3,"file":"probaFromTableNoContext.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/probaFromTableNoContext.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAmHF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAezD,CAAC"}
|
|
@@ -62,10 +62,11 @@ const getProbaFromTableNoContextQuestion = () => {
|
|
|
62
62
|
answer,
|
|
63
63
|
instruction: `On considère deux événements $A$ et $B$. Le tableau suivant donne le nombre d'issues pour chacun des événements $A\\cap B$, $\\overline A\\cap B$, $A\\cap \\overline B$ et $\\overline A \\cap \\overline B$. Calculer la probabilité $${event}$.
|
|
64
64
|
|
|
65
|
-
| | $B$ | $\\overline{B}$|
|
|
66
|
-
|
|
67
|
-
|$A$|${aCapB}|${aCapBBarre}|
|
|
68
|
-
|$\\overline{A}$|${aBarreCapB}|${aBarreCapBBarre}|
|
|
65
|
+
| | $B$ | $\\overline{B}$| Total
|
|
66
|
+
|-|-|-|-|
|
|
67
|
+
|$A$|${aCapB}|${aCapBBarre}|${aTotal}|
|
|
68
|
+
|$\\overline{A}$|${aBarreCapB}|${aBarreCapBBarre}|${aBarreTotal}|
|
|
69
|
+
|Total|${bTotal}|${bBarreTotal}|${total}|
|
|
69
70
|
|
|
70
71
|
`,
|
|
71
72
|
keys: [],
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
rank1: number;
|
|
4
|
+
value1: number;
|
|
5
|
+
rank2: number;
|
|
6
|
+
value2: number;
|
|
7
|
+
rankAsked: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const arithmeticFindRandomTermFromTwoTerms: Exercise<Identifiers>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=arithmeticFindRandomTermFromTwoTerms.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arithmeticFindRandomTermFromTwoTerms.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticFindRandomTermFromTwoTerms.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAIlC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAqCF,eAAO,MAAM,oCAAoC,EAAE,QAAQ,CAAC,WAAW,CAetE,CAAC"}
|