math-exercises 3.0.107 → 3.0.109
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/addAndSub.d.ts +1 -1
- package/lib/exercises/math/calcul/addAndSub.d.ts.map +1 -1
- package/lib/exercises/math/calcul/addAndSub.js +18 -4
- package/lib/exercises/math/calcul/addAndSubWithoutRelatives.d.ts.map +1 -1
- package/lib/exercises/math/calcul/addAndSubWithoutRelatives.js +8 -3
- package/lib/exercises/math/calcul/arithmetics/divisibiltyCriteria.d.ts.map +1 -1
- package/lib/exercises/math/calcul/digitDecimalRankNumber.d.ts.map +1 -1
- package/lib/exercises/math/calcul/rounding/getPhysicalOrderOfMagnitude.d.ts +7 -0
- package/lib/exercises/math/calcul/rounding/getPhysicalOrderOfMagnitude.d.ts.map +1 -0
- package/lib/exercises/math/calcul/rounding/getPhysicalOrderOfMagnitude.js +197 -0
- package/lib/exercises/math/calcul/rounding/index.d.ts +1 -0
- package/lib/exercises/math/calcul/rounding/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/rounding/index.js +1 -0
- package/lib/exercises/math/calcul/writing/numberToFrenchWriting.js +0 -1
- package/lib/exercises/math/calculLitteral/distributivity/canonicalFormDevelopment.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/canonicalFormDevelopment.js +6 -2
- package/lib/exercises/math/calculLitteral/distributivity/identitiesWithNonIntegers.js +4 -4
- package/lib/exercises/math/calculLitteral/factorisation/factoType2.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/formulas/index.d.ts +2 -0
- package/lib/exercises/math/calculLitteral/formulas/index.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/formulas/index.js +1 -0
- package/lib/exercises/math/calculLitteral/formulas/useFormula.d.ts +18 -0
- package/lib/exercises/math/calculLitteral/formulas/useFormula.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/formulas/useFormula.js +208 -0
- 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/writing/index.d.ts +2 -0
- package/lib/exercises/math/calculLitteral/writing/index.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/writing/index.js +1 -0
- package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.d.ts +33 -0
- package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.js +348 -0
- package/lib/exercises/math/dataRepresentations/functionGraphReading.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/pieChartReading.d.ts.map +1 -1
- package/lib/exercises/math/derivation/tangent/derivativeTangentEquationReading.d.ts.map +1 -1
- package/lib/exercises/math/derivation/variations/index.d.ts +1 -0
- package/lib/exercises/math/derivation/variations/index.d.ts.map +1 -1
- package/lib/exercises/math/derivation/variations/index.js +1 -0
- package/lib/exercises/math/derivation/variations/thirdDegreeDerivativeVariation.d.ts +10 -0
- package/lib/exercises/math/derivation/variations/thirdDegreeDerivativeVariation.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/thirdDegreeDerivativeVariation.js +201 -0
- package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.js +3 -0
- package/lib/exercises/math/functions/affines/affineExpressionReading.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineExpressionReading.js +2 -0
- package/lib/exercises/math/functions/basics/graphicInequationAffine.d.ts.map +1 -1
- package/lib/exercises/math/functions/logarithm/index.d.ts +1 -0
- package/lib/exercises/math/functions/logarithm/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/logarithm/index.js +1 -0
- package/lib/exercises/math/functions/logarithm/powerEquation.d.ts +11 -0
- package/lib/exercises/math/functions/logarithm/powerEquation.d.ts.map +1 -0
- package/lib/exercises/math/functions/logarithm/powerEquation.js +148 -0
- package/lib/exercises/math/functions/trinoms/parabole/paraboleExpressionReading.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/rootsReading.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/rootsReading.js +28 -5
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/canonicalFromDevForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/canonicalFromDevForm.js +3 -1
- package/lib/exercises/math/functions/variations/varTableExtremaReading.d.ts.map +1 -1
- package/lib/exercises/math/geometry/angles/recognizeAngleType.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/placeAPoint.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/placeAPoint.js +14 -0
- package/lib/exercises/math/geometry/cartesian/readAbscissOnLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/readAbscissOnSemiLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/linesRelativePositions.d.ts.map +1 -1
- package/lib/exercises/math/geometry/quadrilaterals/parallelogramAngles.d.ts.map +1 -1
- package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.d.ts.map +1 -1
- package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts.map +1 -1
- package/lib/exercises/math/geometry/triangles/triangleNature.d.ts.map +1 -1
- package/lib/exercises/math/geometry/triangles/triangleThirdAngleValue.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.js +1 -1
- package/lib/exercises/math/percent/evolutions/evolutionRateFromValues.d.ts.map +1 -1
- package/lib/exercises/math/percent/evolutions/findEndValueAfterEvolution.d.ts.map +1 -1
- package/lib/exercises/math/percent/evolutions/findStartValueAfterEvolution.d.ts.map +1 -1
- package/lib/exercises/math/percent/populationEffectifFromSubPopulation.d.ts.map +1 -1
- package/lib/exercises/math/percent/subPopulationEffectifFromPercent.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticExplicitFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticExplicitFormulaUsage.js +6 -4
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindAntecedent.d.ts +9 -0
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindAntecedent.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindAntecedent.js +110 -0
- package/lib/exercises/math/sequences/arithmetic/index.d.ts +1 -0
- package/lib/exercises/math/sequences/arithmetic/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/index.js +1 -0
- package/lib/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/arcLength.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/basicEquationCos.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/basicEquationSin.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/basicTrigoSystemEquation.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/degreeToRadians.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/mainAngleMeasure.d.ts.map +1 -1
- package/lib/index.d.ts +26 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/math/numbers/rationals/rational.d.ts.map +1 -1
- package/lib/math/polynomials/polynomial.d.ts.map +1 -1
- package/lib/math/polynomials/polynomial.js +25 -29
- package/lib/math/utils/random/randfloat.d.ts +7 -1
- package/lib/math/utils/random/randfloat.d.ts.map +1 -1
- package/lib/math/utils/random/randfloat.js +2 -1
- package/lib/math/utils/random/randfrac.d.ts +9 -0
- package/lib/math/utils/random/randfrac.d.ts.map +1 -0
- package/lib/math/utils/random/randfrac.js +19 -0
- package/lib/math/utils/random/randint.d.ts +7 -1
- package/lib/math/utils/random/randint.d.ts.map +1 -1
- package/lib/math/utils/random/randint.js +2 -1
- package/lib/playground.d.ts +1 -1
- package/lib/playground.js +1 -1
- package/lib/tree/nodes/algebraicNode.d.ts +1 -1
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equalNode.d.ts +1 -1
- package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equalNode.js +5 -5
- package/lib/tree/nodes/functions/expNode.d.ts +1 -1
- package/lib/tree/nodes/functions/expNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/expNode.js +1 -1
- package/lib/tree/nodes/functions/sqrtNode.d.ts +1 -1
- package/lib/tree/nodes/functions/sqrtNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sqrtNode.js +1 -3
- package/lib/tree/nodes/operators/addNode.d.ts +1 -1
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +1 -1
- package/lib/tree/nodes/operators/fractionNode.d.ts +1 -1
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +3 -1
- package/lib/tree/nodes/operators/multiplyNode.d.ts +1 -1
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +44 -38
- package/lib/tree/nodes/operators/powerNode.d.ts +1 -1
- package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/powerNode.js +1 -1
- package/lib/tree/nodes/randomReal.d.ts +15 -0
- package/lib/tree/nodes/randomReal.d.ts.map +1 -0
- package/lib/tree/nodes/randomReal.js +32 -0
- package/lib/tree/parsers/latexParser.js +5 -4
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"affineExpressionReading.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/affineExpressionReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAkBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;
|
|
1
|
+
{"version":3,"file":"affineExpressionReading.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/affineExpressionReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAkBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AA8KF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAezD,CAAC"}
|
|
@@ -78,6 +78,8 @@ const getAffineExpressionReadingQuestion = () => {
|
|
|
78
78
|
const b = randint(-5, 6);
|
|
79
79
|
const secondPoint = [randint(-5, 6, [0]), randint(-5, 6)];
|
|
80
80
|
const identifiers = { b, secondPoint };
|
|
81
|
+
//[0,b] et [x,y]
|
|
82
|
+
//a = (y-b)/x
|
|
81
83
|
return getQuestionFromIdentifiers(identifiers);
|
|
82
84
|
};
|
|
83
85
|
const getQuestionFromIdentifiers = (identifiers) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphicInequationAffine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/graphicInequationAffine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"graphicInequationAffine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/graphicInequationAffine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EACL,gBAAgB,EAGjB,MAAM,sCAAsC,CAAC;AAe9C,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,gBAAgB,CAAC;IAClC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAgKF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAezD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
a: number;
|
|
4
|
+
b: number;
|
|
5
|
+
};
|
|
6
|
+
type Options = {
|
|
7
|
+
useLog10?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const powerEquation: Exercise<Identifiers, Options>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=powerEquation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"powerEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/powerEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAsBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAoJF,KAAK,OAAO,GAAG;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAUF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkBxD,CAAC"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, GeneratorOptionType, GeneratorOptionTarget, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
4
|
+
import { round } from "../../../../math/utils/round.js";
|
|
5
|
+
import { Log10Node } from "../../../../tree/nodes/functions/log10Node.js";
|
|
6
|
+
import { LogNode } from "../../../../tree/nodes/functions/logNode.js";
|
|
7
|
+
import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
|
|
8
|
+
import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
9
|
+
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
10
|
+
import { power } from "../../../../tree/nodes/operators/powerNode.js";
|
|
11
|
+
import { VariableNode } from "../../../../tree/nodes/variables/variableNode.js";
|
|
12
|
+
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
13
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
14
|
+
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
15
|
+
const getPropositions = (n, { answer, ...identifiers }, opts) => {
|
|
16
|
+
const { a, b } = identifiers;
|
|
17
|
+
const propositions = [];
|
|
18
|
+
const logNode = opts?.useLog10 ? Log10Node : LogNode;
|
|
19
|
+
addValidProp(propositions, answer);
|
|
20
|
+
tryToAddWrongProp(propositions, frac(a, b).simplify().toTex());
|
|
21
|
+
tryToAddWrongProp(propositions, frac(new logNode(a.toTree()), new logNode(b.toTree())).simplify().toTex());
|
|
22
|
+
tryToAddWrongProp(propositions, frac(new logNode(a.toTree()), b).simplify().toTex());
|
|
23
|
+
tryToAddWrongProp(propositions, frac(a, new logNode(b.toTree())).simplify().toTex());
|
|
24
|
+
return shuffleProps(propositions, n);
|
|
25
|
+
};
|
|
26
|
+
const getAnswer = (identifiers, opts) => {
|
|
27
|
+
const { a, b } = identifiers;
|
|
28
|
+
const logNode = opts?.useLog10 ? Log10Node : LogNode;
|
|
29
|
+
return frac(new logNode(new NumberNode(b)), new logNode(new NumberNode(a)))
|
|
30
|
+
.simplify()
|
|
31
|
+
.toTex();
|
|
32
|
+
};
|
|
33
|
+
const getInstruction = (identifiers) => {
|
|
34
|
+
const { a, b } = identifiers;
|
|
35
|
+
return `Résoudre :
|
|
36
|
+
|
|
37
|
+
$$
|
|
38
|
+
${a}^x = ${b}
|
|
39
|
+
$$
|
|
40
|
+
|
|
41
|
+
*Donner la valeur exacte ou une valeur arrondie au centième.*`;
|
|
42
|
+
};
|
|
43
|
+
const getHint = (identifiers, opts) => {
|
|
44
|
+
const logNode = opts?.useLog10 ? Log10Node : LogNode;
|
|
45
|
+
return `Utilise la propriété :
|
|
46
|
+
|
|
47
|
+
$$
|
|
48
|
+
${new logNode(power("a", "x")).toTex()} = ${multiply("x", new logNode(new VariableNode("a"))).toTex()}
|
|
49
|
+
$$`;
|
|
50
|
+
};
|
|
51
|
+
const getCorrection = (identifiers, opts) => {
|
|
52
|
+
const answer = getAnswer(identifiers, opts);
|
|
53
|
+
const { a, b } = identifiers;
|
|
54
|
+
const logNode = opts?.useLog10 ? Log10Node : LogNode;
|
|
55
|
+
const steps = [
|
|
56
|
+
[
|
|
57
|
+
"",
|
|
58
|
+
new logNode(power(a, "x")).toTex(),
|
|
59
|
+
"=",
|
|
60
|
+
new logNode(new NumberNode(b)).toTex(),
|
|
61
|
+
],
|
|
62
|
+
[
|
|
63
|
+
"\\iff",
|
|
64
|
+
multiply("x", new logNode(new NumberNode(a))).toTex(),
|
|
65
|
+
"=",
|
|
66
|
+
new logNode(new NumberNode(b)).toTex(),
|
|
67
|
+
],
|
|
68
|
+
[
|
|
69
|
+
"\\iff",
|
|
70
|
+
"x",
|
|
71
|
+
"=",
|
|
72
|
+
frac(new logNode(new NumberNode(b)), new logNode(new NumberNode(a))).toTex(),
|
|
73
|
+
],
|
|
74
|
+
];
|
|
75
|
+
const lastStep = frac(new logNode(new NumberNode(b)), new logNode(new NumberNode(a)));
|
|
76
|
+
if (lastStep.toTex() !== answer)
|
|
77
|
+
steps.push(["\\iff", "x", "=", answer]);
|
|
78
|
+
return `En appliquant le logarithme des deux côtés de l'équation, on obtient :
|
|
79
|
+
|
|
80
|
+
${alignTex(steps)}
|
|
81
|
+
|
|
82
|
+
La solution de l'équation est donc :
|
|
83
|
+
|
|
84
|
+
$$
|
|
85
|
+
${answer} \\approx ${round(lastStep.evaluate(), 2).frenchify()}
|
|
86
|
+
$$`;
|
|
87
|
+
};
|
|
88
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
89
|
+
try {
|
|
90
|
+
const parsed = parseAlgebraic(ans);
|
|
91
|
+
const value = parsed.evaluate();
|
|
92
|
+
const answerValue = parseAlgebraic(answer).evaluate();
|
|
93
|
+
console.log(value, answerValue);
|
|
94
|
+
if (Math.abs(value - answerValue) < 0.01)
|
|
95
|
+
return true;
|
|
96
|
+
return parsed.simplify().toTex() === answer;
|
|
97
|
+
}
|
|
98
|
+
catch (err) {
|
|
99
|
+
return handleVEAError(err);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
const getKeys = (identifiers, opts) => {
|
|
103
|
+
return opts?.useLog10 ? ["logBrackets"] : ["lnBrackets"];
|
|
104
|
+
};
|
|
105
|
+
const getPowerEquationQuestion = (opts) => {
|
|
106
|
+
const a = randint(2, 20, [10]);
|
|
107
|
+
const b = randint(2, 20, [10, a]);
|
|
108
|
+
const identifiers = { a, b };
|
|
109
|
+
return getQuestionFromIdentifiers(identifiers, opts);
|
|
110
|
+
};
|
|
111
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
112
|
+
return {
|
|
113
|
+
answer: getAnswer(identifiers, opts),
|
|
114
|
+
instruction: getInstruction(identifiers, opts),
|
|
115
|
+
keys: getKeys(identifiers, opts),
|
|
116
|
+
answerFormat: "tex",
|
|
117
|
+
identifiers,
|
|
118
|
+
hint: getHint(identifiers, opts),
|
|
119
|
+
correction: getCorrection(identifiers, opts),
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
const options = [
|
|
123
|
+
{
|
|
124
|
+
id: "useLog10",
|
|
125
|
+
label: "Utiliser le logarithme décimal",
|
|
126
|
+
target: GeneratorOptionTarget.answer,
|
|
127
|
+
type: GeneratorOptionType.checkbox,
|
|
128
|
+
defaultValue: false,
|
|
129
|
+
},
|
|
130
|
+
];
|
|
131
|
+
export const powerEquation = {
|
|
132
|
+
id: "powerEquation",
|
|
133
|
+
label: "Résoudre une équation de type $a^x = b$",
|
|
134
|
+
isSingleStep: true,
|
|
135
|
+
generator: (nb, opts) => getDistinctQuestions(() => getPowerEquationQuestion(opts), nb),
|
|
136
|
+
qcmTimer: 60,
|
|
137
|
+
freeTimer: 60,
|
|
138
|
+
getPropositions,
|
|
139
|
+
isAnswerValid,
|
|
140
|
+
subject: "Mathématiques",
|
|
141
|
+
getInstruction,
|
|
142
|
+
getHint,
|
|
143
|
+
getCorrection,
|
|
144
|
+
getAnswer,
|
|
145
|
+
getQuestionFromIdentifiers,
|
|
146
|
+
hasHintAndCorrection: true,
|
|
147
|
+
options,
|
|
148
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paraboleExpressionReading.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/parabole/paraboleExpressionReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"paraboleExpressionReading.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/parabole/paraboleExpressionReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;CAIpB,CAAC;AA4SF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAe3D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rootsReading.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/roots/rootsReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"rootsReading.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/roots/rootsReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAmGF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAY9C,CAAC"}
|
|
@@ -4,15 +4,27 @@ import { randomColor } from "../../../../../geogebra/colors.js";
|
|
|
4
4
|
import { GeogebraConstructor } from "../../../../../geogebra/geogebraConstructor.js";
|
|
5
5
|
import { Trinom, TrinomConstructor } from "../../../../../math/polynomials/trinom.js";
|
|
6
6
|
import { randint } from "../../../../../math/utils/random/randint.js";
|
|
7
|
+
import { divide } from "../../../../../tree/nodes/operators/divideNode.js";
|
|
8
|
+
import { multiply } from "../../../../../tree/nodes/operators/multiplyNode.js";
|
|
9
|
+
import { probaLawFlip } from "../../../../../utils/alea/probaLawFlip.js";
|
|
7
10
|
const getInstruction = (identifiers) => {
|
|
8
|
-
return `Déterminer graphiquement le ou les racine(s) du polynôme du second degré représenté ci-dessous
|
|
11
|
+
return `Déterminer graphiquement le ou les racine(s) du polynôme du second degré représenté ci-dessous.
|
|
12
|
+
|
|
13
|
+
S'il n'y en a pas, on écrira "Aucun".`;
|
|
9
14
|
};
|
|
10
15
|
const getAnswer = (identifiers) => {
|
|
11
16
|
const { a, b, c } = identifiers;
|
|
12
17
|
const trinom = new Trinom(a, b, c);
|
|
13
18
|
const roots = trinom.getRoots();
|
|
14
|
-
|
|
15
|
-
|
|
19
|
+
switch (roots.length) {
|
|
20
|
+
case 0:
|
|
21
|
+
return "\\text{Aucun}";
|
|
22
|
+
case 1:
|
|
23
|
+
return roots[0].toString();
|
|
24
|
+
case 2:
|
|
25
|
+
default:
|
|
26
|
+
return roots.join("\\text{ et }");
|
|
27
|
+
}
|
|
16
28
|
};
|
|
17
29
|
const getGGBOptions = (identifiers) => {
|
|
18
30
|
const { a, b, c } = identifiers;
|
|
@@ -28,7 +40,12 @@ const getGGBOptions = (identifiers) => {
|
|
|
28
40
|
return ggb.getOptions({ coords: trinom.getCoords() });
|
|
29
41
|
};
|
|
30
42
|
const getRootsReadingQuestion = () => {
|
|
31
|
-
const
|
|
43
|
+
const nbRoots = probaLawFlip([
|
|
44
|
+
[0, 0.2],
|
|
45
|
+
[1, 0.4],
|
|
46
|
+
[2, 0.4],
|
|
47
|
+
]);
|
|
48
|
+
const trinom = TrinomConstructor.randomNiceRoots(nbRoots);
|
|
32
49
|
const identifiers = { a: trinom.a, b: trinom.b, c: trinom.c };
|
|
33
50
|
return getQuestionFromIdentifiers(identifiers);
|
|
34
51
|
};
|
|
@@ -43,9 +60,12 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
43
60
|
};
|
|
44
61
|
return question;
|
|
45
62
|
};
|
|
46
|
-
const getPropositions = (n, { answer }) => {
|
|
63
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
47
64
|
const propositions = [];
|
|
48
65
|
addValidProp(propositions, answer);
|
|
66
|
+
tryToAddWrongProp(propositions, "\\text{Aucun}");
|
|
67
|
+
const { a, b, c } = identifiers;
|
|
68
|
+
tryToAddWrongProp(propositions, divide(-b, multiply(2, a)).simplify().toTex());
|
|
49
69
|
while (propositions.length < n) {
|
|
50
70
|
const x1 = randint(-10, 10);
|
|
51
71
|
const x2 = randint(-10, 10, [x1]);
|
|
@@ -56,6 +76,9 @@ const getPropositions = (n, { answer }) => {
|
|
|
56
76
|
};
|
|
57
77
|
const isAnswerValid = (ans, { answer, a, b, c }) => {
|
|
58
78
|
const roots = new Trinom(a, b, c).getRoots();
|
|
79
|
+
if (!roots.length) {
|
|
80
|
+
return ans === "\\text{Aucun}";
|
|
81
|
+
}
|
|
59
82
|
const studentNumbers = ans
|
|
60
83
|
.replaceAll("\\text{ }", "")
|
|
61
84
|
.split("\\text{ et }")
|
package/lib/exercises/math/functions/trinoms/summitAndCanonical/canonicalFromDevForm.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonicalFromDevForm.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/summitAndCanonical/canonicalFromDevForm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;
|
|
1
|
+
{"version":3,"file":"canonicalFromDevForm.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/summitAndCanonical/canonicalFromDevForm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA8DF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAatD,CAAC"}
|
|
@@ -28,7 +28,9 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
28
28
|
return question;
|
|
29
29
|
};
|
|
30
30
|
const getCanonicalFromDevFormQuestion = () => {
|
|
31
|
-
const trinom = TrinomConstructor.randomCanonical(
|
|
31
|
+
const trinom = TrinomConstructor.randomCanonical(undefined, {
|
|
32
|
+
excludes: [0],
|
|
33
|
+
});
|
|
32
34
|
const identifiers = { a: trinom.a, b: trinom.b, c: trinom.c };
|
|
33
35
|
return getQuestionFromIdentifiers(identifiers);
|
|
34
36
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"varTableExtremaReading.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/variations/varTableExtremaReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"varTableExtremaReading.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/variations/varTableExtremaReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAoBT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC;AAyPF,KAAK,OAAO,GAAG;IACb,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAWF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgBjE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recognizeAngleType.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/angles/recognizeAngleType.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"recognizeAngleType.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/angles/recognizeAngleType.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAWtC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAwVF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAcpD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"placeAPoint.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/placeAPoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"placeAPoint.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/placeAPoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAiE5C,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAW/C,CAAC"}
|
|
@@ -7,6 +7,17 @@ const getInstruction = (identifiers) => {
|
|
|
7
7
|
const point = new Point("A", identifiers.x, identifiers.y);
|
|
8
8
|
return `Placer le point $A$ de coordonnées $${point.toTexWithCoords()}$.`;
|
|
9
9
|
};
|
|
10
|
+
const getHint = (identifiers) => {
|
|
11
|
+
return `Le point $A(x;y)$ a pour abscisse $x$ et pour ordonnée $y$.
|
|
12
|
+
|
|
13
|
+
L'abscisse se lit sur l'axe horizontal. L'ordonnée se lit sur l'axe verticale.`;
|
|
14
|
+
};
|
|
15
|
+
const getCorrection = (identifiers) => {
|
|
16
|
+
const { x, y } = identifiers;
|
|
17
|
+
return `Le point $A$ a pour abcsisse $${x}$ et pour ordonnée $${y}$.
|
|
18
|
+
|
|
19
|
+
On se place donc à $${x}$ sur l'axe des abscisses (axe horizontal), puis à $${y}$ sur l'axe des ordonnées (axe vertical).`;
|
|
20
|
+
};
|
|
10
21
|
const getGGBAnswer = (identifiers) => {
|
|
11
22
|
const { x, y } = identifiers;
|
|
12
23
|
return [`(${x},${y})`];
|
|
@@ -34,6 +45,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
34
45
|
keys: [],
|
|
35
46
|
studentGgbOptions: getStudentGGBOptions(identifiers),
|
|
36
47
|
identifiers,
|
|
48
|
+
hint: getHint(identifiers),
|
|
49
|
+
correction: getCorrection(identifiers),
|
|
37
50
|
};
|
|
38
51
|
return question;
|
|
39
52
|
};
|
|
@@ -54,4 +67,5 @@ export const testGGBAnswer = {
|
|
|
54
67
|
isGGBAnswerValid,
|
|
55
68
|
subject: "Mathématiques",
|
|
56
69
|
getQuestionFromIdentifiers,
|
|
70
|
+
hasHintAndCorrection: true,
|
|
57
71
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readAbscissOnLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/readAbscissOnLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"readAbscissOnLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/readAbscissOnLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAgB1D,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,UAAU,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AA6LF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAkBnD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readAbscissOnSemiLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/readAbscissOnSemiLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"readAbscissOnSemiLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/readAbscissOnSemiLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAc1D,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,UAAU,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAqLF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAkBvD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pythagoreOrThales.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidian/pythagoreOrThales.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"pythagoreOrThales.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidian/pythagoreOrThales.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAkBtC,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IAEzB,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IACtC,OAAO,EAAE,MAAM,EAAE,CAAC;CAQnB,CAAC;AA4RF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAuBnD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linesRelativePositions.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/lines/linesRelativePositions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"linesRelativePositions.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/lines/linesRelativePositions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAE/D,WAAW,EAAE,MAAM,CAAC;CAKrB,CAAC;AAyKF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAqBxD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parallelogramAngles.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/quadrilaterals/parallelogramAngles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"parallelogramAngles.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/quadrilaterals/parallelogramAngles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAEL,wBAAwB,EACzB,MAAM,qDAAqD,CAAC;AAO7D,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,wBAAwB,CAAC;IAC1C,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AA6IF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAoBrD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quadrilateralRecognition.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"quadrilateralRecognition.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAEL,wBAAwB,EACzB,MAAM,qDAAqD,CAAC;AAE7D,OAAO,EAEL,oBAAoB,EACrB,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAGL,kBAAkB,EACnB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAEL,iBAAiB,EAClB,MAAM,8CAA8C,CAAC;AAItD,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EACZ,oBAAoB,GACpB,iBAAiB,GACjB,kBAAkB,GAClB,wBAAwB,CAAC;CAC9B,CAAC;AA+MF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAqB1D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thalesCalcul.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/thales/thalesCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"thalesCalcul.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/thales/thalesCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAoBT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAGL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAanD,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AA4OF,KAAK,OAAO,GAAG;IACb,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAqEF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CA0BvD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"triangleNature.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/triangles/triangleNature.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"triangleNature.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/triangles/triangleNature.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAEL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAKnD,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAoLF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAoBhD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"triangleThirdAngleValue.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/triangles/triangleThirdAngleValue.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"triangleThirdAngleValue.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/triangles/triangleThirdAngleValue.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAGL,mBAAmB,EAEpB,MAAM,2CAA2C,CAAC;AASnD,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AA0JF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAoBzD,CAAC"}
|
package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scalarProductOrthoInSquare.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"scalarProductOrthoInSquare.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAsKF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAkB5D,CAAC"}
|
|
@@ -111,7 +111,7 @@ const getScalarProductOrthoInSquareQuestion = () => {
|
|
|
111
111
|
},
|
|
112
112
|
AL: {
|
|
113
113
|
projLength: c / 2,
|
|
114
|
-
reps: ["AL", "LD", "IO", "OK", "BJ", "
|
|
114
|
+
reps: ["AL", "LD", "IO", "OK", "BJ", "JC"],
|
|
115
115
|
},
|
|
116
116
|
};
|
|
117
117
|
const vec1Choices = random(isFirstVecOnAB ? ["AB", "AI"] : ["AD", "AL"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evolutionRateFromValues.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/percent/evolutions/evolutionRateFromValues.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"evolutionRateFromValues.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/percent/evolutions/evolutionRateFromValues.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAyGF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAgBzD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findEndValueAfterEvolution.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/percent/evolutions/findEndValueAfterEvolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"findEndValueAfterEvolution.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/percent/evolutions/findEndValueAfterEvolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAiGF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAiB5D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findStartValueAfterEvolution.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/percent/evolutions/findStartValueAfterEvolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"findStartValueAfterEvolution.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/percent/evolutions/findStartValueAfterEvolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAiGF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAiB9D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"populationEffectifFromSubPopulation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/populationEffectifFromSubPopulation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"populationEffectifFromSubPopulation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/populationEffectifFromSubPopulation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAsJF,eAAO,MAAM,mCAAmC,EAAE,QAAQ,CAAC,WAAW,CAiBrE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subPopulationEffectifFromPercent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/subPopulationEffectifFromPercent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"subPopulationEffectifFromPercent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/subPopulationEffectifFromPercent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AA2GF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CAgBlE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arithmeticExplicitFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticExplicitFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;
|
|
1
|
+
{"version":3,"file":"arithmeticExplicitFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticExplicitFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA8FF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,CAchE,CAAC"}
|
|
@@ -9,11 +9,13 @@ import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
|
9
9
|
const getInstruction = (identifiers) => {
|
|
10
10
|
const { firstValue, askedRank, reason } = identifiers;
|
|
11
11
|
const polynomial = new Polynomial([firstValue, reason], "n");
|
|
12
|
-
return `$(u_n)$ est une suite arithmétique définie par
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
return `$(u_n)$ est une suite arithmétique définie par :
|
|
13
|
+
|
|
14
|
+
$$
|
|
15
|
+
u_n = ${polynomial.toTree().toTex()}
|
|
16
|
+
$$
|
|
15
17
|
|
|
16
|
-
Calculer $u_{${askedRank}}
|
|
18
|
+
Calculer $u_{${askedRank}}$.`;
|
|
17
19
|
};
|
|
18
20
|
const getAnswer = (identifiers) => {
|
|
19
21
|
const { firstValue, askedRank, reason } = identifiers;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
a: number;
|
|
4
|
+
b: number;
|
|
5
|
+
n: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const arithmeticFindAntecedent: Exercise<Identifiers>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=arithmeticFindAntecedent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arithmeticFindAntecedent.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticFindAntecedent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAqBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA2HF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAiB1D,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { numberVEA } from "../../../../exercises/vea/numberVEA.js";
|
|
4
|
+
import { Affine, AffineConstructor } from "../../../../math/polynomials/affine.js";
|
|
5
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
6
|
+
import { EqualNode, equationResolutionTex, } from "../../../../tree/nodes/equations/equalNode.js";
|
|
7
|
+
import { NumberNode, NumberNodeConstructor, } from "../../../../tree/nodes/numbers/numberNode.js";
|
|
8
|
+
const varName = "n";
|
|
9
|
+
const getInstruction = (identifiers) => {
|
|
10
|
+
const { a, b, n } = identifiers;
|
|
11
|
+
const affineWithN = new Affine(a, b, varName);
|
|
12
|
+
const u = affineWithN.calculate(n);
|
|
13
|
+
const affineWithNTex = affineWithN.toTree().toTex();
|
|
14
|
+
const uTex = u.frenchify();
|
|
15
|
+
return `On donne la suite numérique $u$ définie par :
|
|
16
|
+
|
|
17
|
+
$$
|
|
18
|
+
u_${varName}= ${affineWithNTex}
|
|
19
|
+
$$
|
|
20
|
+
|
|
21
|
+
Calculer la valeur de $ ${varName} $ pour laquelle $ u_${varName} = ${uTex} $.`;
|
|
22
|
+
};
|
|
23
|
+
const getPropositions = (nb_prop, { answer, a, b, n }) => {
|
|
24
|
+
const propositions = [];
|
|
25
|
+
addValidProp(propositions, answer);
|
|
26
|
+
const affineWithN = new Affine(a, b, varName);
|
|
27
|
+
const u = affineWithN.calculate(n);
|
|
28
|
+
tryToAddWrongProp(propositions, new Affine(a, b).solve(0).toTex());
|
|
29
|
+
tryToAddWrongProp(propositions, affineWithN.calculate(u).toTree().toTex());
|
|
30
|
+
tryToAddWrongProp(propositions, new NumberNode(n + 1).toTex());
|
|
31
|
+
if (propositions.length < nb_prop) {
|
|
32
|
+
if (n - 1 >= 0) {
|
|
33
|
+
tryToAddWrongProp(propositions, new NumberNode(n - 1).toTex());
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
while (propositions.length < nb_prop) {
|
|
37
|
+
const wrongAnswer = NumberNodeConstructor.random(0, 20);
|
|
38
|
+
tryToAddWrongProp(propositions, wrongAnswer.toTex());
|
|
39
|
+
}
|
|
40
|
+
return shuffleProps(propositions, nb_prop);
|
|
41
|
+
};
|
|
42
|
+
const getAnswer = (identifiers) => {
|
|
43
|
+
const { n } = identifiers;
|
|
44
|
+
return n.frenchify();
|
|
45
|
+
};
|
|
46
|
+
const getHint = (identifiers) => {
|
|
47
|
+
// const {affineWithNTex, uTex} = getTailoredTex(identifiers);
|
|
48
|
+
const { a, b, n } = identifiers;
|
|
49
|
+
const affineWithN = new Affine(a, b, varName);
|
|
50
|
+
const u = affineWithN.calculate(n);
|
|
51
|
+
const equationNode = new EqualNode(affineWithN.toTree(), new NumberNode(u));
|
|
52
|
+
const equationTex = equationNode.toTex();
|
|
53
|
+
return `Résous l'équation $${equationTex} $.`;
|
|
54
|
+
};
|
|
55
|
+
/*
|
|
56
|
+
a n + b = k
|
|
57
|
+
n = (k - b) / a
|
|
58
|
+
*/
|
|
59
|
+
const getCorrection = (identifiers) => {
|
|
60
|
+
const { a, b, n } = identifiers;
|
|
61
|
+
const affineWithN = new Affine(a, b, varName);
|
|
62
|
+
const u = affineWithN.calculate(n);
|
|
63
|
+
return `On résout l'équation $u_${varName} = ${u}$ :
|
|
64
|
+
|
|
65
|
+
$$
|
|
66
|
+
${equationResolutionTex(a.toTree(), b.toTree(), (0).toTree(), u.toTree(), varName)}
|
|
67
|
+
$$`;
|
|
68
|
+
};
|
|
69
|
+
const getKeys = (identifiers) => {
|
|
70
|
+
return [];
|
|
71
|
+
};
|
|
72
|
+
const isAnswerValid = (ans, { answer, a, b, n }) => {
|
|
73
|
+
return numberVEA(ans, answer);
|
|
74
|
+
};
|
|
75
|
+
const getArithmeticFindAntecedentQuestion = (ops) => {
|
|
76
|
+
const affine = AffineConstructor.random(undefined, {
|
|
77
|
+
excludes: [0],
|
|
78
|
+
});
|
|
79
|
+
const n = randint(0, 20, []);
|
|
80
|
+
const identifiers = { a: affine.a, b: affine.b, n: n };
|
|
81
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
82
|
+
};
|
|
83
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
84
|
+
return {
|
|
85
|
+
answer: getAnswer(identifiers),
|
|
86
|
+
instruction: getInstruction(identifiers),
|
|
87
|
+
keys: getKeys(identifiers),
|
|
88
|
+
answerFormat: "tex",
|
|
89
|
+
identifiers,
|
|
90
|
+
hint: getHint(identifiers),
|
|
91
|
+
correction: getCorrection(identifiers),
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
export const arithmeticFindAntecedent = {
|
|
95
|
+
id: "arithmeticFindAntecedent",
|
|
96
|
+
label: "Déterminer un antécedent via une suite arithmétique",
|
|
97
|
+
isSingleStep: true,
|
|
98
|
+
generator: (nb, opts) => getDistinctQuestions(() => getArithmeticFindAntecedentQuestion(opts), nb),
|
|
99
|
+
qcmTimer: 60,
|
|
100
|
+
freeTimer: 60,
|
|
101
|
+
getPropositions,
|
|
102
|
+
isAnswerValid,
|
|
103
|
+
subject: "Mathématiques",
|
|
104
|
+
getInstruction,
|
|
105
|
+
getHint,
|
|
106
|
+
getCorrection,
|
|
107
|
+
getAnswer,
|
|
108
|
+
getQuestionFromIdentifiers,
|
|
109
|
+
hasHintAndCorrection: true,
|
|
110
|
+
};
|
|
@@ -14,4 +14,5 @@ export * from "./arithmeticFindExplictFormulaFirstTermRandom.js";
|
|
|
14
14
|
export * from "./arithmeticFindReasonRandomRange.js";
|
|
15
15
|
export * from "./arithmeticFindRandomTermFromTwoTerms.js";
|
|
16
16
|
export * from "./arithmeticFindTerm.js";
|
|
17
|
+
export * from "./arithmeticFindAntecedent.js";
|
|
17
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC;AACpD,cAAc,oCAAoC,CAAC;AACnD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uCAAuC,CAAC;AACtD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wCAAwC,CAAC;AACvD,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kDAAkD,CAAC;AACjE,cAAc,sCAAsC,CAAC;AACrD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC;AACpD,cAAc,oCAAoC,CAAC;AACnD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uCAAuC,CAAC;AACtD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wCAAwC,CAAC;AACvD,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kDAAkD,CAAC;AACjE,cAAc,sCAAsC,CAAC;AACrD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC"}
|