math-exercises 3.0.151 → 3.0.153
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 +7 -0
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionToPercentToDecimal.d.ts +5 -1
- package/lib/exercises/math/calcul/fractions/fractionToPercentToDecimal.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionToPercentToDecimal.js +92 -38
- package/lib/exercises/math/calcul/proportionality/findCoeffInProportionalTableNonIntegers.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/findCoeffInProportionalTableNonIntegers.js +5 -1
- package/lib/exercises/math/calcul/proportionality/isTableProportional.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/isTableProportional.js +7 -1
- package/lib/exercises/math/calcul/proportionality/isTableProportionalNonInteger.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/isTableProportionalNonInteger.js +5 -1
- package/lib/exercises/math/calcul/proportionality/proportionalityTable.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/proportionalityTable.js +5 -1
- package/lib/exercises/math/calcul/proportionality/proportionalityTableCoefficient.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/proportionalityTableCoefficient.js +8 -2
- package/lib/exercises/math/calculLitteral/equation/index.d.ts +1 -1
- package/lib/exercises/math/calculLitteral/equation/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/index.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/square/equationSimpleSquare.d.ts +10 -0
- package/lib/exercises/math/calculLitteral/equation/square/equationSimpleSquare.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/equation/square/equationSimpleSquare.js +183 -0
- package/lib/exercises/math/calculLitteral/equation/square/equationSquareWithSteps.d.ts +10 -0
- package/lib/exercises/math/calculLitteral/equation/square/equationSquareWithSteps.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/equation/square/equationSquareWithSteps.js +173 -0
- package/lib/exercises/math/calculLitteral/equation/square/index.d.ts +3 -0
- package/lib/exercises/math/calculLitteral/equation/square/index.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/equation/square/index.js +2 -0
- package/lib/exercises/math/dataRepresentations/histogram/histogramIsSameData.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/histogram/histogramIsSameData.js +7 -0
- package/lib/exercises/math/dataRepresentations/tableReading.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/tableReading.js +7 -0
- package/lib/exercises/math/functions/affines/affineAdjustment.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineAdjustment.js +7 -1
- package/lib/exercises/math/functions/affines/affineAdjustmentComplete.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineAdjustmentComplete.js +7 -1
- package/lib/exercises/math/functions/affines/affineAdjustmentRsquared.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineAdjustmentRsquared.js +7 -1
- package/lib/exercises/math/functions/basics/inverseImageFunctionTable.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/inverseImageFunctionTable.js +7 -1
- package/lib/exercises/math/functions/basics/placePointsFromValueTable.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/placePointsFromValueTable.js +7 -0
- package/lib/exercises/math/functions/sqrt/squareRootCalculation.d.ts.map +1 -1
- package/lib/exercises/math/functions/sqrt/squareRootCalculation.js +4 -2
- package/lib/exercises/math/geometry/euclidian/homothetyFactorFromPoints.d.ts +15 -0
- package/lib/exercises/math/geometry/euclidian/homothetyFactorFromPoints.d.ts.map +1 -0
- package/lib/exercises/math/geometry/euclidian/homothetyFactorFromPoints.js +301 -0
- package/lib/exercises/math/geometry/euclidian/index.d.ts +7 -0
- package/lib/exercises/math/geometry/euclidian/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidian/index.js +7 -0
- package/lib/exercises/math/geometry/euclidian/pinPointFromAxialOrCentralSymmetry.d.ts +21 -0
- package/lib/exercises/math/geometry/euclidian/pinPointFromAxialOrCentralSymmetry.d.ts.map +1 -0
- package/lib/exercises/math/geometry/euclidian/pinPointFromAxialOrCentralSymmetry.js +406 -0
- package/lib/exercises/math/geometry/euclidian/pinPointFromRotation.d.ts +18 -0
- package/lib/exercises/math/geometry/euclidian/pinPointFromRotation.d.ts.map +1 -0
- package/lib/exercises/math/geometry/euclidian/pinPointFromRotation.js +315 -0
- package/lib/exercises/math/geometry/euclidian/pinPointFromTranslation.d.ts +20 -0
- package/lib/exercises/math/geometry/euclidian/pinPointFromTranslation.d.ts.map +1 -0
- package/lib/exercises/math/geometry/euclidian/pinPointFromTranslation.js +314 -0
- package/lib/exercises/math/geometry/euclidian/pinSegmentFromRotation.d.ts +18 -0
- package/lib/exercises/math/geometry/euclidian/pinSegmentFromRotation.d.ts.map +1 -0
- package/lib/exercises/math/geometry/euclidian/pinSegmentFromRotation.js +387 -0
- package/lib/exercises/math/geometry/euclidian/recognizeAngleFromRotation.d.ts +18 -0
- package/lib/exercises/math/geometry/euclidian/recognizeAngleFromRotation.d.ts.map +1 -0
- package/lib/exercises/math/geometry/euclidian/recognizeAngleFromRotation.js +309 -0
- package/lib/exercises/math/geometry/euclidian/recognizeHomothetyCenter.d.ts +17 -0
- package/lib/exercises/math/geometry/euclidian/recognizeHomothetyCenter.d.ts.map +1 -0
- package/lib/exercises/math/geometry/euclidian/recognizeHomothetyCenter.js +301 -0
- package/lib/exercises/math/geometry/euclidianConstructions/buildPointFromAxialSymetry.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidianConstructions/buildPointFromAxialSymetry.js +22 -8
- package/lib/exercises/math/geometry/euclidianConstructions/buildPointFromCentralSymmetry.d.ts +11 -0
- package/lib/exercises/math/geometry/euclidianConstructions/buildPointFromCentralSymmetry.d.ts.map +1 -0
- package/lib/exercises/math/geometry/euclidianConstructions/buildPointFromCentralSymmetry.js +169 -0
- package/lib/exercises/math/geometry/euclidianConstructions/index.d.ts +2 -0
- package/lib/exercises/math/geometry/euclidianConstructions/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidianConstructions/index.js +2 -0
- package/lib/exercises/math/geometry/euclidianConstructions/placeHomothetyCenter.d.ts +16 -0
- package/lib/exercises/math/geometry/euclidianConstructions/placeHomothetyCenter.d.ts.map +1 -0
- package/lib/exercises/math/geometry/euclidianConstructions/placeHomothetyCenter.js +309 -0
- package/lib/exercises/math/probaStat/basicProbas/calculateProbaFromProbaLaw.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/basicProbas/calculateProbaFromProbaLaw.js +7 -0
- package/lib/exercises/math/probaStat/basicProbas/getMissingProbabilityValue.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/basicProbas/getMissingProbabilityValue.js +7 -0
- package/lib/exercises/math/probaStat/basicProbas/getMissingProbabilityValueMiddleSchool.d.ts +9 -0
- package/lib/exercises/math/probaStat/basicProbas/getMissingProbabilityValueMiddleSchool.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/basicProbas/getMissingProbabilityValueMiddleSchool.js +120 -0
- package/lib/exercises/math/probaStat/basicProbas/index.d.ts +2 -0
- package/lib/exercises/math/probaStat/basicProbas/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/basicProbas/index.js +2 -0
- package/lib/exercises/math/probaStat/basicProbas/pickEquiprobableTo.d.ts +12 -0
- package/lib/exercises/math/probaStat/basicProbas/pickEquiprobableTo.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/basicProbas/pickEquiprobableTo.js +374 -0
- package/lib/exercises/math/probaStat/probaFromTableNoContext.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaFromTableNoContext.js +7 -0
- package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaFromTableWithContext.js +7 -0
- package/lib/exercises/math/probaStat/stats1var/averageWithClasses.d.ts +9 -0
- package/lib/exercises/math/probaStat/stats1var/averageWithClasses.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/stats1var/averageWithClasses.js +140 -0
- package/lib/exercises/math/probaStat/stats1var/averageWithTable.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/averageWithTable.js +7 -1
- package/lib/exercises/math/probaStat/stats1var/averageWithTableWithContext.d.ts +8 -0
- package/lib/exercises/math/probaStat/stats1var/averageWithTableWithContext.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/stats1var/averageWithTableWithContext.js +113 -0
- package/lib/exercises/math/probaStat/stats1var/calculateMeanFromFrequencies.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/calculateMeanFromFrequencies.js +7 -0
- package/lib/exercises/math/probaStat/stats1var/cumulativeSum.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/cumulativeSum.js +7 -0
- package/lib/exercises/math/probaStat/stats1var/etendueTable.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/etendueTable.js +7 -1
- package/lib/exercises/math/probaStat/stats1var/getQuartileProportionQuestion.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/getQuartileProportionQuestion.js +7 -0
- package/lib/exercises/math/probaStat/stats1var/index.d.ts +2 -0
- package/lib/exercises/math/probaStat/stats1var/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/index.js +2 -0
- package/lib/exercises/math/probaStat/stats1var/interquartilesTable.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/interquartilesTable.js +5 -1
- package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.js +7 -0
- package/lib/exercises/math/probaStat/stats1var/medianWithList.d.ts +2 -0
- package/lib/exercises/math/probaStat/stats1var/medianWithList.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/medianWithList.js +67 -14
- package/lib/exercises/math/probaStat/stats1var/medianWithTable.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/medianWithTable.js +7 -1
- package/lib/exercises/math/probaStat/stats1var/quartiles.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/quartiles.js +7 -1
- package/lib/exercises/math/probaStat/stats1var/standardDeviationTable.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/standardDeviationTable.js +5 -1
- package/lib/exercises/math/probaStat/stats1var/varianceTable.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/varianceTable.js +5 -1
- package/lib/exercises/math/probaStat/stats2var/averagePoint.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats2var/averagePoint.js +7 -1
- package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceOutcomes.d.ts +7 -0
- package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceOutcomes.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceOutcomes.js +171 -0
- package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceProbas.d.ts +7 -0
- package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceProbas.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceProbas.js +155 -0
- package/lib/exercises/math/probaStat/twoStepExperiments/index.d.ts +3 -0
- package/lib/exercises/math/probaStat/twoStepExperiments/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/twoStepExperiments/index.js +3 -0
- package/lib/exercises/math/probaStat/twoStepExperiments/numberPoolTwiceProbas.d.ts +7 -0
- package/lib/exercises/math/probaStat/twoStepExperiments/numberPoolTwiceProbas.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/twoStepExperiments/numberPoolTwiceProbas.js +189 -0
- package/lib/exercises/math/scratch/index.d.ts +3 -0
- package/lib/exercises/math/scratch/index.d.ts.map +1 -1
- package/lib/exercises/math/scratch/index.js +3 -0
- package/lib/exercises/math/scratch/scratchListElemAtIndex.d.ts +13 -0
- package/lib/exercises/math/scratch/scratchListElemAtIndex.d.ts.map +1 -0
- package/lib/exercises/math/scratch/scratchListElemAtIndex.js +189 -0
- package/lib/exercises/math/scratch/scratchListElemAtIndex2.d.ts +23 -0
- package/lib/exercises/math/scratch/scratchListElemAtIndex2.d.ts.map +1 -0
- package/lib/exercises/math/scratch/scratchListElemAtIndex2.js +207 -0
- package/lib/exercises/math/scratch/scratchListFilter.d.ts +13 -0
- package/lib/exercises/math/scratch/scratchListFilter.d.ts.map +1 -0
- package/lib/exercises/math/scratch/scratchListFilter.js +397 -0
- package/lib/exercises/math/spaceGeometry/basis/findSpacePointOnRectangularPrism.d.ts +14 -0
- package/lib/exercises/math/spaceGeometry/basis/findSpacePointOnRectangularPrism.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/basis/findSpacePointOnRectangularPrism.js +347 -0
- package/lib/exercises/math/spaceGeometry/basis/index.d.ts +1 -0
- package/lib/exercises/math/spaceGeometry/basis/index.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/basis/index.js +1 -0
- package/lib/exercises/math/spaceGeometry/index.d.ts +2 -0
- package/lib/exercises/math/spaceGeometry/index.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/index.js +2 -0
- package/lib/exercises/math/spaceGeometry/sections/areaOfConeSection.js +3 -3
- package/lib/exercises/math/spaceGeometry/solids/index.d.ts +3 -0
- package/lib/exercises/math/spaceGeometry/solids/index.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/solids/index.js +2 -0
- package/lib/exercises/math/spaceGeometry/solids/recognizeSolidFrom3D.d.ts +15 -0
- package/lib/exercises/math/spaceGeometry/solids/recognizeSolidFrom3D.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/solids/recognizeSolidFrom3D.js +440 -0
- package/lib/exercises/math/spaceGeometry/solids/recognizeSolidFromSolidPattern.d.ts +11 -0
- package/lib/exercises/math/spaceGeometry/solids/recognizeSolidFromSolidPattern.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/solids/recognizeSolidFromSolidPattern.js +1089 -0
- package/lib/exercises/math/spaceGeometry/sphere/index.d.ts +3 -0
- package/lib/exercises/math/spaceGeometry/sphere/index.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/sphere/index.js +2 -0
- package/lib/exercises/math/spaceGeometry/sphere/pickIsPointInSphereOrBall.d.ts +9 -0
- package/lib/exercises/math/spaceGeometry/sphere/pickIsPointInSphereOrBall.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/sphere/pickIsPointInSphereOrBall.js +127 -0
- package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.d.ts +14 -0
- package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.js +390 -0
- package/lib/geogebra/geogebraConstructor.d.ts +2 -0
- package/lib/geogebra/geogebraConstructor.d.ts.map +1 -1
- package/lib/geogebra/geogebraConstructor.js +6 -0
- package/lib/index.d.ts +198 -6
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/point.d.ts +6 -0
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +28 -0
- package/lib/tree/nodes/equations/equalNode.d.ts +1 -1
- package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equalNode.js +0 -1
- package/lib/tree/utilities/nodeSimplifier.d.ts +1 -1
- package/lib/utils/arrays/arrayZip.d.ts +2 -0
- package/lib/utils/arrays/arrayZip.d.ts.map +1 -0
- package/lib/utils/arrays/arrayZip.js +12 -0
- package/package.json +1 -1
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, propWhile, } from "../../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { randint } from "../../../../../math/utils/random/randint.js";
|
|
4
|
+
import { equationResolutionTex } from "../../../../../tree/nodes/equations/equalNode.js";
|
|
5
|
+
import { sqrt } from "../../../../../tree/nodes/functions/sqrtNode.js";
|
|
6
|
+
import { add } from "../../../../../tree/nodes/operators/addNode.js";
|
|
7
|
+
import { frac } from "../../../../../tree/nodes/operators/fractionNode.js";
|
|
8
|
+
import { multiply } from "../../../../../tree/nodes/operators/multiplyNode.js";
|
|
9
|
+
import { substract } from "../../../../../tree/nodes/operators/substractNode.js";
|
|
10
|
+
import { discreteSetParser } from "../../../../../tree/parsers/discreteSetParser.js";
|
|
11
|
+
import { coinFlip } from "../../../../../utils/alea/coinFlip.js";
|
|
12
|
+
import { probaLawFlip } from "../../../../../utils/alea/probaLawFlip.js";
|
|
13
|
+
import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
|
|
14
|
+
const getPropositions = (n, { answer, a, b, c, d }) => {
|
|
15
|
+
const propositions = [];
|
|
16
|
+
addValidProp(propositions, answer);
|
|
17
|
+
if (coinFlip())
|
|
18
|
+
tryToAddWrongProp(propositions, `S=\\varnothing`);
|
|
19
|
+
if (coinFlip())
|
|
20
|
+
tryToAddWrongProp(propositions, `S=\\left\\{0\\right\\}`);
|
|
21
|
+
const k = frac(substract(d, b), substract(a, c)).simplify();
|
|
22
|
+
if (coinFlip())
|
|
23
|
+
tryToAddWrongProp(propositions, sqrt(k).simplify().toTex());
|
|
24
|
+
propWhile(propositions, n, () => {
|
|
25
|
+
const rand = randint(-10, 10, [0]);
|
|
26
|
+
tryToAddWrongProp(propositions, `S=\\left\\{-${rand};${rand}\\right\\}`);
|
|
27
|
+
});
|
|
28
|
+
return shuffleProps(propositions, n);
|
|
29
|
+
};
|
|
30
|
+
const getAnswer = (identifiers) => {
|
|
31
|
+
const { a, b, c, d } = identifiers;
|
|
32
|
+
const k = frac(substract(d, b), substract(a, c));
|
|
33
|
+
const kEv = k.evaluate();
|
|
34
|
+
if (kEv < 0)
|
|
35
|
+
return "S=\\varnothing";
|
|
36
|
+
if (kEv === 0)
|
|
37
|
+
return "S=\\left\\{0\\right\\}";
|
|
38
|
+
else {
|
|
39
|
+
const squareRoot = sqrt(k).simplify().toTex();
|
|
40
|
+
return `S=\\left\\{-${squareRoot};${squareRoot}\\right\\}`;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const getInstruction = (identifiers) => {
|
|
44
|
+
const { a, b, c, d } = identifiers;
|
|
45
|
+
return `Résoudre l'équation suivante :
|
|
46
|
+
|
|
47
|
+
$$
|
|
48
|
+
${add(multiply(a, "x^2"), b)
|
|
49
|
+
.simplify({ forbidFactorize: true })
|
|
50
|
+
.toTex()} = ${add(multiply(c, "x^2"), d)
|
|
51
|
+
.simplify({ forbidFactorize: true })
|
|
52
|
+
.toTex()}
|
|
53
|
+
$$`;
|
|
54
|
+
};
|
|
55
|
+
const getHint = () => {
|
|
56
|
+
return `Commence par regrouper les termes en $x^2$ à gauche, et les autres termes à droite. Puis, utilise la propriété suivante : l'équation $x^2 = k$ :
|
|
57
|
+
|
|
58
|
+
- n'admet pas de solution si $k<0$ ;
|
|
59
|
+
- admet une solution si $k=0$, qui est $0$ ;
|
|
60
|
+
- admet deux solutions si $k>0$, qui sont $-\\sqrt{k}$ et $\\sqrt{k}$.
|
|
61
|
+
`;
|
|
62
|
+
};
|
|
63
|
+
const getCorrection = (identifiers) => {
|
|
64
|
+
const { a, b, c, d } = identifiers;
|
|
65
|
+
const answer = getAnswer(identifiers);
|
|
66
|
+
const k = (d - b) / (a - c);
|
|
67
|
+
const resolutiontex = equationResolutionTex(a.toTree(), b.toTree(), c.toTree(), d.toTree());
|
|
68
|
+
let finalResolutionTex = "";
|
|
69
|
+
finalResolutionTex = resolutiontex.replaceAll("x", "x^2");
|
|
70
|
+
return `On commence par regrouper les termes en $x^2$ d'un côté, et les autres termes de l'autre :
|
|
71
|
+
|
|
72
|
+
$$
|
|
73
|
+
${finalResolutionTex}
|
|
74
|
+
$$
|
|
75
|
+
|
|
76
|
+
${k < 0
|
|
77
|
+
? `L'équation $x^2 = ${k}$ n'admet pas de solution, car $${k}$ est négatif. Ainsi:
|
|
78
|
+
|
|
79
|
+
$$
|
|
80
|
+
${answer}
|
|
81
|
+
$$`
|
|
82
|
+
: k === 0
|
|
83
|
+
? `L'équation $x^2 = 0$ admet une unique solution : $0$. En effet, $0$ est le seul nombre qui au carré est égal à $0$. Ainsi :
|
|
84
|
+
|
|
85
|
+
$$
|
|
86
|
+
${answer}
|
|
87
|
+
$$`
|
|
88
|
+
: `Puisque $${k}>0$, l'équation $x^2 = ${k}$ admet deux solutions : $-\\sqrt{${k}}$ et $\\sqrt{${k}}$.
|
|
89
|
+
|
|
90
|
+
Ainsi :
|
|
91
|
+
|
|
92
|
+
$$
|
|
93
|
+
${answer}
|
|
94
|
+
$$
|
|
95
|
+
`}`;
|
|
96
|
+
};
|
|
97
|
+
const getKeys = () => {
|
|
98
|
+
return ["S", "equal", "lbrace", "semicolon", "rbrace", "varnothing"];
|
|
99
|
+
};
|
|
100
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
101
|
+
try {
|
|
102
|
+
const parsed = discreteSetParser(ans);
|
|
103
|
+
if (!parsed)
|
|
104
|
+
return false;
|
|
105
|
+
console.log(parsed.simplify().toTex());
|
|
106
|
+
return "S=" + parsed.simplify().toTex() === answer;
|
|
107
|
+
}
|
|
108
|
+
catch (err) {
|
|
109
|
+
return handleVEAError(err);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
const getEquationSquareWithStepsQuestion = () => {
|
|
113
|
+
const a = randint(-10, 10, [0]);
|
|
114
|
+
const c = randint(-10, 10, [a]);
|
|
115
|
+
let b = 0;
|
|
116
|
+
let d = 0;
|
|
117
|
+
const type = probaLawFlip([
|
|
118
|
+
[0, 0.2],
|
|
119
|
+
[1, 0.2],
|
|
120
|
+
[2, 0.6],
|
|
121
|
+
]);
|
|
122
|
+
//final = d-b / a-c
|
|
123
|
+
//on veut k entier : d-b = k(a-c)
|
|
124
|
+
if (type === 0) {
|
|
125
|
+
//pas de sol
|
|
126
|
+
const k = randint(-5, 0);
|
|
127
|
+
b = randint(-10, 10);
|
|
128
|
+
d = k * (a - c) + b;
|
|
129
|
+
}
|
|
130
|
+
else if (type === 1) {
|
|
131
|
+
//une sol
|
|
132
|
+
b = randint(-10, 10);
|
|
133
|
+
d = b;
|
|
134
|
+
}
|
|
135
|
+
else if (type === 2) {
|
|
136
|
+
//deux sols
|
|
137
|
+
const isPerfectSquare = coinFlip();
|
|
138
|
+
const k = isPerfectSquare ? randint(1, 10) ** 2 : randint(1, 10);
|
|
139
|
+
b = randint(-10, 10);
|
|
140
|
+
d = k * (a - c) + b;
|
|
141
|
+
}
|
|
142
|
+
const identifiers = { a, b, c, d };
|
|
143
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
144
|
+
};
|
|
145
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
146
|
+
return {
|
|
147
|
+
answer: getAnswer(identifiers),
|
|
148
|
+
instruction: getInstruction(identifiers),
|
|
149
|
+
keys: getKeys(identifiers),
|
|
150
|
+
answerFormat: "tex",
|
|
151
|
+
identifiers,
|
|
152
|
+
hint: getHint(identifiers),
|
|
153
|
+
correction: getCorrection(identifiers),
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
export const equationSquareWithSteps = {
|
|
157
|
+
id: "equationSquareWithSteps",
|
|
158
|
+
connector: "\\iff",
|
|
159
|
+
label: "Résoudre une équation du type $ax^2 + b = cx^2 + d$",
|
|
160
|
+
isSingleStep: true,
|
|
161
|
+
generator: (nb, opts) => getDistinctQuestions(() => getEquationSquareWithStepsQuestion(opts), nb),
|
|
162
|
+
qcmTimer: 60,
|
|
163
|
+
freeTimer: 60,
|
|
164
|
+
getPropositions,
|
|
165
|
+
isAnswerValid,
|
|
166
|
+
subject: "Mathématiques",
|
|
167
|
+
getInstruction,
|
|
168
|
+
getHint,
|
|
169
|
+
getCorrection,
|
|
170
|
+
getAnswer,
|
|
171
|
+
getQuestionFromIdentifiers,
|
|
172
|
+
hasHintAndCorrection: true,
|
|
173
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/calculLitteral/equation/square/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"histogramIsSameData.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/dataRepresentations/histogram/histogramIsSameData.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAyErC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE;QACT,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,IAAI,EAAE,MAAM,EAAE,CAAC;KAChB,CAAC;IACF,KAAK,EACD;QACE,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,IAAI,EAAE,MAAM,EAAE,CAAC;KAChB,GACD,SAAS,CAAC;CACf,CAAC;
|
|
1
|
+
{"version":3,"file":"histogramIsSameData.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/dataRepresentations/histogram/histogramIsSameData.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAyErC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE;QACT,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,IAAI,EAAE,MAAM,EAAE,CAAC;KAChB,CAAC;IACF,KAAK,EACD;QACE,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,IAAI,EAAE,MAAM,EAAE,CAAC;KAChB,GACD,SAAS,CAAC;CACf,CAAC;AAmNF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAmBrD,CAAC"}
|
|
@@ -209,6 +209,13 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
209
209
|
hint: getHint(identifiers),
|
|
210
210
|
correction: getCorrection(identifiers),
|
|
211
211
|
ggbOptions: getGGBOptions(identifiers),
|
|
212
|
+
style: {
|
|
213
|
+
tableOptions: {
|
|
214
|
+
firstCellIsDivided: false,
|
|
215
|
+
firstColumnIsHeader: true,
|
|
216
|
+
firstRowIsHeader: false,
|
|
217
|
+
},
|
|
218
|
+
},
|
|
212
219
|
};
|
|
213
220
|
};
|
|
214
221
|
export const histogramIsSameData = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tableReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/tableReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IAIjB,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;
|
|
1
|
+
{"version":3,"file":"tableReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/tableReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IAIjB,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAsGF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAa9C,CAAC"}
|
|
@@ -84,6 +84,13 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
84
84
|
identifiers,
|
|
85
85
|
// hint: getHint(identifiers),
|
|
86
86
|
// correction: getCorrection(identifiers),
|
|
87
|
+
style: {
|
|
88
|
+
tableOptions: {
|
|
89
|
+
firstColumnIsHeader: true,
|
|
90
|
+
firstCellIsDivided: false,
|
|
91
|
+
firstRowIsHeader: true,
|
|
92
|
+
},
|
|
93
|
+
},
|
|
87
94
|
};
|
|
88
95
|
return question;
|
|
89
96
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"affineAdjustment.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/affineAdjustment.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;
|
|
1
|
+
{"version":3,"file":"affineAdjustment.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/affineAdjustment.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AA8KF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAa1D,CAAC"}
|
|
@@ -73,7 +73,13 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
73
73
|
keys: ["equal", "y", "x", "a", "b"],
|
|
74
74
|
answerFormat: "tex",
|
|
75
75
|
identifiers,
|
|
76
|
-
style: {
|
|
76
|
+
style: {
|
|
77
|
+
tableOptions: {
|
|
78
|
+
firstCellIsDivided: false,
|
|
79
|
+
firstColumnIsHeader: true,
|
|
80
|
+
firstRowIsHeader: false,
|
|
81
|
+
},
|
|
82
|
+
},
|
|
77
83
|
};
|
|
78
84
|
return question;
|
|
79
85
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"affineAdjustmentComplete.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/affineAdjustmentComplete.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAmBrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;
|
|
1
|
+
{"version":3,"file":"affineAdjustmentComplete.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/affineAdjustmentComplete.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAmBrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAgKF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CAalE,CAAC"}
|
|
@@ -52,7 +52,13 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
52
52
|
keys: [],
|
|
53
53
|
answerFormat: "tex",
|
|
54
54
|
identifiers,
|
|
55
|
-
style: {
|
|
55
|
+
style: {
|
|
56
|
+
tableOptions: {
|
|
57
|
+
firstCellIsDivided: false,
|
|
58
|
+
firstColumnIsHeader: true,
|
|
59
|
+
firstRowIsHeader: false,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
56
62
|
};
|
|
57
63
|
return question;
|
|
58
64
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"affineAdjustmentRsquared.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/affineAdjustmentRsquared.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAcrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;
|
|
1
|
+
{"version":3,"file":"affineAdjustmentRsquared.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/affineAdjustmentRsquared.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAcrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAqHF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CAalE,CAAC"}
|
|
@@ -43,7 +43,13 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
43
43
|
keys: ["R", "equal"],
|
|
44
44
|
answerFormat: "tex",
|
|
45
45
|
identifiers,
|
|
46
|
-
style: {
|
|
46
|
+
style: {
|
|
47
|
+
tableOptions: {
|
|
48
|
+
firstCellIsDivided: false,
|
|
49
|
+
firstColumnIsHeader: true,
|
|
50
|
+
firstRowIsHeader: false,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
47
53
|
};
|
|
48
54
|
return question;
|
|
49
55
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inverseImageFunctionTable.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/inverseImageFunctionTable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAWrC,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;
|
|
1
|
+
{"version":3,"file":"inverseImageFunctionTable.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/inverseImageFunctionTable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAWrC,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;AA2IF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAc3D,CAAC"}
|
|
@@ -70,7 +70,13 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
70
70
|
instruction: getInstruction(identifiers),
|
|
71
71
|
keys: ["et"],
|
|
72
72
|
answerFormat: "tex",
|
|
73
|
-
style: {
|
|
73
|
+
style: {
|
|
74
|
+
tableOptions: {
|
|
75
|
+
firstCellIsDivided: false,
|
|
76
|
+
firstColumnIsHeader: true,
|
|
77
|
+
firstRowIsHeader: false,
|
|
78
|
+
},
|
|
79
|
+
},
|
|
74
80
|
identifiers,
|
|
75
81
|
hint: getHint(identifiers),
|
|
76
82
|
correction: getCorrection(identifiers),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"placePointsFromValueTable.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/placePointsFromValueTable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAI7C,KAAK,WAAW,GAAG;IACjB,kBAAkB,EAAE,eAAe,EAAE,EAAE,CAAC;CACzC,CAAC;
|
|
1
|
+
{"version":3,"file":"placePointsFromValueTable.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/placePointsFromValueTable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAI7C,KAAK,WAAW,GAAG;IACjB,kBAAkB,EAAE,eAAe,EAAE,EAAE,CAAC;CACzC,CAAC;AA+JF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAiB3D,CAAC"}
|
|
@@ -107,6 +107,13 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
107
107
|
identifiers,
|
|
108
108
|
hint: getHint(identifiers),
|
|
109
109
|
correction: getCorrection(identifiers),
|
|
110
|
+
style: {
|
|
111
|
+
tableOptions: {
|
|
112
|
+
firstCellIsDivided: false,
|
|
113
|
+
firstColumnIsHeader: true,
|
|
114
|
+
firstRowIsHeader: false,
|
|
115
|
+
},
|
|
116
|
+
},
|
|
110
117
|
};
|
|
111
118
|
};
|
|
112
119
|
export const placePointsFromValueTable = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"squareRootCalculation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/sqrt/squareRootCalculation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAS7C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,eAAe,CAAC;CACpB,CAAC;
|
|
1
|
+
{"version":3,"file":"squareRootCalculation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/sqrt/squareRootCalculation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAS7C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,eAAe,CAAC;CACpB,CAAC;AAoGF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAmBvD,CAAC"}
|
|
@@ -35,9 +35,11 @@ const getAnswer = (identifiers) => {
|
|
|
35
35
|
const getInstruction = (identifiers) => {
|
|
36
36
|
const { x } = identifiers;
|
|
37
37
|
const sqrtExpression = sqrt(reifyAlgebraic(x));
|
|
38
|
-
return `
|
|
38
|
+
return `Calculer :
|
|
39
39
|
|
|
40
|
-
$$
|
|
40
|
+
$$
|
|
41
|
+
${sqrtExpression.toTex()}
|
|
42
|
+
$$`;
|
|
41
43
|
};
|
|
42
44
|
const getHint = (identifiers) => {
|
|
43
45
|
const { x } = identifiers;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { PointIdentifiers } from "../../../../math/geometry/point.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
pointsDict: Record<string, PointIdentifiers>;
|
|
5
|
+
nameCenterPoint: string;
|
|
6
|
+
nameSrcPoint: string;
|
|
7
|
+
nameDstPoint: string;
|
|
8
|
+
};
|
|
9
|
+
type Options = {
|
|
10
|
+
isPositiveFactorOnly: boolean;
|
|
11
|
+
factorTypes: string[];
|
|
12
|
+
};
|
|
13
|
+
export declare const homothetyFactorFromPoints: Exercise<Identifiers, Options>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=homothetyFactorFromPoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"homothetyFactorFromPoints.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidian/homothetyFactorFromPoints.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AA8DtC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC7C,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AA0SF,KAAK,OAAO,GAAG;IACb,oBAAoB,EAAE,OAAO,CAAC;IAC9B,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAyBF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAiBpE,CAAC"}
|