math-exercises 3.0.198 → 3.0.200
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/exercises/exercise.d.ts +14 -1
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/math/_debug/debugReorder1.d.ts +8 -0
- package/lib/exercises/math/_debug/debugReorder1.d.ts.map +1 -0
- package/lib/exercises/math/_debug/debugReorder1.js +81 -0
- package/lib/exercises/math/_debug/debugReorder2.d.ts +10 -0
- package/lib/exercises/math/_debug/debugReorder2.d.ts.map +1 -0
- package/lib/exercises/math/_debug/debugReorder2.js +88 -0
- package/lib/exercises/math/_debug/debugReorder3.d.ts +10 -0
- package/lib/exercises/math/_debug/debugReorder3.d.ts.map +1 -0
- package/lib/exercises/math/_debug/debugReorder3.js +81 -0
- package/lib/exercises/math/_debug/index.d.ts +3 -1
- package/lib/exercises/math/_debug/index.d.ts.map +1 -1
- package/lib/exercises/math/_debug/index.js +3 -1
- package/lib/exercises/math/calcul/factorial/index.d.ts +2 -0
- package/lib/exercises/math/calcul/factorial/index.d.ts.map +1 -0
- package/lib/exercises/math/calcul/factorial/index.js +1 -0
- package/lib/exercises/math/calcul/factorial/simplifyQuotientOfFactorialToProduct.d.ts +8 -0
- package/lib/exercises/math/calcul/factorial/simplifyQuotientOfFactorialToProduct.d.ts.map +1 -0
- package/lib/exercises/math/calcul/factorial/simplifyQuotientOfFactorialToProduct.js +199 -0
- package/lib/exercises/math/calculLitteral/equation/exp/expOfTrinomEquals1Equation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/exp/expOfTrinomEquals1Equation.js +3 -0
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.js +58 -30
- package/lib/exercises/math/combinatory/combination/index.d.ts +3 -0
- package/lib/exercises/math/combinatory/combination/index.d.ts.map +1 -0
- package/lib/exercises/math/combinatory/combination/index.js +2 -0
- package/lib/exercises/math/combinatory/combination/mentalCalculateCombination.d.ts +11 -0
- package/lib/exercises/math/combinatory/combination/mentalCalculateCombination.d.ts.map +1 -0
- package/lib/exercises/math/combinatory/combination/mentalCalculateCombination.js +225 -0
- package/lib/exercises/math/combinatory/combination/writeCombinationFormulaUsingFactorial.d.ts +13 -0
- package/lib/exercises/math/combinatory/combination/writeCombinationFormulaUsingFactorial.d.ts.map +1 -0
- package/lib/exercises/math/combinatory/combination/writeCombinationFormulaUsingFactorial.js +285 -0
- package/lib/exercises/math/complex/addComplex.d.ts.map +1 -1
- package/lib/exercises/math/complex/addComplex.js +53 -7
- package/lib/exercises/math/complex/conjugateComplex.d.ts.map +1 -1
- package/lib/exercises/math/complex/conjugateComplex.js +48 -7
- package/lib/exercises/math/complex/mutiplyComplex.d.ts.map +1 -1
- package/lib/exercises/math/complex/mutiplyComplex.js +51 -18
- package/lib/exercises/math/complex/reAndIm.d.ts.map +1 -1
- package/lib/exercises/math/complex/reAndIm.js +35 -4
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotInterpreting.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotInterpreting.js +1 -1
- package/lib/exercises/math/derivation/derivative/trigo/cosSecondDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/trigo/cosSecondDegreeDerivative.js +47 -3
- package/lib/exercises/math/derivation/derivative/trigo/productOfSinAXPlusBCosCXPlusDDerivative.d.ts +9 -0
- package/lib/exercises/math/derivation/derivative/trigo/productOfSinAXPlusBCosCXPlusDDerivative.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/trigo/productOfSinAXPlusBCosCXPlusDDerivative.js +209 -0
- package/lib/exercises/math/derivation/derivative/trigo/sinAndCosMixedWithSquareDerivative.d.ts +9 -0
- package/lib/exercises/math/derivation/derivative/trigo/sinAndCosMixedWithSquareDerivative.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/trigo/sinAndCosMixedWithSquareDerivative.js +359 -0
- package/lib/exercises/math/derivation/derivative/trigo/sinCosDerivativeRewriteUsingCos2PlusSin2Equals1.d.ts +11 -0
- package/lib/exercises/math/derivation/derivative/trigo/sinCosDerivativeRewriteUsingCos2PlusSin2Equals1.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/trigo/sinCosDerivativeRewriteUsingCos2PlusSin2Equals1.js +445 -0
- package/lib/exercises/math/functions/affines/affineVarTableOnBoundedInterval.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineVarTableOnBoundedInterval.js +2 -3
- package/lib/exercises/math/functions/exponential/sign/expFunctionBasicSign.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/sign/expFunctionBasicSign.js +3 -0
- package/lib/exercises/math/functions/sign/affineProductSign.d.ts.map +1 -1
- package/lib/exercises/math/functions/sign/affineProductSign.js +0 -4
- package/lib/exercises/math/index.d.ts +1 -0
- package/lib/exercises/math/index.d.ts.map +1 -1
- package/lib/exercises/math/index.js +1 -1
- package/lib/exercises/math/limits/sequenceGeometricLimit.d.ts.map +1 -1
- package/lib/exercises/math/limits/sequenceGeometricLimit.js +9 -0
- package/lib/exercises/math/primitive/constantPrimitive.d.ts +8 -5
- package/lib/exercises/math/primitive/constantPrimitive.d.ts.map +1 -1
- package/lib/exercises/math/primitive/constantPrimitive.js +40 -21
- package/lib/exercises/math/probaStat/stats2var/averagePoint.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats2var/averagePoint.js +34 -2
- package/lib/exercises/math/sequences/geometric/graph/geometricFindThresholdFromGraph.d.ts +15 -0
- package/lib/exercises/math/sequences/geometric/graph/geometricFindThresholdFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/graph/geometricFindThresholdFromGraph.js +255 -0
- package/lib/exercises/math/sequences/geometric/graph/geometricFindThresholdUsingCalculator.d.ts +15 -0
- package/lib/exercises/math/sequences/geometric/graph/geometricFindThresholdUsingCalculator.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/graph/geometricFindThresholdUsingCalculator.js +242 -0
- package/lib/exercises/math/sequences/geometric/graph/geometricPlaceFirstPoints.js +4 -4
- package/lib/exercises/math/sequences/geometric/graph/geometricSignOfReasonFromGraph.d.ts +12 -0
- package/lib/exercises/math/sequences/geometric/graph/geometricSignOfReasonFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/graph/geometricSignOfReasonFromGraph.js +161 -0
- package/lib/exercises/math/sets/cartesianProduct/findCardinalOfCartesianProductOfFiniteSets.d.ts +10 -0
- package/lib/exercises/math/sets/cartesianProduct/findCardinalOfCartesianProductOfFiniteSets.d.ts.map +1 -0
- package/lib/exercises/math/sets/cartesianProduct/findCardinalOfCartesianProductOfFiniteSets.js +224 -0
- package/lib/exercises/math/sets/cartesianProduct/findCardinalOfCartesianProductOfFiniteSetsFromSituation.d.ts +18 -0
- package/lib/exercises/math/sets/cartesianProduct/findCardinalOfCartesianProductOfFiniteSetsFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sets/cartesianProduct/findCardinalOfCartesianProductOfFiniteSetsFromSituation.js +198 -0
- package/lib/exercises/math/sets/cartesianProduct/findCardinalOfPowEK.d.ts +10 -0
- package/lib/exercises/math/sets/cartesianProduct/findCardinalOfPowEK.d.ts.map +1 -0
- package/lib/exercises/math/sets/cartesianProduct/findCardinalOfPowEK.js +231 -0
- package/lib/exercises/math/sets/cartesianProduct/findNumberOfPasswordsWithLettersAndNumbers.d.ts +19 -0
- package/lib/exercises/math/sets/cartesianProduct/findNumberOfPasswordsWithLettersAndNumbers.d.ts.map +1 -0
- package/lib/exercises/math/sets/cartesianProduct/findNumberOfPasswordsWithLettersAndNumbers.js +187 -0
- package/lib/exercises/math/sets/cartesianProduct/index.d.ts +7 -0
- package/lib/exercises/math/sets/cartesianProduct/index.d.ts.map +1 -0
- package/lib/exercises/math/sets/cartesianProduct/index.js +6 -0
- package/lib/exercises/math/sets/cartesianProduct/proposeElementInCartesianProductOfFiniteSets.d.ts +15 -0
- package/lib/exercises/math/sets/cartesianProduct/proposeElementInCartesianProductOfFiniteSets.d.ts.map +1 -0
- package/lib/exercises/math/sets/cartesianProduct/proposeElementInCartesianProductOfFiniteSets.js +291 -0
- package/lib/exercises/math/sets/cartesianProduct/proposeElementInPowEK.d.ts +15 -0
- package/lib/exercises/math/sets/cartesianProduct/proposeElementInPowEK.d.ts.map +1 -0
- package/lib/exercises/math/sets/cartesianProduct/proposeElementInPowEK.js +274 -0
- package/lib/exercises/math/sets/combinations/findNumberOfCombinationsFromSituation.d.ts +17 -0
- package/lib/exercises/math/sets/combinations/findNumberOfCombinationsFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sets/combinations/findNumberOfCombinationsFromSituation.js +228 -0
- package/lib/exercises/math/sets/combinations/findNumberOfProductsOfCombinationsFromSituation.d.ts +17 -0
- package/lib/exercises/math/sets/combinations/findNumberOfProductsOfCombinationsFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sets/combinations/findNumberOfProductsOfCombinationsFromSituation.js +388 -0
- package/lib/exercises/math/sets/combinations/index.d.ts +4 -0
- package/lib/exercises/math/sets/combinations/index.d.ts.map +1 -0
- package/lib/exercises/math/sets/combinations/index.js +3 -0
- package/lib/exercises/math/sets/combinations/proposeCombination.d.ts +15 -0
- package/lib/exercises/math/sets/combinations/proposeCombination.d.ts.map +1 -0
- package/lib/exercises/math/sets/combinations/proposeCombination.js +347 -0
- package/lib/exercises/math/sets/partialPermutations/findNumberOfPartialPermutationsFromSituation.d.ts +16 -0
- package/lib/exercises/math/sets/partialPermutations/findNumberOfPartialPermutationsFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sets/partialPermutations/findNumberOfPartialPermutationsFromSituation.js +186 -0
- package/lib/exercises/math/sets/partialPermutations/findNumberOfPermutationsFromSituation.d.ts +17 -0
- package/lib/exercises/math/sets/partialPermutations/findNumberOfPermutationsFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sets/partialPermutations/findNumberOfPermutationsFromSituation.js +232 -0
- package/lib/exercises/math/sets/partialPermutations/index.d.ts +4 -0
- package/lib/exercises/math/sets/partialPermutations/index.d.ts.map +1 -0
- package/lib/exercises/math/sets/partialPermutations/index.js +3 -0
- package/lib/exercises/math/sets/partialPermutations/proposePartialPermutation.d.ts +15 -0
- package/lib/exercises/math/sets/partialPermutations/proposePartialPermutation.d.ts.map +1 -0
- package/lib/exercises/math/sets/partialPermutations/proposePartialPermutation.js +343 -0
- package/lib/exercises/math/spaceGeometry/vectors/spaceVectorLinearCombinationCoords.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/functions/parityOfCosAXTimesSinBX.d.ts +8 -0
- package/lib/exercises/math/trigonometry/functions/parityOfCosAXTimesSinBX.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/functions/parityOfCosAXTimesSinBX.js +193 -0
- package/lib/index.d.ts +15 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/math/sets/setOperations.d.ts +9 -0
- package/lib/math/sets/setOperations.d.ts.map +1 -0
- package/lib/math/sets/setOperations.js +84 -0
- package/lib/math/sets/tuple.d.ts +12 -0
- package/lib/math/sets/tuple.d.ts.map +1 -0
- package/lib/math/sets/tuple.js +17 -0
- package/lib/server.js +28 -2
- package/lib/tests/pdfExo.test.js +2 -2
- package/lib/tests/pdfs/buildPDFForExercise.d.ts.map +1 -1
- package/lib/tests/pdfs/buildPDFForExercise.js +6 -0
- package/lib/tests/pdfs/quizPdfPreambule.d.ts.map +1 -1
- package/lib/tests/pdfs/quizPdfPreambule.js +1 -0
- package/lib/tests/pdfs/treeDiagramToLatex.d.ts +15 -0
- package/lib/tests/pdfs/treeDiagramToLatex.d.ts.map +1 -0
- package/lib/tests/pdfs/treeDiagramToLatex.js +49 -0
- package/lib/tests/questionTest.d.ts.map +1 -1
- package/lib/tests/questionTest.js +19 -0
- package/lib/tree/utilities/nodePrinter.d.ts +7 -0
- package/lib/tree/utilities/nodePrinter.d.ts.map +1 -0
- package/lib/tree/utilities/nodePrinter.js +36 -0
- package/package.json +1 -1
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { nodeByReplacingNodeAtPath } from "../../../../../math/utils/functions/functionComposition.js";
|
|
4
|
+
import { randint } from "../../../../../math/utils/random/randint.js";
|
|
5
|
+
import { cos, CosNode } from "../../../../../tree/nodes/functions/cosNode.js";
|
|
6
|
+
import { isFunctionNode } from "../../../../../tree/nodes/functions/functionNode.js";
|
|
7
|
+
import { sin, SinNode } from "../../../../../tree/nodes/functions/sinNode.js";
|
|
8
|
+
import { NodeIds } from "../../../../../tree/nodes/node.js";
|
|
9
|
+
import { NodeConstructor, } from "../../../../../tree/nodes/nodeConstructor.js";
|
|
10
|
+
import { isNumberNode } from "../../../../../tree/nodes/numbers/numberNode.js";
|
|
11
|
+
import { add } from "../../../../../tree/nodes/operators/addNode.js";
|
|
12
|
+
import { multiply, } from "../../../../../tree/nodes/operators/multiplyNode.js";
|
|
13
|
+
import { isOperatorNode, } from "../../../../../tree/nodes/operators/operatorNode.js";
|
|
14
|
+
import { isPowerNode, isSquareNode, power, square, } from "../../../../../tree/nodes/operators/powerNode.js";
|
|
15
|
+
import { substract } from "../../../../../tree/nodes/operators/substractNode.js";
|
|
16
|
+
import { VariableNode } from "../../../../../tree/nodes/variables/variableNode.js";
|
|
17
|
+
import { parseAlgebraic } from "../../../../../tree/parsers/latexParser.js";
|
|
18
|
+
import { NodeComparator } from "../../../../../tree/utilities/nodeComparator.js";
|
|
19
|
+
import { NodePrinter } from "../../../../../tree/utilities/nodePrinter.js";
|
|
20
|
+
import { coinFlip } from "../../../../../utils/alea/coinFlip.js";
|
|
21
|
+
import { shuffle } from "../../../../../utils/alea/shuffle.js";
|
|
22
|
+
import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
|
|
23
|
+
import { alignTex } from "../../../../../utils/latex/alignTex.js";
|
|
24
|
+
function myRewrite(node, createFuncRewrite) {
|
|
25
|
+
const funcRewrite = createFuncRewrite(node);
|
|
26
|
+
if (funcRewrite !== undefined) {
|
|
27
|
+
const nodeRewritten = funcRewrite(node);
|
|
28
|
+
return nodeRewritten;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
if (isOperatorNode(node)) {
|
|
32
|
+
return nodeByReplacingNodeAtPath(nodeByReplacingNodeAtPath(node, { keys: ["leftChild"] }, myRewrite(node.leftChild, createFuncRewrite)), { keys: ["rightChild"] }, myRewrite(node.rightChild, createFuncRewrite));
|
|
33
|
+
}
|
|
34
|
+
else if (isFunctionNode(node)) {
|
|
35
|
+
return nodeByReplacingNodeAtPath(node, { keys: ["child"] }, myRewrite(node.child, createFuncRewrite));
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
return node;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const mySimplify = (node) => {
|
|
43
|
+
const rewriteCosToCAndSinToS = (node) => myRewrite(node, (node) => {
|
|
44
|
+
if (node.toTex() === "\\cos\\left(x\\right)") {
|
|
45
|
+
return () => new VariableNode("c");
|
|
46
|
+
}
|
|
47
|
+
else if (node.toTex() === "\\sin\\left(x\\right)") {
|
|
48
|
+
return () => new VariableNode("s");
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
const rewriteCToCosAndSToSin = (node) => myRewrite(node, (node) => {
|
|
55
|
+
if (node.toTex() === "c") {
|
|
56
|
+
return () => new CosNode(new VariableNode("x"));
|
|
57
|
+
}
|
|
58
|
+
else if (node.toTex() === "s") {
|
|
59
|
+
return () => new SinNode(new VariableNode("x"));
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
const nodeCSRaw = rewriteCosToCAndSinToS(node);
|
|
66
|
+
const nodeCSSimplified = nodeCSRaw.simplify({
|
|
67
|
+
towardsDistribute: true,
|
|
68
|
+
forbidFactorize: true,
|
|
69
|
+
});
|
|
70
|
+
const nodeMySimplified = rewriteCToCosAndSToSin(nodeCSSimplified);
|
|
71
|
+
return nodeMySimplified;
|
|
72
|
+
};
|
|
73
|
+
const getPrettyNodeDerivative = (node) => {
|
|
74
|
+
if (isPowerNode(node)) {
|
|
75
|
+
const nodeDerivativeUgly = node.derivative();
|
|
76
|
+
const nodeDerivativeLeft = nodeDerivativeUgly.leftChild;
|
|
77
|
+
const nodeDerivativeRight = nodeDerivativeUgly.rightChild;
|
|
78
|
+
const nodeDerivativePretty = multiply(nodeDerivativeLeft.leftChild, multiply(nodeDerivativeLeft.rightChild.simplify({
|
|
79
|
+
towardsDistribute: true,
|
|
80
|
+
forbidFactorize: true,
|
|
81
|
+
}), nodeDerivativeRight));
|
|
82
|
+
return nodeDerivativePretty;
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
return node.derivative();
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
const getInstruction = (identifiers) => {
|
|
89
|
+
const { nodeIdsLambda, nodeIdsU, nodeIdsV, nodeIdsRewriteUsing } = identifiers;
|
|
90
|
+
const [nodeLambda, nodeU, nodeV, nodeRewriteUsing] = [
|
|
91
|
+
nodeIdsLambda,
|
|
92
|
+
nodeIdsU,
|
|
93
|
+
nodeIdsV,
|
|
94
|
+
nodeIdsRewriteUsing,
|
|
95
|
+
].map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
|
|
96
|
+
const nodeF = multiply(nodeLambda, multiply(nodeU, nodeV)).simplify();
|
|
97
|
+
return `Soit la fonction $f$ définie sur $\\mathbb{R}$ par :
|
|
98
|
+
|
|
99
|
+
$$
|
|
100
|
+
f(x) = ${nodeF.toTex()}
|
|
101
|
+
$$
|
|
102
|
+
|
|
103
|
+
Calculer $f'(x)$, et l'exprimer uniquement en fonction de $${nodeRewriteUsing.toTex()}$.`;
|
|
104
|
+
};
|
|
105
|
+
const getNodeFDerivativeStuff = (identifiers) => {
|
|
106
|
+
const { nodeIdsLambda, nodeIdsU, nodeIdsV } = identifiers;
|
|
107
|
+
const [nodeLambda, nodeU, nodeV] = [nodeIdsLambda, nodeIdsU, nodeIdsV].map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
|
|
108
|
+
// const nodeF = multiply(nodeLambda, multiply(nodeU, nodeV)).simplify();
|
|
109
|
+
const [nodeUPrime, nodeVPrime] = [nodeU, nodeV].map(getPrettyNodeDerivative);
|
|
110
|
+
//f' = lambda (u'v+uv')
|
|
111
|
+
return {
|
|
112
|
+
nodeFDerivative0: multiply(nodeLambda, add(multiply(nodeUPrime, nodeV), multiply(nodeU, nodeVPrime))),
|
|
113
|
+
nodeFDerivative1: multiply(nodeLambda, add(mySimplify(multiply(nodeUPrime, nodeV).simplify()), mySimplify(multiply(nodeU, nodeVPrime).simplify()))),
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
const getAnswerNode = (identifiers) => {
|
|
117
|
+
const { nodeIdsRewriteUsing } = identifiers;
|
|
118
|
+
const { nodeFDerivative1: nodeDerivative1 } = getNodeFDerivativeStuff(identifiers);
|
|
119
|
+
const createFuncRewrite = (node) => {
|
|
120
|
+
const isPowerNode2 = (node) => isPowerNode(node) &&
|
|
121
|
+
isNumberNode(node.rightChild) &&
|
|
122
|
+
node.rightChild.value === 2;
|
|
123
|
+
if (isSquareNode(node) || isPowerNode2(node)) {
|
|
124
|
+
const nodeIdsLeftChild = node.leftChild.toIdentifiers();
|
|
125
|
+
switch (nodeIdsRewriteUsing.id) {
|
|
126
|
+
case NodeIds.cos:
|
|
127
|
+
if (nodeIdsLeftChild.id === NodeIds.sin) {
|
|
128
|
+
return (node) => {
|
|
129
|
+
const nodeSin = node.leftChild;
|
|
130
|
+
return substract(1, power(cos(nodeSin.child), 2));
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
return undefined;
|
|
135
|
+
}
|
|
136
|
+
case NodeIds.sin:
|
|
137
|
+
if (nodeIdsLeftChild.id === NodeIds.cos) {
|
|
138
|
+
return (node) => {
|
|
139
|
+
const nodeCos = node.leftChild;
|
|
140
|
+
return substract(1, power(sin(nodeCos.child), 2));
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
return undefined;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
return undefined;
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
const nodeDerivative2 = myRewrite(nodeDerivative1, createFuncRewrite);
|
|
153
|
+
return nodeDerivative2;
|
|
154
|
+
};
|
|
155
|
+
const getAnswer = (identifiers) => {
|
|
156
|
+
return mySimplify(getAnswerNode(identifiers)).toTex();
|
|
157
|
+
};
|
|
158
|
+
const getHint = (_identifiers) => {
|
|
159
|
+
return `Si $u$ et $v$ sont deux fonctions dérivables alors,
|
|
160
|
+
pour $x$ dans l'ensemble de dérivation de $u \\circ v = x \\mapsto u(v(x))$, on a :
|
|
161
|
+
|
|
162
|
+
$$
|
|
163
|
+
(u \\circ v)'(x) = v'(x)u'(v(x))
|
|
164
|
+
$$
|
|
165
|
+
|
|
166
|
+
Une fois que tu as obtenu la dérivée, réécris-la en utilisant la formule,
|
|
167
|
+
pour tout $x$ réel :
|
|
168
|
+
|
|
169
|
+
$$
|
|
170
|
+
\\sin^{2}{(x)} + \\cos^{2}{(x)} = 1
|
|
171
|
+
$$
|
|
172
|
+
|
|
173
|
+
`;
|
|
174
|
+
};
|
|
175
|
+
const getCorrection = (identifiers) => {
|
|
176
|
+
const { nodeIdsLambda, nodeIdsU, nodeIdsV } = identifiers;
|
|
177
|
+
const [nodeLambda, nodeU, nodeV] = [nodeIdsLambda, nodeIdsU, nodeIdsV].map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
|
|
178
|
+
const [nodeUPrime, nodeVPrime] = [nodeU, nodeV].map(getPrettyNodeDerivative);
|
|
179
|
+
const { nodeFDerivative0, nodeFDerivative1 } = getNodeFDerivativeStuff(identifiers);
|
|
180
|
+
const nodeAnswer = getAnswerNode(identifiers);
|
|
181
|
+
return `On doit calculer la dérivée d'un produit.
|
|
182
|
+
|
|
183
|
+
${(() => {
|
|
184
|
+
if (nodeLambda.evaluate() === 1) {
|
|
185
|
+
return `Ici, $f(x) = u(x) v(x)$ avec :`;
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
return `Ici, $f(x) = \\lambda u(x) v(x)$ avec :
|
|
189
|
+
|
|
190
|
+
$$
|
|
191
|
+
\\lambda = ${nodeLambda.toTex({})}
|
|
192
|
+
$$
|
|
193
|
+
|
|
194
|
+
`;
|
|
195
|
+
}
|
|
196
|
+
})()}
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
$$
|
|
200
|
+
u(x) = ${nodeU.toTex({})}
|
|
201
|
+
$$
|
|
202
|
+
|
|
203
|
+
$$
|
|
204
|
+
v(x) = ${nodeV.toTex()}
|
|
205
|
+
$$
|
|
206
|
+
|
|
207
|
+
On calcule (dérivées de fonctions composées):
|
|
208
|
+
|
|
209
|
+
$$
|
|
210
|
+
u'(x) = ${nodeUPrime.toTex()}
|
|
211
|
+
$$
|
|
212
|
+
|
|
213
|
+
$$
|
|
214
|
+
v'(x) = ${nodeVPrime.toTex()}
|
|
215
|
+
$$
|
|
216
|
+
|
|
217
|
+
Donc :
|
|
218
|
+
|
|
219
|
+
${alignTex([
|
|
220
|
+
[
|
|
221
|
+
`f'(x)`,
|
|
222
|
+
`=`,
|
|
223
|
+
nodeLambda.evaluate() === 1
|
|
224
|
+
? `u'(x)v(x)+u(x)v'(x)`
|
|
225
|
+
: `\\lambda(u'(x)v(x)+u(x)v'(x))`,
|
|
226
|
+
],
|
|
227
|
+
[``, `=`, NodePrinter.toTexWithMaxWidth(nodeFDerivative0, 70)],
|
|
228
|
+
[``, `=`, nodeFDerivative1.toTex()],
|
|
229
|
+
])}
|
|
230
|
+
|
|
231
|
+
Pour tout $x$ réel, on a :
|
|
232
|
+
|
|
233
|
+
$$
|
|
234
|
+
\\sin^{2}{(x)} + \\cos^{2}{(x)} = 1
|
|
235
|
+
$$
|
|
236
|
+
|
|
237
|
+
On peut donc réécrire :
|
|
238
|
+
|
|
239
|
+
${alignTex([
|
|
240
|
+
[`f'(x)`, `=`, nodeAnswer.toTex()],
|
|
241
|
+
[``, `=`, mySimplify(nodeAnswer).toTex()],
|
|
242
|
+
])}
|
|
243
|
+
|
|
244
|
+
`;
|
|
245
|
+
};
|
|
246
|
+
const getPropositions = (n, { answer: _answer, ...identifiers }) => {
|
|
247
|
+
const { nodeIdsU, nodeIdsV, nodeIdsRewriteUsing } = identifiers;
|
|
248
|
+
const [nodeU, nodeV] = [nodeIdsU, nodeIdsV].map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
|
|
249
|
+
const [_nodeUPrime, _nodeVPrime] = [nodeU, nodeV].map((node) => node.derivative().simplify());
|
|
250
|
+
const maxWidthForTex = 70;
|
|
251
|
+
const propositions = [];
|
|
252
|
+
const nodeAnswer = mySimplify(getAnswerNode(identifiers));
|
|
253
|
+
addValidProp(propositions, NodePrinter.toTexWithMaxWidth(nodeAnswer, maxWidthForTex));
|
|
254
|
+
//student: cos^2(x) - sin^2(x) = 1
|
|
255
|
+
{
|
|
256
|
+
const { nodeFDerivative1: nodeDerivative1 } = getNodeFDerivativeStuff(identifiers);
|
|
257
|
+
const createFuncRewrite = (node) => {
|
|
258
|
+
const isPowerNode2 = (node) => isPowerNode(node) &&
|
|
259
|
+
isNumberNode(node.rightChild) &&
|
|
260
|
+
node.rightChild.value === 2;
|
|
261
|
+
if (isSquareNode(node) || isPowerNode2(node)) {
|
|
262
|
+
const nodeIdsLeftChild = node.leftChild.toIdentifiers();
|
|
263
|
+
switch (nodeIdsRewriteUsing.id) {
|
|
264
|
+
case NodeIds.cos:
|
|
265
|
+
if (nodeIdsLeftChild.id === NodeIds.sin) {
|
|
266
|
+
return (node) => {
|
|
267
|
+
const nodeSin = node.leftChild;
|
|
268
|
+
return substract(power(cos(nodeSin.child), 2), 1);
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
return undefined;
|
|
273
|
+
}
|
|
274
|
+
case NodeIds.sin:
|
|
275
|
+
if (nodeIdsLeftChild.id === NodeIds.cos) {
|
|
276
|
+
return (node) => {
|
|
277
|
+
const nodeCos = node.leftChild;
|
|
278
|
+
return add(1, power(sin(nodeCos.child), 2));
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
return undefined;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
return undefined;
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
const nodeDerivative2 = myRewrite(nodeDerivative1, createFuncRewrite);
|
|
291
|
+
try {
|
|
292
|
+
const nodeWrong = mySimplify(nodeDerivative2);
|
|
293
|
+
tryToAddWrongProp(propositions, NodePrinter.toTexWithMaxWidth(nodeWrong, maxWidthForTex));
|
|
294
|
+
}
|
|
295
|
+
catch (e) {
|
|
296
|
+
console.log(e);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
//student: cos^2(x) + sin^2(x) = -1
|
|
300
|
+
{
|
|
301
|
+
const { nodeFDerivative1: nodeDerivative1 } = getNodeFDerivativeStuff(identifiers);
|
|
302
|
+
const createFuncRewrite = (node) => {
|
|
303
|
+
const isPowerNode2 = (node) => isPowerNode(node) &&
|
|
304
|
+
isNumberNode(node.rightChild) &&
|
|
305
|
+
node.rightChild.value === 2;
|
|
306
|
+
if (isSquareNode(node) || isPowerNode2(node)) {
|
|
307
|
+
const nodeIdsLeftChild = node.leftChild.toIdentifiers();
|
|
308
|
+
switch (nodeIdsRewriteUsing.id) {
|
|
309
|
+
case NodeIds.cos:
|
|
310
|
+
if (nodeIdsLeftChild.id === NodeIds.sin) {
|
|
311
|
+
return (node) => {
|
|
312
|
+
const nodeSin = node.leftChild;
|
|
313
|
+
return substract(-1, power(cos(nodeSin.child), 2));
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
else {
|
|
317
|
+
return undefined;
|
|
318
|
+
}
|
|
319
|
+
case NodeIds.sin:
|
|
320
|
+
if (nodeIdsLeftChild.id === NodeIds.cos) {
|
|
321
|
+
return (node) => {
|
|
322
|
+
const nodeCos = node.leftChild;
|
|
323
|
+
return substract(-1, power(sin(nodeCos.child), 2));
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
else {
|
|
327
|
+
return undefined;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
else {
|
|
332
|
+
return undefined;
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
const nodeDerivative2 = myRewrite(nodeDerivative1, createFuncRewrite);
|
|
336
|
+
try {
|
|
337
|
+
const nodeWrong = mySimplify(nodeDerivative2);
|
|
338
|
+
tryToAddWrongProp(propositions, NodePrinter.toTexWithMaxWidth(nodeWrong, maxWidthForTex));
|
|
339
|
+
}
|
|
340
|
+
catch (e) {
|
|
341
|
+
console.log(e);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
//student: cos(x) = sin(x)
|
|
345
|
+
{
|
|
346
|
+
const { nodeFDerivative1: nodeDerivative1 } = getNodeFDerivativeStuff(identifiers);
|
|
347
|
+
const createFuncRewrite = (node) => {
|
|
348
|
+
const isPowerNode2 = (node) => isPowerNode(node) &&
|
|
349
|
+
isNumberNode(node.rightChild) &&
|
|
350
|
+
node.rightChild.value === 2;
|
|
351
|
+
if (isSquareNode(node) || isPowerNode2(node)) {
|
|
352
|
+
const nodeIdsLeftChild = node.leftChild.toIdentifiers();
|
|
353
|
+
switch (nodeIdsRewriteUsing.id) {
|
|
354
|
+
case NodeIds.cos:
|
|
355
|
+
if (nodeIdsLeftChild.id === NodeIds.sin) {
|
|
356
|
+
return (node) => {
|
|
357
|
+
const nodeSin = node.leftChild;
|
|
358
|
+
return power(cos(nodeSin.child), 2);
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
else {
|
|
362
|
+
return undefined;
|
|
363
|
+
}
|
|
364
|
+
case NodeIds.sin:
|
|
365
|
+
if (nodeIdsLeftChild.id === NodeIds.cos) {
|
|
366
|
+
return (node) => {
|
|
367
|
+
const nodeCos = node.leftChild;
|
|
368
|
+
return power(sin(nodeCos.child), 2);
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
else {
|
|
372
|
+
return undefined;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
else {
|
|
377
|
+
return undefined;
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
const nodeDerivative2 = myRewrite(nodeDerivative1, createFuncRewrite);
|
|
381
|
+
try {
|
|
382
|
+
const nodeWrong = mySimplify(nodeDerivative2);
|
|
383
|
+
tryToAddWrongProp(propositions, NodePrinter.toTexWithMaxWidth(nodeWrong, maxWidthForTex));
|
|
384
|
+
}
|
|
385
|
+
catch (e) {
|
|
386
|
+
console.log(e);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
return shuffleProps(propositions, n);
|
|
390
|
+
};
|
|
391
|
+
const isAnswerValid = (ans, { answer, ...identifiers }) => {
|
|
392
|
+
try {
|
|
393
|
+
const nodeAns = parseAlgebraic(ans);
|
|
394
|
+
const nodeAnswer = getAnswerNode(identifiers);
|
|
395
|
+
return NodeComparator.isEqualViaRandomEvaluations(nodeAns, nodeAnswer, 3);
|
|
396
|
+
}
|
|
397
|
+
catch (e) {
|
|
398
|
+
handleVEAError(e);
|
|
399
|
+
return false;
|
|
400
|
+
}
|
|
401
|
+
};
|
|
402
|
+
const getSinCosDerivativeRewriteUsingCos2PlusSin2Equals1Question = () => {
|
|
403
|
+
const nodeVarX = new VariableNode("x");
|
|
404
|
+
const createRandomFactorNode = () => ((coinFlip() ? +1 : -1) * randint(1, 7)).toTree();
|
|
405
|
+
const [func1, func2] = shuffle([sin, cos]);
|
|
406
|
+
const nodeLambda = createRandomFactorNode();
|
|
407
|
+
const node1 = square(func1(nodeVarX));
|
|
408
|
+
const node2 = func2(nodeVarX);
|
|
409
|
+
const [nodeU, nodeV] = shuffle([node1, node2]);
|
|
410
|
+
const identifiers = {
|
|
411
|
+
nodeIdsLambda: nodeLambda.toIdentifiers(),
|
|
412
|
+
nodeIdsU: nodeU.toIdentifiers(),
|
|
413
|
+
nodeIdsV: nodeV.toIdentifiers(),
|
|
414
|
+
nodeIdsRewriteUsing: func1(nodeVarX).toIdentifiers(),
|
|
415
|
+
};
|
|
416
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
417
|
+
};
|
|
418
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
419
|
+
const question = {
|
|
420
|
+
answer: getAnswer(identifiers),
|
|
421
|
+
instruction: getInstruction(identifiers),
|
|
422
|
+
keys: ["x", "sin", "cos", "tan"],
|
|
423
|
+
answerFormat: "tex",
|
|
424
|
+
identifiers,
|
|
425
|
+
hint: getHint(identifiers),
|
|
426
|
+
correction: getCorrection(identifiers),
|
|
427
|
+
};
|
|
428
|
+
return question;
|
|
429
|
+
};
|
|
430
|
+
export const sinCosDerivativeRewriteUsingCos2PlusSin2Equals1 = {
|
|
431
|
+
id: "sinCosDerivativeRewriteUsingCos2PlusSin2Equals1",
|
|
432
|
+
connector: "=",
|
|
433
|
+
label: "Dérivée de $\\sin{(x)}\\cos^{2}{(x)}$ ou $\\sin^{2}{(x)}\\cos{(x)}$ à exprimer en fonction de $\\cos{(x)}$ ou $\\sin{(x)}$ uniquement",
|
|
434
|
+
isSingleStep: true,
|
|
435
|
+
generator: (nb) => getDistinctQuestions(getSinCosDerivativeRewriteUsingCos2PlusSin2Equals1Question, nb),
|
|
436
|
+
qcmTimer: 60,
|
|
437
|
+
freeTimer: 60,
|
|
438
|
+
getPropositions,
|
|
439
|
+
isAnswerValid,
|
|
440
|
+
subject: "Mathématiques",
|
|
441
|
+
getInstruction,
|
|
442
|
+
getAnswer,
|
|
443
|
+
getQuestionFromIdentifiers,
|
|
444
|
+
hasHintAndCorrection: true,
|
|
445
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"affineVarTableOnBoundedInterval.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/affineVarTableOnBoundedInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAK7C,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,eAAe,EAAE,CAAC;IACjC,QAAQ,EAAE,eAAe,CAAC;CAC3B,CAAC;
|
|
1
|
+
{"version":3,"file":"affineVarTableOnBoundedInterval.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/affineVarTableOnBoundedInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAK7C,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,eAAe,EAAE,CAAC;IACjC,QAAQ,EAAE,eAAe,CAAC;CAC3B,CAAC;AA6KF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAqBjE,CAAC"}
|
|
@@ -10,14 +10,13 @@ const getInstruction = (identifiers) => {
|
|
|
10
10
|
const [nodeX1, nodeX2] = nodeIdsBounds.map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
|
|
11
11
|
const nodeF = NodeConstructor.fromIdentifiers(nodeIdsF);
|
|
12
12
|
const strInterval = `[${nodeX1.toTex()};${nodeX2.toTex()}]`;
|
|
13
|
-
return `
|
|
14
|
-
|
|
15
|
-
On donne, pour tout $x$ dans $${strInterval}$ :
|
|
13
|
+
return `Soit $f$ la fonction définie sur $${strInterval}$ par :
|
|
16
14
|
|
|
17
15
|
$$
|
|
18
16
|
f(x) = ${nodeF.toTex()}
|
|
19
17
|
$$
|
|
20
18
|
|
|
19
|
+
Dresser le tableau de variations de la fonction $f$ sur l'intervalle $${strInterval}$.
|
|
21
20
|
`;
|
|
22
21
|
};
|
|
23
22
|
const getAnswerTable = (identifiers) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expFunctionBasicSign.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/exponential/sign/expFunctionBasicSign.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IAGjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAwFF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"expFunctionBasicSign.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/exponential/sign/expFunctionBasicSign.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IAGjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAwFF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAqBtD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"affineProductSign.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/sign/affineProductSign.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,wBAAwB,EACzB,MAAM,yCAAyC,CAAC;AAejD,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,wBAAwB,CAAC;IACrC,UAAU,EAAE,wBAAwB,CAAC;IACrC,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;
|
|
1
|
+
{"version":3,"file":"affineProductSign.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/sign/affineProductSign.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,wBAAwB,EACzB,MAAM,yCAAyC,CAAC;AAejD,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,wBAAwB,CAAC;IACrC,UAAU,EAAE,wBAAwB,CAAC;IACrC,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AA6IF,KAAK,OAAO,GAAG;IACb,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAaF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAiB5D,CAAC"}
|
|
@@ -75,8 +75,6 @@ $$
|
|
|
75
75
|
|
|
76
76
|
Sur quel(s) intervalle(s) $f$ est-elle ${isAskingPositive ? "positive" : "négative"} ?`;
|
|
77
77
|
};
|
|
78
|
-
// const getHint: GetHint<Identifiers, Options> = (identifiers, opts) => {};
|
|
79
|
-
// const getCorrection: GetCorrection<Identifiers, Options> = (identifiers) => {};
|
|
80
78
|
const getKeys = () => {
|
|
81
79
|
return ["lbracket", "semicolon", "rbracket", "cup", "infty"];
|
|
82
80
|
};
|
|
@@ -114,8 +112,6 @@ const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
|
114
112
|
keys: getKeys(identifiers, opts),
|
|
115
113
|
answerFormat: "tex",
|
|
116
114
|
identifiers,
|
|
117
|
-
// hint: getHint(identifiers, opts),
|
|
118
|
-
// correction: getCorrection(identifiers, opts),
|
|
119
115
|
};
|
|
120
116
|
return question;
|
|
121
117
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/math/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/math/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequenceGeometricLimit.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/limits/sequenceGeometricLimit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAE7C,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,eAAe,CAAC;IACxB,SAAS,EAAE,eAAe,CAAC;CAC5B,CAAC;
|
|
1
|
+
{"version":3,"file":"sequenceGeometricLimit.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/limits/sequenceGeometricLimit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAE7C,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,eAAe,CAAC;IACxB,SAAS,EAAE,eAAe,CAAC;CAC5B,CAAC;AA4EF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAgBxD,CAAC"}
|
|
@@ -17,6 +17,12 @@ const getAnswer = (identifiers) => {
|
|
|
17
17
|
const answer = sequence.getLimit();
|
|
18
18
|
return answer.toTex();
|
|
19
19
|
};
|
|
20
|
+
// const getHint: GetHint<Identifiers> = (identifiers)=>{
|
|
21
|
+
// return ``
|
|
22
|
+
// }
|
|
23
|
+
// const getCorrection: GetCorrection<Identifiers> = (identifiers)=>{
|
|
24
|
+
// return ``
|
|
25
|
+
// }
|
|
20
26
|
const getSequenceGeometricLimitQuestion = () => {
|
|
21
27
|
const sequence = GeometricSequenceConstructor.randomWithLimit();
|
|
22
28
|
const identifiers = {
|
|
@@ -32,6 +38,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
32
38
|
keys: ["infty"],
|
|
33
39
|
answerFormat: "tex",
|
|
34
40
|
identifiers,
|
|
41
|
+
// hint: getHint(identifiers),
|
|
42
|
+
// correction: getCorrection(identifiers),
|
|
35
43
|
};
|
|
36
44
|
return question;
|
|
37
45
|
};
|
|
@@ -62,4 +70,5 @@ export const sequenceGeometricLimit = {
|
|
|
62
70
|
getAnswer,
|
|
63
71
|
getInstruction,
|
|
64
72
|
getQuestionFromIdentifiers,
|
|
73
|
+
// hasHintAndCorrection: true,
|
|
65
74
|
};
|
|
@@ -2,10 +2,13 @@ import { Exercise, GetQuestionFromIdentifiers, QCMGenerator, QuestionGenerator,
|
|
|
2
2
|
type Identifiers = {
|
|
3
3
|
c: number;
|
|
4
4
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
5
|
+
type Options = {
|
|
6
|
+
askParticularPrimitive?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const getConstantPrimitive: QuestionGenerator<Identifiers, Options>;
|
|
9
|
+
export declare const getConstantPrimitiveQuestionFromIdentifiers: GetQuestionFromIdentifiers<Identifiers, Options>;
|
|
10
|
+
export declare const getConstantPrimitivePropositions: QCMGenerator<Identifiers, Options>;
|
|
11
|
+
export declare const isConstantPrimitiveAnswerValid: VEA<Identifiers, Options>;
|
|
12
|
+
export declare const constantPrimitive: Exercise<Identifiers, Options>;
|
|
10
13
|
export {};
|
|
11
14
|
//# sourceMappingURL=constantPrimitive.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constantPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/constantPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAGR,0BAA0B,EAE1B,YAAY,EAEZ,iBAAiB,EACjB,GAAG,
|
|
1
|
+
{"version":3,"file":"constantPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/constantPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAGR,0BAA0B,EAE1B,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAOJ,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC,CAAC;AAgCF,eAAO,MAAM,oBAAoB,EAAE,iBAAiB,CAAC,WAAW,EAAE,OAAO,CAMxE,CAAC;AAEF,eAAO,MAAM,2CAA2C,EAAE,0BAA0B,CAClF,WAAW,EACX,OAAO,CAaR,CAAC;AACF,eAAO,MAAM,gCAAgC,EAAE,YAAY,CAAC,WAAW,EAAE,OAAO,CAmB/E,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,GAAG,CAAC,WAAW,EAAE,OAAO,CAQpE,CAAC;AAYF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAc5D,CAAC"}
|