math-exercises 2.0.23 → 2.0.25
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/calcul/arithmetics/paritySumsAndProducts.d.ts +3 -1
- package/lib/exercises/calcul/arithmetics/paritySumsAndProducts.d.ts.map +1 -1
- package/lib/exercises/calcul/arithmetics/paritySumsAndProducts.js +1 -1
- package/lib/exercises/calculLitteral/equation/equationSimpleSquare.js +2 -2
- package/lib/exercises/calculLitteral/equation/fractionEquation.js +2 -2
- package/lib/exercises/combinatory/diceCounting.d.ts +3 -0
- package/lib/exercises/combinatory/diceCounting.d.ts.map +1 -1
- package/lib/exercises/combinatory/diceCounting.js +4 -2
- package/lib/exercises/complex/argumentFromAlgebraicComplex.d.ts +1 -0
- package/lib/exercises/complex/argumentFromAlgebraicComplex.d.ts.map +1 -1
- package/lib/exercises/complex/argumentFromAlgebraicComplex.js +1 -1
- package/lib/exercises/derivation/derivative/thirdDegreeFunctionVariation.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/thirdDegreeFunctionVariation.js +12 -6
- package/lib/exercises/derivation/derivativeNumberReading.d.ts.map +1 -1
- package/lib/exercises/derivation/derivativeNumberReading.js +6 -3
- package/lib/exercises/exercise.d.ts +9 -1
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/functions/absolute/absoluteValueEquations.js +3 -3
- package/lib/exercises/functions/absolute/absoluteValueInequations.js +1 -1
- package/lib/exercises/functions/affines/affineExpressionReading.d.ts.map +1 -1
- package/lib/exercises/functions/affines/affineExpressionReading.js +11 -12
- package/lib/exercises/functions/affines/interceptReading.d.ts.map +1 -1
- package/lib/exercises/functions/affines/interceptReading.js +16 -10
- package/lib/exercises/functions/affines/leadingCoefficient.d.ts.map +1 -1
- package/lib/exercises/functions/affines/leadingCoefficient.js +12 -25
- package/lib/exercises/functions/basics/graphicEquation.d.ts.map +1 -1
- package/lib/exercises/functions/basics/graphicEquation.js +16 -15
- package/lib/exercises/functions/basics/graphicInequation.d.ts.map +1 -1
- package/lib/exercises/functions/basics/graphicInequation.js +14 -13
- package/lib/exercises/functions/basics/imageFunctionGeogebra.d.ts.map +1 -1
- package/lib/exercises/functions/basics/imageFunctionGeogebra.js +9 -19
- package/lib/exercises/functions/basics/inverseImageFunctionGeogebra.d.ts.map +1 -1
- package/lib/exercises/functions/basics/inverseImageFunctionGeogebra.js +25 -69
- package/lib/exercises/functions/logarithm/log10PowerSimplifying.d.ts +1 -0
- package/lib/exercises/functions/logarithm/log10PowerSimplifying.d.ts.map +1 -1
- package/lib/exercises/functions/logarithm/log10PowerSimplifying.js +1 -1
- package/lib/exercises/functions/trinoms/niceRootsFromDevForm.js +2 -2
- package/lib/exercises/functions/trinoms/rootsFromDevForm.js +2 -2
- package/lib/exercises/functions/trinoms/rootsFromFactorizedForm.js +1 -1
- package/lib/exercises/functions/trinoms/secondDegreeInequation.js +1 -1
- package/lib/exercises/geometry/areas/rightTriangleArea.d.ts.map +1 -1
- package/lib/exercises/geometry/areas/rightTriangleArea.js +7 -1
- package/lib/exercises/geometry/areas/triangleArea.d.ts.map +1 -1
- package/lib/exercises/geometry/areas/triangleArea.js +11 -3
- package/lib/exercises/geometry/pythagore/pythagore.d.ts.map +1 -1
- package/lib/exercises/geometry/pythagore/pythagore.js +7 -1
- package/lib/exercises/geometry/pythagore/pythagoreCalcul.d.ts.map +1 -1
- package/lib/exercises/geometry/pythagore/pythagoreCalcul.js +7 -1
- package/lib/exercises/geometry/thales/thales.d.ts.map +1 -1
- package/lib/exercises/geometry/thales/thales.js +7 -3
- package/lib/exercises/geometry/thales/thalesCalcul.d.ts.map +1 -1
- package/lib/exercises/geometry/thales/thalesCalcul.js +7 -3
- package/lib/exercises/geometry/vectors/coordinatesReading.d.ts.map +1 -1
- package/lib/exercises/geometry/vectors/coordinatesReading.js +15 -9
- package/lib/exercises/probaStat/probabilityTree.d.ts.map +1 -1
- package/lib/exercises/probaStat/probabilityTree.js +6 -2
- package/lib/exercises/sets/intervals/intervalsIntersection.js +1 -1
- package/lib/exercises/sets/setBelonging.js +1 -1
- package/lib/exercises/squareRoots/squareRootEquation.js +3 -3
- package/lib/exercises/trigonometry/trigonometry.d.ts.map +1 -1
- package/lib/exercises/trigonometry/trigonometry.js +7 -3
- package/lib/exercises/trigonometry/trigonometryAngleCalcul.d.ts.map +1 -1
- package/lib/exercises/trigonometry/trigonometryAngleCalcul.js +7 -3
- package/lib/exercises/trigonometry/trigonometrySideCalcul.d.ts.map +1 -1
- package/lib/exercises/trigonometry/trigonometrySideCalcul.js +7 -1
- package/lib/exercises/utils/keys/discreteSetKeys.d.ts +3 -0
- package/lib/exercises/utils/keys/discreteSetKeys.d.ts.map +1 -0
- package/lib/exercises/utils/keys/discreteSetKeys.js +11 -0
- package/lib/exercises/utils/keys/equationKeys.js +1 -1
- package/lib/exercises/utils/keys/inequationKeys.js +1 -1
- package/lib/geogebra/geogebraConstructor.d.ts +34 -3
- package/lib/geogebra/geogebraConstructor.d.ts.map +1 -1
- package/lib/geogebra/geogebraConstructor.js +35 -6
- package/lib/index.d.ts +8 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/triangles.d.ts +1 -1
- package/lib/math/geometry/triangles.d.ts.map +1 -1
- package/lib/math/geometry/triangles.js +1 -3
- package/lib/math/polynomials/polynomial.js +1 -1
- package/lib/math/polynomials/trinom.js +2 -2
- package/lib/math/sets/emptySet.js +1 -1
- package/lib/math/sets/intervals/intervals.js +1 -1
- package/lib/tree/nodes/sets/discreteSetNode.js +1 -1
- package/lib/types/keyIds.d.ts +1 -1
- package/lib/types/keyIds.d.ts.map +1 -1
- package/package.json +3 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { MathExercise } from "../../../exercises/exercise";
|
|
2
|
-
type Identifiers = {
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
type: number;
|
|
4
|
+
};
|
|
3
5
|
export declare const paritySumsAndProducts: MathExercise<Identifiers>;
|
|
4
6
|
export {};
|
|
5
7
|
//# sourceMappingURL=paritySumsAndProducts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paritySumsAndProducts.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calcul/arithmetics/paritySumsAndProducts.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAKb,MAAM,0BAA0B,CAAC;AAyElC,KAAK,WAAW,GAAG,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"paritySumsAndProducts.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calcul/arithmetics/paritySumsAndProducts.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAKb,MAAM,0BAA0B,CAAC;AAyElC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAgCF,eAAO,MAAM,qBAAqB,EAAE,YAAY,CAAC,WAAW,CAc3D,CAAC"}
|
|
@@ -77,7 +77,7 @@ const getPropositions = (n, { answer, randNbr }) => {
|
|
|
77
77
|
const tempAns = sqrt + (0, randint_1.randint)(-sqrt + 1, 7, [0]);
|
|
78
78
|
(0, exercise_1.tryToAddWrongProp)(propositions, (0, coinFlip_1.coinFlip)()
|
|
79
79
|
? `S=\\left\\{-${tempAns};${tempAns}\\right\\}`
|
|
80
|
-
: `S=\\
|
|
80
|
+
: `S=\\varnothing`);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
else {
|
|
@@ -92,7 +92,7 @@ const getPropositions = (n, { answer, randNbr }) => {
|
|
|
92
92
|
const tempRadicand = radicand + (0, randint_1.randint)(-radicand + 1, 7, [0]);
|
|
93
93
|
(0, exercise_1.tryToAddWrongProp)(propositions, (0, coinFlip_1.coinFlip)()
|
|
94
94
|
? `S=\\left\\{-${tempFactor}\\sqrt{${tempRadicand}};${tempFactor}\\sqrt{${tempRadicand}}\\right\\}`
|
|
95
|
-
: `S=\\
|
|
95
|
+
: `S=\\varnothing`);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
@@ -18,7 +18,7 @@ const getFractionEquation = () => {
|
|
|
18
18
|
const polynome1 = new polynomial_1.Polynomial([b, a]);
|
|
19
19
|
const polynome2 = new polynomial_1.Polynomial([d, c]);
|
|
20
20
|
const answer = -d / c === -b / a
|
|
21
|
-
? `S=\\
|
|
21
|
+
? `S=\\varnothing`
|
|
22
22
|
: `S=\\left\\{${new rational_1.Rational(-b, a)
|
|
23
23
|
.simplify()
|
|
24
24
|
.toTree()
|
|
@@ -35,7 +35,7 @@ const getFractionEquation = () => {
|
|
|
35
35
|
"rbrace",
|
|
36
36
|
"semicolon",
|
|
37
37
|
"ou",
|
|
38
|
-
"
|
|
38
|
+
"varnothing",
|
|
39
39
|
],
|
|
40
40
|
answerFormat: "tex",
|
|
41
41
|
identifiers: { a, b, c, d },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diceCounting.d.ts","sourceRoot":"","sources":["../../../src/exercises/combinatory/diceCounting.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAKlC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"diceCounting.d.ts","sourceRoot":"","sources":["../../../src/exercises/combinatory/diceCounting.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAKlC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAkHF,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,WAAW,CAYlD,CAAC"}
|
|
@@ -8,7 +8,9 @@ const getDiceCountingQuestion = () => {
|
|
|
8
8
|
const type = (0, randint_1.randint)(0, 8);
|
|
9
9
|
let instruction = "";
|
|
10
10
|
let answer = "";
|
|
11
|
-
let face1
|
|
11
|
+
let face1;
|
|
12
|
+
let face2;
|
|
13
|
+
let face3;
|
|
12
14
|
switch (type) {
|
|
13
15
|
case 0:
|
|
14
16
|
instruction = `avec exactement deux chiffres identiques`;
|
|
@@ -56,7 +58,7 @@ const getDiceCountingQuestion = () => {
|
|
|
56
58
|
instruction: `On tire 3 fois consécutivement un dé à six faces numérotées de 1 à 6. Combien de tirages ${instruction} sont possibles ?`,
|
|
57
59
|
keys: [],
|
|
58
60
|
answerFormat: "tex",
|
|
59
|
-
identifiers: { type },
|
|
61
|
+
identifiers: { type, face1, face2, face3 },
|
|
60
62
|
};
|
|
61
63
|
return question;
|
|
62
64
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"argumentFromAlgebraicComplex.d.ts","sourceRoot":"","sources":["../../../src/exercises/complex/argumentFromAlgebraicComplex.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAgBlC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"argumentFromAlgebraicComplex.d.ts","sourceRoot":"","sources":["../../../src/exercises/complex/argumentFromAlgebraicComplex.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAgBlC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AA4CF,eAAO,MAAM,4BAA4B,EAAE,YAAY,CAAC,WAAW,CAalE,CAAC"}
|
|
@@ -30,7 +30,7 @@ const getArgumentFromAlgebraicComplexQuestion = () => {
|
|
|
30
30
|
instruction: `Soit $z=${zTex}$. Déterminer l'argument principal de $z$.`,
|
|
31
31
|
keys: ["pi"],
|
|
32
32
|
answerFormat: "tex",
|
|
33
|
-
identifiers: { arg: arg.angle.evaluate({}) },
|
|
33
|
+
identifiers: { arg: arg.angle.evaluate({}), zTex },
|
|
34
34
|
};
|
|
35
35
|
return question;
|
|
36
36
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thirdDegreeFunctionVariation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/thirdDegreeFunctionVariation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"thirdDegreeFunctionVariation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/thirdDegreeFunctionVariation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAgBlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAsGF,eAAO,MAAM,4BAA4B,EAAE,YAAY,CAAC,WAAW,CAsBlE,CAAC"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.thirdDegreeFunctionVariation = void 0;
|
|
4
4
|
const exercise_1 = require("../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const geogebraConstructor_1 = require("../../../geogebra/geogebraConstructor");
|
|
6
7
|
const polynomial_1 = require("../../../math/polynomials/polynomial");
|
|
7
8
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
9
|
const infiniteNode_1 = require("../../../tree/nodes/numbers/infiniteNode");
|
|
@@ -32,6 +33,11 @@ const getThirdDegreeFunctionVariation = () => {
|
|
|
32
33
|
const commands = [polynome.toString()];
|
|
33
34
|
const ymax = Math.max(polynome.calculate(racine1), polynome.calculate(racine2));
|
|
34
35
|
const ymin = Math.min(polynome.calculate(racine1), polynome.calculate(racine2));
|
|
36
|
+
const ggb = new geogebraConstructor_1.GeogebraConstructor(commands, {
|
|
37
|
+
isAxesRatioFixed: false,
|
|
38
|
+
isGridSimple: true,
|
|
39
|
+
gridDistance: false,
|
|
40
|
+
});
|
|
35
41
|
const question = {
|
|
36
42
|
instruction,
|
|
37
43
|
startStatement: "S",
|
|
@@ -39,12 +45,13 @@ const getThirdDegreeFunctionVariation = () => {
|
|
|
39
45
|
keys: ["lbracket", "rbracket", "semicolon", "infty"],
|
|
40
46
|
answerFormat: "tex",
|
|
41
47
|
coords: [
|
|
42
|
-
racine1 - ((0, randint_1.randint)(7, 20) / 10) * (racine2 - racine1),
|
|
43
|
-
racine2 + ((0, randint_1.randint)(7, 20) / 10) * (racine2 - racine1),
|
|
44
|
-
ymin - ((ymax - ymin) * (0, randint_1.randint)(7, 20)) / 10,
|
|
45
|
-
ymax + ((ymax - ymin) * (0, randint_1.randint)(7, 20)) / 10,
|
|
48
|
+
Math.min(racine1 - ((0, randint_1.randint)(7, 20) / 10) * (racine2 - racine1), -1),
|
|
49
|
+
Math.max(racine2 + ((0, randint_1.randint)(7, 20) / 10) * (racine2 - racine1), 1),
|
|
50
|
+
Math.min(ymin - ((ymax - ymin) * (0, randint_1.randint)(7, 20)) / 10, -1),
|
|
51
|
+
Math.max(ymax + ((ymax - ymin) * (0, randint_1.randint)(7, 20)) / 10, 1),
|
|
46
52
|
],
|
|
47
|
-
commands,
|
|
53
|
+
commands: ggb.commands,
|
|
54
|
+
options: ggb.getOptions(),
|
|
48
55
|
identifiers: { racine1, racine2, coin, a },
|
|
49
56
|
};
|
|
50
57
|
return question;
|
|
@@ -73,7 +80,6 @@ const isAnswerValid = (ans, { racine1, racine2, coin, a }) => {
|
|
|
73
80
|
new intervalNode_1.IntervalNode(r2, infiniteNode_1.PlusInfinityNode, intervalNode_1.ClosureType.FO),
|
|
74
81
|
]);
|
|
75
82
|
const texs = answer.toAllValidTexs();
|
|
76
|
-
console.log(texs);
|
|
77
83
|
return texs.includes(ans);
|
|
78
84
|
};
|
|
79
85
|
exports.thirdDegreeFunctionVariation = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"derivativeNumberReading.d.ts","sourceRoot":"","sources":["../../../src/exercises/derivation/derivativeNumberReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"derivativeNumberReading.d.ts","sourceRoot":"","sources":["../../../src/exercises/derivation/derivativeNumberReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,CAAC,EAAE,MAAM,EAAE,CAAC;CACb,CAAC;AAiFF,eAAO,MAAM,uBAAuB,EAAE,YAAY,CAAC,WAAW,CAa7D,CAAC"}
|
|
@@ -32,12 +32,15 @@ const getDerivativeNumberReading = () => {
|
|
|
32
32
|
const c = penteValue - a * Math.pow(xA, 2) - b * xA;
|
|
33
33
|
const d = yA - (a / 3) * Math.pow(xA, 3) - (b / 2) * Math.pow(xA, 2) - xA * c;
|
|
34
34
|
const polynome = new polynomial_1.Polynomial([d, c, b / 2, a / 3]);
|
|
35
|
-
const instruction = `Ci-dessous sont tracées la courbe de la fonction $f$ et la tangente à cette courbe au point d'abscisse $${xA}$.$\\\\$ Déterminer $f'(${xA})$.`;
|
|
35
|
+
const instruction = `Ci-dessous sont tracées la courbe $\\mathcal C_f$ de la fonction $f$ et la tangente à cette courbe au point d'abscisse $${xA}$.$\\\\$ Déterminer $f'(${xA})$.`;
|
|
36
36
|
const commands = [
|
|
37
|
-
polynome.toString()
|
|
37
|
+
`f(x) = ${polynome.toString()}`,
|
|
38
|
+
`SetCaption(f, "$\\mathcal C_f$")`,
|
|
39
|
+
`ShowLabel(f, true)`,
|
|
38
40
|
`g(x) = (${penteString}) * x + (${originString})`,
|
|
39
|
-
`(${xA},${yA})`,
|
|
41
|
+
`A = (${xA},${yA})`,
|
|
40
42
|
];
|
|
43
|
+
// const ggb = new GeogebraConstructor(commands);
|
|
41
44
|
const answer = penteTree.toTex();
|
|
42
45
|
const question = {
|
|
43
46
|
instruction,
|
|
@@ -18,7 +18,15 @@ export interface Question<TIdentifiers = {}> {
|
|
|
18
18
|
keys?: KeyId[];
|
|
19
19
|
commands?: string[];
|
|
20
20
|
coords?: number[];
|
|
21
|
-
options?:
|
|
21
|
+
options?: {
|
|
22
|
+
axesRatio?: [number, number] | false;
|
|
23
|
+
gridDistance?: [number, number] | false;
|
|
24
|
+
hideGrid?: boolean;
|
|
25
|
+
hideAxes?: boolean;
|
|
26
|
+
isGridBold?: boolean;
|
|
27
|
+
isGridSimple?: boolean;
|
|
28
|
+
isAxesRatioFixed?: boolean;
|
|
29
|
+
};
|
|
22
30
|
divisionFormat?: "fraction" | "obelus";
|
|
23
31
|
identifiers: TIdentifiers;
|
|
24
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAI3C,eAAO,MAAM,YAAY,UAChB,WAAW,EAAE,aACT,MAAM,WACT,KAAK,GAAG,KAAK,SAQtB,CAAC;AACF,eAAO,MAAM,YAAY,UAChB,WAAW,EAAE,aACT,MAAM,WACT,KAAK,GAAG,KAAK,SAQtB,CAAC;AACF,eAAO,MAAM,iBAAiB,UACrB,WAAW,EAAE,aACT,MAAM,WACT,KAAK,GAAG,KAAK,SAUtB,CAAC;AAEF,eAAO,MAAM,YAAY,UAAW,WAAW,EAAE,KAAK,MAAM,kBAE3D,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAElC,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,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B,cAAc,GACd,cAAc,GACd,QAAQ,GACR,uBAAuB,GACvB,oBAAoB,GACpB,eAAe,GACf,gBAAgB,GAChB,UAAU,CAAC"}
|
|
@@ -18,12 +18,12 @@ const getAbsoluteValueEquationsQuestion = () => {
|
|
|
18
18
|
const answer = a === 0
|
|
19
19
|
? `S=\\left\\{${b}\\right\\}`
|
|
20
20
|
: a < 0
|
|
21
|
-
? `S=\\
|
|
21
|
+
? `S=\\varnothing`
|
|
22
22
|
: `S=\\left\\{${b - a};${b + a}\\right\\}`;
|
|
23
23
|
const question = {
|
|
24
24
|
answer: answer,
|
|
25
25
|
instruction: `Résoudre l'équation $|${poly.toTree().toTex()}| = ${a}$.`,
|
|
26
|
-
keys: ["S", "equal", "
|
|
26
|
+
keys: ["S", "equal", "varnothing", "lbrace", "semicolon", "rbrace"],
|
|
27
27
|
answerFormat: "tex",
|
|
28
28
|
identifiers: { a, b },
|
|
29
29
|
};
|
|
@@ -37,7 +37,7 @@ const getPropositions = (n, { answer, a, b }) => {
|
|
|
37
37
|
(0, exercise_1.tryToAddWrongProp)(propositions, `S=\\left\\{${b + a}\\right\\}`);
|
|
38
38
|
}
|
|
39
39
|
else if (a === 0) {
|
|
40
|
-
(0, exercise_1.tryToAddWrongProp)(propositions, `S=\\
|
|
40
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, `S=\\varnothing`);
|
|
41
41
|
}
|
|
42
42
|
else if (a > 0) {
|
|
43
43
|
(0, exercise_1.tryToAddWrongProp)(propositions, `S=\\left\\{${b + a}\\right\\}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"affineExpressionReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/affines/affineExpressionReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"affineExpressionReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/affines/affineExpressionReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAclC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AA6GF,eAAO,MAAM,uBAAuB,EAAE,YAAY,CAAC,WAAW,CAa7D,CAAC"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.affineExpressionReading = void 0;
|
|
4
4
|
const exercise_1 = require("../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const geogebraConstructor_1 = require("../../../geogebra/geogebraConstructor");
|
|
6
7
|
const rational_1 = require("../../../math/numbers/rationals/rational");
|
|
7
8
|
const affine_1 = require("../../../math/polynomials/affine");
|
|
8
9
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
@@ -19,24 +20,22 @@ const getAffineExpressionReadingQuestion = () => {
|
|
|
19
20
|
.toTree();
|
|
20
21
|
const answer = new equalNode_1.EqualNode(new variableNode_1.VariableNode("f(x)"), new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(leadingCoeff, new variableNode_1.VariableNode("x")), new numberNode_1.NumberNode(b)).simplify({ forceDistributeFractions: true, forbidFactorize: true })).toTex();
|
|
21
22
|
let xMin = Math.min(0, secondPoint[0]);
|
|
22
|
-
if (xMin > 0)
|
|
23
|
-
xMin = -0.5;
|
|
24
23
|
let xMax = Math.max(0, secondPoint[0]);
|
|
25
|
-
if (xMax < 0)
|
|
26
|
-
xMax = 0.5;
|
|
27
24
|
let yMin = Math.min(b, secondPoint[1]);
|
|
28
|
-
if (yMin > 0)
|
|
29
|
-
yMin = -0.5;
|
|
30
25
|
let yMax = Math.max(b, secondPoint[1]);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
const commands = [`Line((0, ${b}), (${secondPoint[0]}, ${secondPoint[1]}))`];
|
|
27
|
+
const ggb = new geogebraConstructor_1.GeogebraConstructor(commands, {
|
|
28
|
+
axesRatio: [1, 1],
|
|
29
|
+
gridDistance: [1, 1],
|
|
30
|
+
isGridSimple: true,
|
|
31
|
+
});
|
|
34
32
|
const question = {
|
|
35
33
|
answer,
|
|
36
34
|
instruction: `Ci-dessous est tracée la courbe représentative d'une fonction affine $f$. Déterminer graphiquement l'expression algébrique de $f(x)$.`,
|
|
37
|
-
keys: ["fx", "equal"],
|
|
38
|
-
commands:
|
|
39
|
-
coords,
|
|
35
|
+
keys: ["fx", "equal", "x"],
|
|
36
|
+
commands: ggb.commands,
|
|
37
|
+
coords: ggb.getAdaptedCoords({ xMin, xMax, yMin, yMax }),
|
|
38
|
+
options: ggb.getOptions(),
|
|
40
39
|
answerFormat: "tex",
|
|
41
40
|
identifiers: { b, secondPoint },
|
|
42
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interceptReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/affines/interceptReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"interceptReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/affines/interceptReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAiBlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAsDF,eAAO,MAAM,gBAAgB,EAAE,YAAY,CAAC,WAAW,CAatD,CAAC"}
|
|
@@ -3,30 +3,31 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.interceptReading = void 0;
|
|
4
4
|
const exercise_1 = require("../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const geogebraConstructor_1 = require("../../../geogebra/geogebraConstructor");
|
|
7
|
+
const frenchify_1 = require("../../../math/utils/latex/frenchify");
|
|
6
8
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
9
|
+
const round_1 = require("../../../math/utils/round");
|
|
7
10
|
const getInterceptReadingQuestion = () => {
|
|
8
11
|
const b = (0, randint_1.randint)(-5, 6);
|
|
9
12
|
const secondPoint = [(0, randint_1.randint)(-5, 6, [0]), (0, randint_1.randint)(-5, 6)];
|
|
10
13
|
const answer = b + "";
|
|
11
14
|
let xMin = Math.min(0, secondPoint[0]);
|
|
12
|
-
if (xMin > 0)
|
|
13
|
-
xMin = -0.5;
|
|
14
15
|
let xMax = Math.max(0, secondPoint[0]);
|
|
15
|
-
if (xMax < 0)
|
|
16
|
-
xMax = 0.5;
|
|
17
16
|
let yMin = Math.min(b, secondPoint[1]);
|
|
18
|
-
if (yMin > 0)
|
|
19
|
-
yMin = -0.5;
|
|
20
17
|
let yMax = Math.max(b, secondPoint[1]);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
const commands = [`Line((0, ${b}), (${secondPoint[0]}, ${secondPoint[1]}))`];
|
|
19
|
+
const ggb = new geogebraConstructor_1.GeogebraConstructor(commands, {
|
|
20
|
+
axesRatio: [1, 1],
|
|
21
|
+
gridDistance: [1, 1],
|
|
22
|
+
isGridSimple: true,
|
|
23
|
+
});
|
|
24
24
|
const question = {
|
|
25
25
|
answer,
|
|
26
26
|
instruction: `Ci-dessous est tracée la courbe représentative d'une fonction affine $f$. Déterminer graphiquement l'ordonnée à l'origine $b$ de la fonction $f$.`,
|
|
27
27
|
keys: [],
|
|
28
28
|
commands: [`Line((0, ${b}), (${secondPoint[0]}, ${secondPoint[1]}))`],
|
|
29
|
-
coords,
|
|
29
|
+
coords: ggb.getAdaptedCoords({ xMin, xMax, yMin, yMax }),
|
|
30
|
+
options: ggb.getOptions(),
|
|
30
31
|
answerFormat: "tex",
|
|
31
32
|
identifiers: { b, secondPoint },
|
|
32
33
|
};
|
|
@@ -35,6 +36,11 @@ const getInterceptReadingQuestion = () => {
|
|
|
35
36
|
const getPropositions = (n, { answer, b, secondPoint }) => {
|
|
36
37
|
const propositions = [];
|
|
37
38
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
39
|
+
const a = (secondPoint[1] - b) / secondPoint[0];
|
|
40
|
+
if (a !== 0) {
|
|
41
|
+
const root = -b / a;
|
|
42
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, frenchify_1.frenchify)((0, round_1.round)(root, 2)));
|
|
43
|
+
}
|
|
38
44
|
while (propositions.length < n) {
|
|
39
45
|
(0, exercise_1.tryToAddWrongProp)(propositions, (0, randint_1.randint)(-5, 6) + "");
|
|
40
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leadingCoefficient.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/affines/leadingCoefficient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"leadingCoefficient.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/affines/leadingCoefficient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAoEF,eAAO,MAAM,kBAAkB,EAAE,YAAY,CAAC,WAAW,CAaxD,CAAC"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.leadingCoefficient = void 0;
|
|
4
4
|
const exercise_1 = require("../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const geogebraConstructor_1 = require("../../../geogebra/geogebraConstructor");
|
|
6
7
|
const integer_1 = require("../../../math/numbers/integer/integer");
|
|
7
8
|
const rational_1 = require("../../../math/numbers/rationals/rational");
|
|
8
9
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
@@ -19,36 +20,22 @@ const getLeadingCoefficientQuestion = () => {
|
|
|
19
20
|
const bTree = b.toTree();
|
|
20
21
|
const aString = aTree.toMathString();
|
|
21
22
|
const bString = bTree.toMathString();
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
ymin = bValue - 1;
|
|
31
|
-
ymax = 1;
|
|
32
|
-
}
|
|
33
|
-
if (aValue === 0) {
|
|
34
|
-
xmax = 5;
|
|
35
|
-
xmin = -5;
|
|
36
|
-
}
|
|
37
|
-
else if (-bValue / aValue > 0) {
|
|
38
|
-
xmax = -bValue / aValue + 1;
|
|
39
|
-
xmin = -1;
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
xmin = -bValue / aValue - 1;
|
|
43
|
-
xmax = 1;
|
|
44
|
-
}
|
|
23
|
+
const xMin = Math.min(xA, xB);
|
|
24
|
+
const xMax = Math.max(xA, xB);
|
|
25
|
+
const yMin = Math.min(yA, yB);
|
|
26
|
+
const yMax = Math.max(yA, yB);
|
|
27
|
+
const commands = [`f(x) = (${aString}) * x + (${bString})`];
|
|
28
|
+
const ggb = new geogebraConstructor_1.GeogebraConstructor(commands, {
|
|
29
|
+
isGridSimple: true,
|
|
30
|
+
});
|
|
45
31
|
const answer = aTree.toTex();
|
|
46
32
|
const question = {
|
|
47
33
|
instruction: "Déterminer le coefficient directeur de la droite représentée ci-dessous : ",
|
|
48
34
|
answer,
|
|
49
35
|
keys: [],
|
|
50
|
-
commands:
|
|
51
|
-
coords:
|
|
36
|
+
commands: ggb.commands,
|
|
37
|
+
coords: ggb.getAdaptedCoords({ xMin, xMax, yMin, yMax }),
|
|
38
|
+
options: ggb.getOptions(),
|
|
52
39
|
answerFormat: "tex",
|
|
53
40
|
identifiers: { xA, xB, yA, yB },
|
|
54
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphicEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/basics/graphicEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"graphicEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/basics/graphicEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAclC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;CAClC,CAAC;AAiGF,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,WAAW,CAarD,CAAC"}
|
|
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.graphicEquation = void 0;
|
|
4
4
|
const exercise_1 = require("../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
-
const
|
|
6
|
+
const discreteSetKeys_1 = require("../../../exercises/utils/keys/discreteSetKeys");
|
|
7
|
+
const geogebraConstructor_1 = require("../../../geogebra/geogebraConstructor");
|
|
7
8
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
9
|
const equationSolutionNode_1 = require("../../../tree/nodes/equations/equationSolutionNode");
|
|
9
10
|
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
@@ -49,23 +50,23 @@ const getGraphicEquationQuestion = () => {
|
|
|
49
50
|
const yMin = Math.min(...splinePoints.map((point) => point[1]));
|
|
50
51
|
const xMax = Math.max(...splinePoints.map((point) => point[0]));
|
|
51
52
|
const yMax = Math.max(...splinePoints.map((point) => point[1]));
|
|
53
|
+
const commands = [
|
|
54
|
+
`S = Spline(${splinePoints
|
|
55
|
+
.map((point) => `(${point[0]},${point[1]})`)
|
|
56
|
+
.join(",")})`,
|
|
57
|
+
"SetFixed(S, true)",
|
|
58
|
+
];
|
|
59
|
+
const ggb = new geogebraConstructor_1.GeogebraConstructor(commands, {
|
|
60
|
+
isGridSimple: true,
|
|
61
|
+
});
|
|
52
62
|
const question = {
|
|
53
63
|
answer,
|
|
54
64
|
instruction: `Déterminer graphiquement les solutions de l'équation $f(x) = ${yValue}$ où $f$ est la fonction représentée ci-dessous.`,
|
|
55
|
-
keys:
|
|
65
|
+
keys: discreteSetKeys_1.discreteSetKeys,
|
|
56
66
|
answerFormat: "tex",
|
|
57
|
-
commands:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
.join(",")})`,
|
|
61
|
-
...splinePoints.map((point) => `(${point[0]},${point[1]})`),
|
|
62
|
-
],
|
|
63
|
-
coords: [
|
|
64
|
-
Math.min(xMin - 1, -1),
|
|
65
|
-
Math.max(xMax + 1, 1),
|
|
66
|
-
Math.min(yMin - 1, -1),
|
|
67
|
-
Math.max(yMax + 1, 1),
|
|
68
|
-
],
|
|
67
|
+
commands: ggb.commands,
|
|
68
|
+
options: ggb.getOptions(),
|
|
69
|
+
coords: ggb.getAdaptedCoords({ xMin, xMax, yMin, yMax }),
|
|
69
70
|
identifiers: { yValue, splinePoints },
|
|
70
71
|
};
|
|
71
72
|
return question;
|
|
@@ -73,7 +74,7 @@ const getGraphicEquationQuestion = () => {
|
|
|
73
74
|
const getPropositions = (n, { answer }) => {
|
|
74
75
|
const propositions = [];
|
|
75
76
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
76
|
-
(0, exercise_1.tryToAddWrongProp)(propositions, `S=\\
|
|
77
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, `S=\\varnothing`);
|
|
77
78
|
while (propositions.length < n) {
|
|
78
79
|
const nbs = [];
|
|
79
80
|
const nbSol = (0, randint_1.randint)(2, 4);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphicInequation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/basics/graphicInequation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"graphicInequation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/basics/graphicInequation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAQlC,OAAO,EAAE,WAAW,EAAgB,MAAM,oCAAoC,CAAC;AAI/E,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,WAAW,CAAA;KAAE,EAAE,CAAC;CAC7D,CAAC;AA+JF,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAAC,WAAW,CAavD,CAAC"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.graphicInequation = void 0;
|
|
4
4
|
const exercise_1 = require("../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const geogebraConstructor_1 = require("../../../geogebra/geogebraConstructor");
|
|
6
7
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
8
|
const inequationSolutionNode_1 = require("../../../tree/nodes/inequations/inequationSolutionNode");
|
|
8
9
|
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
@@ -75,6 +76,15 @@ const getGraphicInequationQuestion = () => {
|
|
|
75
76
|
const answer = intervalsNodes.length === 1
|
|
76
77
|
? `S=${intervalsNodes[0].toTex()}`
|
|
77
78
|
: `S=${new unionIntervalNode_1.UnionIntervalNode(intervalsNodes).toTex()}`;
|
|
79
|
+
const commands = [
|
|
80
|
+
`S =Spline(${splinePoints
|
|
81
|
+
.map((point) => `(${point[0]},${point[1]})`)
|
|
82
|
+
.join(",")})`,
|
|
83
|
+
"SetFixed(S, true)",
|
|
84
|
+
];
|
|
85
|
+
const ggb = new geogebraConstructor_1.GeogebraConstructor(commands, {
|
|
86
|
+
isGridSimple: true,
|
|
87
|
+
});
|
|
78
88
|
const question = {
|
|
79
89
|
answer,
|
|
80
90
|
instruction: `Déterminer graphiquement les solutions de l'inéquation $f(x)${isAskingSup ? (isStrict ? ">" : "\\geq") : isStrict ? "<" : "\\leq"}${yValue}$ où $f$ est la fonction représentée ci-dessous.`,
|
|
@@ -89,18 +99,9 @@ const getGraphicInequationQuestion = () => {
|
|
|
89
99
|
"rbrace",
|
|
90
100
|
],
|
|
91
101
|
answerFormat: "tex",
|
|
92
|
-
commands:
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
.join(",")})`,
|
|
96
|
-
...splinePoints.map((point) => `(${point[0]},${point[1]})`),
|
|
97
|
-
],
|
|
98
|
-
coords: [
|
|
99
|
-
Math.min(xMin - 1, -1),
|
|
100
|
-
Math.max(xMax + 1, 1),
|
|
101
|
-
Math.min(yMin - 1, -1),
|
|
102
|
-
Math.max(yMax + 1, 1),
|
|
103
|
-
],
|
|
102
|
+
commands: ggb.commands,
|
|
103
|
+
options: ggb.getOptions(),
|
|
104
|
+
coords: ggb.getAdaptedCoords({ xMin, xMax, yMin, yMax }),
|
|
104
105
|
identifiers: {
|
|
105
106
|
yValue,
|
|
106
107
|
splinePoints,
|
|
@@ -114,7 +115,7 @@ const getGraphicInequationQuestion = () => {
|
|
|
114
115
|
const getPropositions = (n, { answer, intervals, splinePoints, yValue }) => {
|
|
115
116
|
const propositions = [];
|
|
116
117
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
117
|
-
(0, exercise_1.tryToAddWrongProp)(propositions, `S=\\
|
|
118
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, `S=\\varnothing`);
|
|
118
119
|
(0, exercise_1.tryToAddWrongProp)(propositions, `S=${new intervalNode_1.IntervalNode(new numberNode_1.NumberNode(splinePoints[0][0]), new numberNode_1.NumberNode(yValue), intervalNode_1.ClosureType.FF).toTex()}`);
|
|
119
120
|
while (propositions.length < n) {
|
|
120
121
|
const a = (0, randint_1.randint)(-9, 3);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imageFunctionGeogebra.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/basics/imageFunctionGeogebra.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"imageFunctionGeogebra.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/basics/imageFunctionGeogebra.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAwEF,eAAO,MAAM,qBAAqB,EAAE,YAAY,CAAC,WAAW,CAY3D,CAAC"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.imageFunctionGeogebra = void 0;
|
|
4
4
|
const exercise_1 = require("../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const geogebraConstructor_1 = require("../../../geogebra/geogebraConstructor");
|
|
6
7
|
const polynomial_1 = require("../../../math/polynomials/polynomial");
|
|
7
8
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
9
|
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
@@ -28,32 +29,21 @@ const getImageFunctionGeogebra = () => {
|
|
|
28
29
|
const answer = rand
|
|
29
30
|
? polynome1.calculate(xValue)
|
|
30
31
|
: polynome2.calculate(xValue);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
ymin = answer - 1;
|
|
38
|
-
ymax = 1;
|
|
39
|
-
}
|
|
40
|
-
if (xValue > 0) {
|
|
41
|
-
xmax = xValue + 1;
|
|
42
|
-
xmin = -1;
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
xmin = xValue - 1;
|
|
46
|
-
xmax = 1;
|
|
47
|
-
}
|
|
32
|
+
const xMin = xValue;
|
|
33
|
+
const xMax = xValue;
|
|
34
|
+
const yMin = answer;
|
|
35
|
+
const yMax = answer;
|
|
48
36
|
const commands = [rand ? polynome1.toString() : polynome2.toString()];
|
|
37
|
+
const ggb = new geogebraConstructor_1.GeogebraConstructor(commands, { isGridSimple: true });
|
|
49
38
|
const answerTex = answer + "";
|
|
50
39
|
const question = {
|
|
51
40
|
instruction: statement,
|
|
52
41
|
startStatement: `f(${xValue})`,
|
|
53
42
|
answer: answerTex,
|
|
54
43
|
keys: [],
|
|
55
|
-
commands,
|
|
56
|
-
|
|
44
|
+
commands: ggb.commands,
|
|
45
|
+
options: ggb.getOptions(),
|
|
46
|
+
coords: ggb.getAdaptedCoords({ xMin, xMax, yMin, yMax }),
|
|
57
47
|
answerFormat: "tex",
|
|
58
48
|
identifiers: {
|
|
59
49
|
poly1: polynome1.coefficients,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inverseImageFunctionGeogebra.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/basics/inverseImageFunctionGeogebra.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"inverseImageFunctionGeogebra.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/basics/inverseImageFunctionGeogebra.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAWlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAyIF,eAAO,MAAM,4BAA4B,EAAE,YAAY,CAAC,WAAW,CAalE,CAAC"}
|