math-exercises 3.0.172 → 3.0.173
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/functions/trinoms/devForm/variationsFromAlgebricForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.js +12 -0
- package/lib/exercises/math/functions/trinoms/parabole/index.d.ts +2 -0
- package/lib/exercises/math/functions/trinoms/parabole/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/parabole/index.js +2 -0
- package/lib/exercises/math/functions/trinoms/parabole/parabolaVarTable.d.ts +8 -0
- package/lib/exercises/math/functions/trinoms/parabole/parabolaVarTable.d.ts.map +1 -0
- package/lib/exercises/math/functions/trinoms/parabole/parabolaVarTable.js +106 -0
- package/lib/exercises/math/functions/trinoms/parabole/paraboleSolveGraphEquation.d.ts +14 -0
- package/lib/exercises/math/functions/trinoms/parabole/paraboleSolveGraphEquation.d.ts.map +1 -0
- package/lib/exercises/math/functions/trinoms/parabole/paraboleSolveGraphEquation.js +186 -0
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.d.ts +6 -2
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.js +98 -13
- package/lib/exercises/math/geometry/lines/index.d.ts +1 -0
- package/lib/exercises/math/geometry/lines/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/index.js +1 -0
- package/lib/exercises/math/geometry/lines/readLineNormalVectorOnGraph.d.ts +13 -0
- package/lib/exercises/math/geometry/lines/readLineNormalVectorOnGraph.d.ts.map +1 -0
- package/lib/exercises/math/geometry/lines/readLineNormalVectorOnGraph.js +195 -0
- package/lib/exercises/math/probaStat/randomVariable/index.d.ts +1 -0
- package/lib/exercises/math/probaStat/randomVariable/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/index.js +1 -0
- package/lib/exercises/math/probaStat/randomVariable/missingValueInRandomVariableProbabilityLaw.d.ts +9 -0
- package/lib/exercises/math/probaStat/randomVariable/missingValueInRandomVariableProbabilityLaw.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/missingValueInRandomVariableProbabilityLaw.js +119 -0
- package/lib/exercises/math/python/sequences/index.d.ts +8 -0
- package/lib/exercises/math/python/sequences/index.d.ts.map +1 -0
- package/lib/exercises/math/python/sequences/index.js +7 -0
- package/lib/exercises/math/python/sequences/pySequenceFactorialInstructionFalseOneOut.d.ts +11 -0
- package/lib/exercises/math/python/sequences/pySequenceFactorialInstructionFalseOneOut.d.ts.map +1 -0
- package/lib/exercises/math/python/sequences/pySequenceFactorialInstructionFalseOneOut.js +274 -0
- package/lib/exercises/math/python/sequences/pySequenceFirstTermsListInstructionCompletion.d.ts +12 -0
- package/lib/exercises/math/python/sequences/pySequenceFirstTermsListInstructionCompletion.d.ts.map +1 -0
- package/lib/exercises/math/python/sequences/pySequenceFirstTermsListInstructionCompletion.js +368 -0
- package/lib/exercises/math/python/sequences/pySequenceFirstTermsSumInstructionCompletion.d.ts +13 -0
- package/lib/exercises/math/python/sequences/pySequenceFirstTermsSumInstructionCompletion.d.ts.map +1 -0
- package/lib/exercises/math/python/sequences/pySequenceFirstTermsSumInstructionCompletion.js +254 -0
- package/lib/exercises/math/python/sequences/pySequenceProgramReading.d.ts +14 -0
- package/lib/exercises/math/python/sequences/pySequenceProgramReading.d.ts.map +1 -0
- package/lib/exercises/math/python/sequences/pySequenceProgramReading.js +365 -0
- package/lib/exercises/math/python/sequences/pySequenceTermForLoopInstructionCompletion.d.ts +11 -0
- package/lib/exercises/math/python/sequences/pySequenceTermForLoopInstructionCompletion.d.ts.map +1 -0
- package/lib/exercises/math/python/sequences/pySequenceTermForLoopInstructionCompletion.js +298 -0
- package/lib/exercises/math/python/sequences/pySequenceTermFromFunctionCallInstructionCompletion.d.ts +12 -0
- package/lib/exercises/math/python/sequences/pySequenceTermFromFunctionCallInstructionCompletion.d.ts.map +1 -0
- package/lib/exercises/math/python/sequences/pySequenceTermFromFunctionCallInstructionCompletion.js +408 -0
- package/lib/exercises/math/python/sequences/pySequenceThresholdInstructionCompletion.d.ts +17 -0
- package/lib/exercises/math/python/sequences/pySequenceThresholdInstructionCompletion.d.ts.map +1 -0
- package/lib/exercises/math/python/sequences/pySequenceThresholdInstructionCompletion.js +498 -0
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFromTwoTerms.d.ts +12 -0
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFromTwoTerms.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFromTwoTerms.js +191 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindExplicitFormulaFromSituation.d.ts +14 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindExplicitFormulaFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindExplicitFormulaFromSituation.js +153 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.d.ts +15 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.js +184 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRecurrenceFormulaFromSituation.d.ts +14 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRecurrenceFormulaFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRecurrenceFormulaFromSituation.js +210 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindTermFromSituation.d.ts +15 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindTermFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindTermFromSituation.js +161 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindThresholdFromSituation.d.ts +17 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindThresholdFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindThresholdFromSituation.js +188 -0
- package/lib/exercises/math/sequences/arithmetic/situations/index.d.ts +6 -0
- package/lib/exercises/math/sequences/arithmetic/situations/index.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/situations/index.js +5 -0
- package/lib/exercises/math/sequences/arithmetic/sum/arithmeticComputeSumWithDots.d.ts +15 -0
- package/lib/exercises/math/sequences/arithmetic/sum/arithmeticComputeSumWithDots.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/sum/arithmeticComputeSumWithDots.js +233 -0
- package/lib/exercises/math/sequences/arithmetic/sum/arithmeticFirstTermsSum.d.ts +13 -0
- package/lib/exercises/math/sequences/arithmetic/sum/arithmeticFirstTermsSum.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/sum/arithmeticFirstTermsSum.js +111 -0
- package/lib/exercises/math/sequences/arithmetic/sum/arithmeticFirstTermsSumThreshold.d.ts +13 -0
- package/lib/exercises/math/sequences/arithmetic/sum/arithmeticFirstTermsSumThreshold.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/sum/arithmeticFirstTermsSumThreshold.js +216 -0
- package/lib/exercises/math/sequences/arithmetic/sum/firstIntegersSum.d.ts +7 -0
- package/lib/exercises/math/sequences/arithmetic/sum/firstIntegersSum.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/sum/firstIntegersSum.js +94 -0
- package/lib/exercises/math/sequences/arithmetic/sum/index.d.ts +5 -0
- package/lib/exercises/math/sequences/arithmetic/sum/index.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/sum/index.js +4 -0
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoTerms.d.ts +14 -0
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoTerms.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoTerms.js +301 -0
- package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoTerms.d.ts +15 -0
- package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoTerms.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoTerms.js +260 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindExplicitFormulaFromSituation.d.ts +14 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindExplicitFormulaFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindExplicitFormulaFromSituation.js +186 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindRankFromSituation.d.ts +15 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindRankFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindRankFromSituation.js +142 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindRecurrenceFormulaFromSituation.d.ts +14 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindRecurrenceFormulaFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindRecurrenceFormulaFromSituation.js +205 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindTermFromSituation.d.ts +15 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindTermFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindTermFromSituation.js +208 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindThresholdFromSituation.d.ts +17 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindThresholdFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindThresholdFromSituation.js +152 -0
- package/lib/exercises/math/sequences/geometric/situations/index.d.ts +4 -0
- package/lib/exercises/math/sequences/geometric/situations/index.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/situations/index.js +5 -0
- package/lib/exercises/math/sequences/geometric/sum/geometricComputeSumWithDots.d.ts +15 -0
- package/lib/exercises/math/sequences/geometric/sum/geometricComputeSumWithDots.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/sum/geometricComputeSumWithDots.js +248 -0
- package/lib/exercises/math/sequences/geometric/sum/geometricFirstTermsGeneralSum.d.ts +14 -0
- package/lib/exercises/math/sequences/geometric/sum/geometricFirstTermsGeneralSum.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/sum/geometricFirstTermsGeneralSum.js +126 -0
- package/lib/exercises/math/sequences/geometric/sum/geometricFirstTermsSum.d.ts +8 -0
- package/lib/exercises/math/sequences/geometric/sum/geometricFirstTermsSum.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/sum/geometricFirstTermsSum.js +91 -0
- package/lib/exercises/math/sequences/geometric/sum/index.d.ts +4 -0
- package/lib/exercises/math/sequences/geometric/sum/index.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/sum/index.js +3 -0
- package/lib/exercises/math/sequences/seqArithmGeom/index.d.ts +2 -0
- package/lib/exercises/math/sequences/seqArithmGeom/index.d.ts.map +1 -0
- package/lib/exercises/math/sequences/seqArithmGeom/index.js +1 -0
- package/lib/exercises/math/sequences/seqArithmGeom/seqArithmGeomRecurrenceFormulaUsage.d.ts +14 -0
- package/lib/exercises/math/sequences/seqArithmGeom/seqArithmGeomRecurrenceFormulaUsage.d.ts.map +1 -0
- package/lib/exercises/math/sequences/seqArithmGeom/seqArithmGeomRecurrenceFormulaUsage.js +202 -0
- package/lib/exercises/options/optionFirstTermRankOne.d.ts +16 -0
- package/lib/exercises/options/optionFirstTermRankOne.d.ts.map +1 -0
- package/lib/exercises/options/optionFirstTermRankOne.js +17 -0
- package/lib/exercises/options/optionIsUsePythonDef.d.ts +16 -0
- package/lib/exercises/options/optionIsUsePythonDef.d.ts.map +1 -0
- package/lib/exercises/options/optionIsUsePythonDef.js +17 -0
- package/lib/exercises/options/optionIsWithSuperfluousData.d.ts +16 -0
- package/lib/exercises/options/optionIsWithSuperfluousData.d.ts.map +1 -0
- package/lib/exercises/options/optionIsWithSuperfluousData.js +17 -0
- package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts +1 -0
- package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts.map +1 -1
- package/lib/exercises/vea/colinearVectorVEA.d.ts +2 -0
- package/lib/exercises/vea/colinearVectorVEA.d.ts.map +1 -0
- package/lib/exercises/vea/colinearVectorVEA.js +11 -0
- package/lib/exercises/vea/varLineVEA.d.ts.map +1 -1
- package/lib/exercises/vea/varLineVEA.js +5 -2
- package/lib/index.d.ts +25 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/line.d.ts +1 -1
- package/lib/math/geometry/line.d.ts.map +1 -1
- package/lib/math/geometry/line.js +3 -3
- package/lib/math/geometry/point.d.ts +1 -1
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +4 -1
- package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts +53 -0
- package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts.map +1 -0
- package/lib/math/utils/sequences/situations/seqArithmeticSituations.js +1928 -0
- package/lib/math/utils/sequences/situations/seqArithmeticUtils.d.ts +15 -0
- package/lib/math/utils/sequences/situations/seqArithmeticUtils.d.ts.map +1 -0
- package/lib/math/utils/sequences/situations/seqArithmeticUtils.js +136 -0
- package/lib/math/utils/sequences/situations/seqGeometricSituations.d.ts +42 -0
- package/lib/math/utils/sequences/situations/seqGeometricSituations.d.ts.map +1 -0
- package/lib/math/utils/sequences/situations/seqGeometricSituations.js +932 -0
- package/lib/math/utils/sequences/situations/seqGeometricUtils.d.ts +12 -0
- package/lib/math/utils/sequences/situations/seqGeometricUtils.d.ts.map +1 -0
- package/lib/math/utils/sequences/situations/seqGeometricUtils.js +90 -0
- package/lib/tests/exosTest.d.ts.map +1 -1
- package/lib/tests/exosTest.js +0 -2
- package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts +3 -3
- package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/binomialCoefficientNode.js +6 -3
- package/lib/tree/parsers/vectorParser.d.ts.map +1 -1
- package/lib/tree/parsers/vectorParser.js +8 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variationsFromAlgebricForm.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"variationsFromAlgebricForm.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,OAAO,CAAC;CACjC,CAAC;AAiIF,KAAK,OAAO,GAAG;IACb,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;AAuBF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgBrE,CAAC"}
|
|
@@ -115,6 +115,17 @@ const options = [
|
|
|
115
115
|
defaultValue: ["Forme canonique", "Forme factorisée", "Forme développée"],
|
|
116
116
|
},
|
|
117
117
|
];
|
|
118
|
+
const validateOptions = (opts) => {
|
|
119
|
+
if (!opts?.form?.length)
|
|
120
|
+
return {
|
|
121
|
+
valid: false,
|
|
122
|
+
message: "Veuillez choisir au moins un type de forme algébrique.",
|
|
123
|
+
};
|
|
124
|
+
return {
|
|
125
|
+
valid: true,
|
|
126
|
+
message: "",
|
|
127
|
+
};
|
|
128
|
+
};
|
|
118
129
|
export const variationsFromAlgebricForm = {
|
|
119
130
|
id: "variationsFromAlgebricForm",
|
|
120
131
|
label: "Déterminer les variations d'une fonction du second degré via sa forme algébrique",
|
|
@@ -128,4 +139,5 @@ export const variationsFromAlgebricForm = {
|
|
|
128
139
|
getQuestionFromIdentifiers,
|
|
129
140
|
options,
|
|
130
141
|
hasHintAndCorrection: true,
|
|
142
|
+
validateOptions,
|
|
131
143
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/parabole/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/parabole/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parabolaVarTable.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/parabole/parabolaVarTable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;CACvB,CAAC;AAsGF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAmBlD,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
|
|
2
|
+
import { varTableVEA } from "../../../../../exercises/vea/varTableVEA.js";
|
|
3
|
+
import { GeogebraConstructor } from "../../../../../geogebra/geogebraConstructor.js";
|
|
4
|
+
import { Trinom, TrinomConstructor } from "../../../../../math/polynomials/trinom.js";
|
|
5
|
+
import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
|
|
6
|
+
const getInstruction = () => {
|
|
7
|
+
return `Dresser le tableau de variations de la fonction $f$ définie sur $\\mathbb{R}$ dont la parabole représentative est donnée ci-dessous :`;
|
|
8
|
+
};
|
|
9
|
+
const getAnswerTable = (identifiers) => {
|
|
10
|
+
const { coeffs } = identifiers;
|
|
11
|
+
const [c, b, a] = coeffs;
|
|
12
|
+
const poly = new Trinom(a, b, c);
|
|
13
|
+
const alpha = poly.getAlphaNode();
|
|
14
|
+
const beta = poly.getBetaNode();
|
|
15
|
+
const vars = coeffs[2] > 0 ? ["\\searrow", "\\nearrow"] : ["\\nearrow", "\\searrow"];
|
|
16
|
+
return [
|
|
17
|
+
["$x$", "-\\infty", "\\ ", alpha.toTex(), "\\ ", "+\\infty"],
|
|
18
|
+
["$\\ $", "\\ ", "\\ ", a < 0 ? beta.toTex() : "\\ ", "\\ ", "\\ "],
|
|
19
|
+
["$f(x)$", "\\ ", vars[0], "\\ ", vars[1], "\\ "],
|
|
20
|
+
["$\\ $", "\\ ", "\\ ", a < 0 ? "\\ " : beta.toTex(), "\\ ", "\\ "],
|
|
21
|
+
];
|
|
22
|
+
};
|
|
23
|
+
const getHint = () => {
|
|
24
|
+
return `La fonction est définie sur $\\mathbb{R}$, donc les valeurs de $x$ vont de $-\\infty$ à $+\\infty$.
|
|
25
|
+
|
|
26
|
+
Repère ensuite les points de la courbe auxquels le sens de variation change. Dans la première ligne du tableau, il faut mettre les abscisses de ces points, et dans la deuxième ligne, les ordonnées.`;
|
|
27
|
+
};
|
|
28
|
+
const getCorrection = (identifiers) => {
|
|
29
|
+
const { coeffs } = identifiers;
|
|
30
|
+
const [c, b, a] = coeffs;
|
|
31
|
+
const poly = new Trinom(a, b, c);
|
|
32
|
+
const alpha = poly.getAlphaNode();
|
|
33
|
+
const beta = poly.getBetaNode();
|
|
34
|
+
const words = a > 0 ? ["décroissante", "croissante"] : ["croissante", "décroissante"];
|
|
35
|
+
return `D'après le graphique, la fonction $f$ est ${words[0]} sur $]-\\infty; ${alpha.toTex()}]$, puis ${words[1]} sur $[${alpha.toTex()}; +\\infty[$.
|
|
36
|
+
|
|
37
|
+
De plus, on lit graphiquement que l'image de $${alpha.toTex()}$ est $${beta.toTex()}$.
|
|
38
|
+
`;
|
|
39
|
+
};
|
|
40
|
+
const getKeys = () => {
|
|
41
|
+
return ["infty"];
|
|
42
|
+
};
|
|
43
|
+
const getGGBOptions = (identifiers) => {
|
|
44
|
+
const { coeffs } = identifiers;
|
|
45
|
+
const poly = TrinomConstructor.fromCoeffs(coeffs);
|
|
46
|
+
const commands = [`f(x) =${poly.toMathString()}`];
|
|
47
|
+
const ggb = new GeogebraConstructor({
|
|
48
|
+
commands,
|
|
49
|
+
lockedAxesRatio: false,
|
|
50
|
+
});
|
|
51
|
+
return ggb.getOptions({
|
|
52
|
+
coords: poly.getCoords(),
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
const isAnswerTableValid = (ans, { answerTable }) => {
|
|
56
|
+
try {
|
|
57
|
+
return varTableVEA(ans, answerTable);
|
|
58
|
+
}
|
|
59
|
+
catch (err) {
|
|
60
|
+
return handleVEAError(err);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
const getParabolaVarTableQuestion = () => {
|
|
64
|
+
const trinom = TrinomConstructor.randomCanonical();
|
|
65
|
+
const identifiers = {
|
|
66
|
+
coeffs: trinom.coefficients,
|
|
67
|
+
initTable: [
|
|
68
|
+
["$x$", " ", "\\ ", " ", "\\ ", " "],
|
|
69
|
+
["$\\ $", "\\ ", "\\ ", "\\ ", "\\ ", "\\ "],
|
|
70
|
+
["$f(x)$", "\\ ", " ", " ", " ", "\\ "],
|
|
71
|
+
["$\\ $", "\\ ", "\\ ", "\\ ", "\\ ", "\\ "],
|
|
72
|
+
],
|
|
73
|
+
};
|
|
74
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
75
|
+
};
|
|
76
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
77
|
+
return {
|
|
78
|
+
answerTable: getAnswerTable(identifiers),
|
|
79
|
+
instruction: getInstruction(identifiers),
|
|
80
|
+
keys: getKeys(identifiers),
|
|
81
|
+
answerFormat: "tex",
|
|
82
|
+
identifiers,
|
|
83
|
+
hint: getHint(identifiers),
|
|
84
|
+
correction: getCorrection(identifiers),
|
|
85
|
+
ggbOptions: getGGBOptions(identifiers),
|
|
86
|
+
initTable: identifiers.initTable,
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
export const parabolaVarTable = {
|
|
90
|
+
id: "parabolaVarTable",
|
|
91
|
+
label: "Dresser le tableau de variations d'une parabole représentée graphiquement",
|
|
92
|
+
isSingleStep: true,
|
|
93
|
+
generator: (nb, opts) => getDistinctQuestions(() => getParabolaVarTableQuestion(opts), nb),
|
|
94
|
+
qcmTimer: 60,
|
|
95
|
+
freeTimer: 60,
|
|
96
|
+
subject: "Mathématiques",
|
|
97
|
+
getInstruction,
|
|
98
|
+
getHint,
|
|
99
|
+
getCorrection,
|
|
100
|
+
getAnswerTable,
|
|
101
|
+
isAnswerTableValid,
|
|
102
|
+
getQuestionFromIdentifiers,
|
|
103
|
+
hasHintAndCorrection: true,
|
|
104
|
+
answerType: "varTable",
|
|
105
|
+
hasGeogebra: true,
|
|
106
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Exercise } from "../../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
a: number;
|
|
4
|
+
b: number;
|
|
5
|
+
c: number;
|
|
6
|
+
k: number;
|
|
7
|
+
};
|
|
8
|
+
type Options = {
|
|
9
|
+
isAskingRoots: boolean;
|
|
10
|
+
nbSols: string[];
|
|
11
|
+
};
|
|
12
|
+
export declare const paraboleSolveGraphEquation: Exercise<Identifiers, Options>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=paraboleSolveGraphEquation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paraboleSolveGraphEquation.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/parabole/paraboleSolveGraphEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAoBT,MAAM,6BAA6B,CAAC;AASrC,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;AA4JF,KAAK,OAAO,GAAG;IACb,aAAa,EAAE,OAAO,CAAC;IACvB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AA6BF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAsBrE,CAAC"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, GeneratorOptionTarget, GeneratorOptionType, propWhile, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { GeogebraConstructor } from "../../../../../geogebra/geogebraConstructor.js";
|
|
4
|
+
import { Trinom, TrinomConstructor } from "../../../../../math/polynomials/trinom.js";
|
|
5
|
+
import { randint } from "../../../../../math/utils/random/randint.js";
|
|
6
|
+
import { discreteSetParser } from "../../../../../tree/parsers/discreteSetParser.js";
|
|
7
|
+
import { random } from "../../../../../utils/alea/random.js";
|
|
8
|
+
import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
|
|
9
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
10
|
+
const propositions = [];
|
|
11
|
+
const { a, b, c } = identifiers;
|
|
12
|
+
const trinom = new Trinom(a, b, c);
|
|
13
|
+
addValidProp(propositions, answer);
|
|
14
|
+
tryToAddWrongProp(propositions, trinom.getRootsEquationSolutionTex());
|
|
15
|
+
propWhile(propositions, n, () => {
|
|
16
|
+
const randomTrinom = TrinomConstructor.randomNiceRoots(randint(0, 3));
|
|
17
|
+
tryToAddWrongProp(propositions, randomTrinom.getRootsEquationSolutionTex());
|
|
18
|
+
});
|
|
19
|
+
return shuffleProps(propositions, n);
|
|
20
|
+
};
|
|
21
|
+
const getAnswer = (identifiers) => {
|
|
22
|
+
const { a, b, c, k } = identifiers;
|
|
23
|
+
const trinom = new Trinom(a, b, c - k);
|
|
24
|
+
return trinom.getRootsEquationSolutionTex();
|
|
25
|
+
};
|
|
26
|
+
const getInstruction = (identifiers) => {
|
|
27
|
+
return `Ci-dessous est tracée la parabole représentative d'une fonction polynôme du second degré $f$.
|
|
28
|
+
|
|
29
|
+
Résoudre graphiquement l'équation $f(x) = ${identifiers.k}$.`;
|
|
30
|
+
};
|
|
31
|
+
const getHint = (identifiers) => {
|
|
32
|
+
return `Détermine les abscisses des points de la courbe qui ont pour ordonnée $${identifiers.k}$.`;
|
|
33
|
+
};
|
|
34
|
+
const getCorrection = (identifiers) => {
|
|
35
|
+
const { a, b, c, k } = identifiers;
|
|
36
|
+
const trinom = new Trinom(a, b, c - k);
|
|
37
|
+
const roots = trinom.getRootsNode();
|
|
38
|
+
return `On cherche graphiquement les abscisses des points de la parabole dont l'ordonnée est $${k.frenchify()}$.
|
|
39
|
+
|
|
40
|
+
${!roots.length
|
|
41
|
+
? `Il n'y en a pas.
|
|
42
|
+
|
|
43
|
+
L'équation $f(x) = ${k.frenchify()}$ n'a donc pas de solution :
|
|
44
|
+
|
|
45
|
+
$$
|
|
46
|
+
${getAnswer(identifiers)}
|
|
47
|
+
$$`
|
|
48
|
+
: ""}
|
|
49
|
+
|
|
50
|
+
${roots.length === 1
|
|
51
|
+
? `Il n'y en a qu'un : c'est le sommet de la parabole, et son abscisse vaut $${roots[0].toTex()}$.
|
|
52
|
+
|
|
53
|
+
L'équation $f(x) = ${k.frenchify()}$ a donc une seule solution :
|
|
54
|
+
|
|
55
|
+
$$
|
|
56
|
+
${getAnswer(identifiers)}
|
|
57
|
+
$$
|
|
58
|
+
`
|
|
59
|
+
: ""}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
${roots.length === 2
|
|
63
|
+
? `On en trouve deux : les points de coordonnées $(${roots[0].toTex()};${k.frenchify()})$ et $(${roots[1].toTex()};${k.frenchify()})$.
|
|
64
|
+
|
|
65
|
+
L'équation $f(x) = ${k.frenchify()}$ a donc deux solutions :
|
|
66
|
+
|
|
67
|
+
$$
|
|
68
|
+
${getAnswer(identifiers)}
|
|
69
|
+
$$`
|
|
70
|
+
: ""}
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
`;
|
|
74
|
+
};
|
|
75
|
+
const getGGBOptions = (identifiers) => {
|
|
76
|
+
const { a, b, c, k } = identifiers;
|
|
77
|
+
const trinom = new Trinom(a, b, c);
|
|
78
|
+
const ggb = new GeogebraConstructor({
|
|
79
|
+
commands: [`f(x) = ${trinom.toMathString()}`],
|
|
80
|
+
lockedAxesRatio: false,
|
|
81
|
+
});
|
|
82
|
+
const baseTrinom = new Trinom(a, b, c - k);
|
|
83
|
+
const roots = baseTrinom.getRootsNode();
|
|
84
|
+
const coords = trinom.getCoords();
|
|
85
|
+
return ggb.getOptions({
|
|
86
|
+
coords: roots.length === 0
|
|
87
|
+
? coords
|
|
88
|
+
: ggb.getAdaptedCoords({
|
|
89
|
+
xMin: coords[0],
|
|
90
|
+
xMax: coords[1],
|
|
91
|
+
yMin: k - 3,
|
|
92
|
+
yMax: k + 3,
|
|
93
|
+
}),
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
const getKeys = () => {
|
|
97
|
+
return ["S", "equal", "lbracket", "semicolon", "rbracket", "varnothing"];
|
|
98
|
+
};
|
|
99
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
100
|
+
try {
|
|
101
|
+
const parsed = discreteSetParser(ans);
|
|
102
|
+
if (!parsed)
|
|
103
|
+
return false;
|
|
104
|
+
return "S=" + parsed.simplify().toTex() === answer;
|
|
105
|
+
}
|
|
106
|
+
catch (err) {
|
|
107
|
+
return handleVEAError(err);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
const getParaboleSolveGraphEquationQuestion = (opts) => {
|
|
111
|
+
const nbSolsTex = opts?.nbSols?.length
|
|
112
|
+
? random(opts.nbSols)
|
|
113
|
+
: random(["$0$", "$1$", "$2$"]);
|
|
114
|
+
const nbSols = nbSolsTex === "$1$" ? 1 : nbSolsTex === "$2$" ? 2 : 0;
|
|
115
|
+
const k = opts?.isAskingRoots ? 0 : randint(-8, 9);
|
|
116
|
+
const baseTrinom = TrinomConstructor.randomNiceRoots(nbSols);
|
|
117
|
+
const trinom = new Trinom(baseTrinom.a, baseTrinom.b, baseTrinom.c + k);
|
|
118
|
+
const identifiers = {
|
|
119
|
+
a: trinom.a,
|
|
120
|
+
b: trinom.b,
|
|
121
|
+
c: trinom.c,
|
|
122
|
+
k,
|
|
123
|
+
};
|
|
124
|
+
return getQuestionFromIdentifiers(identifiers, opts);
|
|
125
|
+
};
|
|
126
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
127
|
+
return {
|
|
128
|
+
answer: getAnswer(identifiers),
|
|
129
|
+
instruction: getInstruction(identifiers),
|
|
130
|
+
keys: getKeys(identifiers),
|
|
131
|
+
answerFormat: "tex",
|
|
132
|
+
identifiers,
|
|
133
|
+
hint: getHint(identifiers),
|
|
134
|
+
correction: getCorrection(identifiers),
|
|
135
|
+
ggbOptions: getGGBOptions(identifiers),
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
const options = [
|
|
139
|
+
{
|
|
140
|
+
id: "isAskingRoots",
|
|
141
|
+
label: "Demander de ne résoudre que $f(x)=0$",
|
|
142
|
+
target: GeneratorOptionTarget.generation,
|
|
143
|
+
type: GeneratorOptionType.checkbox,
|
|
144
|
+
defaultValue: false,
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
id: "nbSols",
|
|
148
|
+
label: "Nombre de solutions",
|
|
149
|
+
target: GeneratorOptionTarget.generation,
|
|
150
|
+
type: GeneratorOptionType.multiselect,
|
|
151
|
+
values: ["$0$", "$1$", "$2$"],
|
|
152
|
+
defaultValue: ["$0$", "$1$", "$2$"],
|
|
153
|
+
},
|
|
154
|
+
];
|
|
155
|
+
const validateOptions = (opts) => {
|
|
156
|
+
if (!opts?.nbSols?.length)
|
|
157
|
+
return {
|
|
158
|
+
valid: false,
|
|
159
|
+
message: "Veuillez choisir au moins un nombre de solutions.",
|
|
160
|
+
};
|
|
161
|
+
return {
|
|
162
|
+
valid: true,
|
|
163
|
+
message: "",
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
export const paraboleSolveGraphEquation = {
|
|
167
|
+
id: "paraboleSolveGraphEquation",
|
|
168
|
+
label: "Résoudre graphiquement une équation du type $f(x)=k$ pour une parabole",
|
|
169
|
+
isSingleStep: true,
|
|
170
|
+
generator: (nb, opts) => getDistinctQuestions(() => getParaboleSolveGraphEquationQuestion(opts), nb),
|
|
171
|
+
qcmTimer: 60,
|
|
172
|
+
freeTimer: 60,
|
|
173
|
+
getPropositions,
|
|
174
|
+
isAnswerValid,
|
|
175
|
+
subject: "Mathématiques",
|
|
176
|
+
getHint,
|
|
177
|
+
getCorrection,
|
|
178
|
+
getInstruction,
|
|
179
|
+
getAnswer,
|
|
180
|
+
getGGBOptions,
|
|
181
|
+
hasGeogebra: true,
|
|
182
|
+
getQuestionFromIdentifiers,
|
|
183
|
+
options,
|
|
184
|
+
validateOptions,
|
|
185
|
+
hasHintAndCorrection: true,
|
|
186
|
+
};
|
package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.d.ts
CHANGED
|
@@ -3,8 +3,12 @@ type Identifiers = {
|
|
|
3
3
|
a: number;
|
|
4
4
|
b: number;
|
|
5
5
|
c: number;
|
|
6
|
-
isDevForm
|
|
6
|
+
isDevForm?: boolean;
|
|
7
|
+
form: "cano" | "dev" | "facto";
|
|
7
8
|
};
|
|
8
|
-
|
|
9
|
+
type Options = {
|
|
10
|
+
form: string[];
|
|
11
|
+
};
|
|
12
|
+
export declare const extremumTypeFromAlgebricForm: Exercise<Identifiers, Options>;
|
|
9
13
|
export {};
|
|
10
14
|
//# sourceMappingURL=extremumTypeFromAlgebricForm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extremumTypeFromAlgebricForm.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"extremumTypeFromAlgebricForm.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,OAAO,CAAC;CAChC,CAAC;AAyIF,KAAK,OAAO,GAAG;IACb,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;AAaF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAmBvE,CAAC"}
|
package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.js
CHANGED
|
@@ -1,15 +1,29 @@
|
|
|
1
|
-
import { addValidProp, addWrongProp, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
|
|
1
|
+
import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, addWrongProp, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { Trinom, TrinomConstructor } from "../../../../../math/polynomials/trinom.js";
|
|
4
|
-
import {
|
|
4
|
+
import { random } from "../../../../../utils/alea/random.js";
|
|
5
5
|
import { shuffle } from "../../../../../utils/alea/shuffle.js";
|
|
6
6
|
const getInstruction = (identifiers) => {
|
|
7
|
-
const { isDevForm, a, b, c } = identifiers;
|
|
7
|
+
const { form, isDevForm, a, b, c } = identifiers;
|
|
8
8
|
const trinom = new Trinom(a, b, c);
|
|
9
|
-
|
|
9
|
+
let trinomTex;
|
|
10
|
+
if (isDevForm !== undefined) {
|
|
11
|
+
trinomTex = isDevForm
|
|
12
|
+
? trinom.toTree().toTex()
|
|
13
|
+
: trinom.getCanonicalForm().toTex();
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
trinomTex =
|
|
17
|
+
form === "dev"
|
|
18
|
+
? trinom.toTree().toTex()
|
|
19
|
+
: form === "cano"
|
|
20
|
+
? trinom.getCanonicalForm().toTex()
|
|
21
|
+
: trinom.toFactorized().toTex();
|
|
22
|
+
}
|
|
23
|
+
return `La fonction $f$ définie sur $\\mathbb{R}$ par :
|
|
10
24
|
|
|
11
25
|
$$
|
|
12
|
-
f(x) = ${
|
|
26
|
+
f(x) = ${trinomTex}
|
|
13
27
|
$$
|
|
14
28
|
|
|
15
29
|
admet-elle un maximum ou un minimum ?`;
|
|
@@ -18,22 +32,69 @@ const getAnswer = (identifiers) => {
|
|
|
18
32
|
const answer = identifiers.a > 0 ? "Un minimum" : "Un maximum";
|
|
19
33
|
return answer;
|
|
20
34
|
};
|
|
21
|
-
const getQuestionFromIdentifiers = (identifiers) => {
|
|
35
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
22
36
|
const question = {
|
|
23
37
|
answer: getAnswer(identifiers),
|
|
24
|
-
instruction: getInstruction(identifiers),
|
|
38
|
+
instruction: getInstruction(identifiers, opts),
|
|
25
39
|
answerFormat: "raw",
|
|
26
40
|
keys: [],
|
|
27
41
|
identifiers,
|
|
42
|
+
hint: getHint(identifiers),
|
|
43
|
+
correction: getCorrection(identifiers),
|
|
28
44
|
};
|
|
29
45
|
return question;
|
|
30
46
|
};
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
47
|
+
const getHint = () => {
|
|
48
|
+
return `La fonction $f$ est un polynôme du second degré. Sa courbe représentative est donc une parabole. Cette parabole est tournée vers le bas si le coefficient $a$ est positif. Dans ce cas, elle admet un minmum. Si $a$ est négatif, alors la parabole est tournée vers le haut, et elle admet donc un maximum.`;
|
|
49
|
+
};
|
|
50
|
+
const getCorrection = (identifiers) => {
|
|
51
|
+
const { form, a } = identifiers;
|
|
52
|
+
return `La fonction $f$ est un polynôme du second degré donnée sous sa forme ${form === "dev"
|
|
53
|
+
? "développée"
|
|
54
|
+
: form === "facto"
|
|
55
|
+
? "factorisée"
|
|
56
|
+
: "canonique"} :
|
|
57
|
+
|
|
58
|
+
$$
|
|
59
|
+
f(x) = ${form === "dev"
|
|
60
|
+
? "ax^2+bx+c"
|
|
61
|
+
: form === "facto"
|
|
62
|
+
? "a(x-x_1)(x-x_2)"
|
|
63
|
+
: "a(x-\\alpha)^2+\\beta)"}
|
|
64
|
+
$$
|
|
65
|
+
|
|
66
|
+
Son coefficient $a$ vaut donc $${a.frenchify()}$.
|
|
67
|
+
|
|
68
|
+
Puisque $${a
|
|
69
|
+
.toTree()
|
|
70
|
+
.toSignInequationTex()}$, la parabole représentative de $f$ est tournée vers ${a > 0 ? "le bas" : "le haut"} : cela signifie que $f$ est admet un ${a > 0 ? "minimum" : "maximum"} sur $\\mathbb{R}$.`;
|
|
71
|
+
};
|
|
72
|
+
const getExtremumTypeFromAlgebricFormQuestion = (opts) => {
|
|
73
|
+
const formalForm = opts?.form
|
|
74
|
+
? random(opts.form)
|
|
75
|
+
: random(["Forme canonique", "Forme factorisée", "Forme développée"]);
|
|
76
|
+
const form = (() => {
|
|
77
|
+
switch (formalForm) {
|
|
78
|
+
case "Forme canonique":
|
|
79
|
+
return "cano";
|
|
80
|
+
case "Forme factorisée":
|
|
81
|
+
return "facto";
|
|
82
|
+
case "Forme développée":
|
|
83
|
+
default:
|
|
84
|
+
return "dev";
|
|
85
|
+
}
|
|
86
|
+
})();
|
|
87
|
+
const trinom = form === "dev"
|
|
34
88
|
? TrinomConstructor.random()
|
|
35
|
-
:
|
|
36
|
-
|
|
89
|
+
: form === "cano"
|
|
90
|
+
? TrinomConstructor.randomCanonical()
|
|
91
|
+
: TrinomConstructor.randomNiceRoots(2);
|
|
92
|
+
const identifiers = {
|
|
93
|
+
form,
|
|
94
|
+
a: trinom.a,
|
|
95
|
+
b: trinom.b,
|
|
96
|
+
c: trinom.c,
|
|
97
|
+
};
|
|
37
98
|
return getQuestionFromIdentifiers(identifiers);
|
|
38
99
|
};
|
|
39
100
|
const getPropositions = (_n, { answer, a }) => {
|
|
@@ -45,15 +106,39 @@ const getPropositions = (_n, { answer, a }) => {
|
|
|
45
106
|
addWrongProp(propositions, "Ni l'un ni l'autre", "raw");
|
|
46
107
|
return propositions;
|
|
47
108
|
};
|
|
109
|
+
const options = [
|
|
110
|
+
{
|
|
111
|
+
id: "form",
|
|
112
|
+
label: "Forme donnée",
|
|
113
|
+
target: GeneratorOptionTarget.generation,
|
|
114
|
+
type: GeneratorOptionType.multiselect,
|
|
115
|
+
values: ["Forme canonique", "Forme factorisée", "Forme développée"],
|
|
116
|
+
defaultValue: ["Forme canonique", "Forme factorisée", "Forme développée"],
|
|
117
|
+
},
|
|
118
|
+
];
|
|
119
|
+
const validateOptions = (opts) => {
|
|
120
|
+
if (!opts?.form?.length)
|
|
121
|
+
return {
|
|
122
|
+
valid: false,
|
|
123
|
+
message: "Veuillez choisir au moins un type de forme algébrique.",
|
|
124
|
+
};
|
|
125
|
+
return {
|
|
126
|
+
valid: true,
|
|
127
|
+
message: "",
|
|
128
|
+
};
|
|
129
|
+
};
|
|
48
130
|
export const extremumTypeFromAlgebricForm = {
|
|
49
131
|
id: "extremumTypeFromAlgebricForm",
|
|
50
132
|
label: "Déterminer le type d'extremum d'une fonction du second degré via sa forme algébrique",
|
|
51
133
|
isSingleStep: true,
|
|
52
|
-
generator: (nb) => getDistinctQuestions(getExtremumTypeFromAlgebricFormQuestion, nb),
|
|
134
|
+
generator: (nb, opts) => getDistinctQuestions(() => getExtremumTypeFromAlgebricFormQuestion(opts), nb),
|
|
53
135
|
answerType: "QCU",
|
|
54
136
|
qcmTimer: 60,
|
|
55
137
|
freeTimer: 60,
|
|
56
138
|
getPropositions,
|
|
57
139
|
subject: "Mathématiques",
|
|
58
140
|
getQuestionFromIdentifiers,
|
|
141
|
+
validateOptions,
|
|
142
|
+
options,
|
|
143
|
+
hasHintAndCorrection: true,
|
|
59
144
|
};
|
|
@@ -16,4 +16,5 @@ export * from "./drawLineFromPointAndVector.js";
|
|
|
16
16
|
export * from "./cartesianEquationsIntersection.js";
|
|
17
17
|
export * from "./directorVectorFromAnother.js";
|
|
18
18
|
export * from "./cartesianEquationOfTriangleHeight.js";
|
|
19
|
+
export * from "./readLineNormalVectorOnGraph.js";
|
|
19
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/lines/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wCAAwC,CAAC;AACvD,cAAc,iCAAiC,CAAC;AAChD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wCAAwC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/lines/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wCAAwC,CAAC;AACvD,cAAc,iCAAiC,CAAC;AAChD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wCAAwC,CAAC;AACvD,cAAc,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { PointIdentifiers } from "../../../../math/geometry/point.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
point1Ids: PointIdentifiers;
|
|
5
|
+
point2Ids: PointIdentifiers;
|
|
6
|
+
point3Ids?: PointIdentifiers;
|
|
7
|
+
};
|
|
8
|
+
type Options = {
|
|
9
|
+
withoutPerp: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare const readLineNormalVectorOnGraph: Exercise<Identifiers, Options>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=readLineNormalVectorOnGraph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readLineNormalVectorOnGraph.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/lines/readLineNormalVectorOnGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAQtC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,SAAS,EAAE,gBAAgB,CAAC;IAC5B,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAC9B,CAAC;AA8KF,KAAK,OAAO,GAAG;IACb,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAaF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAwBtE,CAAC"}
|