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":"firstDegreeEquationIntType1.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/firstDegreeEquationIntType1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"firstDegreeEquationIntType1.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/firstDegreeEquationIntType1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAWlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAqFF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAc7D,CAAC"}
|
|
@@ -3,20 +3,38 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.firstDegreeEquationIntType1 = void 0;
|
|
4
4
|
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const affine_1 = require("../../../../math/polynomials/affine");
|
|
6
7
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
7
8
|
const equalNode_1 = require("../../../../tree/nodes/equations/equalNode");
|
|
9
|
+
const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
|
|
10
|
+
const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
|
|
8
11
|
const variableNode_1 = require("../../../../tree/nodes/variables/variableNode");
|
|
12
|
+
const alignTex_1 = require("../../../../utils/alignTex");
|
|
9
13
|
const getFirstDegreeEquationIntQuestion = () => {
|
|
10
14
|
const a = (0, randint_1.randint)(-15, 15, [0]);
|
|
11
15
|
const x = (0, randint_1.randint)(-15, 15, [0]);
|
|
12
16
|
const b = a * x;
|
|
13
17
|
const answer = new equalNode_1.EqualNode(new variableNode_1.VariableNode("x"), x.toTree()).toTex();
|
|
18
|
+
const aMonom = new affine_1.Affine(a, 0).toTree();
|
|
19
|
+
const statementTex = new equalNode_1.EqualNode(aMonom, new numberNode_1.NumberNode(b)).toTex();
|
|
14
20
|
const question = {
|
|
15
21
|
answer: answer,
|
|
16
|
-
instruction: `Résoudre l'équation suivante : $${
|
|
22
|
+
instruction: `Résoudre l'équation suivante : $${statementTex}$`,
|
|
17
23
|
keys: ["x", "equal"],
|
|
18
24
|
answerFormat: "tex",
|
|
19
25
|
identifiers: { a: a, x: x, b: b },
|
|
26
|
+
hint: `Il faut isoler $x$ à gauche. Pour cela, effectue l'opération des deux côtés de l'équation qui permet de supprimer la multiplication par $${a}$.`,
|
|
27
|
+
correction: `Pour isoler $x$ à gauche, on divise les deux côtés de l'équation par $${a}$:
|
|
28
|
+
|
|
29
|
+
${(0, alignTex_1.alignTex)([
|
|
30
|
+
[
|
|
31
|
+
`${statementTex}`,
|
|
32
|
+
"\\iff",
|
|
33
|
+
new equalNode_1.EqualNode(new fractionNode_1.FractionNode(aMonom, new numberNode_1.NumberNode(a)), new fractionNode_1.FractionNode(b.toTree(), new numberNode_1.NumberNode(a))).toTex(),
|
|
34
|
+
],
|
|
35
|
+
["", "\\iff", answer],
|
|
36
|
+
])}
|
|
37
|
+
`,
|
|
20
38
|
};
|
|
21
39
|
return question;
|
|
22
40
|
};
|
|
@@ -62,4 +80,5 @@ exports.firstDegreeEquationIntType1 = {
|
|
|
62
80
|
getPropositions,
|
|
63
81
|
isAnswerValid,
|
|
64
82
|
subject: "Mathématiques",
|
|
83
|
+
hasHintAndCorrection: true,
|
|
65
84
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firstDegreeEquationIntType2.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/firstDegreeEquationIntType2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"firstDegreeEquationIntType2.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/firstDegreeEquationIntType2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA8FF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAc7D,CAAC"}
|
|
@@ -9,19 +9,34 @@ const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
|
9
9
|
const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
|
|
10
10
|
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
11
11
|
const variableNode_1 = require("../../../../tree/nodes/variables/variableNode");
|
|
12
|
+
const alignTex_1 = require("../../../../utils/alignTex");
|
|
12
13
|
const getFirstDegreeEquationIntQuestion = () => {
|
|
13
|
-
const a = (0, randint_1.randint)(-15, 15, [0]);
|
|
14
|
+
const a = (0, randint_1.randint)(-15, 15, [0, 1]);
|
|
14
15
|
const x = (0, randint_1.randint)(-15, 15, [0]);
|
|
15
|
-
const c = (0, randint_1.randint)(-15, 15, [0]);
|
|
16
|
+
const c = (0, randint_1.randint)(-15, 15, [0, a * x]);
|
|
16
17
|
const b = c - a * x;
|
|
17
18
|
const answer = new equalNode_1.EqualNode(new variableNode_1.VariableNode("x"), x.toTree()).toTex();
|
|
18
19
|
const equation = new equalNode_1.EqualNode(new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(a.toTree(), new variableNode_1.VariableNode("x")), b.toTree()).simplify({ forbidFactorize: true }), c.toTree());
|
|
20
|
+
const statementTex = equation.toTex();
|
|
19
21
|
const question = {
|
|
20
22
|
answer: answer,
|
|
21
|
-
instruction: `Résoudre l'équation suivante : $${
|
|
23
|
+
instruction: `Résoudre l'équation suivante : $${statementTex}$`,
|
|
22
24
|
keys: ["x", "equal"],
|
|
23
25
|
answerFormat: "tex",
|
|
24
26
|
identifiers: { a: a, x: x, c: c, b: b },
|
|
27
|
+
hint: "Isolez le terme $x$ dans la partie gauche de l'équation.",
|
|
28
|
+
correction: `Commencer par soustraire $${b}$ des deux côtés de l'équation pour
|
|
29
|
+
l'éliminer du côté gauche. Ensuite, diviser les deux côtés de l'équation par
|
|
30
|
+
$${a}$ pour isoler $x$, ce qui donne :
|
|
31
|
+
|
|
32
|
+
${(0, alignTex_1.alignTex)([
|
|
33
|
+
[
|
|
34
|
+
statementTex,
|
|
35
|
+
"\\iff",
|
|
36
|
+
new equalNode_1.EqualNode(new multiplyNode_1.MultiplyNode(a.toTree(), new variableNode_1.VariableNode("x")), (c - b).toTree()).toTex(),
|
|
37
|
+
],
|
|
38
|
+
["", "\\iff", answer],
|
|
39
|
+
])}`,
|
|
25
40
|
};
|
|
26
41
|
return question;
|
|
27
42
|
};
|
|
@@ -69,4 +84,5 @@ exports.firstDegreeEquationIntType2 = {
|
|
|
69
84
|
getPropositions,
|
|
70
85
|
isAnswerValid,
|
|
71
86
|
subject: "Mathématiques",
|
|
87
|
+
hasHintAndCorrection: true,
|
|
72
88
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fractionEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/fractionEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"fractionEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/fractionEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAgBlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA+FF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAclD,CAAC"}
|
|
@@ -6,8 +6,11 @@ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQ
|
|
|
6
6
|
const rational_1 = require("../../../../math/numbers/rationals/rational");
|
|
7
7
|
const polynomial_1 = require("../../../../math/polynomials/polynomial");
|
|
8
8
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
9
|
+
const equalNode_1 = require("../../../../tree/nodes/equations/equalNode");
|
|
9
10
|
const equationSolutionNode_1 = require("../../../../tree/nodes/equations/equationSolutionNode");
|
|
11
|
+
const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
|
|
10
12
|
const discreteSetNode_1 = require("../../../../tree/nodes/sets/discreteSetNode");
|
|
13
|
+
const alignTex_1 = require("../../../../utils/alignTex");
|
|
11
14
|
const shuffle_1 = require("../../../../utils/shuffle");
|
|
12
15
|
const getFractionEquation = () => {
|
|
13
16
|
// (ax + b)/(cx + d) = 0
|
|
@@ -17,15 +20,14 @@ const getFractionEquation = () => {
|
|
|
17
20
|
const d = (0, randint_1.randint)(-9, 10, [0]);
|
|
18
21
|
const polynome1 = new polynomial_1.Polynomial([b, a]);
|
|
19
22
|
const polynome2 = new polynomial_1.Polynomial([d, c]);
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
.toTex()}\\right\\}`;
|
|
23
|
+
const root1 = new rational_1.Rational(-b, a).simplify().toTree().toTex();
|
|
24
|
+
const root2 = new rational_1.Rational(-d, c).simplify().toTree().toTex();
|
|
25
|
+
const hasSolution = -d / c !== -b / a;
|
|
26
|
+
const answer = -d / c === -b / a ? `S=\\varnothing` : `S=\\left\\{${root1}\\right\\}`;
|
|
27
|
+
const statement = new equalNode_1.EqualNode(new fractionNode_1.FractionNode(polynome1.toTree(), polynome2.toTree()), (0).toTree()).toTex();
|
|
26
28
|
const question = {
|
|
27
|
-
instruction: `Résoudre :
|
|
28
|
-
startStatement:
|
|
29
|
+
instruction: `Résoudre : $${statement}$`,
|
|
30
|
+
startStatement: statement,
|
|
29
31
|
answer,
|
|
30
32
|
keys: [
|
|
31
33
|
"x",
|
|
@@ -39,6 +41,19 @@ const getFractionEquation = () => {
|
|
|
39
41
|
],
|
|
40
42
|
answerFormat: "tex",
|
|
41
43
|
identifiers: { a, b, c, d },
|
|
44
|
+
hint: `Un quotient est nul si est seulement si le numérateur est nul et le dénominateur est non nul. Il faut donc déterminer la valeur de $x$ qui rend le numérateur nul, sans rendre le dénominateur nul.`,
|
|
45
|
+
correction: `Un quotient est nul si est seulement si le numérateur est nul et le dénominateur est non nul. Ainsi :
|
|
46
|
+
|
|
47
|
+
${(0, alignTex_1.alignTex)([
|
|
48
|
+
["", statement],
|
|
49
|
+
["\\iff", `${polynome1.toTex()}=0 \\text{ et } ${polynome2.toTex()}\\neq 0`],
|
|
50
|
+
["\\iff", `x=${root1} \\text{ et } x\\neq ${root2}`],
|
|
51
|
+
])}
|
|
52
|
+
|
|
53
|
+
${!hasSolution
|
|
54
|
+
? `Il n'y a donc pas de solution pour cette équation. Ainsi, $${answer}$.`
|
|
55
|
+
: `Il y a donc bien une solution pour cette équation : $${answer}$.`}
|
|
56
|
+
`,
|
|
42
57
|
};
|
|
43
58
|
return question;
|
|
44
59
|
};
|
|
@@ -80,4 +95,5 @@ exports.fractionEquation = {
|
|
|
80
95
|
getPropositions,
|
|
81
96
|
isAnswerValid,
|
|
82
97
|
subject: "Mathématiques",
|
|
98
|
+
hasHintAndCorrection: true,
|
|
83
99
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiplicationEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/multiplicationEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"multiplicationEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/multiplicationEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAalC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA0FF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAexD,CAAC"}
|
|
@@ -7,7 +7,9 @@ const rational_1 = require("../../../../math/numbers/rationals/rational");
|
|
|
7
7
|
const polynomial_1 = require("../../../../math/polynomials/polynomial");
|
|
8
8
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
9
9
|
const equationSolutionNode_1 = require("../../../../tree/nodes/equations/equationSolutionNode");
|
|
10
|
+
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
10
11
|
const discreteSetNode_1 = require("../../../../tree/nodes/sets/discreteSetNode");
|
|
12
|
+
const alignTex_1 = require("../../../../utils/alignTex");
|
|
11
13
|
const shuffle_1 = require("../../../../utils/shuffle");
|
|
12
14
|
const getMultiplicationEquation = () => {
|
|
13
15
|
// (ax + b)(cx + d) = 0
|
|
@@ -24,13 +26,29 @@ const getMultiplicationEquation = () => {
|
|
|
24
26
|
const sol2 = new rational_1.Rational(-d, c).simplify().toTree();
|
|
25
27
|
const sortedSols = -b / a < -d / c ? [sol1, sol2] : [sol2, sol1];
|
|
26
28
|
const answer = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode(sortedSols)).toTex();
|
|
29
|
+
const statementTex = new multiplyNode_1.MultiplyNode(polynome1.toTree(), polynome2.toTree()).toTex();
|
|
27
30
|
const question = {
|
|
28
|
-
instruction: `Résoudre :
|
|
29
|
-
startStatement:
|
|
31
|
+
instruction: `Résoudre : $${statementTex} = 0$`,
|
|
32
|
+
startStatement: `${statementTex} = 0`,
|
|
30
33
|
answer,
|
|
31
34
|
keys: ["x", "S", "equal", "lbrace", "rbrace", "semicolon", "ou"],
|
|
32
35
|
answerFormat: "tex",
|
|
33
36
|
identifiers: { a, b, c, d },
|
|
37
|
+
hint: "Un produit est nul si et seulement si un des deux facteurs est nul. Donc, il faut trouver les valeurs de $x$ qui rendent un des deux facteurs nuls.",
|
|
38
|
+
correction: `Un produit est nul si et seulement si un des deux facteurs est nul. On résout donc deux équations :
|
|
39
|
+
|
|
40
|
+
${(0, alignTex_1.alignTex)([
|
|
41
|
+
["", `${statementTex} = 0`],
|
|
42
|
+
[
|
|
43
|
+
"\\iff",
|
|
44
|
+
`${polynome1.toTree().toTex()} = 0 \\text{ ou } ${polynome2
|
|
45
|
+
.toTree()
|
|
46
|
+
.toTex()} = 0`,
|
|
47
|
+
],
|
|
48
|
+
["\\iff", `x=${sol1.toTex()} \\text{ ou } x=${sol2.toTex()}`],
|
|
49
|
+
])}
|
|
50
|
+
|
|
51
|
+
Ainsi, $${answer}$`,
|
|
34
52
|
};
|
|
35
53
|
return question;
|
|
36
54
|
};
|
|
@@ -76,4 +94,5 @@ exports.multiplicationEquation = {
|
|
|
76
94
|
getPropositions,
|
|
77
95
|
isAnswerValid,
|
|
78
96
|
subject: "Mathématiques",
|
|
97
|
+
hasHintAndCorrection: true,
|
|
79
98
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factoIdRmq1.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoIdRmq1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"factoIdRmq1.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoIdRmq1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAclC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA8EF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAc7C,CAAC"}
|
|
@@ -6,22 +6,41 @@ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQ
|
|
|
6
6
|
const affine_1 = require("../../../../math/polynomials/affine");
|
|
7
7
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
8
8
|
const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
|
|
9
|
+
const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
10
|
+
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
9
11
|
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
12
|
+
const alignTex_1 = require("../../../../utils/alignTex");
|
|
10
13
|
const shuffle_1 = require("../../../../utils/shuffle");
|
|
11
14
|
const getFactoType1Question = () => {
|
|
12
|
-
const affine = affine_1.AffineConstructor.random(
|
|
13
|
-
|
|
15
|
+
const affine = affine_1.AffineConstructor.random({ min: 1, max: 10 }, {
|
|
16
|
+
min: 1,
|
|
17
|
+
max: 10,
|
|
14
18
|
});
|
|
15
19
|
const statementTree = affine.multiply(affine).toTree();
|
|
20
|
+
const aMonom = new affine_1.Affine(affine.a, 0).toTree();
|
|
16
21
|
const answerTree = new powerNode_1.PowerNode(affine.toTree(), new numberNode_1.NumberNode(2));
|
|
17
22
|
const answer = answerTree.toTex();
|
|
23
|
+
const statementTex = statementTree.toTex();
|
|
18
24
|
const question = {
|
|
19
|
-
instruction: `Factoriser : $${
|
|
20
|
-
startStatement:
|
|
25
|
+
instruction: `Factoriser : $${statementTex}$`,
|
|
26
|
+
startStatement: statementTex,
|
|
21
27
|
answer,
|
|
22
28
|
keys: ["x"],
|
|
23
29
|
answerFormat: "tex",
|
|
24
30
|
identifiers: { a: affine.a, b: affine.b },
|
|
31
|
+
hint: `Essaie de réécrire cette expression sous la forme $a^2 + 2ab+b^2$`,
|
|
32
|
+
correction: `
|
|
33
|
+
On utilise l'identité remarquable $ a^2 + 2ab+b^2 = (a+b)^2$ en prenant $a=${aMonom.toTex()}$ et $b=${affine.b}$ :
|
|
34
|
+
|
|
35
|
+
${(0, alignTex_1.alignTex)([
|
|
36
|
+
[
|
|
37
|
+
statementTex,
|
|
38
|
+
"=",
|
|
39
|
+
new addNode_1.AddNode(new addNode_1.AddNode(new powerNode_1.SquareNode(aMonom), new multiplyNode_1.MultiplyNode((2).toTree(), new multiplyNode_1.MultiplyNode(aMonom, affine.b.toTree()))), new powerNode_1.SquareNode(affine.b.toTree())).toTex(),
|
|
40
|
+
],
|
|
41
|
+
["", "=", answer],
|
|
42
|
+
])}
|
|
43
|
+
`,
|
|
25
44
|
};
|
|
26
45
|
return question;
|
|
27
46
|
};
|
|
@@ -54,4 +73,5 @@ exports.factoIdRmq1 = {
|
|
|
54
73
|
getPropositions,
|
|
55
74
|
isAnswerValid,
|
|
56
75
|
subject: "Mathématiques",
|
|
76
|
+
hasHintAndCorrection: true,
|
|
57
77
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factoIdRmq2.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoIdRmq2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"factoIdRmq2.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoIdRmq2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAelC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA+EF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAc7C,CAAC"}
|
|
@@ -6,23 +6,42 @@ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQ
|
|
|
6
6
|
const affine_1 = require("../../../../math/polynomials/affine");
|
|
7
7
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
8
8
|
const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
|
|
9
|
+
const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
10
|
+
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
9
11
|
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
12
|
+
const substractNode_1 = require("../../../../tree/nodes/operators/substractNode");
|
|
13
|
+
const alignTex_1 = require("../../../../utils/alignTex");
|
|
10
14
|
const shuffle_1 = require("../../../../utils/shuffle");
|
|
11
15
|
const getFactoType1Question = () => {
|
|
12
16
|
const affine = affine_1.AffineConstructor.random({
|
|
13
|
-
min:
|
|
14
|
-
max:
|
|
15
|
-
}, { min: -
|
|
17
|
+
min: 1,
|
|
18
|
+
max: 10,
|
|
19
|
+
}, { min: -9, max: 0 });
|
|
16
20
|
const statementTree = affine.multiply(affine).toTree();
|
|
21
|
+
const statementTex = statementTree.toTex();
|
|
17
22
|
const answerTree = new powerNode_1.PowerNode(affine.toTree(), new numberNode_1.NumberNode(2));
|
|
18
23
|
const answer = answerTree.toTex();
|
|
24
|
+
const aMonom = new affine_1.Affine(affine.a, 0).toTree();
|
|
19
25
|
const question = {
|
|
20
|
-
instruction: `Factoriser : $${
|
|
21
|
-
startStatement:
|
|
26
|
+
instruction: `Factoriser : $${statementTex}$`,
|
|
27
|
+
startStatement: statementTex,
|
|
22
28
|
answer,
|
|
23
29
|
keys: ["x"],
|
|
24
30
|
answerFormat: "tex",
|
|
25
31
|
identifiers: { a: affine.a, b: affine.b },
|
|
32
|
+
hint: `Essaie de réécrire cette expression sous la forme $a^2 - 2ab+b^2$`,
|
|
33
|
+
correction: `
|
|
34
|
+
On utilise l'identité remarquable $ a^2 - 2ab+b^2 = (a-b)^2$ en prenant $a=${aMonom.toTex()}$ et $b=${-affine.b}$ :
|
|
35
|
+
|
|
36
|
+
${(0, alignTex_1.alignTex)([
|
|
37
|
+
[
|
|
38
|
+
statementTex,
|
|
39
|
+
"=",
|
|
40
|
+
new addNode_1.AddNode(new substractNode_1.SubstractNode(new powerNode_1.SquareNode(aMonom), new multiplyNode_1.MultiplyNode((2).toTree(), new multiplyNode_1.MultiplyNode(aMonom, (-affine.b).toTree()))), new powerNode_1.SquareNode((-affine.b).toTree())).toTex(),
|
|
41
|
+
],
|
|
42
|
+
["", "=", answer],
|
|
43
|
+
])}
|
|
44
|
+
`,
|
|
26
45
|
};
|
|
27
46
|
return question;
|
|
28
47
|
};
|
|
@@ -56,4 +75,5 @@ exports.factoIdRmq2 = {
|
|
|
56
75
|
getPropositions,
|
|
57
76
|
isAnswerValid,
|
|
58
77
|
subject: "Mathématiques",
|
|
78
|
+
hasHintAndCorrection: true,
|
|
59
79
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factoIdRmq3.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoIdRmq3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"factoIdRmq3.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoIdRmq3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAmGF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAc7C,CAAC"}
|
|
@@ -6,6 +6,9 @@ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQ
|
|
|
6
6
|
const affine_1 = require("../../../../math/polynomials/affine");
|
|
7
7
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
8
8
|
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
9
|
+
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
10
|
+
const substractNode_1 = require("../../../../tree/nodes/operators/substractNode");
|
|
11
|
+
const alignTex_1 = require("../../../../utils/alignTex");
|
|
9
12
|
const getFactoType1Question = () => {
|
|
10
13
|
const affine = affine_1.AffineConstructor.random({
|
|
11
14
|
min: 1,
|
|
@@ -13,6 +16,9 @@ const getFactoType1Question = () => {
|
|
|
13
16
|
}, { excludes: [0] });
|
|
14
17
|
const affine2 = new affine_1.Affine(affine.a, -affine.b);
|
|
15
18
|
const statementTree = affine.multiply(affine2).toTree();
|
|
19
|
+
const statementTex = statementTree.toTex();
|
|
20
|
+
const bPositive = Math.abs(affine.b);
|
|
21
|
+
const aMonom = new multiplyNode_1.MultiplyNode(affine.a.toTree(), "x".toTree());
|
|
16
22
|
const answerTree = new multiplyNode_1.MultiplyNode(affine.toTree(), affine2.toTree());
|
|
17
23
|
const answer = answerTree.toTex();
|
|
18
24
|
const question = {
|
|
@@ -25,6 +31,18 @@ const getFactoType1Question = () => {
|
|
|
25
31
|
affine1Coeffs: affine.coefficients,
|
|
26
32
|
affine2Coeffs: affine2.coefficients,
|
|
27
33
|
},
|
|
34
|
+
hint: `Utilise l'identité remarquable $a^2 - b^2 = (a-b)(a+b)$`,
|
|
35
|
+
correction: `
|
|
36
|
+
On utilise l'identité remarquable $ a^2 - b^2=(a-b)(a+b)$ en prenant $a=${aMonom.toTex()}$ et $b=${bPositive}$ :
|
|
37
|
+
|
|
38
|
+
${(0, alignTex_1.alignTex)([
|
|
39
|
+
[
|
|
40
|
+
statementTex,
|
|
41
|
+
"=",
|
|
42
|
+
new substractNode_1.SubstractNode(new powerNode_1.SquareNode(aMonom), new powerNode_1.SquareNode(bPositive.toTree())).toTex(),
|
|
43
|
+
],
|
|
44
|
+
["", "=", answer],
|
|
45
|
+
])}`,
|
|
28
46
|
};
|
|
29
47
|
return question;
|
|
30
48
|
};
|
|
@@ -63,4 +81,5 @@ exports.factoIdRmq3 = {
|
|
|
63
81
|
getPropositions,
|
|
64
82
|
isAnswerValid,
|
|
65
83
|
subject: "Mathématiques",
|
|
84
|
+
hasHintAndCorrection: true,
|
|
66
85
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factoType1Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoType1Exercise.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;
|
|
1
|
+
{"version":3,"file":"factoType1Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoType1Exercise.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA0HF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAapD,CAAC"}
|
|
@@ -12,6 +12,7 @@ const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
|
12
12
|
const substractNode_1 = require("../../../../tree/nodes/operators/substractNode");
|
|
13
13
|
const random_1 = require("../../../../utils/random");
|
|
14
14
|
const shuffle_1 = require("../../../../utils/shuffle");
|
|
15
|
+
//TODO fix { "affinesCoeffs": [ [ -2, 8 ], [ -5, 4 ], [ 0, -8 ] ], "operation": "substract" } donne trop de moins
|
|
15
16
|
const getFactoType1Question = () => {
|
|
16
17
|
const affines = affine_1.AffineConstructor.differentRandoms(3);
|
|
17
18
|
const permut = [
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factorizeCanonicalForm.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factorizeCanonicalForm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAuFF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAexD,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.factorizeCanonicalForm = void 0;
|
|
4
|
+
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const affine_1 = require("../../../../math/polynomials/affine");
|
|
7
|
+
const randint_1 = require("../../../../math/utils/random/randint");
|
|
8
|
+
const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
9
|
+
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
10
|
+
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
11
|
+
const substractNode_1 = require("../../../../tree/nodes/operators/substractNode");
|
|
12
|
+
const alignTex_1 = require("../../../../utils/alignTex");
|
|
13
|
+
//(x-a)^2-b^2 avec b entier
|
|
14
|
+
const getFactorizeCanonicalFormQuestion = () => {
|
|
15
|
+
const affine = new affine_1.Affine(1, (0, randint_1.randint)(-10, 10, [0]));
|
|
16
|
+
const b = (0, randint_1.randint)(-10, 10, [0]);
|
|
17
|
+
const statement = new substractNode_1.SubstractNode(new powerNode_1.SquareNode(affine.toTree()), (b ** 2).toTree());
|
|
18
|
+
const bPositive = Math.abs(b);
|
|
19
|
+
const answer = new multiplyNode_1.MultiplyNode(affine.add(-bPositive).toTree(), affine.add(bPositive).toTree()).toTex();
|
|
20
|
+
const statementTex = statement.toTex();
|
|
21
|
+
const question = {
|
|
22
|
+
answer,
|
|
23
|
+
instruction: `Factoriser : $${statementTex}$`,
|
|
24
|
+
keys: ["x"],
|
|
25
|
+
answerFormat: "tex",
|
|
26
|
+
identifiers: { a: affine.b, b },
|
|
27
|
+
hint: `Utilise l'identité remarquable $a^2 - b^2 = (a-b)(a+b)$`,
|
|
28
|
+
correction: `
|
|
29
|
+
On utilise l'identité remarquable $ a^2 - b^2=(a-b)(a+b)$ en prenant $a=${affine.toTex()}$ et $b=${bPositive}$ :
|
|
30
|
+
|
|
31
|
+
${(0, alignTex_1.alignTex)([
|
|
32
|
+
[
|
|
33
|
+
statementTex,
|
|
34
|
+
"=",
|
|
35
|
+
new substractNode_1.SubstractNode(new powerNode_1.SquareNode(affine.toTree()), new powerNode_1.SquareNode(bPositive.toTree())).toTex(),
|
|
36
|
+
],
|
|
37
|
+
[
|
|
38
|
+
"",
|
|
39
|
+
"=",
|
|
40
|
+
new multiplyNode_1.MultiplyNode(new addNode_1.AddNode(affine.toTree(), (-bPositive).toTree()), new addNode_1.AddNode(affine.toTree(), bPositive.toTree())).toTex(),
|
|
41
|
+
],
|
|
42
|
+
["", "=", answer],
|
|
43
|
+
])}`,
|
|
44
|
+
};
|
|
45
|
+
return question;
|
|
46
|
+
};
|
|
47
|
+
const getPropositions = (n, { answer, a, b }) => {
|
|
48
|
+
const propositions = [];
|
|
49
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
50
|
+
const affine = new affine_1.Affine(a, b);
|
|
51
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new multiplyNode_1.MultiplyNode(affine.add(-(b ** 2)).toTree(), affine.add(b ** 2).toTree()).toTex());
|
|
52
|
+
while (propositions.length < n) {
|
|
53
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new multiplyNode_1.MultiplyNode(new affine_1.Affine(1, (0, randint_1.randint)(-10, 10)).toTree(), new affine_1.Affine(1, (0, randint_1.randint)(-10, 10)).toTree()).toTex());
|
|
54
|
+
}
|
|
55
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
56
|
+
};
|
|
57
|
+
const isAnswerValid = (ans, { answer, a, b }) => {
|
|
58
|
+
const affine = new affine_1.Affine(1, a);
|
|
59
|
+
const bPositive = Math.abs(b);
|
|
60
|
+
const answerTree = new multiplyNode_1.MultiplyNode(affine.add(-bPositive).toTree(), affine.add(bPositive).toTree());
|
|
61
|
+
return answerTree.toAllValidTexs().includes(ans);
|
|
62
|
+
};
|
|
63
|
+
exports.factorizeCanonicalForm = {
|
|
64
|
+
id: "factorizeCanonicalForm",
|
|
65
|
+
connector: "=",
|
|
66
|
+
label: "Factoriser une expression du type $(x-a)^2-b^2$ avec $b$ entier",
|
|
67
|
+
levels: [],
|
|
68
|
+
isSingleStep: true,
|
|
69
|
+
sections: [],
|
|
70
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getFactorizeCanonicalFormQuestion, nb),
|
|
71
|
+
qcmTimer: 60,
|
|
72
|
+
freeTimer: 60,
|
|
73
|
+
getPropositions,
|
|
74
|
+
isAnswerValid,
|
|
75
|
+
subject: "Mathématiques",
|
|
76
|
+
hasHintAndCorrection: true,
|
|
77
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
a: number;
|
|
4
|
+
bOperand: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const factorizeCanonicalFormWithSqrt: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=factorizeCanonicalFormWithSqrt.d.ts.map
|
package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalFormWithSqrt.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factorizeCanonicalFormWithSqrt.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factorizeCanonicalFormWithSqrt.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAelC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AA2FF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,CAehE,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.factorizeCanonicalFormWithSqrt = void 0;
|
|
4
|
+
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const real_1 = require("../../../../math/numbers/reals/real");
|
|
7
|
+
const affine_1 = require("../../../../math/polynomials/affine");
|
|
8
|
+
const randint_1 = require("../../../../math/utils/random/randint");
|
|
9
|
+
const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
10
|
+
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
11
|
+
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
12
|
+
const substractNode_1 = require("../../../../tree/nodes/operators/substractNode");
|
|
13
|
+
const alignTex_1 = require("../../../../utils/alignTex");
|
|
14
|
+
//(x-a)^2-b^2 avec b irrational
|
|
15
|
+
const getFactorizeCanonicalFormWithSqrtQuestion = () => {
|
|
16
|
+
const affine = new affine_1.Affine(1, (0, randint_1.randint)(-10, 10, [0]));
|
|
17
|
+
const b = real_1.SquareRootConstructor.randomIrreductible(10);
|
|
18
|
+
const statement = new substractNode_1.SubstractNode(new powerNode_1.SquareNode(affine.toTree()), b.operand.toTree());
|
|
19
|
+
const answer = new multiplyNode_1.MultiplyNode(new substractNode_1.SubstractNode(affine.toTree(), b.toTree()), new addNode_1.AddNode(affine.toTree(), b.toTree()))
|
|
20
|
+
.simplify({ forbidFactorize: true })
|
|
21
|
+
.toTex();
|
|
22
|
+
const statementTex = statement.toTex();
|
|
23
|
+
const question = {
|
|
24
|
+
answer,
|
|
25
|
+
instruction: `Factoriser : $${statementTex}$`,
|
|
26
|
+
keys: ["x"],
|
|
27
|
+
answerFormat: "tex",
|
|
28
|
+
identifiers: { a: affine.b, bOperand: b.operand },
|
|
29
|
+
hint: `Utilise l'identité remarquable $a^2 - b^2 = (a-b)(a+b)$`,
|
|
30
|
+
correction: `
|
|
31
|
+
On utilise l'identité remarquable $ a^2 - b^2=(a-b)(a+b)$ en prenant $a=${affine.toTex()}$ et $b=${b
|
|
32
|
+
.toTree()
|
|
33
|
+
.toTex()}$ :
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
${(0, alignTex_1.alignTex)([
|
|
37
|
+
[
|
|
38
|
+
statementTex,
|
|
39
|
+
"=",
|
|
40
|
+
new substractNode_1.SubstractNode(new powerNode_1.SquareNode(affine.toTree()), new powerNode_1.SquareNode(b.toTree())).toTex(),
|
|
41
|
+
],
|
|
42
|
+
["", "=", answer],
|
|
43
|
+
])}
|
|
44
|
+
|
|
45
|
+
`,
|
|
46
|
+
};
|
|
47
|
+
return question;
|
|
48
|
+
};
|
|
49
|
+
const getPropositions = (n, { answer, a, bOperand }) => {
|
|
50
|
+
const propositions = [];
|
|
51
|
+
const affine = new affine_1.Affine(1, a);
|
|
52
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
53
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new multiplyNode_1.MultiplyNode(affine.add(bOperand).toTree(), affine.add(-bOperand).toTree()).toTex());
|
|
54
|
+
while (propositions.length < n) {
|
|
55
|
+
const randomSqrt = real_1.SquareRootConstructor.randomIrreductible(10);
|
|
56
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new multiplyNode_1.MultiplyNode(new substractNode_1.SubstractNode(affine.toTree(), randomSqrt.toTree()), new addNode_1.AddNode(affine.toTree(), randomSqrt.toTree())).toTex());
|
|
57
|
+
}
|
|
58
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
59
|
+
};
|
|
60
|
+
const isAnswerValid = (ans, { answer, a, bOperand }) => {
|
|
61
|
+
const affine = new affine_1.Affine(1, a);
|
|
62
|
+
const b = new real_1.SquareRoot(bOperand);
|
|
63
|
+
const answerTree = new multiplyNode_1.MultiplyNode(new substractNode_1.SubstractNode(affine.toTree(), b.toTree()), new addNode_1.AddNode(affine.toTree(), b.toTree())).simplify({ forbidFactorize: true });
|
|
64
|
+
return answerTree.toAllValidTexs().includes(ans);
|
|
65
|
+
};
|
|
66
|
+
exports.factorizeCanonicalFormWithSqrt = {
|
|
67
|
+
id: "factorizeCanonicalFormWithSqrt",
|
|
68
|
+
connector: "=",
|
|
69
|
+
label: "Factoriser une expression du type $(x-a)^2-b^2$ avec $b$ irrationnel",
|
|
70
|
+
levels: [],
|
|
71
|
+
isSingleStep: true,
|
|
72
|
+
sections: [],
|
|
73
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getFactorizeCanonicalFormWithSqrtQuestion, nb),
|
|
74
|
+
qcmTimer: 60,
|
|
75
|
+
freeTimer: 60,
|
|
76
|
+
getPropositions,
|
|
77
|
+
isAnswerValid,
|
|
78
|
+
subject: "Mathématiques",
|
|
79
|
+
hasHintAndCorrection: true,
|
|
80
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC"}
|
|
@@ -18,3 +18,5 @@ __exportStar(require("./factoIdRmq1"), exports);
|
|
|
18
18
|
__exportStar(require("./factoIdRmq2"), exports);
|
|
19
19
|
__exportStar(require("./factoIdRmq3"), exports);
|
|
20
20
|
__exportStar(require("./factoType1Exercise"), exports);
|
|
21
|
+
__exportStar(require("./factorizeCanonicalForm"), exports);
|
|
22
|
+
__exportStar(require("./factorizeCanonicalFormWithSqrt"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equaDiffGeneralForme.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/equaDiff/equaDiffGeneralForme.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAWlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA6EF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"equaDiffGeneralForme.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/equaDiff/equaDiffGeneralForme.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAWlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA6EF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAcjE,CAAC"}
|