math-exercises 3.0.178 → 3.0.179
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/derivation/derivative/derivativeEquationSolving1.d.ts +14 -0
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.js +283 -0
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.d.ts +15 -0
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.js +296 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.js +3 -3
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeProductFExp.d.ts +14 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeProductFExp.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeProductFExp.js +346 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeQuotientFExp.d.ts +15 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeQuotientFExp.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeQuotientFExp.js +435 -0
- package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.d.ts +13 -0
- package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.js +326 -0
- package/lib/exercises/math/derivation/derivativeNumber/signOfDerivativeNumberFromFunctionCurve.d.ts +14 -0
- package/lib/exercises/math/derivation/derivativeNumber/signOfDerivativeNumberFromFunctionCurve.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivativeNumber/signOfDerivativeNumberFromFunctionCurve.js +181 -0
- package/lib/exercises/math/derivation/derivativeNumber/valueTableImageAndDerivativeFromFunctionExpression.d.ts +10 -0
- package/lib/exercises/math/derivation/derivativeNumber/valueTableImageAndDerivativeFromFunctionExpression.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivativeNumber/valueTableImageAndDerivativeFromFunctionExpression.js +272 -0
- package/lib/exercises/math/derivation/problems/index.d.ts +5 -0
- package/lib/exercises/math/derivation/problems/index.d.ts.map +1 -0
- package/lib/exercises/math/derivation/problems/index.js +4 -0
- package/lib/exercises/math/derivation/problems/problemMaximizeBoxVolumeFindX.d.ts +8 -0
- package/lib/exercises/math/derivation/problems/problemMaximizeBoxVolumeFindX.d.ts.map +1 -0
- package/lib/exercises/math/derivation/problems/problemMaximizeBoxVolumeFindX.js +171 -0
- package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.d.ts +15 -0
- package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.d.ts.map +1 -0
- package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.js +328 -0
- package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.d.ts +13 -0
- package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.d.ts.map +1 -0
- package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.js +275 -0
- package/lib/exercises/math/derivation/problems/problemProjectileHeightFindAbscissa.d.ts +8 -0
- package/lib/exercises/math/derivation/problems/problemProjectileHeightFindAbscissa.d.ts.map +1 -0
- package/lib/exercises/math/derivation/problems/problemProjectileHeightFindAbscissa.js +137 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.d.ts +10 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.js +478 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineYAndSlope.d.ts +10 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineYAndSlope.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineYAndSlope.js +499 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingPoint.d.ts +10 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingPoint.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingPoint.js +240 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingBuildingTangent.d.ts +12 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingBuildingTangent.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingBuildingTangent.js +436 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingPoint.d.ts +12 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingPoint.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingPoint.js +219 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingSecant.d.ts +13 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingSecant.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingSecant.js +273 -0
- package/lib/exercises/math/derivation/tangent/placePointsOfDerivativeFromGraph.d.ts +18 -0
- package/lib/exercises/math/derivation/tangent/placePointsOfDerivativeFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/placePointsOfDerivativeFromGraph.js +295 -0
- package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.d.ts +13 -0
- package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.js +388 -0
- package/lib/exercises/math/derivation/tangent/tangentEquationFromGraph.d.ts +9 -0
- package/lib/exercises/math/derivation/tangent/tangentEquationFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/tangentEquationFromGraph.js +308 -0
- package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.d.ts +14 -0
- package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.js +439 -0
- package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.d.ts +14 -0
- package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.js +547 -0
- package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.d.ts +15 -0
- package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.js +537 -0
- package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.d.ts +15 -0
- package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.js +639 -0
- package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.d.ts +14 -0
- package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.js +530 -0
- package/lib/exercises/math/derivation/variations/signVarTableProductFExp.d.ts +10 -0
- package/lib/exercises/math/derivation/variations/signVarTableProductFExp.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/signVarTableProductFExp.js +451 -0
- package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.d.ts +11 -0
- package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.js +514 -0
- package/lib/exercises/math/functions/composition/index.d.ts +0 -1
- package/lib/exercises/math/functions/composition/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/composition/index.js +1 -1
- package/lib/exercises/math/functions/exponential/algebraic/index.d.ts +0 -1
- package/lib/exercises/math/functions/exponential/algebraic/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/algebraic/index.js +1 -1
- package/lib/exercises/math/functions/trinoms/sign/signOfProductOfAffineAndTrinom.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/sign/signOfProductOfAffineAndTrinom.js +4 -11
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.js +32 -17
- package/lib/exercises/math/probaStat/conditional/conditionalProbaFromTableWithContext.d.ts +13 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbaFromTableWithContext.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbaFromTableWithContext.js +195 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbaWriteFromFrench.d.ts +9 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbaWriteFromFrench.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbaWriteFromFrench.js +220 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbability.d.ts +15 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbability.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbability.js +332 -0
- package/lib/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.d.ts +8 -0
- package/lib/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.js +222 -0
- package/lib/exercises/math/probaStat/conditional/index.d.ts +5 -0
- package/lib/exercises/math/probaStat/conditional/index.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/conditional/index.js +4 -0
- package/lib/exercises/math/probaStat/index.d.ts +1 -2
- package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/index.js +1 -2
- package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts +1 -0
- package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaFromTableWithContext.js +26 -199
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.js +6 -2
- package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.js +6 -5
- package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.js +4 -27
- package/lib/exercises/math/probaStat/twoEventsSituations.d.ts +29 -0
- package/lib/exercises/math/probaStat/twoEventsSituations.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/twoEventsSituations.js +145 -0
- package/lib/exercises/math/sequences/explicitFormulaUsage.d.ts +4 -1
- package/lib/exercises/math/sequences/explicitFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/math/sequences/explicitFormulaUsage.js +47 -7
- package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoTerms.js +1 -1
- package/lib/exercises/math/sequences/geometric/index.d.ts +0 -3
- package/lib/exercises/math/sequences/geometric/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/index.js +3 -3
- package/lib/exercises/math/sequences/geometric/situations/index.d.ts +0 -1
- package/lib/exercises/math/sequences/geometric/situations/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/situations/index.js +1 -1
- package/lib/exercises/math/sequences/recurrenceFormulaUsage.d.ts +5 -1
- package/lib/exercises/math/sequences/recurrenceFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/math/sequences/recurrenceFormulaUsage.js +89 -9
- package/lib/exercises/math/trigonometry/circle/associatePoint.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/circle/associatePoint.js +55 -6
- package/lib/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.js +5 -6
- package/lib/exercises/math/trigonometry/functions/associateAngleSimplification.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/functions/associateAngleSimplification.js +1 -3
- package/lib/exercises/vea/polynomialVEA.d.ts +2 -0
- package/lib/exercises/vea/polynomialVEA.d.ts.map +1 -0
- package/lib/exercises/vea/polynomialVEA.js +17 -0
- package/lib/exercises/vea/valueTableVEA.d.ts +8 -0
- package/lib/exercises/vea/valueTableVEA.d.ts.map +1 -0
- package/lib/exercises/vea/valueTableVEA.js +12 -0
- package/lib/index.d.ts +27 -47
- package/lib/index.d.ts.map +1 -1
- package/lib/latexTester.d.ts.map +1 -1
- package/lib/latexTester.js +1 -1
- package/lib/math/utils/polynomial/polynomialInterpolationUtils.d.ts +19 -0
- package/lib/math/utils/polynomial/polynomialInterpolationUtils.d.ts.map +1 -0
- package/lib/math/utils/polynomial/polynomialInterpolationUtils.js +53 -0
- package/lib/math/utils/polynomial/polynomialUtils.d.ts +37 -0
- package/lib/math/utils/polynomial/polynomialUtils.d.ts.map +1 -0
- package/lib/math/utils/polynomial/polynomialUtils.js +223 -0
- package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts.map +1 -1
- package/lib/math/utils/sequences/situations/seqArithmeticSituations.js +6 -6
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +1 -1
- package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/substractNode.js +2 -1
- package/lib/tree/utilities/nodeUtils.d.ts +6 -0
- package/lib/tree/utilities/nodeUtils.d.ts.map +1 -0
- package/lib/tree/utilities/nodeUtils.js +24 -0
- package/lib/utils/strings/prependArticle.d.ts +2 -0
- package/lib/utils/strings/prependArticle.d.ts.map +1 -0
- package/lib/utils/strings/prependArticle.js +1 -0
- package/package.json +1 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { shuffleProps, tryToAddWrongProp, addValidProp, propWhile, } from "../../../exercises/exercise.js";
|
|
1
|
+
import { shuffleProps, tryToAddWrongProp, addValidProp, propWhile, GeneratorOptionTarget, GeneratorOptionType, } from "../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { AffineConstructor } from "../../../math/polynomials/affine.js";
|
|
3
4
|
import { Polynomial, PolynomialConstructor, } from "../../../math/polynomials/polynomial.js";
|
|
4
5
|
import { randint } from "../../../math/utils/random/randint.js";
|
|
6
|
+
import { random } from "../../../utils/alea/random.js";
|
|
5
7
|
const getInstruction = (identifiers) => {
|
|
6
8
|
const { rank, coeffs } = identifiers;
|
|
7
9
|
const u = new Polynomial(coeffs, "n");
|
|
@@ -19,18 +21,44 @@ const getAnswer = (identifiers) => {
|
|
|
19
21
|
const answer = u.calculate(rank) + "";
|
|
20
22
|
return answer;
|
|
21
23
|
};
|
|
24
|
+
const getHint = (identifiers) => {
|
|
25
|
+
return `La suite est donnée sous forme explicite.
|
|
26
|
+
|
|
27
|
+
Remplace $n$ par $${identifiers.rank}$ dans la formule donnée.`;
|
|
28
|
+
};
|
|
29
|
+
const getCorrection = (identifiers) => {
|
|
30
|
+
const { coeffs, rank } = identifiers;
|
|
31
|
+
const u = new Polynomial(coeffs, "n");
|
|
32
|
+
return `La suite étant donnée sous forme explicite, il suffit de remplacer $n$ par $${rank}$ dans la formule :
|
|
33
|
+
|
|
34
|
+
$$
|
|
35
|
+
u_{${rank}} = ${u.toTree().toDetailedEvaluation({ n: rank.toTree() }).toTex()}
|
|
36
|
+
$$
|
|
37
|
+
|
|
38
|
+
donc
|
|
39
|
+
|
|
40
|
+
$$
|
|
41
|
+
u_{${rank}} = ${getAnswer(identifiers)}
|
|
42
|
+
$$`;
|
|
43
|
+
};
|
|
22
44
|
const getQuestionFromIdentifiers = (identifiers) => {
|
|
23
|
-
|
|
45
|
+
return {
|
|
24
46
|
answer: getAnswer(identifiers),
|
|
25
47
|
instruction: getInstruction(identifiers),
|
|
26
|
-
keys: [
|
|
48
|
+
keys: [],
|
|
27
49
|
answerFormat: "tex",
|
|
28
50
|
identifiers,
|
|
51
|
+
hint: getHint(identifiers),
|
|
52
|
+
correction: getCorrection(identifiers),
|
|
29
53
|
};
|
|
30
|
-
return question;
|
|
31
54
|
};
|
|
32
|
-
const getExplicitFormulaUsageQuestion = () => {
|
|
33
|
-
const
|
|
55
|
+
const getExplicitFormulaUsageQuestion = (opts) => {
|
|
56
|
+
const type = opts?.functionType?.length
|
|
57
|
+
? random(opts.functionType)
|
|
58
|
+
: random(["Affine", "Second degré"]);
|
|
59
|
+
const u = type === "Affine"
|
|
60
|
+
? AffineConstructor.random()
|
|
61
|
+
: PolynomialConstructor.randomWithOrder(2, "n");
|
|
34
62
|
const rank = randint(0, 4);
|
|
35
63
|
const identifiers = { rank, coeffs: u.coefficients };
|
|
36
64
|
return getQuestionFromIdentifiers(identifiers);
|
|
@@ -50,16 +78,28 @@ const getPropositions = (n, { answer, rank, coeffs }) => {
|
|
|
50
78
|
const isAnswerValid = (ans, { answer, rank }) => {
|
|
51
79
|
return [answer, `u_{${rank}}=${answer}`, `u_${rank}=${answer}`].includes(ans);
|
|
52
80
|
};
|
|
81
|
+
const options = [
|
|
82
|
+
{
|
|
83
|
+
id: "functionType",
|
|
84
|
+
label: "Type de fonction",
|
|
85
|
+
values: ["Affine", "Second degré"],
|
|
86
|
+
target: GeneratorOptionTarget.generation,
|
|
87
|
+
type: GeneratorOptionType.multiselect,
|
|
88
|
+
defaultValue: ["Affine", "Second degré"],
|
|
89
|
+
},
|
|
90
|
+
];
|
|
53
91
|
export const explicitFormulaUsage = {
|
|
54
92
|
id: "explicitFormulaUsage",
|
|
55
93
|
connector: "=",
|
|
56
94
|
label: "Utiliser la formule explicite d'une suite",
|
|
57
95
|
isSingleStep: true,
|
|
58
|
-
generator: (nb) => getDistinctQuestions(getExplicitFormulaUsageQuestion, nb),
|
|
96
|
+
generator: (nb, opts) => getDistinctQuestions(() => getExplicitFormulaUsageQuestion(opts), nb),
|
|
59
97
|
qcmTimer: 60,
|
|
60
98
|
freeTimer: 60,
|
|
61
99
|
getPropositions,
|
|
62
100
|
isAnswerValid,
|
|
63
101
|
subject: "Mathématiques",
|
|
64
102
|
getQuestionFromIdentifiers,
|
|
103
|
+
hasHintAndCorrection: true,
|
|
104
|
+
options,
|
|
65
105
|
};
|
|
@@ -246,7 +246,7 @@ const options = [generatorOptionFirstTermRankOne];
|
|
|
246
246
|
export const geometricFindRandomTermFromTwoTerms = {
|
|
247
247
|
id: "geometricFindRandomTermFromTwoTerms",
|
|
248
248
|
connector: "=",
|
|
249
|
-
label: "Connaissant deux termes d'une suite géométrique, en
|
|
249
|
+
label: "Connaissant deux termes d'une suite géométrique, en calculer un troisième",
|
|
250
250
|
isSingleStep: true,
|
|
251
251
|
generator: (nb, opts) => getDistinctQuestions(() => getGeometricFindRandomTermFromTwoTermsQuestion(opts), nb),
|
|
252
252
|
options,
|
|
@@ -9,10 +9,7 @@ export * from "./geometricFindTerm.js";
|
|
|
9
9
|
export * from "./geometricFindTermFirstRankOne.js";
|
|
10
10
|
export * from "./geometricRecognizeReasonFromFirstTerms.js";
|
|
11
11
|
export * from "./geometricVariations.js";
|
|
12
|
-
export * from "./geometricFindExplicitFormulaFromTwoTerms.js";
|
|
13
|
-
export * from "./geometricFindExplicitFormulaFromTwoConsecutiveTerms.js";
|
|
14
12
|
export * from "./geometricFindRandomTermFromTwoTerms.js";
|
|
15
|
-
export * from "./geometricFindRandomTermFromTwoConsecutiveTerms.js";
|
|
16
13
|
export * from "./sum/index.js";
|
|
17
14
|
export * from "./situations/index.js";
|
|
18
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/geometric/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC;AACnD,cAAc,mCAAmC,CAAC;AAClD,cAAc,+CAA+C,CAAC;AAE9D,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sCAAsC,CAAC;AACrD,cAAc,kDAAkD,CAAC;AACjE,cAAc,wBAAwB,CAAC;AACvC,cAAc,oCAAoC,CAAC;AAEnD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/geometric/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC;AACnD,cAAc,mCAAmC,CAAC;AAClD,cAAc,+CAA+C,CAAC;AAE9D,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sCAAsC,CAAC;AACrD,cAAc,kDAAkD,CAAC;AACjE,cAAc,wBAAwB,CAAC;AACvC,cAAc,oCAAoC,CAAC;AAEnD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,0BAA0B,CAAC;AAIzC,cAAc,0CAA0C,CAAC;AAGzD,cAAc,gBAAgB,CAAC;AAE/B,cAAc,uBAAuB,CAAC"}
|
|
@@ -9,9 +9,9 @@ export * from "./geometricFindTerm.js";
|
|
|
9
9
|
export * from "./geometricFindTermFirstRankOne.js";
|
|
10
10
|
export * from "./geometricRecognizeReasonFromFirstTerms.js";
|
|
11
11
|
export * from "./geometricVariations.js";
|
|
12
|
-
export * from "./geometricFindExplicitFormulaFromTwoTerms.js";
|
|
13
|
-
export * from "./geometricFindExplicitFormulaFromTwoConsecutiveTerms.js";
|
|
12
|
+
// export * from "./geometricFindExplicitFormulaFromTwoTerms.js";
|
|
13
|
+
// export * from "./geometricFindExplicitFormulaFromTwoConsecutiveTerms.js";
|
|
14
14
|
export * from "./geometricFindRandomTermFromTwoTerms.js";
|
|
15
|
-
export * from "./geometricFindRandomTermFromTwoConsecutiveTerms.js";
|
|
15
|
+
// export * from "./geometricFindRandomTermFromTwoConsecutiveTerms.js";
|
|
16
16
|
export * from "./sum/index.js";
|
|
17
17
|
export * from "./situations/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/sequences/geometric/situations/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/sequences/geometric/situations/index.ts"],"names":[],"mappings":"AACA,cAAc,kDAAkD,CAAC;AACjE,cAAc,qCAAqC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from "./geometricFindExplicitFormulaFromSituation.js";
|
|
1
|
+
// export * from "./geometricFindExplicitFormulaFromSituation.js";
|
|
2
2
|
export * from "./geometricFindRecurrenceFormulaFromSituation.js";
|
|
3
3
|
export * from "./geometricFindTermFromSituation.js";
|
|
4
4
|
// export * from "./geometricFindRankFromSituation.js";
|
|
@@ -4,6 +4,10 @@ type Identifiers = {
|
|
|
4
4
|
u0: number;
|
|
5
5
|
coeffs: number[];
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
type Options = {
|
|
8
|
+
functionType: string[];
|
|
9
|
+
askedRank: string[];
|
|
10
|
+
};
|
|
11
|
+
export declare const recurrenceFormulaUsage: Exercise<Identifiers, Options>;
|
|
8
12
|
export {};
|
|
9
13
|
//# sourceMappingURL=recurrenceFormulaUsage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recurrenceFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sequences/recurrenceFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,
|
|
1
|
+
{"version":3,"file":"recurrenceFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sequences/recurrenceFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAwIF,KAAK,OAAO,GAAG;IACb,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAmBF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAejE,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { shuffleProps, tryToAddWrongProp, addValidProp, propWhile, } from "../../../exercises/exercise.js";
|
|
1
|
+
import { shuffleProps, tryToAddWrongProp, addValidProp, propWhile, GeneratorOptionType, GeneratorOptionTarget, } from "../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { Polynomial } from "../../../math/polynomials/polynomial.js";
|
|
4
4
|
import { randint } from "../../../math/utils/random/randint.js";
|
|
5
|
+
import { random } from "../../../utils/alea/random.js";
|
|
5
6
|
const getInstruction = (identifiers) => {
|
|
6
7
|
const { rank, u0, coeffs } = identifiers;
|
|
7
8
|
const u = new Polynomial(coeffs, "u_n");
|
|
@@ -27,21 +28,80 @@ const getAnswer = (identifiers) => {
|
|
|
27
28
|
return answer;
|
|
28
29
|
};
|
|
29
30
|
const getQuestionFromIdentifiers = (identifiers) => {
|
|
30
|
-
|
|
31
|
+
return {
|
|
31
32
|
answer: getAnswer(identifiers),
|
|
32
33
|
instruction: getInstruction(identifiers),
|
|
33
|
-
keys: [
|
|
34
|
+
keys: [],
|
|
34
35
|
answerFormat: "tex",
|
|
35
36
|
identifiers,
|
|
37
|
+
hint: getHint(identifiers),
|
|
38
|
+
correction: getCorrection(identifiers),
|
|
36
39
|
};
|
|
37
|
-
return question;
|
|
38
40
|
};
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
+
const getHint = (identifiers) => {
|
|
42
|
+
const { rank } = identifiers;
|
|
43
|
+
let corr = `La formule qui est donnée est une formule de récurrence. Pour calculer $u_1$, tu peux remplacer $n$ par $0$ dans la formule.`;
|
|
44
|
+
if (rank > 1) {
|
|
45
|
+
corr += `
|
|
46
|
+
|
|
47
|
+
Tu peux ensuite répéter cette méthode : remplace $n$ par $1$ et utilise la valeur de $u_1$ que tu as trouvée pour déterminer $u_2$.`;
|
|
48
|
+
}
|
|
49
|
+
return corr;
|
|
50
|
+
};
|
|
51
|
+
const getCorrection = (identifiers) => {
|
|
52
|
+
const { rank, u0, coeffs } = identifiers;
|
|
53
|
+
const u = new Polynomial(coeffs, "u_n");
|
|
54
|
+
let currentValue = u0;
|
|
55
|
+
const values = [u0];
|
|
56
|
+
for (let i = 0; i < rank; i++) {
|
|
57
|
+
currentValue = u.calculate(currentValue);
|
|
58
|
+
values.push(currentValue);
|
|
59
|
+
}
|
|
60
|
+
let corr = `On remplace $n$ par $0$ :
|
|
61
|
+
|
|
62
|
+
$$
|
|
63
|
+
u_1 = ${u.toTree().toDetailedEvaluation({ u_n: u0.toTree() }).toTex()}
|
|
64
|
+
$$
|
|
65
|
+
|
|
66
|
+
donc $u_1 = ${values[1].frenchify()}$.
|
|
67
|
+
|
|
68
|
+
`;
|
|
69
|
+
if (rank > 1) {
|
|
70
|
+
corr += `Puis, on se sert de ce résultat pour trouver $u_2$ : on remplace $n$ par $1$ dans la formule de récurrence :
|
|
71
|
+
|
|
72
|
+
$$
|
|
73
|
+
u_2 = ${u.toTree().toDetailedEvaluation({ u_n: values[1].toTree() }).toTex()}
|
|
74
|
+
$$
|
|
75
|
+
|
|
76
|
+
donc $u_2 = ${values[2].frenchify()}$.
|
|
77
|
+
|
|
78
|
+
`;
|
|
79
|
+
}
|
|
80
|
+
if (rank > 2) {
|
|
81
|
+
corr += `De même pour trouver $u_3$ :
|
|
82
|
+
|
|
83
|
+
$$
|
|
84
|
+
u_2 = ${u.toTree().toDetailedEvaluation({ u_n: values[2].toTree() }).toTex()}
|
|
85
|
+
$$
|
|
86
|
+
|
|
87
|
+
donc $u_2 = ${values[3].frenchify()}$.`;
|
|
88
|
+
}
|
|
89
|
+
return corr;
|
|
90
|
+
};
|
|
91
|
+
const getRecurrenceFormulaUsageQuestion = (opts) => {
|
|
92
|
+
const type = opts?.functionType?.length
|
|
93
|
+
? random(opts.functionType)
|
|
94
|
+
: random(["Affine", "Second degré"]);
|
|
95
|
+
const coeffs = type === "Affine"
|
|
96
|
+
? [randint(-5, 6), randint(-5, 6, [0])]
|
|
97
|
+
: [randint(-5, 6), randint(-5, 6), randint(-3, 4, [0])];
|
|
41
98
|
const u0 = randint(-2, 3, [0]);
|
|
42
|
-
const
|
|
99
|
+
const texRank = opts?.askedRank?.length
|
|
100
|
+
? random(opts.askedRank)
|
|
101
|
+
: random(["$1$", "$2$", "$3$"]);
|
|
102
|
+
const rank = Number(texRank[1]);
|
|
43
103
|
const identifiers = { rank, u0, coeffs };
|
|
44
|
-
return getQuestionFromIdentifiers(identifiers);
|
|
104
|
+
return getQuestionFromIdentifiers(identifiers, opts);
|
|
45
105
|
};
|
|
46
106
|
const getPropositions = (n, { answer, rank, coeffs }) => {
|
|
47
107
|
const propositions = [];
|
|
@@ -57,16 +117,36 @@ const getPropositions = (n, { answer, rank, coeffs }) => {
|
|
|
57
117
|
const isAnswerValid = (ans, { answer, rank }) => {
|
|
58
118
|
return [answer, `u_{${rank}}=${answer}`, `u_${rank}=${answer}`].includes(ans);
|
|
59
119
|
};
|
|
120
|
+
const options = [
|
|
121
|
+
{
|
|
122
|
+
id: "functionType",
|
|
123
|
+
label: "Type de fonction",
|
|
124
|
+
values: ["Affine", "Second degré"],
|
|
125
|
+
target: GeneratorOptionTarget.generation,
|
|
126
|
+
type: GeneratorOptionType.multiselect,
|
|
127
|
+
defaultValue: ["Affine", "Second degré"],
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
id: "askedRank",
|
|
131
|
+
label: "Rang demandé",
|
|
132
|
+
values: ["$1$", "$2$", "$3$"],
|
|
133
|
+
target: GeneratorOptionTarget.generation,
|
|
134
|
+
type: GeneratorOptionType.multiselect,
|
|
135
|
+
defaultValue: ["$1$", "$2$", "$3$"],
|
|
136
|
+
},
|
|
137
|
+
];
|
|
60
138
|
export const recurrenceFormulaUsage = {
|
|
61
139
|
id: "recurrenceFormulaUsage",
|
|
62
140
|
connector: "=",
|
|
63
141
|
label: "Utiliser la formule de récurrence d'une suite",
|
|
64
142
|
isSingleStep: true,
|
|
65
|
-
generator: (nb) => getDistinctQuestions(getRecurrenceFormulaUsageQuestion, nb),
|
|
143
|
+
generator: (nb, opts) => getDistinctQuestions(() => getRecurrenceFormulaUsageQuestion(opts), nb),
|
|
66
144
|
qcmTimer: 60,
|
|
67
145
|
freeTimer: 60,
|
|
68
146
|
getPropositions,
|
|
69
147
|
isAnswerValid,
|
|
70
148
|
subject: "Mathématiques",
|
|
71
149
|
getQuestionFromIdentifiers,
|
|
150
|
+
options,
|
|
151
|
+
hasHintAndCorrection: true,
|
|
72
152
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"associatePoint.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/circle/associatePoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"associatePoint.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/circle/associatePoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAQ7C,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,eAAe,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAgIF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAchD,CAAC"}
|
|
@@ -2,6 +2,9 @@ import { addValidProp, propWhile, shuffleProps, tryToAddWrongProp, } from "../..
|
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { RemarkableValueConstructor } from "../../../../math/trigonometry/remarkableValue.js";
|
|
4
4
|
import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
5
|
+
import { PiNode } from "../../../../tree/nodes/numbers/piNode.js";
|
|
6
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
7
|
+
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
5
8
|
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
6
9
|
import { random } from "../../../../utils/alea/random.js";
|
|
7
10
|
const points = [
|
|
@@ -32,12 +35,55 @@ const getAnswer = (identifiers) => {
|
|
|
32
35
|
const { point } = identifiers;
|
|
33
36
|
return point;
|
|
34
37
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
const getHint = (identifiers) => {
|
|
39
|
+
const { angleIdentifiers } = identifiers;
|
|
40
|
+
const angle = reifyAlgebraic(angleIdentifiers);
|
|
41
|
+
const isSimplifiable = angle.evaluate() > Math.PI || angle.evaluate() <= -Math.PI;
|
|
42
|
+
let hint = "";
|
|
43
|
+
if (isSimplifiable) {
|
|
44
|
+
hint += `Commence par te ramener à l'intervalle $]-\\pi; \\pi]$, en ajoutant ou en retirant un multiple de $2\\pi$ à $${angle.toTex()}$.
|
|
45
|
+
|
|
46
|
+
`;
|
|
47
|
+
}
|
|
48
|
+
return hint + `Le cercle trigonométrique a un périmètre de $2\\pi$.`;
|
|
49
|
+
};
|
|
50
|
+
const getCorrection = (identifiers) => {
|
|
51
|
+
const { angleIdentifiers } = identifiers;
|
|
52
|
+
const angle = reifyAlgebraic(angleIdentifiers);
|
|
53
|
+
const isSimplifiable = angle.evaluate() > Math.PI || angle.evaluate() <= -Math.PI;
|
|
54
|
+
let corr = "";
|
|
55
|
+
if (isSimplifiable) {
|
|
56
|
+
let toAdd = 0;
|
|
57
|
+
let newAngle = angle;
|
|
58
|
+
let counter = 0;
|
|
59
|
+
while (newAngle.evaluate() > Math.PI || newAngle.evaluate() <= -Math.PI) {
|
|
60
|
+
counter++;
|
|
61
|
+
if (counter > 1000)
|
|
62
|
+
throw new Error("too many iterations in remarkable values");
|
|
63
|
+
if (newAngle.evaluate() > 0)
|
|
64
|
+
toAdd--;
|
|
65
|
+
else
|
|
66
|
+
toAdd++;
|
|
67
|
+
console.log(newAngle.evaluate(), toAdd);
|
|
68
|
+
newAngle = add(newAngle, multiply(toAdd > 0 ? 2 : -2, PiNode)).simplify();
|
|
69
|
+
}
|
|
70
|
+
// const raw = frac(angle, PiNode).simplify();
|
|
71
|
+
corr += `On se ramène à l'intervalle $]-\\pi; \\pi]$ :
|
|
72
|
+
|
|
73
|
+
$$
|
|
74
|
+
${add(angle, multiply(2 * toAdd, PiNode)).toTex()} = ${newAngle.toTex()}
|
|
75
|
+
$$`;
|
|
76
|
+
}
|
|
77
|
+
return (corr +
|
|
78
|
+
`
|
|
79
|
+
|
|
80
|
+
On se sert du cercle trigonométrique ci-dessous :
|
|
81
|
+
|
|
82
|
+

|
|
83
|
+
|
|
84
|
+
Le point cherché est donc $${getAnswer(identifiers)}$.
|
|
85
|
+
`);
|
|
86
|
+
};
|
|
41
87
|
const getQuestionFromIdentifiers = (identifiers) => {
|
|
42
88
|
const question = {
|
|
43
89
|
answer: getAnswer(identifiers),
|
|
@@ -45,6 +91,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
45
91
|
keys: points,
|
|
46
92
|
answerFormat: "tex",
|
|
47
93
|
identifiers,
|
|
94
|
+
hint: getHint(identifiers),
|
|
95
|
+
correction: getCorrection(identifiers),
|
|
48
96
|
};
|
|
49
97
|
return question;
|
|
50
98
|
};
|
|
@@ -83,4 +131,5 @@ export const associatePoint = {
|
|
|
83
131
|
isAnswerValid,
|
|
84
132
|
subject: "Mathématiques",
|
|
85
133
|
getQuestionFromIdentifiers,
|
|
134
|
+
hasHintAndCorrection: true,
|
|
86
135
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectQuadrantOnTrigoCircle.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"selectQuadrantOnTrigoCircle.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAIrC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AA8FF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAuB7D,CAAC"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { addValidProp,
|
|
1
|
+
import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
4
|
-
const getPropositions = (
|
|
4
|
+
const getPropositions = (_n, { answer }) => {
|
|
5
5
|
const propositions = [];
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
tryToAddWrongProp(propositions, color, "raw");
|
|
6
|
+
["Bleu", "Jaune", "Rouge", "Vert"].forEach((color) => {
|
|
7
|
+
(color === answer ? addValidProp : tryToAddWrongProp)(propositions, color, "raw");
|
|
9
8
|
});
|
|
10
|
-
return
|
|
9
|
+
return propositions;
|
|
11
10
|
};
|
|
12
11
|
const getAnswer = (identifiers) => {
|
|
13
12
|
return ["Bleu", "Rouge", "Vert", "Jaune"][identifiers.quartant];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"associateAngleSimplification.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/functions/associateAngleSimplification.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,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":"associateAngleSimplification.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/functions/associateAngleSimplification.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA8JF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAsB9D,CAAC"}
|
|
@@ -95,9 +95,7 @@ $$`;
|
|
|
95
95
|
corr += `
|
|
96
96
|
|
|
97
97
|
$$
|
|
98
|
-
${multiply(d, fct(substract(PiNode, "x"))).toTex()} = ${isCos
|
|
99
|
-
? multiply(-d, cos(substract(PiNode, "x"))).toTex()
|
|
100
|
-
: multiply(d, sin(substract(PiNode, "x"))).toTex()}
|
|
98
|
+
${multiply(d, fct(substract(PiNode, "x"))).toTex()} = ${isCos ? multiply(-d, cos("x")).toTex() : multiply(d, sin("x")).toTex()}
|
|
101
99
|
$$`;
|
|
102
100
|
}
|
|
103
101
|
corr += `
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polynomialVEA.d.ts","sourceRoot":"","sources":["../../../src/exercises/vea/polynomialVEA.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,EAAE,QAAQ,MAAM,YAmBxD,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { getArrNodeCoeffOfPolynomialNode } from "../../math/utils/polynomial/polynomialUtils.js";
|
|
2
|
+
import { substract } from "../../tree/nodes/operators/substractNode.js";
|
|
3
|
+
import { parseAlgebraic } from "../../tree/parsers/latexParser.js";
|
|
4
|
+
import { zip } from "../../utils/arrays/arrayZip.js";
|
|
5
|
+
import { handleVEAError } from "../../utils/errors/handleVEAError.js";
|
|
6
|
+
export const polynomialVEA = (ans, answer) => {
|
|
7
|
+
try {
|
|
8
|
+
const nodeAns = parseAlgebraic(ans);
|
|
9
|
+
const nodeAnswer = parseAlgebraic(answer);
|
|
10
|
+
const [arrNodeCoeffAns, arrNodeCoeffAnswer] = [nodeAns, nodeAnswer].map((node) => getArrNodeCoeffOfPolynomialNode(node));
|
|
11
|
+
return (arrNodeCoeffAns.length === arrNodeCoeffAnswer.length &&
|
|
12
|
+
zip(arrNodeCoeffAns, arrNodeCoeffAnswer).every(([nodeCoeffAns, nodeCoeffAnswer]) => substract(nodeCoeffAns, nodeCoeffAnswer).evaluate() === 0));
|
|
13
|
+
}
|
|
14
|
+
catch (err) {
|
|
15
|
+
return handleVEAError(err);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param ans tableau du student
|
|
4
|
+
* @param answerTable tableau réponse
|
|
5
|
+
* TODO passer en argument le VEA check qui est ajd fixé à rationalVEA
|
|
6
|
+
*/
|
|
7
|
+
export declare const valueTableVEA: (ans: string[][], answerTable: string[][]) => boolean;
|
|
8
|
+
//# sourceMappingURL=valueTableVEA.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"valueTableVEA.d.ts","sourceRoot":"","sources":["../../../src/exercises/vea/valueTableVEA.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,EAAE,EAAE,EAAE,aAAa,MAAM,EAAE,EAAE,YAOrE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param ans tableau du student
|
|
4
|
+
* @param answerTable tableau réponse
|
|
5
|
+
* TODO passer en argument le VEA check qui est ajd fixé à rationalVEA
|
|
6
|
+
*/
|
|
7
|
+
import { rationalVEA } from "./rationalVEA.js";
|
|
8
|
+
export const valueTableVEA = (ans, answerTable) => {
|
|
9
|
+
return ans.every((row, i) => {
|
|
10
|
+
return row.every((cell, j) => cell === answerTable[i][j] || rationalVEA(cell, answerTable[i][j]));
|
|
11
|
+
});
|
|
12
|
+
};
|
package/lib/index.d.ts
CHANGED
|
@@ -1597,13 +1597,6 @@ declare const mathExercises: (Exercise<{
|
|
|
1597
1597
|
expBRounded: number;
|
|
1598
1598
|
precision: number;
|
|
1599
1599
|
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
1600
|
-
nodeIdsA: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
1601
|
-
nodeIdsB: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
1602
|
-
nodeIdsAOpB: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
1603
|
-
rand: number;
|
|
1604
|
-
}, {
|
|
1605
|
-
isUseExpNotation: boolean;
|
|
1606
|
-
}> | Exercise<{
|
|
1607
1600
|
nodeIdsF: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
1608
1601
|
nodeIdsT: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
1609
1602
|
x: number;
|
|
@@ -1838,8 +1831,6 @@ declare const mathExercises: (Exercise<{
|
|
|
1838
1831
|
isMinusInside: boolean;
|
|
1839
1832
|
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
1840
1833
|
k: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
1841
|
-
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
1842
|
-
nodeIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers[];
|
|
1843
1834
|
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
1844
1835
|
isFindU: boolean;
|
|
1845
1836
|
nodeIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers[];
|
|
@@ -2861,15 +2852,6 @@ declare const mathExercises: (Exercise<{
|
|
|
2861
2852
|
kIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
2862
2853
|
uCoeffs: number[];
|
|
2863
2854
|
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
2864
|
-
flip: number;
|
|
2865
|
-
pA?: number;
|
|
2866
|
-
pB?: number;
|
|
2867
|
-
pAB?: number;
|
|
2868
|
-
pA_B?: number;
|
|
2869
|
-
pB_A?: number;
|
|
2870
|
-
}, {
|
|
2871
|
-
probaType: string[];
|
|
2872
|
-
}> | Exercise<{
|
|
2873
2855
|
randomValues: number[];
|
|
2874
2856
|
randomEffectives: number[];
|
|
2875
2857
|
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
@@ -3014,6 +2996,7 @@ declare const mathExercises: (Exercise<{
|
|
|
3014
2996
|
allowedAnsType: string[];
|
|
3015
2997
|
}, {
|
|
3016
2998
|
allowedAnsType: string[];
|
|
2999
|
+
probaTypes: string[];
|
|
3017
3000
|
}> | Exercise<{
|
|
3018
3001
|
exerciseVars: {
|
|
3019
3002
|
n: number;
|
|
@@ -3205,6 +3188,25 @@ declare const mathExercises: (Exercise<{
|
|
|
3205
3188
|
situationIndex: number;
|
|
3206
3189
|
dictShuffle: Record<string, string>;
|
|
3207
3190
|
pType: string;
|
|
3191
|
+
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
3192
|
+
flip: number;
|
|
3193
|
+
pA?: number;
|
|
3194
|
+
pB?: number;
|
|
3195
|
+
pAB?: number;
|
|
3196
|
+
pA_B?: number;
|
|
3197
|
+
pB_A?: number;
|
|
3198
|
+
}, {
|
|
3199
|
+
probaType: string[];
|
|
3200
|
+
}> | Exercise<{
|
|
3201
|
+
params: import("./exercises/math/probaStat/trees/probaTreeSituations.js").ProbaTreeSituationParams;
|
|
3202
|
+
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
3203
|
+
situationIndex: number;
|
|
3204
|
+
aCapB: number;
|
|
3205
|
+
aCapBBarre: number;
|
|
3206
|
+
aBarreCapB: number;
|
|
3207
|
+
aBarreCapBBarre: number;
|
|
3208
|
+
knowing: "A" | "\\overline{A}" | "B" | "\\overline{B}";
|
|
3209
|
+
asked: "A" | "\\overline{A}" | "B" | "\\overline{B}";
|
|
3208
3210
|
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
3209
3211
|
situationIndex: number;
|
|
3210
3212
|
values: number[];
|
|
@@ -3396,28 +3398,6 @@ declare const mathExercises: (Exercise<{
|
|
|
3396
3398
|
value2: number;
|
|
3397
3399
|
precisionInitial: number;
|
|
3398
3400
|
precisionReason: number;
|
|
3399
|
-
}, import("./exercises/options/optionFirstTermRankOne.js").OptionFirstTermRankOne> | Exercise<{
|
|
3400
|
-
rank1: number;
|
|
3401
|
-
value1: number;
|
|
3402
|
-
rank2: number;
|
|
3403
|
-
value2: number;
|
|
3404
|
-
precisionInitial: number;
|
|
3405
|
-
precisionReason: number;
|
|
3406
|
-
}, import("./exercises/options/optionFirstTermRankOne.js").OptionFirstTermRankOne> | Exercise<{
|
|
3407
|
-
rank1: number;
|
|
3408
|
-
value1: number;
|
|
3409
|
-
rank2: number;
|
|
3410
|
-
value2: number;
|
|
3411
|
-
precisionInitial: number;
|
|
3412
|
-
precisionReason: number;
|
|
3413
|
-
rankAsked: number;
|
|
3414
|
-
}, import("./exercises/options/optionFirstTermRankOne.js").OptionFirstTermRankOne> | Exercise<{
|
|
3415
|
-
rank1: number;
|
|
3416
|
-
value1: number;
|
|
3417
|
-
rank2: number;
|
|
3418
|
-
value2: number;
|
|
3419
|
-
precisionInitial: number;
|
|
3420
|
-
precisionReason: number;
|
|
3421
3401
|
rankAsked: number;
|
|
3422
3402
|
}, import("./exercises/options/optionFirstTermRankOne.js").OptionFirstTermRankOne> | Exercise<{
|
|
3423
3403
|
raison: number;
|
|
@@ -3443,11 +3423,6 @@ declare const mathExercises: (Exercise<{
|
|
|
3443
3423
|
initial: number;
|
|
3444
3424
|
reason: number;
|
|
3445
3425
|
superfluousData?: import("./math/utils/sequences/situations/seqGeometricSituations.js").SituationGeometricSuperfluousData;
|
|
3446
|
-
}, import("./exercises/options/optionFirstTermRankOne.js").OptionFirstTermRankOne & import("./exercises/options/optionIsWithSuperfluousData.js").OptionIsWithSuperfluousData> | Exercise<{
|
|
3447
|
-
situationIndex: number;
|
|
3448
|
-
initial: number;
|
|
3449
|
-
reason: number;
|
|
3450
|
-
superfluousData?: import("./math/utils/sequences/situations/seqGeometricSituations.js").SituationGeometricSuperfluousData;
|
|
3451
3426
|
}, import("./exercises/options/optionFirstTermRankOne.js").OptionFirstTermRankOne & import("./exercises/options/optionIsWithSuperfluousData.js").OptionIsWithSuperfluousData> | Exercise<{
|
|
3452
3427
|
situationIndex: number;
|
|
3453
3428
|
initial: number;
|
|
@@ -3457,13 +3432,18 @@ declare const mathExercises: (Exercise<{
|
|
|
3457
3432
|
}, import("./exercises/options/optionFirstTermRankOne.js").OptionFirstTermRankOne & import("./exercises/options/optionIsWithSuperfluousData.js").OptionIsWithSuperfluousData> | Exercise<{
|
|
3458
3433
|
rank: number;
|
|
3459
3434
|
coeffs: number[];
|
|
3460
|
-
},
|
|
3435
|
+
}, {
|
|
3436
|
+
functionType: string[];
|
|
3437
|
+
}> | Exercise<{
|
|
3461
3438
|
coeffs: number[];
|
|
3462
3439
|
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
3463
3440
|
rank: number;
|
|
3464
3441
|
u0: number;
|
|
3465
3442
|
coeffs: number[];
|
|
3466
|
-
},
|
|
3443
|
+
}, {
|
|
3444
|
+
functionType: string[];
|
|
3445
|
+
askedRank: string[];
|
|
3446
|
+
}> | Exercise<{
|
|
3467
3447
|
termeid: number;
|
|
3468
3448
|
affine: number[];
|
|
3469
3449
|
termeAdd: number;
|