math-exercises 3.0.49 → 3.0.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/exercises/math/calcul/addAndSubWithoutRelatives.d.ts.map +1 -1
- package/lib/exercises/math/calcul/operations/expressionNature.d.ts.map +1 -1
- package/lib/exercises/math/calcul/ordering/decimalOrdering.d.ts.map +1 -1
- package/lib/exercises/math/calcul/ordering/decimalOrdering.js +0 -2
- package/lib/exercises/math/calcul/proportionality/proportionalityTable.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/proportionalityTable.js +6 -0
- package/lib/exercises/math/calcul/proportionality/proportionalityTableCoefficient.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/proportionalityTableCoefficient.js +33 -3
- package/lib/exercises/math/calculLitteral/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/index.js +1 -0
- package/lib/exercises/math/calculLitteral/isolate/index.d.ts +2 -0
- package/lib/exercises/math/calculLitteral/isolate/index.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/isolate/index.js +2 -0
- package/lib/exercises/math/calculLitteral/isolate/isolateVariable.d.ts +2 -0
- package/lib/exercises/math/calculLitteral/isolate/isolateVariable.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/isolate/isolateVariable.js +83 -0
- package/lib/exercises/math/calculLitteral/simplifying/reduceExpression.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/lnDerivativeThree.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/rootFunctionDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/rootFunctionDerivative.js +1 -1
- package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineExpressionReading.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/signFunction.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/inverseImageFunction.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/inverseImageFunction.js +16 -3
- package/lib/exercises/math/functions/trinoms/equation/secondDegreeInequation.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationFromCano.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/rootsFromFactorizedForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/rootsFromFactorizedForm.js +10 -0
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromDevForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromDevForm.js +31 -16
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromRoots.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromRoots.js +50 -14
- package/lib/exercises/math/geometry/cartesian/directionVectorEquation.d.ts +1 -0
- package/lib/exercises/math/geometry/cartesian/directionVectorEquation.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/directionVectorEquation.js +48 -40
- package/lib/exercises/math/geometry/lines/isPointOnLine.js +1 -1
- package/lib/exercises/math/geometry/lines/linesRelativePositions.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/linesRelativePositions.js +0 -2
- package/lib/exercises/math/geometry/vectors/scalarProduct/angleFromScalarProduct.d.ts +8 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/angleFromScalarProduct.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/angleFromScalarProduct.js +93 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/findCoordinatesToOrthogonalize.d.ts +9 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/findCoordinatesToOrthogonalize.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/findCoordinatesToOrthogonalize.js +111 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/index.d.ts +3 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/index.js +3 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductIdentities.d.ts +10 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductIdentities.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductIdentities.js +174 -0
- package/lib/exercises/math/geometry/vectors/vectorLinearCombination.js +2 -2
- package/lib/exercises/math/primitive/constantPrimitive.d.ts.map +1 -1
- package/lib/exercises/math/primitive/constantPrimitive.js +22 -5
- package/lib/exercises/math/primitive/expUPrimitive.d.ts.map +1 -1
- package/lib/exercises/math/primitive/expUPrimitive.js +25 -7
- package/lib/exercises/math/primitive/exponentialPrimitive.d.ts.map +1 -1
- package/lib/exercises/math/primitive/exponentialPrimitive.js +23 -5
- package/lib/exercises/math/primitive/index.d.ts +2 -0
- package/lib/exercises/math/primitive/index.d.ts.map +1 -1
- package/lib/exercises/math/primitive/index.js +2 -0
- package/lib/exercises/math/primitive/kexpUPrimitive.d.ts +9 -0
- package/lib/exercises/math/primitive/kexpUPrimitive.d.ts.map +1 -0
- package/lib/exercises/math/primitive/kexpUPrimitive.js +130 -0
- package/lib/exercises/math/primitive/klogUPrimitive.d.ts +9 -0
- package/lib/exercises/math/primitive/klogUPrimitive.d.ts.map +1 -0
- package/lib/exercises/math/primitive/klogUPrimitive.js +120 -0
- package/lib/exercises/math/primitive/logarithmePrimitive.d.ts.map +1 -1
- package/lib/exercises/math/primitive/logarithmePrimitive.js +30 -18
- package/lib/exercises/math/primitive/polynomialPrimitive.d.ts.map +1 -1
- package/lib/exercises/math/primitive/polynomialPrimitive.js +0 -11
- package/lib/exercises/math/primitive/sinCosPrimitive.d.ts.map +1 -1
- package/lib/exercises/math/primitive/sinUCosUPrimitive.d.ts.map +1 -1
- package/lib/exercises/math/primitive/sinUCosUPrimitive.js +33 -18
- package/lib/exercises/math/probaStat/ballsBasicProbas.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/ballsBasicProbas.js +28 -4
- package/lib/exercises/math/squareRoots/squareRootIdentities.d.ts.map +1 -1
- package/lib/index.d.ts +17 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/spaceVector.d.ts +1 -2
- package/lib/math/geometry/spaceVector.d.ts.map +1 -1
- package/lib/math/geometry/vector.d.ts +8 -0
- package/lib/math/geometry/vector.d.ts.map +1 -1
- package/lib/math/geometry/vector.js +12 -1
- package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
- package/lib/math/numbers/integer/integer.d.ts.map +1 -1
- package/lib/math/numbers/integer/power.d.ts.map +1 -1
- package/lib/math/numbers/nombre.d.ts.map +1 -1
- package/lib/math/numbers/rationals/rational.d.ts.map +1 -1
- package/lib/math/numbers/reals/real.d.ts.map +1 -1
- package/lib/math/polynomials/polynomial.d.ts.map +1 -1
- package/lib/math/sequences/sequence.d.ts +3 -3
- package/lib/math/sequences/sequence.d.ts.map +1 -1
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +4 -0
- package/lib/prototypesEnhancement.d.ts.map +1 -1
- package/lib/tree/nodes/complex/complexNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equalNode.d.ts +14 -8
- package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equalNode.js +119 -6
- package/lib/tree/nodes/equations/equationSolutionNode.d.ts +8 -2
- package/lib/tree/nodes/equations/equationSolutionNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equationSolutionNode.js +14 -0
- package/lib/tree/nodes/equations/multiEqualNode.d.ts +7 -1
- package/lib/tree/nodes/equations/multiEqualNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/multiEqualNode.js +14 -0
- package/lib/tree/nodes/functions/arccosNode.d.ts +1 -0
- package/lib/tree/nodes/functions/arccosNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/arccosNode.js +4 -0
- package/lib/tree/nodes/functions/integralNode.d.ts +8 -3
- package/lib/tree/nodes/functions/integralNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/integralNode.js +14 -0
- package/lib/tree/nodes/geometry/pointNode.d.ts +8 -2
- package/lib/tree/nodes/geometry/pointNode.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/pointNode.js +14 -0
- package/lib/tree/nodes/geometry/vectorNode.d.ts +8 -2
- package/lib/tree/nodes/geometry/vectorNode.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/vectorNode.js +14 -0
- package/lib/tree/nodes/inequations/inequationNode.d.ts +8 -3
- package/lib/tree/nodes/inequations/inequationNode.d.ts.map +1 -1
- package/lib/tree/nodes/inequations/inequationNode.js +14 -0
- package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts +8 -2
- package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts.map +1 -1
- package/lib/tree/nodes/inequations/inequationSolutionNode.js +14 -0
- package/lib/tree/nodes/nodeConstructor.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/percentNode.d.ts +10 -3
- package/lib/tree/nodes/numbers/percentNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/percentNode.js +17 -1
- package/lib/tree/nodes/operators/scalarProductNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/belongsNode.d.ts +11 -5
- package/lib/tree/nodes/sets/belongsNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/belongsNode.js +14 -0
- package/lib/tree/parsers/affineParser.d.ts.map +1 -1
- package/lib/tree/parsers/affineParser.js +0 -1
- package/lib/tree/parsers/equationSolutionParser.d.ts +1 -1
- package/lib/tree/parsers/equationSolutionParser.d.ts.map +1 -1
- package/lib/tree/parsers/vectorParser.d.ts +3 -0
- package/lib/tree/parsers/vectorParser.d.ts.map +1 -0
- package/lib/tree/parsers/vectorParser.js +13 -0
- package/package.json +1 -1
|
@@ -5,17 +5,33 @@ import { randint } from "../../../math/utils/random/randint.js";
|
|
|
5
5
|
import { AddNode } from "../../../tree/nodes/operators/addNode.js";
|
|
6
6
|
import { VariableNode } from "../../../tree/nodes/variables/variableNode.js";
|
|
7
7
|
import { shuffle } from "../../../utils/alea/shuffle.js";
|
|
8
|
-
|
|
9
|
-
const c =
|
|
8
|
+
const getInstruction = (identifiers) => {
|
|
9
|
+
const { c } = identifiers;
|
|
10
|
+
return `Déterminer la forme générale des primitives de la fonction constante $f$ définie par :
|
|
11
|
+
|
|
12
|
+
$$
|
|
13
|
+
f(x) = ${c}
|
|
14
|
+
$$`;
|
|
15
|
+
};
|
|
16
|
+
const getAnswer = (identifiers) => {
|
|
17
|
+
const { c } = identifiers;
|
|
10
18
|
const monom = new Monom(1, c);
|
|
11
19
|
const answer = new AddNode(monom.toTree(), new VariableNode("C")).toTex();
|
|
20
|
+
return answer;
|
|
21
|
+
};
|
|
22
|
+
export const getConstantPrimitive = () => {
|
|
23
|
+
const c = randint(-19, 20, [0]);
|
|
24
|
+
const identifiers = { c };
|
|
25
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
26
|
+
};
|
|
27
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
12
28
|
const question = {
|
|
13
|
-
instruction:
|
|
29
|
+
instruction: getInstruction(identifiers),
|
|
14
30
|
startStatement: `F(x)`,
|
|
15
|
-
answer,
|
|
31
|
+
answer: getAnswer(identifiers),
|
|
16
32
|
keys: ["x", "C"],
|
|
17
33
|
answerFormat: "tex",
|
|
18
|
-
identifiers
|
|
34
|
+
identifiers,
|
|
19
35
|
};
|
|
20
36
|
return question;
|
|
21
37
|
};
|
|
@@ -48,4 +64,5 @@ export const constantPrimitive = {
|
|
|
48
64
|
getPropositions: getConstantPrimitivePropositions,
|
|
49
65
|
isAnswerValid: isConstantPrimitiveAnswerValid,
|
|
50
66
|
subject: "Mathématiques",
|
|
67
|
+
getQuestionFromIdentifiers,
|
|
51
68
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expUPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/expUPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"expUPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/expUPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAKR,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAIJ,MAAM,6BAA6B,CAAC;AAcrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AA0BF,eAAO,MAAM,gBAAgB,EAAE,iBAAiB,CAAC,WAAW,CAK3D,CAAC;AAgBF,eAAO,MAAM,4BAA4B,EAAE,YAAY,CAAC,WAAW,CAiClE,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,GAAG,CAAC,WAAW,CAYvD,CAAC;AACF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAa/C,CAAC"}
|
|
@@ -8,18 +8,37 @@ import { AddNode } from "../../../tree/nodes/operators/addNode.js";
|
|
|
8
8
|
import { FractionNode } from "../../../tree/nodes/operators/fractionNode.js";
|
|
9
9
|
import { MultiplyNode } from "../../../tree/nodes/operators/multiplyNode.js";
|
|
10
10
|
import { VariableNode } from "../../../tree/nodes/variables/variableNode.js";
|
|
11
|
-
|
|
12
|
-
const
|
|
11
|
+
const getInstruction = (identifiers) => {
|
|
12
|
+
const { coeffs } = identifiers;
|
|
13
|
+
const u = new Polynomial(coeffs);
|
|
13
14
|
const integratedFuction = new ExpNode(u.toTree());
|
|
14
15
|
const selectedFunction = new MultiplyNode(u.derivate().toTree(), integratedFuction);
|
|
16
|
+
return `Déterminer la forme générale des primitives de la fonction $f$ définie par :
|
|
17
|
+
|
|
18
|
+
$$
|
|
19
|
+
f(x) = ${selectedFunction.toTex()}
|
|
20
|
+
$$`;
|
|
21
|
+
};
|
|
22
|
+
const getAnswer = (identifiers) => {
|
|
23
|
+
const { coeffs } = identifiers;
|
|
24
|
+
const u = new Polynomial(coeffs);
|
|
25
|
+
const integratedFuction = new ExpNode(u.toTree());
|
|
15
26
|
const answer = new AddNode(integratedFuction, new VariableNode("C")).toTex();
|
|
27
|
+
return answer;
|
|
28
|
+
};
|
|
29
|
+
export const getExpUPrimitive = () => {
|
|
30
|
+
const u = PolynomialConstructor.randomWithOrder(randint(1, 3));
|
|
31
|
+
const identifiers = { coeffs: u.coefficients };
|
|
32
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
33
|
+
};
|
|
34
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
16
35
|
const question = {
|
|
17
|
-
instruction:
|
|
36
|
+
instruction: getInstruction(identifiers),
|
|
18
37
|
startStatement: `F(x)`,
|
|
19
|
-
answer,
|
|
38
|
+
answer: getAnswer(identifiers),
|
|
20
39
|
keys: ["x", "C", "epower", "exp"],
|
|
21
40
|
answerFormat: "tex",
|
|
22
|
-
identifiers
|
|
41
|
+
identifiers,
|
|
23
42
|
};
|
|
24
43
|
return question;
|
|
25
44
|
};
|
|
@@ -58,8 +77,6 @@ export const expUPrimitive = {
|
|
|
58
77
|
id: "expUPrimitive",
|
|
59
78
|
connector: "=",
|
|
60
79
|
label: "Primitive de $u'\\exp(u)$",
|
|
61
|
-
levels: ["TermSpé", "MathComp"],
|
|
62
|
-
sections: ["Primitives", "Exponentielle"],
|
|
63
80
|
isSingleStep: false,
|
|
64
81
|
generator: (nb) => getDistinctQuestions(getExpUPrimitive, nb),
|
|
65
82
|
qcmTimer: 60,
|
|
@@ -68,4 +85,5 @@ export const expUPrimitive = {
|
|
|
68
85
|
isAnswerValid: isExpUPrimitiveAnswerValid,
|
|
69
86
|
subject: "Mathématiques",
|
|
70
87
|
pdfOptions: { shouldSpreadPropositions: true },
|
|
88
|
+
getQuestionFromIdentifiers,
|
|
71
89
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exponentialPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/exponentialPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"exponentialPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/exponentialPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAKR,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAIJ,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAwBF,eAAO,MAAM,uBAAuB,EAAE,iBAAiB,CAAC,WAAW,CAIlE,CAAC;AAiBF,eAAO,MAAM,mCAAmC,EAAE,YAAY,CAAC,WAAW,CAgCzE,CAAC;AAEF,eAAO,MAAM,iCAAiC,EAAE,GAAG,CAAC,WAAW,CAY9D,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAetD,CAAC"}
|
|
@@ -8,17 +8,34 @@ import { FractionNode } from "../../../tree/nodes/operators/fractionNode.js";
|
|
|
8
8
|
import { MultiplyNode } from "../../../tree/nodes/operators/multiplyNode.js";
|
|
9
9
|
import { PowerNode } from "../../../tree/nodes/operators/powerNode.js";
|
|
10
10
|
import { VariableNode } from "../../../tree/nodes/variables/variableNode.js";
|
|
11
|
-
|
|
12
|
-
const a =
|
|
11
|
+
const getInstruction = (identifiers) => {
|
|
12
|
+
const { a } = identifiers;
|
|
13
|
+
const integratedFuction = new MultiplyNode(new NumberNode(a), new ExpNode(new VariableNode("x")));
|
|
14
|
+
return `Déterminer la forme générale des primitives de la fonction $f$ définie par :
|
|
15
|
+
|
|
16
|
+
$$
|
|
17
|
+
f(x) = ${integratedFuction.toTex()}
|
|
18
|
+
$$`;
|
|
19
|
+
};
|
|
20
|
+
const getAnswer = (identifiers) => {
|
|
21
|
+
const { a } = identifiers;
|
|
13
22
|
const integratedFuction = new MultiplyNode(new NumberNode(a), new ExpNode(new VariableNode("x")));
|
|
14
23
|
const answer = new AddNode(integratedFuction, new VariableNode("C")).toTex();
|
|
24
|
+
return answer;
|
|
25
|
+
};
|
|
26
|
+
export const getExponentialPrimitive = () => {
|
|
27
|
+
const a = randint(-20, 20, [0]);
|
|
28
|
+
const identifiers = { a };
|
|
29
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
30
|
+
};
|
|
31
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
15
32
|
const question = {
|
|
16
|
-
instruction:
|
|
33
|
+
instruction: getInstruction(identifiers),
|
|
17
34
|
startStatement: `F(x)`,
|
|
18
|
-
answer,
|
|
35
|
+
answer: getAnswer(identifiers),
|
|
19
36
|
keys: ["x", "C", "epower", "exp"],
|
|
20
37
|
answerFormat: "tex",
|
|
21
|
-
identifiers
|
|
38
|
+
identifiers,
|
|
22
39
|
};
|
|
23
40
|
return question;
|
|
24
41
|
};
|
|
@@ -64,4 +81,5 @@ export const exponentialPrimitive = {
|
|
|
64
81
|
isAnswerValid: isExponentialPrimitiveAnswerValid,
|
|
65
82
|
subject: "Mathématiques",
|
|
66
83
|
pdfOptions: { shouldSpreadPropositions: true },
|
|
84
|
+
getQuestionFromIdentifiers,
|
|
67
85
|
};
|
|
@@ -6,4 +6,6 @@ export { polynomialPrimitive } from "./polynomialPrimitive.js";
|
|
|
6
6
|
export { sinCosPrimitive } from "./sinCosPrimitive.js";
|
|
7
7
|
export { sinUCosUPrimitive } from "./sinUCosUPrimitive.js";
|
|
8
8
|
export * from "./usualPrimitives.js";
|
|
9
|
+
export * from "./kexpUPrimitive.js";
|
|
10
|
+
export * from "./klogUPrimitive.js";
|
|
9
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC"}
|
|
@@ -6,3 +6,5 @@ export { polynomialPrimitive } from "./polynomialPrimitive.js";
|
|
|
6
6
|
export { sinCosPrimitive } from "./sinCosPrimitive.js";
|
|
7
7
|
export { sinUCosUPrimitive } from "./sinUCosUPrimitive.js";
|
|
8
8
|
export * from "./usualPrimitives.js";
|
|
9
|
+
export * from "./kexpUPrimitive.js";
|
|
10
|
+
export * from "./klogUPrimitive.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercises/exercise.js";
|
|
2
|
+
import { NodeIdentifiers } from "../../../tree/nodes/nodeConstructor.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
kIds: NodeIdentifiers;
|
|
5
|
+
uCoeffs: number[];
|
|
6
|
+
};
|
|
7
|
+
export declare const kexpUPrimitive: Exercise<Identifiers>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=kexpUPrimitive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kexpUPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/kexpUPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAUrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAQ7C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,eAAe,CAAC;IACtB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AA4HF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAiBhD,CAAC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { RationalConstructor } from "../../../math/numbers/rationals/rational.js";
|
|
4
|
+
import { Polynomial, } from "../../../math/polynomials/polynomial.js";
|
|
5
|
+
import { Trinom, TrinomConstructor } from "../../../math/polynomials/trinom.js";
|
|
6
|
+
import { randint } from "../../../math/utils/random/randint.js";
|
|
7
|
+
import { exp, ExpNode } from "../../../tree/nodes/functions/expNode.js";
|
|
8
|
+
import { reifyAlgebraic, } from "../../../tree/nodes/nodeConstructor.js";
|
|
9
|
+
import { add } from "../../../tree/nodes/operators/addNode.js";
|
|
10
|
+
import { frac } from "../../../tree/nodes/operators/fractionNode.js";
|
|
11
|
+
import { multiply } from "../../../tree/nodes/operators/multiplyNode.js";
|
|
12
|
+
import { parseAlgebraic } from "../../../tree/parsers/latexParser.js";
|
|
13
|
+
import { coinFlip } from "../../../utils/alea/coinFlip.js";
|
|
14
|
+
import { handleVEAError } from "../../../utils/errors/handleVEAError.js";
|
|
15
|
+
//k u' e^u --> k e^u
|
|
16
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
17
|
+
const propositions = [];
|
|
18
|
+
const { uCoeffs, kIds } = identifiers;
|
|
19
|
+
const k = reifyAlgebraic(kIds);
|
|
20
|
+
const u = new Polynomial(uCoeffs);
|
|
21
|
+
addValidProp(propositions, answer);
|
|
22
|
+
while (propositions.length < n) {
|
|
23
|
+
const kRand = coinFlip()
|
|
24
|
+
? randint(-5, 6, [0, 1, -1]).toTree()
|
|
25
|
+
: RationalConstructor.randomIrreductibleProba().toTree();
|
|
26
|
+
tryToAddWrongProp(propositions, multiply(kRand, exp(u.toTree())).toTex() + "+C");
|
|
27
|
+
}
|
|
28
|
+
return shuffleProps(propositions, n);
|
|
29
|
+
};
|
|
30
|
+
const getAnswer = (identifiers) => {
|
|
31
|
+
const { uCoeffs, kIds } = identifiers;
|
|
32
|
+
const k = reifyAlgebraic(kIds);
|
|
33
|
+
const u = new Polynomial(uCoeffs);
|
|
34
|
+
const integratedFuction = new ExpNode(u.toTree());
|
|
35
|
+
const answer = add(multiply(k, integratedFuction), "C").toTex();
|
|
36
|
+
return answer;
|
|
37
|
+
};
|
|
38
|
+
const getInstruction = (identifiers) => {
|
|
39
|
+
const { uCoeffs, kIds } = identifiers;
|
|
40
|
+
const u = new Polynomial(uCoeffs).toTree();
|
|
41
|
+
const uprime = u.derivative().simplify({
|
|
42
|
+
towardsDistribute: true,
|
|
43
|
+
forbidFactorize: true,
|
|
44
|
+
});
|
|
45
|
+
const k = reifyAlgebraic(kIds);
|
|
46
|
+
const fct = multiply(multiply(k, uprime).simplify({
|
|
47
|
+
towardsDistribute: true,
|
|
48
|
+
forbidFactorize: true,
|
|
49
|
+
forceDistributeFractions: true,
|
|
50
|
+
}), new ExpNode(u));
|
|
51
|
+
return `Déterminer la forme générale des primitives de la fonction $f$ définie par :
|
|
52
|
+
|
|
53
|
+
$$
|
|
54
|
+
f(x) = ${fct.toTex()}
|
|
55
|
+
$$`;
|
|
56
|
+
};
|
|
57
|
+
// const getHint: GetHint<Identifiers> = (identifiers) => {};
|
|
58
|
+
// const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
|
|
59
|
+
const getKeys = (identifiers) => {
|
|
60
|
+
return ["epower", "x", "C"];
|
|
61
|
+
};
|
|
62
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
63
|
+
try {
|
|
64
|
+
const parsed = parseAlgebraic(ans);
|
|
65
|
+
if (!parsed)
|
|
66
|
+
return false;
|
|
67
|
+
return (parsed
|
|
68
|
+
.simplify({
|
|
69
|
+
towardsDistribute: true,
|
|
70
|
+
forbidFactorize: true,
|
|
71
|
+
forceDistributeFractions: true,
|
|
72
|
+
decimalToFractions: true,
|
|
73
|
+
})
|
|
74
|
+
.toTex() === answer);
|
|
75
|
+
}
|
|
76
|
+
catch (err) {
|
|
77
|
+
return handleVEAError(err);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
const getKexpUPrimitiveQuestion = (ops) => {
|
|
81
|
+
const kIsInt = coinFlip();
|
|
82
|
+
let k;
|
|
83
|
+
let u;
|
|
84
|
+
if (kIsInt) {
|
|
85
|
+
k = randint(-4, 5, [0, 1, -1]).toTree();
|
|
86
|
+
u = TrinomConstructor.random();
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
const denum = randint(2, 6);
|
|
90
|
+
k = frac(1, denum);
|
|
91
|
+
u = new Trinom(denum * randint(1, 4), denum * randint(1, 4), randint(-9, 10));
|
|
92
|
+
}
|
|
93
|
+
// const k = coinFlip()
|
|
94
|
+
// ? randint(-9, 10, [0, 1, -1]).toTree()
|
|
95
|
+
// : RationalConstructor.randomIrreductibleProba().toTree();
|
|
96
|
+
// const u = TrinomConstructor.random();
|
|
97
|
+
const identifiers = {
|
|
98
|
+
kIds: k.toIdentifiers(),
|
|
99
|
+
uCoeffs: u.coefficients,
|
|
100
|
+
};
|
|
101
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
102
|
+
};
|
|
103
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
104
|
+
return {
|
|
105
|
+
answer: getAnswer(identifiers),
|
|
106
|
+
instruction: getInstruction(identifiers),
|
|
107
|
+
keys: getKeys(identifiers),
|
|
108
|
+
answerFormat: "tex",
|
|
109
|
+
identifiers,
|
|
110
|
+
// hint: getHint(identifiers),
|
|
111
|
+
// correction: getCorrection(identifiers),
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
export const kexpUPrimitive = {
|
|
115
|
+
id: "kexpUPrimitive",
|
|
116
|
+
connector: "=",
|
|
117
|
+
label: "Primitive du type $k u'\\exp(u)$",
|
|
118
|
+
isSingleStep: true,
|
|
119
|
+
generator: (nb, opts) => getDistinctQuestions(() => getKexpUPrimitiveQuestion(opts), nb),
|
|
120
|
+
qcmTimer: 60,
|
|
121
|
+
freeTimer: 60,
|
|
122
|
+
getPropositions,
|
|
123
|
+
isAnswerValid,
|
|
124
|
+
subject: "Mathématiques",
|
|
125
|
+
getInstruction,
|
|
126
|
+
// getHint,
|
|
127
|
+
// getCorrection,
|
|
128
|
+
getAnswer,
|
|
129
|
+
getQuestionFromIdentifiers,
|
|
130
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercises/exercise.js";
|
|
2
|
+
import { NodeIdentifiers } from "../../../tree/nodes/nodeConstructor.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
kIds: NodeIdentifiers;
|
|
5
|
+
uCoeffs: number[];
|
|
6
|
+
};
|
|
7
|
+
export declare const klogUPrimitive: Exercise<Identifiers>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=klogUPrimitive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"klogUPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/klogUPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAQ7C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,eAAe,CAAC;IACtB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAqHF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAiBhD,CAAC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { RationalConstructor } from "../../../math/numbers/rationals/rational.js";
|
|
4
|
+
import { Polynomial } from "../../../math/polynomials/polynomial.js";
|
|
5
|
+
import { Trinom, TrinomConstructor } from "../../../math/polynomials/trinom.js";
|
|
6
|
+
import { randint } from "../../../math/utils/random/randint.js";
|
|
7
|
+
import { abs } from "../../../tree/nodes/functions/absNode.js";
|
|
8
|
+
import { LogNode } from "../../../tree/nodes/functions/logNode.js";
|
|
9
|
+
import { reifyAlgebraic, } from "../../../tree/nodes/nodeConstructor.js";
|
|
10
|
+
import { add } from "../../../tree/nodes/operators/addNode.js";
|
|
11
|
+
import { frac } from "../../../tree/nodes/operators/fractionNode.js";
|
|
12
|
+
import { multiply } from "../../../tree/nodes/operators/multiplyNode.js";
|
|
13
|
+
import { coinFlip } from "../../../utils/alea/coinFlip.js";
|
|
14
|
+
//k u' e^u --> k e^u
|
|
15
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
16
|
+
const propositions = [];
|
|
17
|
+
const { uCoeffs, kIds } = identifiers;
|
|
18
|
+
const k = reifyAlgebraic(kIds);
|
|
19
|
+
const u = new Polynomial(uCoeffs);
|
|
20
|
+
const integratedFuction = new LogNode(abs(u.toTree()));
|
|
21
|
+
addValidProp(propositions, answer);
|
|
22
|
+
while (propositions.length < n) {
|
|
23
|
+
const kRand = coinFlip()
|
|
24
|
+
? randint(-5, 6, [0, 1, -1]).toTree()
|
|
25
|
+
: RationalConstructor.randomIrreductibleProba().toTree();
|
|
26
|
+
tryToAddWrongProp(propositions, multiply(kRand, integratedFuction).toTex() + "+C");
|
|
27
|
+
}
|
|
28
|
+
return shuffleProps(propositions, n);
|
|
29
|
+
};
|
|
30
|
+
const getAnswer = (identifiers) => {
|
|
31
|
+
const { uCoeffs, kIds } = identifiers;
|
|
32
|
+
const k = reifyAlgebraic(kIds);
|
|
33
|
+
const u = new Polynomial(uCoeffs);
|
|
34
|
+
const integratedFuction = new LogNode(abs(u.toTree()));
|
|
35
|
+
const answer = add(multiply(k, integratedFuction), "C").toTex();
|
|
36
|
+
return answer;
|
|
37
|
+
};
|
|
38
|
+
const getInstruction = (identifiers) => {
|
|
39
|
+
const { uCoeffs, kIds } = identifiers;
|
|
40
|
+
const u = new Polynomial(uCoeffs).toTree();
|
|
41
|
+
const uprime = u.derivative().simplify({
|
|
42
|
+
towardsDistribute: true,
|
|
43
|
+
forbidFactorize: true,
|
|
44
|
+
});
|
|
45
|
+
const k = reifyAlgebraic(kIds);
|
|
46
|
+
const fct = frac(multiply(k, uprime).simplify({
|
|
47
|
+
towardsDistribute: true,
|
|
48
|
+
forbidFactorize: true,
|
|
49
|
+
forceDistributeFractions: true,
|
|
50
|
+
}), u);
|
|
51
|
+
return `Déterminer la forme générale des primitives de la fonction $f$ définie par :
|
|
52
|
+
|
|
53
|
+
$$
|
|
54
|
+
f(x) = ${fct.toTex()}
|
|
55
|
+
$$`;
|
|
56
|
+
};
|
|
57
|
+
// const getHint: GetHint<Identifiers> = (identifiers) => {};
|
|
58
|
+
// const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
|
|
59
|
+
const getKeys = (identifiers) => {
|
|
60
|
+
return ["ln", "epower", "abs", "x", "C"];
|
|
61
|
+
};
|
|
62
|
+
const isAnswerValid = (ans, { answer, ...identifiers }) => {
|
|
63
|
+
//!VEA chaud
|
|
64
|
+
const { uCoeffs, kIds } = identifiers;
|
|
65
|
+
const k = reifyAlgebraic(kIds);
|
|
66
|
+
const u = new Polynomial(uCoeffs);
|
|
67
|
+
const uTree = u.toTree({ forbidPowerToProduct: true });
|
|
68
|
+
const integratedFuction = new LogNode(abs(u.toTree({ forbidPowerToProduct: true })));
|
|
69
|
+
const answerNode = add(multiply(k, integratedFuction), "C");
|
|
70
|
+
// const answer = new AddNode(integratedFuction, new VariableNode("C"));
|
|
71
|
+
const texs = answerNode.toAllValidTexs();
|
|
72
|
+
return texs.includes(ans);
|
|
73
|
+
};
|
|
74
|
+
const getKlogUPrimitiveQuestion = (ops) => {
|
|
75
|
+
const kIsInt = coinFlip();
|
|
76
|
+
let k;
|
|
77
|
+
let u;
|
|
78
|
+
if (kIsInt) {
|
|
79
|
+
k = randint(-4, 5, [0, 1, -1]).toTree();
|
|
80
|
+
u = TrinomConstructor.random();
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
const denum = randint(2, 6);
|
|
84
|
+
k = frac(1, denum);
|
|
85
|
+
u = new Trinom(denum * randint(1, 4), denum * randint(1, 4), randint(-9, 10));
|
|
86
|
+
}
|
|
87
|
+
const identifiers = {
|
|
88
|
+
kIds: k.toIdentifiers(),
|
|
89
|
+
uCoeffs: u.coefficients,
|
|
90
|
+
};
|
|
91
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
92
|
+
};
|
|
93
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
94
|
+
return {
|
|
95
|
+
answer: getAnswer(identifiers),
|
|
96
|
+
instruction: getInstruction(identifiers),
|
|
97
|
+
keys: getKeys(identifiers),
|
|
98
|
+
answerFormat: "tex",
|
|
99
|
+
identifiers,
|
|
100
|
+
// hint: getHint(identifiers),
|
|
101
|
+
// correction: getCorrection(identifiers),
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
export const klogUPrimitive = {
|
|
105
|
+
id: "klogUPrimitive",
|
|
106
|
+
connector: "=",
|
|
107
|
+
label: "Primitive du type $\\frac{ku'}{u}$",
|
|
108
|
+
isSingleStep: true,
|
|
109
|
+
generator: (nb, opts) => getDistinctQuestions(() => getKlogUPrimitiveQuestion(opts), nb),
|
|
110
|
+
qcmTimer: 60,
|
|
111
|
+
freeTimer: 60,
|
|
112
|
+
getPropositions,
|
|
113
|
+
isAnswerValid,
|
|
114
|
+
subject: "Mathématiques",
|
|
115
|
+
getInstruction,
|
|
116
|
+
// getHint,
|
|
117
|
+
// getCorrection,
|
|
118
|
+
getAnswer,
|
|
119
|
+
getQuestionFromIdentifiers,
|
|
120
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logarithmePrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/logarithmePrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"logarithmePrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/logarithmePrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAMR,YAAY,EAEZ,iBAAiB,EAIlB,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AA4BF,eAAO,MAAM,sBAAsB,EAAE,iBAAiB,CAAC,WAAW,CAMjE,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE,YAAY,CAAC,WAAW,CAsCxE,CAAC;AA6BF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAarD,CAAC"}
|
|
@@ -11,28 +11,30 @@ import { PowerNode } from "../../../tree/nodes/operators/powerNode.js";
|
|
|
11
11
|
import { VariableNode } from "../../../tree/nodes/variables/variableNode.js";
|
|
12
12
|
import { shuffle } from "../../../utils/alea/shuffle.js";
|
|
13
13
|
const getKeys = () => {
|
|
14
|
-
return ["x", "C", "lnBrackets", "abs"];
|
|
14
|
+
return ["x", "C", "lnBrackets", "abs", "epower"];
|
|
15
15
|
};
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
const uTree =
|
|
19
|
-
const selectedFunction = new FractionNode(u.derivate().toTree(), uTree);
|
|
16
|
+
const getAnswer = (identifiers) => {
|
|
17
|
+
const { coeffs } = identifiers;
|
|
18
|
+
const uTree = new Polynomial(coeffs).toTree();
|
|
20
19
|
const integratedFuction = new LogNode(new AbsNode(uTree));
|
|
21
20
|
const answer = new AddNode(integratedFuction, new VariableNode("C")).toTex();
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
return answer;
|
|
22
|
+
};
|
|
23
|
+
const getInstruction = (identifiers) => {
|
|
24
|
+
const { coeffs } = identifiers;
|
|
25
|
+
const u = new Polynomial(coeffs);
|
|
26
|
+
const selectedFunction = new FractionNode(u.derivate().toTree(), u.toTree());
|
|
27
|
+
return `Déterminer la forme générale des primitives de la fonction $f$ définie par :
|
|
25
28
|
|
|
26
29
|
$$
|
|
27
30
|
f(x) = ${selectedFunction.toTex()}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return question;
|
|
31
|
+
$$`;
|
|
32
|
+
};
|
|
33
|
+
export const getLogarithmePrimitive = () => {
|
|
34
|
+
const u = PolynomialConstructor.randomWithOrder(randint(1, 3));
|
|
35
|
+
const uTree = u.toTree();
|
|
36
|
+
const identifiers = { coeffs: u.coefficients };
|
|
37
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
36
38
|
};
|
|
37
39
|
export const getLogarithmePrimitivePropositions = (n, { answer, coeffs }) => {
|
|
38
40
|
const propositions = [];
|
|
@@ -66,12 +68,21 @@ const isLogarithmePrimitiveAnswerValid = (ans, { coeffs }) => {
|
|
|
66
68
|
const texs = answer.toAllValidTexs();
|
|
67
69
|
return texs.includes(ans);
|
|
68
70
|
};
|
|
71
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
72
|
+
const question = {
|
|
73
|
+
instruction: getInstruction(identifiers),
|
|
74
|
+
startStatement: `F(x)`,
|
|
75
|
+
answer: getAnswer(identifiers),
|
|
76
|
+
keys: getKeys(identifiers),
|
|
77
|
+
answerFormat: "tex",
|
|
78
|
+
identifiers,
|
|
79
|
+
};
|
|
80
|
+
return question;
|
|
81
|
+
};
|
|
69
82
|
export const logarithmePrimitive = {
|
|
70
83
|
id: "logarithmePrimitive",
|
|
71
84
|
connector: "=",
|
|
72
85
|
label: "Primitive de $\\frac{u'}{u}$",
|
|
73
|
-
levels: ["TermSpé", "MathComp"],
|
|
74
|
-
sections: ["Primitives", "Logarithme népérien"],
|
|
75
86
|
isSingleStep: false,
|
|
76
87
|
generator: (nb) => getDistinctQuestions(getLogarithmePrimitive, nb),
|
|
77
88
|
qcmTimer: 60,
|
|
@@ -80,4 +91,5 @@ export const logarithmePrimitive = {
|
|
|
80
91
|
isAnswerValid: isLogarithmePrimitiveAnswerValid,
|
|
81
92
|
subject: "Mathématiques",
|
|
82
93
|
pdfOptions: { shouldSpreadPropositions: true },
|
|
94
|
+
getQuestionFromIdentifiers,
|
|
83
95
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polynomialPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/polynomialPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAIR,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAGJ,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAiBF,eAAO,MAAM,sBAAsB,EAAE,iBAAiB,CAAC,WAAW,CAcjE,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE,YAAY,CAAC,WAAW,CAexE,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,GAAG,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"polynomialPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/polynomialPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAIR,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAGJ,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAiBF,eAAO,MAAM,sBAAsB,EAAE,iBAAiB,CAAC,WAAW,CAcjE,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE,YAAY,CAAC,WAAW,CAexE,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,GAAG,CAAC,WAAW,CAmB7D,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAWrD,CAAC"}
|
|
@@ -48,17 +48,6 @@ export const isPolynomialPrimitiveAnswerValid = (ans, { coeffs, answer }) => {
|
|
|
48
48
|
const parsed = parseAlgebraic(ans);
|
|
49
49
|
if (!parsed)
|
|
50
50
|
return false;
|
|
51
|
-
// console.log(
|
|
52
|
-
// parsed
|
|
53
|
-
// .simplify({
|
|
54
|
-
// towardsDistribute: true,
|
|
55
|
-
// forbidFactorize: true,
|
|
56
|
-
// decimalToFractions: true,
|
|
57
|
-
// forceDistributeFractions: true,
|
|
58
|
-
// forceIsolateMonomCoeffs: true,
|
|
59
|
-
// })
|
|
60
|
-
// .toTex(),
|
|
61
|
-
// );
|
|
62
51
|
return (parsed
|
|
63
52
|
.simplify({
|
|
64
53
|
towardsDistribute: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sinCosPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/sinCosPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAER,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAGJ,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"sinCosPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/sinCosPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAER,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAGJ,MAAM,6BAA6B,CAAC;AAcrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,iBAAiB,CAAC,WAAW,CA2B7D,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,YAAY,CAAC,WAAW,CA4BpE,CAAC;AACF,eAAO,MAAM,4BAA4B,EAAE,GAAG,CAAC,WAAW,CAYzD,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAajD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sinUCosUPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/sinUCosUPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"sinUCosUPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/sinUCosUPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAKR,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAGJ,MAAM,6BAA6B,CAAC;AAkBrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AA2BF,eAAO,MAAM,oBAAoB,EAAE,iBAAiB,CAAC,WAAW,CAK/D,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,YAAY,CAAC,WAAW,CA8BtE,CAAC;AAgBF,eAAO,MAAM,8BAA8B,EAAE,GAAG,CAAC,WAAW,CAa3D,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAYnD,CAAC"}
|