math-exercises 2.2.55 → 2.2.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/exercises/math/calcul/proportionality/index.d.ts +1 -0
- package/lib/exercises/math/calcul/proportionality/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/index.js +1 -0
- package/lib/exercises/math/calcul/proportionality/isTableProportional.d.ts +8 -0
- package/lib/exercises/math/calcul/proportionality/isTableProportional.d.ts.map +1 -0
- package/lib/exercises/math/calcul/proportionality/isTableProportional.js +91 -0
- package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.js +0 -1
- package/lib/exercises/math/functions/trinoms/coefficientsIdentification.d.ts +11 -0
- package/lib/exercises/math/functions/trinoms/coefficientsIdentification.d.ts.map +1 -0
- package/lib/exercises/math/functions/trinoms/coefficientsIdentification.js +131 -0
- package/lib/exercises/math/functions/trinoms/index.d.ts +1 -0
- package/lib/exercises/math/functions/trinoms/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/index.js +1 -0
- package/lib/exercises/math/functions/trinoms/summitAbscissFromDevForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAbscissFromDevForm.js +39 -1
- package/lib/exercises/math/geometry/areas/rightTriangleArea.js +2 -2
- package/lib/exercises/math/geometry/areas/triangleArea.js +2 -2
- package/lib/exercises/math/geometry/euclidianConstructions/buildTriangleWithSizes.d.ts +7 -0
- package/lib/exercises/math/geometry/euclidianConstructions/buildTriangleWithSizes.d.ts.map +1 -0
- package/lib/exercises/math/geometry/euclidianConstructions/buildTriangleWithSizes.js +117 -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/pointImageFromTranslation.d.ts +10 -0
- package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.d.ts.map +1 -0
- package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.js +102 -0
- package/lib/exercises/math/geometry/pythagore/pythagore.d.ts +2 -0
- package/lib/exercises/math/geometry/pythagore/pythagore.d.ts.map +1 -1
- package/lib/exercises/math/geometry/pythagore/pythagore.js +4 -3
- package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts +2 -0
- package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts.map +1 -1
- package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.js +4 -3
- package/lib/exercises/math/geometry/shapes/basicShapesNaming.d.ts.map +1 -1
- package/lib/exercises/math/geometry/shapes/basicShapesNaming.js +0 -1
- package/lib/exercises/math/geometry/thales/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/thales/index.js +1 -0
- package/lib/exercises/math/geometry/thales/thales.d.ts +7 -0
- package/lib/exercises/math/geometry/thales/thales.d.ts.map +1 -1
- package/lib/exercises/math/geometry/thales/thales.js +1 -1
- package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts +11 -5
- package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts.map +1 -1
- package/lib/exercises/math/geometry/thales/thalesCalcul.js +166 -118
- package/lib/exercises/math/geometry/thales/thalesCalculOld.d.ts +1 -0
- package/lib/exercises/math/geometry/thales/thalesCalculOld.d.ts.map +1 -0
- package/lib/exercises/math/geometry/thales/thalesCalculOld.js +214 -0
- package/lib/exercises/math/percent/index.d.ts +0 -1
- package/lib/exercises/math/percent/index.d.ts.map +1 -1
- package/lib/exercises/math/percent/index.js +0 -1
- package/lib/exercises/math/probaStat/binomial/binomialInequation.d.ts +16 -0
- package/lib/exercises/math/probaStat/binomial/binomialInequation.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/binomial/binomialInequation.js +159 -0
- package/lib/exercises/math/probaStat/binomial/calculateProbaOfBinomialDistribution.d.ts +13 -0
- package/lib/exercises/math/probaStat/binomial/calculateProbaOfBinomialDistribution.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/binomial/calculateProbaOfBinomialDistribution.js +106 -0
- package/lib/exercises/math/probaStat/binomial/expectedValueOfBinomialProba.d.ts +9 -0
- package/lib/exercises/math/probaStat/binomial/expectedValueOfBinomialProba.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/binomial/expectedValueOfBinomialProba.js +89 -0
- package/lib/exercises/math/probaStat/binomial/index.d.ts +5 -0
- package/lib/exercises/math/probaStat/binomial/index.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/binomial/index.js +20 -0
- package/lib/exercises/math/probaStat/binomial/varianceOfBinomialProba.d.ts +9 -0
- package/lib/exercises/math/probaStat/binomial/varianceOfBinomialProba.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/binomial/varianceOfBinomialProba.js +94 -0
- package/lib/exercises/math/probaStat/cardBasicProbas.d.ts +3 -0
- package/lib/exercises/math/probaStat/cardBasicProbas.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/cardBasicProbas.js +3 -2
- package/lib/exercises/math/probaStat/diceBasicProbas.d.ts +1 -0
- package/lib/exercises/math/probaStat/diceBasicProbas.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/diceBasicProbas.js +8 -4
- package/lib/exercises/math/probaStat/index.d.ts +1 -3
- package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/index.js +1 -3
- package/lib/exercises/math/probaStat/issuesCountingForCards.d.ts +2 -0
- package/lib/exercises/math/probaStat/issuesCountingForCards.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/issuesCountingForCards.js +1 -1
- package/lib/exercises/math/probaStat/probaFromTableNoContext.d.ts +4 -1
- package/lib/exercises/math/probaStat/probaFromTableNoContext.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaFromTableNoContext.js +17 -5
- package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.js +0 -1
- package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.d.ts +2 -0
- package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.js +4 -1
- package/lib/exercises/math/trigonometry/associatePoint.d.ts +3 -0
- package/lib/exercises/math/trigonometry/associatePoint.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/associatePoint.js +5 -1
- package/lib/exercises/math/trigonometry/trigonometry.js +2 -2
- package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.js +2 -2
- package/lib/exercises/math/trigonometry/trigonometrySideCalcul.js +2 -2
- package/lib/exercises/pc/calibrationCurveOfSolution.d.ts +1 -0
- package/lib/exercises/pc/calibrationCurveOfSolution.d.ts.map +1 -1
- package/lib/exercises/pc/calibrationCurveOfSolution.js +2 -0
- package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.d.ts +6 -1
- package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.d.ts.map +1 -1
- package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.js +1 -1
- package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.d.ts +4 -1
- package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.d.ts.map +1 -1
- package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.js +2 -1
- package/lib/exercises/pc/identifyAtomicMassOrAtomicNb.d.ts +2 -0
- package/lib/exercises/pc/identifyAtomicMassOrAtomicNb.d.ts.map +1 -1
- package/lib/exercises/pc/identifyAtomicMassOrAtomicNb.js +2 -0
- package/lib/exercises/pc/mole/molarMass.js +1 -1
- package/lib/exercises/pc/motion/typeOfAcceleration.d.ts +4 -1
- package/lib/exercises/pc/motion/typeOfAcceleration.d.ts.map +1 -1
- package/lib/exercises/pc/motion/typeOfAcceleration.js +5 -1
- package/lib/exercises/pc/motion/typeOfMovement.d.ts +4 -1
- package/lib/exercises/pc/motion/typeOfMovement.d.ts.map +1 -1
- package/lib/exercises/pc/motion/typeOfMovement.js +1 -1
- package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.d.ts +3 -1
- package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.d.ts.map +1 -1
- package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.js +1 -1
- package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts +3 -0
- package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts.map +1 -1
- package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts +4 -0
- package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts.map +1 -1
- package/lib/exercises/utils/geogebra/toolBarConstructor.js +8 -0
- package/lib/exercises/utils/getDistinctQuestions.d.ts.map +1 -1
- package/lib/exercises/utils/getDistinctQuestions.js +11 -4
- package/lib/index.d.ts +94 -26
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/CloudPoints.d.ts +5 -1
- package/lib/math/geometry/CloudPoints.d.ts.map +1 -1
- package/lib/math/geometry/CloudPoints.js +5 -0
- package/lib/math/geometry/line.d.ts +23 -1
- package/lib/math/geometry/line.d.ts.map +1 -1
- package/lib/math/geometry/line.js +53 -2
- package/lib/math/geometry/point.d.ts +15 -13
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +28 -12
- package/lib/math/geometry/segment.d.ts +11 -1
- package/lib/math/geometry/segment.d.ts.map +1 -1
- package/lib/math/geometry/segment.js +12 -0
- package/lib/math/geometry/triangle.d.ts +67 -0
- package/lib/math/geometry/triangle.d.ts.map +1 -0
- package/lib/math/geometry/triangle.js +227 -0
- package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
- package/lib/math/numbers/decimals/decimal.js +0 -2
- 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 +5 -0
- package/lib/math/polynomials/generalTrinom.d.ts +2 -2
- package/lib/math/polynomials/generalTrinom.d.ts.map +1 -1
- package/lib/math/probability/binomial.d.ts +10 -0
- package/lib/math/probability/binomial.d.ts.map +1 -0
- package/lib/math/probability/binomial.js +30 -0
- package/lib/math/sets/intervals/intervals.d.ts +1 -1
- package/lib/math/systems/generalSystem.d.ts +11 -0
- package/lib/math/systems/generalSystem.d.ts.map +1 -0
- package/lib/math/systems/generalSystem.js +79 -0
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +1 -4
- package/lib/server.js +0 -2
- package/lib/tree/nodes/geometry/pointNode.d.ts +1 -10
- package/lib/tree/nodes/geometry/pointNode.d.ts.map +1 -1
- package/lib/tree/nodes/inequations/inequationNode.js +1 -1
- package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts +2 -11
- package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts.map +1 -1
- package/lib/tree/nodes/node.d.ts +2 -1
- package/lib/tree/nodes/node.d.ts.map +1 -1
- package/lib/tree/nodes/node.js +1 -0
- package/lib/tree/nodes/nodeConstructor.d.ts +4 -3
- package/lib/tree/nodes/nodeConstructor.d.ts.map +1 -1
- package/lib/tree/nodes/nodeConstructor.js +4 -0
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +20 -8
- package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts +35 -0
- package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts.map +1 -0
- package/lib/tree/nodes/operators/binomialCoefficientNode.js +52 -0
- package/lib/tree/nodes/operators/fractionNode.d.ts +1 -1
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +2 -4
- package/lib/tree/nodes/operators/operatorNode.d.ts +2 -1
- package/lib/tree/nodes/operators/operatorNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/operatorNode.js +1 -0
- package/lib/tree/nodes/sets/intervalNode.d.ts +9 -10
- package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/intervalNode.js +1 -0
- package/lib/utils/alea/random.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/proportionality/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,mCAAmC,CAAC;AAClD,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,iCAAiC,CAAC;AAChD,cAAc,2CAA2C,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/proportionality/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,mCAAmC,CAAC;AAClD,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,iCAAiC,CAAC;AAChD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,uBAAuB,CAAC"}
|
|
@@ -20,3 +20,4 @@ __exportStar(require("./scaleCalculation"), exports);
|
|
|
20
20
|
__exportStar(require("./scaleUsage"), exports);
|
|
21
21
|
__exportStar(require("./isTableProportionalNonInteger"), exports);
|
|
22
22
|
__exportStar(require("./findCoeffInProportionalTableNonIntegers"), exports);
|
|
23
|
+
__exportStar(require("./isTableProportional"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isTableProportional.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/proportionality/isTableProportional.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AA6E5D,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAgBrD,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isTableProportional = void 0;
|
|
4
|
+
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const randTupleInt_1 = require("../../../../math/utils/random/randTupleInt");
|
|
7
|
+
const randint_1 = require("../../../../math/utils/random/randint");
|
|
8
|
+
const coinFlip_1 = require("../../../../utils/alea/coinFlip");
|
|
9
|
+
const doWhile_1 = require("../../../../utils/doWhile");
|
|
10
|
+
const dollarize_1 = require("../../../../utils/latex/dollarize");
|
|
11
|
+
const mdTable_1 = require("../../../../utils/markdown/mdTable");
|
|
12
|
+
const getInstruction = ({ xValues, yValues }) => {
|
|
13
|
+
return `Le tableau ci-dessous est-il un tableau de proportionnalité ?
|
|
14
|
+
|
|
15
|
+
${(0, mdTable_1.mdTable)([xValues.map((v) => (0, dollarize_1.dollarize)(v)), yValues.map((v) => (0, dollarize_1.dollarize)(v))])}
|
|
16
|
+
|
|
17
|
+
`;
|
|
18
|
+
};
|
|
19
|
+
const getIsTableProportionalQuestion = () => {
|
|
20
|
+
const xValues = (0, randTupleInt_1.randTupleInt)(3, {
|
|
21
|
+
from: 1,
|
|
22
|
+
to: 15,
|
|
23
|
+
allDifferent: true,
|
|
24
|
+
}).sort((a, b) => a - b);
|
|
25
|
+
const isProportionnal = (0, coinFlip_1.coinFlip)();
|
|
26
|
+
const coeff = (0, randint_1.randint)(2, 6);
|
|
27
|
+
const fakeCoeffs = [];
|
|
28
|
+
let yValues = [];
|
|
29
|
+
if (isProportionnal) {
|
|
30
|
+
yValues = xValues.map((value) => value * coeff);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
xValues.forEach((x) => {
|
|
34
|
+
const newCoeff = (0, doWhile_1.doWhile)(() => (0, randint_1.randint)(2, 6), (newX) => fakeCoeffs.length === 2 &&
|
|
35
|
+
fakeCoeffs[0] === newX &&
|
|
36
|
+
fakeCoeffs[1] === newX);
|
|
37
|
+
fakeCoeffs.push(newCoeff);
|
|
38
|
+
yValues.push(x * newCoeff);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
const identifiers = { xValues, yValues };
|
|
42
|
+
const question = {
|
|
43
|
+
answer: isProportionnal ? "Oui" : "Non",
|
|
44
|
+
instruction: getInstruction(identifiers),
|
|
45
|
+
keys: [],
|
|
46
|
+
answerFormat: "raw",
|
|
47
|
+
style: { tableHasNoHeader: true },
|
|
48
|
+
identifiers,
|
|
49
|
+
hint: "Pour passer de la ligne du haut à la ligne du bas, multiplie-t-on toujours par le même nombre ? Si oui, alors c'est un tableau de proportionnalité.",
|
|
50
|
+
correction: `On divise les nombres de la deuxième ligne par les nombres de la première ligne. Si on obtient toujours le même résultat, alors c'est un tableau de proportionnalité.
|
|
51
|
+
|
|
52
|
+
- $${yValues[0]}\\div ${xValues[0]} = ${yValues[0] / xValues[0]}$
|
|
53
|
+
|
|
54
|
+
- $${yValues[1]}\\div ${xValues[1]} = ${yValues[1] / xValues[1]}$
|
|
55
|
+
|
|
56
|
+
- $${yValues[2]}\\div ${xValues[2]} = ${yValues[2] / xValues[2]}$
|
|
57
|
+
|
|
58
|
+
${isProportionnal
|
|
59
|
+
? "Puisque tous les résultats sont égaux, c'est bien un tableau de proportionnalité."
|
|
60
|
+
: "Puisque les résultats ne sont pas tous égaux, ce n'est pas un tableau de proportionnalité."}
|
|
61
|
+
`,
|
|
62
|
+
};
|
|
63
|
+
return question;
|
|
64
|
+
};
|
|
65
|
+
const getPropositions = (n, { answer }) => {
|
|
66
|
+
const propositions = [];
|
|
67
|
+
(0, exercise_1.addValidProp)(propositions, answer, "raw");
|
|
68
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "Oui", "raw");
|
|
69
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "Non", "raw");
|
|
70
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "On ne peut pas savoir", "raw");
|
|
71
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
72
|
+
};
|
|
73
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
74
|
+
return ans === answer;
|
|
75
|
+
};
|
|
76
|
+
exports.isTableProportional = {
|
|
77
|
+
id: "isVTableProportional",
|
|
78
|
+
label: "Reconnaître un tableau de proportionnalité",
|
|
79
|
+
levels: ["5ème"],
|
|
80
|
+
isSingleStep: true,
|
|
81
|
+
sections: ["Proportionnalité"],
|
|
82
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getIsTableProportionalQuestion, nb),
|
|
83
|
+
qcmTimer: 60,
|
|
84
|
+
freeTimer: 60,
|
|
85
|
+
getPropositions,
|
|
86
|
+
isAnswerValid,
|
|
87
|
+
answerType: "QCU",
|
|
88
|
+
subject: "Mathématiques",
|
|
89
|
+
hasHintAndCorrection: true,
|
|
90
|
+
getInstruction,
|
|
91
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equationType4Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationType4Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAgBlC;;GAEG;AAEH,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;
|
|
1
|
+
{"version":3,"file":"equationType4Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationType4Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAgBlC;;GAEG;AAEH,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;AAwFF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAcvD,CAAC"}
|
|
@@ -65,7 +65,6 @@ const isAnswerValid = (ans, { a, b, c, d }) => {
|
|
|
65
65
|
// try {
|
|
66
66
|
// const parsed = equationSolutionParser(ans);
|
|
67
67
|
// if (!parsed) return false;
|
|
68
|
-
// console.log("parsed", parsed.toTex());
|
|
69
68
|
// const solution = new Rational(d - b, a - c).simplify().toTree();
|
|
70
69
|
// const solutionTex = solution.toTex();
|
|
71
70
|
// const decimal = round(solution.evaluate({}), 12).frenchify();
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
+
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
aIdentifiers: NodeIdentifiers;
|
|
5
|
+
bIdentifiers: NodeIdentifiers;
|
|
6
|
+
cIdentifiers: NodeIdentifiers;
|
|
7
|
+
isAsking: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const coefficientsIdentification: Exercise<Identifiers>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=coefficientsIdentification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coefficientsIdentification.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/coefficientsIdentification.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EAEL,eAAe,EAChB,MAAM,kCAAkC,CAAC;AAO1C,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,eAAe,CAAC;IAC9B,YAAY,EAAE,eAAe,CAAC;IAC9B,YAAY,EAAE,eAAe,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAmIF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAgB5D,CAAC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.coefficientsIdentification = void 0;
|
|
4
|
+
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const rational_1 = require("../../../../math/numbers/rationals/rational");
|
|
7
|
+
const generalTrinom_1 = require("../../../../math/polynomials/generalTrinom");
|
|
8
|
+
const randint_1 = require("../../../../math/utils/random/randint");
|
|
9
|
+
const nodeConstructor_1 = require("../../../../tree/nodes/nodeConstructor");
|
|
10
|
+
const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
|
|
11
|
+
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
12
|
+
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
13
|
+
const latexParser_1 = require("../../../../tree/parsers/latexParser");
|
|
14
|
+
const random_1 = require("../../../../utils/alea/random");
|
|
15
|
+
const getPropositions = (n, { answer, aIdentifiers, bIdentifiers, cIdentifiers, isAsking }) => {
|
|
16
|
+
const propositions = [];
|
|
17
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
18
|
+
const trinom = new generalTrinom_1.GeneralTrinom(nodeConstructor_1.NodeConstructor.fromIdentifiers(aIdentifiers), nodeConstructor_1.NodeConstructor.fromIdentifiers(bIdentifiers), nodeConstructor_1.NodeConstructor.fromIdentifiers(cIdentifiers));
|
|
19
|
+
if (answer === "1") {
|
|
20
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "0");
|
|
21
|
+
}
|
|
22
|
+
if (answer === "0") {
|
|
23
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "1");
|
|
24
|
+
}
|
|
25
|
+
if (answer === "-1") {
|
|
26
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "-");
|
|
27
|
+
}
|
|
28
|
+
const askedNode = isAsking === "a" ? trinom.a : isAsking === "b" ? trinom.b : trinom.c;
|
|
29
|
+
if ((0, fractionNode_1.isFractionNode)(askedNode)) {
|
|
30
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, askedNode.leftChild.toTex());
|
|
31
|
+
}
|
|
32
|
+
// si frac ajouter que le num
|
|
33
|
+
const monom = isAsking === "a"
|
|
34
|
+
? (0, multiplyNode_1.multiply)(trinom.a, (0, powerNode_1.square)("x")).simplify()
|
|
35
|
+
: isAsking === "b"
|
|
36
|
+
? (0, multiplyNode_1.multiply)(trinom.b, "x").simplify()
|
|
37
|
+
: trinom.c;
|
|
38
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, monom.toTex());
|
|
39
|
+
while (propositions.length < n) {
|
|
40
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, randint_1.randint)(-10, 10) + "");
|
|
41
|
+
}
|
|
42
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
43
|
+
};
|
|
44
|
+
const getAnswer = (identifiers) => {
|
|
45
|
+
const { aIdentifiers, bIdentifiers, cIdentifiers, isAsking } = identifiers;
|
|
46
|
+
return isAsking === "a"
|
|
47
|
+
? nodeConstructor_1.NodeConstructor.fromIdentifiers(aIdentifiers).toTex()
|
|
48
|
+
: isAsking === "b"
|
|
49
|
+
? nodeConstructor_1.NodeConstructor.fromIdentifiers(bIdentifiers).toTex()
|
|
50
|
+
: nodeConstructor_1.NodeConstructor.fromIdentifiers(cIdentifiers).toTex();
|
|
51
|
+
};
|
|
52
|
+
const getInstruction = (identifiers) => {
|
|
53
|
+
const trinom = new generalTrinom_1.GeneralTrinom(nodeConstructor_1.NodeConstructor.fromIdentifiers(identifiers.aIdentifiers), nodeConstructor_1.NodeConstructor.fromIdentifiers(identifiers.bIdentifiers), nodeConstructor_1.NodeConstructor.fromIdentifiers(identifiers.cIdentifiers));
|
|
54
|
+
return `Soit $f$ la fonction polynôme de degré $2$ définie sur $\\mathbb{R}$ par :
|
|
55
|
+
|
|
56
|
+
$$
|
|
57
|
+
f(x)=${trinom
|
|
58
|
+
.toTree()
|
|
59
|
+
.simplify({
|
|
60
|
+
// forceDistributeFractions: true,
|
|
61
|
+
forbidFactorize: true,
|
|
62
|
+
towardsDistribute: true,
|
|
63
|
+
})
|
|
64
|
+
.toTex()}
|
|
65
|
+
$$
|
|
66
|
+
|
|
67
|
+
Quelle est la valeur du coefficient $${identifiers.isAsking}$ de $f$ ?`;
|
|
68
|
+
};
|
|
69
|
+
// const getHint: GetHint<Identifiers> = (identifiers) => {};
|
|
70
|
+
// const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
|
|
71
|
+
const getKeys = (identifiers) => {
|
|
72
|
+
return [];
|
|
73
|
+
};
|
|
74
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
75
|
+
const parsed = (0, latexParser_1.parseAlgebraic)(ans);
|
|
76
|
+
if (!parsed)
|
|
77
|
+
return false;
|
|
78
|
+
return parsed.simplify().toTex() === answer;
|
|
79
|
+
};
|
|
80
|
+
const getCoefficientsIdentificationQuestion = () => {
|
|
81
|
+
const a = (0, random_1.random)([
|
|
82
|
+
(-1).toTree(),
|
|
83
|
+
(1).toTree(),
|
|
84
|
+
(0, randint_1.randint)(-10, 11, [-1, 0, 1]).toTree(),
|
|
85
|
+
rational_1.RationalConstructor.randomIrreductible().toTree(),
|
|
86
|
+
]);
|
|
87
|
+
const b = (0, random_1.random)([
|
|
88
|
+
(-1).toTree(),
|
|
89
|
+
(1).toTree(),
|
|
90
|
+
(0).toTree(),
|
|
91
|
+
(0, randint_1.randint)(-10, 10, [-1, 1, 0]).toTree(),
|
|
92
|
+
rational_1.RationalConstructor.randomIrreductible().toTree(),
|
|
93
|
+
]);
|
|
94
|
+
const c = (0, random_1.random)([
|
|
95
|
+
(0).toTree(),
|
|
96
|
+
(0, randint_1.randint)(-10, 11, [0]).toTree(),
|
|
97
|
+
rational_1.RationalConstructor.randomIrreductible().toTree(),
|
|
98
|
+
]);
|
|
99
|
+
const isAsking = (0, random_1.random)(["a", "b", "c"]);
|
|
100
|
+
const identifiers = {
|
|
101
|
+
aIdentifiers: a.toIdentifiers(),
|
|
102
|
+
bIdentifiers: b.toIdentifiers(),
|
|
103
|
+
cIdentifiers: c.toIdentifiers(),
|
|
104
|
+
isAsking,
|
|
105
|
+
};
|
|
106
|
+
const question = {
|
|
107
|
+
answer: getAnswer(identifiers),
|
|
108
|
+
instruction: getInstruction(identifiers),
|
|
109
|
+
keys: getKeys(identifiers),
|
|
110
|
+
answerFormat: "tex",
|
|
111
|
+
identifiers,
|
|
112
|
+
// hint: getHint(identifiers),
|
|
113
|
+
// correction: getCorrection(identifiers),
|
|
114
|
+
};
|
|
115
|
+
return question;
|
|
116
|
+
};
|
|
117
|
+
exports.coefficientsIdentification = {
|
|
118
|
+
id: "coefficientsIdentification",
|
|
119
|
+
connector: "=",
|
|
120
|
+
label: "Reconnaître les coefficients d'un trinôme exprimé sous forme développée",
|
|
121
|
+
isSingleStep: true,
|
|
122
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getCoefficientsIdentificationQuestion, nb),
|
|
123
|
+
qcmTimer: 60,
|
|
124
|
+
freeTimer: 60,
|
|
125
|
+
getPropositions,
|
|
126
|
+
isAnswerValid,
|
|
127
|
+
subject: "Mathématiques",
|
|
128
|
+
// getHint,
|
|
129
|
+
// getCorrection,
|
|
130
|
+
getAnswer,
|
|
131
|
+
};
|
|
@@ -18,4 +18,5 @@ export * from "./trinomialMeanValue";
|
|
|
18
18
|
export * from "./solveSecondDegreeEquationByFactorisation";
|
|
19
19
|
export * from "./solveSecondDegreeEquationFromCano";
|
|
20
20
|
export * from "./trinomSignFromRoots";
|
|
21
|
+
export * from "./coefficientsIdentification";
|
|
21
22
|
//# 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;AACrC,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC;AACpD,cAAc,uBAAuB,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;AACpD,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC"}
|
|
@@ -34,3 +34,4 @@ __exportStar(require("./trinomialMeanValue"), exports);
|
|
|
34
34
|
__exportStar(require("./solveSecondDegreeEquationByFactorisation"), exports);
|
|
35
35
|
__exportStar(require("./solveSecondDegreeEquationFromCano"), exports);
|
|
36
36
|
__exportStar(require("./trinomSignFromRoots"), exports);
|
|
37
|
+
__exportStar(require("./coefficientsIdentification"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summitAbscissFromDevForm.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/summitAbscissFromDevForm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"summitAbscissFromDevForm.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/summitAbscissFromDevForm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAgFF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAkB1D,CAAC"}
|
|
@@ -6,10 +6,15 @@ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQ
|
|
|
6
6
|
const rational_1 = require("../../../../math/numbers/rationals/rational");
|
|
7
7
|
const trinom_1 = require("../../../../math/polynomials/trinom");
|
|
8
8
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
9
|
+
const oppositeNode_1 = require("../../../../tree/nodes/functions/oppositeNode");
|
|
10
|
+
const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
|
|
11
|
+
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
12
|
+
const alignTex_1 = require("../../../../utils/latex/alignTex");
|
|
9
13
|
const getSummitAbscissFromDevFormQuestion = () => {
|
|
10
14
|
const trinom = trinom_1.TrinomConstructor.random();
|
|
11
15
|
const alpha = trinom.getAlphaNode();
|
|
12
16
|
const answer = alpha.toTex();
|
|
17
|
+
const identifiers = { a: trinom.a, b: trinom.b, c: trinom.c };
|
|
13
18
|
const question = {
|
|
14
19
|
answer,
|
|
15
20
|
instruction: `Soit $f(x) = ${trinom
|
|
@@ -17,7 +22,9 @@ const getSummitAbscissFromDevFormQuestion = () => {
|
|
|
17
22
|
.toTex()}$ une fonction polynôme du second degré. Quelle est l'abscisse du sommet de la parabole représentant $f$ ?`,
|
|
18
23
|
keys: [],
|
|
19
24
|
answerFormat: "tex",
|
|
20
|
-
identifiers
|
|
25
|
+
identifiers,
|
|
26
|
+
hint: getHint(identifiers),
|
|
27
|
+
correction: getCorrection(identifiers),
|
|
21
28
|
};
|
|
22
29
|
return question;
|
|
23
30
|
};
|
|
@@ -31,6 +38,34 @@ const getPropositions = (n, { answer, a, b, c }) => {
|
|
|
31
38
|
}
|
|
32
39
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
33
40
|
};
|
|
41
|
+
const getHint = (identifiers) => {
|
|
42
|
+
return `L'abscisse $\\alpha$ du sommet d'une parabole s'obtient à partir de la forme développée $f(x) = ax^2 + bx +c$ via la formule :
|
|
43
|
+
|
|
44
|
+
$$
|
|
45
|
+
\\alpha = \\frac{-b}{2a}
|
|
46
|
+
$$`;
|
|
47
|
+
};
|
|
48
|
+
const getCorrection = (identifiers) => {
|
|
49
|
+
const { a, b, c } = identifiers;
|
|
50
|
+
const alpha = (0, fractionNode_1.frac)((0, oppositeNode_1.opposite)(b), (0, multiplyNode_1.multiply)(2, a), {
|
|
51
|
+
allowMinusAnywhereInFraction: true,
|
|
52
|
+
});
|
|
53
|
+
return `On sait que l'abscisse $\\alpha$ du sommet de la parabole vaut :
|
|
54
|
+
|
|
55
|
+
$$
|
|
56
|
+
\\alpha = \\frac{-b}{2a}
|
|
57
|
+
$$
|
|
58
|
+
|
|
59
|
+
Ici, $a=${a}$ et $b=${b}$.
|
|
60
|
+
|
|
61
|
+
Donc,
|
|
62
|
+
|
|
63
|
+
${(0, alignTex_1.alignTex)([
|
|
64
|
+
["\\alpha", "=", alpha.toTex()],
|
|
65
|
+
["", "=", alpha.simplify().toTex()],
|
|
66
|
+
])}
|
|
67
|
+
`;
|
|
68
|
+
};
|
|
34
69
|
const isAnswerValid = (ans, { a, b, c }) => {
|
|
35
70
|
const node = new rational_1.Rational(-b, 2 * a).simplify().toTree();
|
|
36
71
|
const texs = node.toAllValidTexs({
|
|
@@ -51,5 +86,8 @@ exports.summitAbscissFromDevForm = {
|
|
|
51
86
|
freeTimer: 60,
|
|
52
87
|
getPropositions,
|
|
53
88
|
isAnswerValid,
|
|
89
|
+
hasHintAndCorrection: true,
|
|
90
|
+
getHint,
|
|
91
|
+
getCorrection,
|
|
54
92
|
subject: "Mathématiques",
|
|
55
93
|
};
|
|
@@ -4,7 +4,7 @@ exports.rightTriangleArea = void 0;
|
|
|
4
4
|
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
6
|
const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor");
|
|
7
|
-
const
|
|
7
|
+
const triangle_1 = require("../../../../math/geometry/triangle");
|
|
8
8
|
const rational_1 = require("../../../../math/numbers/rationals/rational");
|
|
9
9
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
10
10
|
const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
@@ -13,7 +13,7 @@ const getRightTriangleArea = () => {
|
|
|
13
13
|
const code = 65 + (0, randint_1.randint)(0, 24); // Générer un code de caractère majuscule aléatoire (A-Z)
|
|
14
14
|
for (let i = 0; i < 3; i++)
|
|
15
15
|
vertices.push(String.fromCharCode(code + i));
|
|
16
|
-
const triangle =
|
|
16
|
+
const triangle = triangle_1.TriangleConstructor.createRandomRightTriangle({
|
|
17
17
|
minRapport: 0.4,
|
|
18
18
|
maxRapport: 1.6,
|
|
19
19
|
names: vertices,
|
|
@@ -4,7 +4,7 @@ exports.triangleArea = void 0;
|
|
|
4
4
|
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
6
|
const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor");
|
|
7
|
-
const
|
|
7
|
+
const triangle_1 = require("../../../../math/geometry/triangle");
|
|
8
8
|
const rational_1 = require("../../../../math/numbers/rationals/rational");
|
|
9
9
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
10
10
|
const randomLetter_1 = require("../../../../utils/strings/randomLetter");
|
|
@@ -14,7 +14,7 @@ const getTriangleArea = () => {
|
|
|
14
14
|
const code = 65 + (0, randint_1.randint)(0, 24); // Générer un code de caractère majuscule aléatoire (A-Z)
|
|
15
15
|
for (let i = 0; i < 3; i++)
|
|
16
16
|
vertices.push(String.fromCharCode(code + i));
|
|
17
|
-
const triangle =
|
|
17
|
+
const triangle = triangle_1.TriangleConstructor.createRandomTriangle({
|
|
18
18
|
minAngle: 0.69,
|
|
19
19
|
maxAngle: 1.5,
|
|
20
20
|
names: vertices,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildTriangleWithSizes.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidianConstructions/buildTriangleWithSizes.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAalC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAuGF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAcxD,CAAC"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildTriangleWithSizes = void 0;
|
|
4
|
+
const toolBarConstructor_1 = require("../../../../exercises/utils/geogebra/toolBarConstructor");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor");
|
|
7
|
+
const ggbPointToCoords_1 = require("../../../../geogebra/parsers/ggbPointToCoords");
|
|
8
|
+
const parseGGBPoints_1 = require("../../../../geogebra/parsers/parseGGBPoints");
|
|
9
|
+
const point_1 = require("../../../../math/geometry/point");
|
|
10
|
+
const segment_1 = require("../../../../math/geometry/segment");
|
|
11
|
+
const randfloat_1 = require("../../../../math/utils/random/randfloat");
|
|
12
|
+
const round_1 = require("../../../../math/utils/round");
|
|
13
|
+
const arrayEqual_1 = require("../../../../utils/arrays/arrayEqual");
|
|
14
|
+
const getInstruction = (identifiers) => {
|
|
15
|
+
return `Construire un triangle dont les côtés mesurent $${identifiers.lengths[0].frenchify()}$ cm, $${identifiers.lengths[1].frenchify()}$ cm et $${identifiers.lengths[2].frenchify()}$ cm.`;
|
|
16
|
+
};
|
|
17
|
+
// const getHint: GetHint<Identifiers> = (identifiers) => {};
|
|
18
|
+
// const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
|
|
19
|
+
const getGGBAnswer = (identifiers) => {
|
|
20
|
+
return [
|
|
21
|
+
`A=(0,0)`,
|
|
22
|
+
`B=Point(Circle(A,${identifiers.lengths[0]}))`,
|
|
23
|
+
`C_1 = Circle(B,${identifiers.lengths[1]})`,
|
|
24
|
+
`C_2 = Circle(A,${identifiers.lengths[2]})`,
|
|
25
|
+
`C = Intersect(C_1,C_2,1)`,
|
|
26
|
+
`Polygon(A,B,C)`,
|
|
27
|
+
];
|
|
28
|
+
};
|
|
29
|
+
const getStudentGGBOptions = (identifiers) => {
|
|
30
|
+
const ggb = new geogebraConstructor_1.GeogebraConstructor({
|
|
31
|
+
commands: [],
|
|
32
|
+
customToolBar: (0, toolBarConstructor_1.toolBarConstructor)({
|
|
33
|
+
point: true,
|
|
34
|
+
intersect: true,
|
|
35
|
+
circleRadius: true,
|
|
36
|
+
// circleTwoPoints: true,
|
|
37
|
+
// segment: true,
|
|
38
|
+
segmentFixed: true,
|
|
39
|
+
polygon: true,
|
|
40
|
+
}),
|
|
41
|
+
hideAxes: true,
|
|
42
|
+
hideGrid: true,
|
|
43
|
+
});
|
|
44
|
+
return ggb.getOptions({
|
|
45
|
+
coords: [-8, 8, -8, 8],
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
const isGGBAnswerValid = (ans, { ggbAnswer, lengths }) => {
|
|
49
|
+
let points = [];
|
|
50
|
+
const polygone = ans.find((c) => c.includes("Polygon"));
|
|
51
|
+
if (polygone) {
|
|
52
|
+
const names = polygone
|
|
53
|
+
.split("=")[1]
|
|
54
|
+
.replace("(", "")
|
|
55
|
+
.replace(")", "")
|
|
56
|
+
.replace("[", "")
|
|
57
|
+
.replace("]", "")
|
|
58
|
+
.replace("Polygon", "")
|
|
59
|
+
.replaceAll(" ", "")
|
|
60
|
+
.split(",");
|
|
61
|
+
points = names.map((n) => {
|
|
62
|
+
const command = ans.find((c) => c.startsWith(n + "="));
|
|
63
|
+
if (!command)
|
|
64
|
+
throw Error("Point not found");
|
|
65
|
+
return (0, ggbPointToCoords_1.ggbPointToCoords)(command.split("=")[1]);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
points = (0, parseGGBPoints_1.parseGGBPoints)(ans).map((c) => (0, ggbPointToCoords_1.ggbPointToCoords)(c));
|
|
70
|
+
}
|
|
71
|
+
if (points.length !== 3) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
const pointsNode = points.map((p, i) => new point_1.Point("P" + i, p.x.toTree(), p.y.toTree()));
|
|
75
|
+
const lengthsAns = pointsNode
|
|
76
|
+
.map((p, i) => new segment_1.Segment(p, pointsNode[(i + 1) % 3]))
|
|
77
|
+
.map((s) => (0, round_1.round)(s.getLength(), 1))
|
|
78
|
+
.sort((a, b) => a - b);
|
|
79
|
+
const sortedExpected = lengths.sort((a, b) => a - b);
|
|
80
|
+
return (0, arrayEqual_1.arrayEqual)(lengthsAns, sortedExpected);
|
|
81
|
+
};
|
|
82
|
+
const getBuildTriangleWithSizesQuestion = () => {
|
|
83
|
+
const lengths = [];
|
|
84
|
+
let a, b, c;
|
|
85
|
+
do {
|
|
86
|
+
a = (0, randfloat_1.randfloat)(1, 10, 1);
|
|
87
|
+
b = (0, randfloat_1.randfloat)(1, 10, 1);
|
|
88
|
+
c = (0, randfloat_1.randfloat)(1, 10, 1);
|
|
89
|
+
} while (a + b < c || a + c < b || b + c < a);
|
|
90
|
+
lengths.push(a, b, c);
|
|
91
|
+
const identifiers = {
|
|
92
|
+
lengths,
|
|
93
|
+
};
|
|
94
|
+
const question = {
|
|
95
|
+
ggbAnswer: getGGBAnswer(identifiers),
|
|
96
|
+
instruction: getInstruction(identifiers),
|
|
97
|
+
studentGgbOptions: getStudentGGBOptions(identifiers),
|
|
98
|
+
identifiers,
|
|
99
|
+
// hint: getHint(identifiers),
|
|
100
|
+
// correction: getCorrection(identifiers),
|
|
101
|
+
};
|
|
102
|
+
return question;
|
|
103
|
+
};
|
|
104
|
+
exports.buildTriangleWithSizes = {
|
|
105
|
+
id: "buildTriangleWithSizes",
|
|
106
|
+
label: "Construire un triangle en connaissant les longueurs de ses côtés",
|
|
107
|
+
isSingleStep: true,
|
|
108
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getBuildTriangleWithSizesQuestion, nb),
|
|
109
|
+
ggbTimer: 60,
|
|
110
|
+
isGGBAnswerValid,
|
|
111
|
+
subject: "Mathématiques",
|
|
112
|
+
// getHint,
|
|
113
|
+
// getCorrection,
|
|
114
|
+
getGGBAnswer,
|
|
115
|
+
getStudentGGBOptions,
|
|
116
|
+
answerType: "GGB",
|
|
117
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidianConstructions/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidianConstructions/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC"}
|
|
@@ -15,3 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./buildMediatriceWithCompass"), exports);
|
|
18
|
+
__exportStar(require("./buildTriangleWithSizes"), exports);
|
|
19
|
+
__exportStar(require("./pointImageFromTranslation"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
+
import { PointIdentifiers } from "../../../../math/geometry/point";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
points: PointIdentifiers[];
|
|
5
|
+
startPoint: string;
|
|
6
|
+
translationPoints: string[];
|
|
7
|
+
};
|
|
8
|
+
export declare const pointImageFromTranslation: Exercise<Identifiers>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=pointImageFromTranslation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pointImageFromTranslation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAGL,gBAAgB,EACjB,MAAM,2BAA2B,CAAC;AAMnC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B,CAAC;AAgHF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAc3D,CAAC"}
|