math-exercises 2.0.42 → 2.0.43
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/commonDivisorsList.d.ts +8 -0
- package/lib/exercises/calcul/arithmetics/commonDivisorsList.d.ts.map +1 -0
- package/lib/exercises/calcul/arithmetics/commonDivisorsList.js +64 -0
- package/lib/exercises/calcul/arithmetics/divisorsList.d.ts +7 -0
- package/lib/exercises/calcul/arithmetics/divisorsList.d.ts.map +1 -0
- package/lib/exercises/calcul/arithmetics/divisorsList.js +56 -0
- package/lib/exercises/calcul/arithmetics/index.d.ts +3 -0
- package/lib/exercises/calcul/arithmetics/index.d.ts.map +1 -1
- package/lib/exercises/calcul/arithmetics/index.js +3 -0
- package/lib/exercises/calcul/arithmetics/pgcdCalcul.d.ts +8 -0
- package/lib/exercises/calcul/arithmetics/pgcdCalcul.d.ts.map +1 -0
- package/lib/exercises/calcul/arithmetics/pgcdCalcul.js +47 -0
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq3.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/index.d.ts +1 -0
- package/lib/exercises/calculLitteral/index.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/index.js +1 -0
- package/lib/exercises/calculLitteral/inequations/index.d.ts +1 -0
- package/lib/exercises/calculLitteral/inequations/index.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/inequations/index.js +1 -0
- package/lib/exercises/calculLitteral/inequations/squareFunctionInequation.d.ts +9 -0
- package/lib/exercises/calculLitteral/inequations/squareFunctionInequation.d.ts.map +1 -0
- package/lib/exercises/calculLitteral/inequations/squareFunctionInequation.js +65 -0
- package/lib/exercises/calculLitteral/systems/basicNiceValuesSystemResolution.d.ts +8 -0
- package/lib/exercises/calculLitteral/systems/basicNiceValuesSystemResolution.d.ts.map +1 -0
- package/lib/exercises/calculLitteral/systems/basicNiceValuesSystemResolution.js +56 -0
- package/lib/exercises/calculLitteral/systems/basicSystemResolution.d.ts +8 -0
- package/lib/exercises/calculLitteral/systems/basicSystemResolution.d.ts.map +1 -0
- package/lib/exercises/calculLitteral/systems/basicSystemResolution.js +67 -0
- package/lib/exercises/calculLitteral/systems/index.d.ts +3 -0
- package/lib/exercises/calculLitteral/systems/index.d.ts.map +1 -0
- package/lib/exercises/calculLitteral/systems/index.js +18 -0
- package/lib/exercises/derivation/derivative/cosCompositionDerivation.d.ts +8 -0
- package/lib/exercises/derivation/derivative/cosCompositionDerivation.d.ts.map +1 -0
- package/lib/exercises/derivation/derivative/cosCompositionDerivation.js +56 -0
- package/lib/exercises/derivation/derivative/index.d.ts +4 -0
- package/lib/exercises/derivation/derivative/index.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/index.js +4 -0
- package/lib/exercises/derivation/derivative/powerCompositionDerivation.d.ts +9 -0
- package/lib/exercises/derivation/derivative/powerCompositionDerivation.d.ts.map +1 -0
- package/lib/exercises/derivation/derivative/powerCompositionDerivation.js +61 -0
- package/lib/exercises/derivation/derivative/sinCompositionDerivation.d.ts +8 -0
- package/lib/exercises/derivation/derivative/sinCompositionDerivation.d.ts.map +1 -0
- package/lib/exercises/derivation/derivative/sinCompositionDerivation.js +57 -0
- package/lib/exercises/derivation/derivative/sqrtCompositionDerivation.d.ts +8 -0
- package/lib/exercises/derivation/derivative/sqrtCompositionDerivation.d.ts.map +1 -0
- package/lib/exercises/derivation/derivative/sqrtCompositionDerivation.js +61 -0
- package/lib/exercises/derivation/derivative/thirdDegreeFunctionVariation.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/thirdDegreeFunctionVariation.js +12 -11
- package/lib/exercises/exercise.d.ts +1 -1
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/functions/absolute/absoluteValueInequations.d.ts.map +1 -1
- package/lib/exercises/functions/absolute/absoluteValueInequations.js +6 -5
- package/lib/exercises/functions/affines/signFunction.d.ts.map +1 -1
- package/lib/exercises/functions/affines/signFunction.js +7 -6
- package/lib/exercises/functions/basics/graphicInequation.d.ts +1 -1
- package/lib/exercises/functions/basics/graphicInequation.d.ts.map +1 -1
- package/lib/exercises/functions/basics/graphicInequation.js +6 -5
- package/lib/exercises/functions/basics/index.d.ts +2 -0
- package/lib/exercises/functions/basics/index.d.ts.map +1 -1
- package/lib/exercises/functions/basics/index.js +2 -0
- package/lib/exercises/functions/basics/twoFunctionsEquation.d.ts +9 -0
- package/lib/exercises/functions/basics/twoFunctionsEquation.d.ts.map +1 -0
- package/lib/exercises/functions/basics/twoFunctionsEquation.js +135 -0
- package/lib/exercises/functions/basics/twoFunctionsInequation.d.ts +17 -0
- package/lib/exercises/functions/basics/twoFunctionsInequation.d.ts.map +1 -0
- package/lib/exercises/functions/basics/twoFunctionsInequation.js +181 -0
- package/lib/exercises/functions/index.d.ts +1 -0
- package/lib/exercises/functions/index.d.ts.map +1 -1
- package/lib/exercises/functions/index.js +1 -0
- package/lib/exercises/functions/square/index.d.ts +2 -0
- package/lib/exercises/functions/square/index.d.ts.map +1 -0
- package/lib/exercises/functions/square/index.js +17 -0
- package/lib/exercises/functions/square/squareImageInterval.d.ts +11 -0
- package/lib/exercises/functions/square/squareImageInterval.d.ts.map +1 -0
- package/lib/exercises/functions/square/squareImageInterval.js +109 -0
- package/lib/exercises/functions/trinoms/secondDegreeInequation.d.ts.map +1 -1
- package/lib/exercises/functions/trinoms/secondDegreeInequation.js +4 -3
- package/lib/exercises/matrices/matrixInversibilityDomain.d.ts.map +1 -1
- package/lib/exercises/matrices/matrixInversibilityDomain.js +3 -2
- package/lib/exercises/sets/intervals/inequalityToInterval.d.ts +1 -1
- package/lib/exercises/sets/intervals/inequalityToInterval.d.ts.map +1 -1
- package/lib/exercises/sets/intervals/intervalsIntersection.d.ts +1 -1
- package/lib/exercises/sets/intervals/intervalsIntersection.d.ts.map +1 -1
- package/lib/exercises/sets/intervals/intervalsUnion.d.ts +1 -1
- package/lib/exercises/sets/intervals/intervalsUnion.d.ts.map +1 -1
- package/lib/index.d.ts +55 -6
- package/lib/index.d.ts.map +1 -1
- package/lib/math/polynomials/affine.d.ts.map +1 -1
- package/lib/math/sets/intervals/intervals.d.ts +2 -1
- package/lib/math/sets/intervals/intervals.d.ts.map +1 -1
- package/lib/math/sets/intervals/intervals.js +14 -13
- package/lib/math/systems/system.d.ts +14 -0
- package/lib/math/systems/system.d.ts.map +1 -0
- package/lib/math/systems/system.js +71 -0
- package/lib/math/utils/arithmetic/isPrime.d.ts +2 -0
- package/lib/math/utils/arithmetic/isPrime.d.ts.map +1 -0
- package/lib/math/utils/arithmetic/isPrime.js +14 -0
- package/lib/server.d.ts.map +1 -1
- package/lib/server.js +0 -5
- package/lib/tree/nodes/inequations/inequationNode.d.ts.map +1 -1
- package/lib/tree/nodes/inequations/inequationNode.js +9 -8
- package/lib/tree/nodes/numbers/infiniteNode.d.ts +2 -0
- package/lib/tree/nodes/numbers/infiniteNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/infiniteNode.js +6 -1
- package/lib/tree/nodes/operators/fractionNode.js +3 -3
- package/lib/tree/nodes/sets/closure.d.ts +13 -0
- package/lib/tree/nodes/sets/closure.d.ts.map +1 -0
- package/lib/tree/nodes/sets/closure.js +63 -0
- package/lib/tree/nodes/sets/intervalNode.d.ts +4 -7
- package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/intervalNode.js +29 -26
- package/lib/tree/nodes/sets/unionIntervalNode.d.ts +0 -6
- package/lib/tree/nodes/sets/unionIntervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/unionIntervalNode.js +4 -10
- package/package.json +1 -1
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.twoFunctionsEquation = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const discreteSetKeys_1 = require("../../../exercises/utils/keys/discreteSetKeys");
|
|
7
|
+
const colors_1 = require("../../../geogebra/colors");
|
|
8
|
+
const geogebraConstructor_1 = require("../../../geogebra/geogebraConstructor");
|
|
9
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
10
|
+
const equationSolutionNode_1 = require("../../../tree/nodes/equations/equationSolutionNode");
|
|
11
|
+
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
12
|
+
const discreteSetNode_1 = require("../../../tree/nodes/sets/discreteSetNode");
|
|
13
|
+
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
14
|
+
const random_1 = require("../../../utils/random");
|
|
15
|
+
const getTwoFunctionsEquationQuestion = () => {
|
|
16
|
+
const yValue = (0, randint_1.randint)(-5, 5);
|
|
17
|
+
let xSolutions = [];
|
|
18
|
+
const nb = (0, randint_1.randint)(2, 4);
|
|
19
|
+
for (let i = 0; i < nb; i++) {
|
|
20
|
+
xSolutions.push((0, randint_1.randint)(-9, 10, xSolutions));
|
|
21
|
+
}
|
|
22
|
+
xSolutions.sort((a, b) => a - b);
|
|
23
|
+
const answer = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode(xSolutions.map((sol) => new numberNode_1.NumberNode(sol)))).toTex();
|
|
24
|
+
const fSplinePoints = [];
|
|
25
|
+
const gSplinePoints = [];
|
|
26
|
+
let prevYWasAbove = (0, coinFlip_1.coinFlip)();
|
|
27
|
+
fSplinePoints.push([
|
|
28
|
+
xSolutions[0] - (1 + Math.random() * 3),
|
|
29
|
+
yValue + (prevYWasAbove ? (0, randint_1.randint)(-2, 0) : (0, randint_1.randint)(1, 3)),
|
|
30
|
+
]);
|
|
31
|
+
gSplinePoints.push([
|
|
32
|
+
xSolutions[0] - (1 + Math.random() * 3),
|
|
33
|
+
yValue - (prevYWasAbove ? (0, randint_1.randint)(-2, 0) : (0, randint_1.randint)(1, 3)),
|
|
34
|
+
]);
|
|
35
|
+
prevYWasAbove = !prevYWasAbove;
|
|
36
|
+
for (let i = 0; i < xSolutions.length; i++) {
|
|
37
|
+
fSplinePoints.push([xSolutions[i], yValue]);
|
|
38
|
+
gSplinePoints.push([xSolutions[i], yValue]);
|
|
39
|
+
if (i < xSolutions.length - 1) {
|
|
40
|
+
const mid = (xSolutions[i] + xSolutions[i + 1]) / 2;
|
|
41
|
+
const distance = xSolutions[i + 1] - xSolutions[i];
|
|
42
|
+
const x = mid + ((Math.random() * 2) / 5) * (distance / 2);
|
|
43
|
+
fSplinePoints.push([
|
|
44
|
+
x,
|
|
45
|
+
yValue + (prevYWasAbove ? (0, randint_1.randint)(-2, 0) : (0, randint_1.randint)(1, 3)),
|
|
46
|
+
]);
|
|
47
|
+
gSplinePoints.push([
|
|
48
|
+
x,
|
|
49
|
+
yValue - (prevYWasAbove ? (0, randint_1.randint)(-2, 0) : (0, randint_1.randint)(1, 3)),
|
|
50
|
+
]);
|
|
51
|
+
prevYWasAbove = !prevYWasAbove;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
fSplinePoints.push([
|
|
55
|
+
xSolutions[xSolutions.length - 1] + (1 + Math.random() * 3),
|
|
56
|
+
yValue + (prevYWasAbove ? (0, randint_1.randint)(-2, 0) : (0, randint_1.randint)(1, 3)),
|
|
57
|
+
]);
|
|
58
|
+
gSplinePoints.push([
|
|
59
|
+
xSolutions[xSolutions.length - 1] + (1 + Math.random() * 3),
|
|
60
|
+
yValue - (prevYWasAbove ? (0, randint_1.randint)(-2, 0) : (0, randint_1.randint)(1, 3)),
|
|
61
|
+
]);
|
|
62
|
+
const xMin = Math.min(...[...fSplinePoints, ...gSplinePoints].map((point) => point[0]));
|
|
63
|
+
const yMin = Math.min(...[...fSplinePoints, ...gSplinePoints].map((point) => point[1]));
|
|
64
|
+
const xMax = Math.max(...[...fSplinePoints, ...gSplinePoints].map((point) => point[0]));
|
|
65
|
+
const yMax = Math.max(...[...fSplinePoints, ...gSplinePoints].map((point) => point[1]));
|
|
66
|
+
const fColor = (0, random_1.random)(colors_1.blues);
|
|
67
|
+
const gColor = (0, random_1.random)(colors_1.oranges);
|
|
68
|
+
const commands = [
|
|
69
|
+
`S = Spline(${fSplinePoints
|
|
70
|
+
.map((point) => `(${point[0]},${point[1]})`)
|
|
71
|
+
.join(",")})`,
|
|
72
|
+
"SetFixed(S, true)",
|
|
73
|
+
`SetColor(S, "${fColor}")`,
|
|
74
|
+
`SetCaption(S, "$f$")`,
|
|
75
|
+
`ShowLabel(S, true)`,
|
|
76
|
+
`T = Spline(${gSplinePoints
|
|
77
|
+
.map((point) => `(${point[0]},${point[1]})`)
|
|
78
|
+
.join(",")})`,
|
|
79
|
+
"SetFixed(T, true)",
|
|
80
|
+
`SetColor(T, "${gColor}")`,
|
|
81
|
+
`SetCaption(T, "$g$")`,
|
|
82
|
+
`ShowLabel(T, true)`,
|
|
83
|
+
];
|
|
84
|
+
const ggb = new geogebraConstructor_1.GeogebraConstructor(commands, {
|
|
85
|
+
isGridSimple: true,
|
|
86
|
+
});
|
|
87
|
+
const question = {
|
|
88
|
+
answer,
|
|
89
|
+
instruction: `Déterminer graphiquement les solutions de l'équation $f(x) = g(x)$ où $f$ et $g$ sont les fonctions représentées ci-dessous.`,
|
|
90
|
+
keys: discreteSetKeys_1.discreteSetKeys,
|
|
91
|
+
answerFormat: "tex",
|
|
92
|
+
identifiers: { yValue, fSplinePoints, gSplinePoints },
|
|
93
|
+
commands: ggb.commands,
|
|
94
|
+
coords: ggb.getAdaptedCoords({ xMax, xMin, yMax, yMin }),
|
|
95
|
+
options: ggb.getOptions(),
|
|
96
|
+
};
|
|
97
|
+
return question;
|
|
98
|
+
};
|
|
99
|
+
const getPropositions = (n, { answer }) => {
|
|
100
|
+
const propositions = [];
|
|
101
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
102
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, `S=\\varnothing`);
|
|
103
|
+
while (propositions.length < n) {
|
|
104
|
+
const nbs = [];
|
|
105
|
+
const nbSol = (0, randint_1.randint)(2, 4);
|
|
106
|
+
for (let i = 0; i < nbSol; i++) {
|
|
107
|
+
nbs.push((0, randint_1.randint)(-9, 10, nbs));
|
|
108
|
+
}
|
|
109
|
+
nbs.sort((a, b) => a - b);
|
|
110
|
+
const sol = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode(nbs.map((nb) => new numberNode_1.NumberNode(nb))));
|
|
111
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, sol.toTex());
|
|
112
|
+
}
|
|
113
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
114
|
+
};
|
|
115
|
+
const isAnswerValid = (ans, { answer, fSplinePoints, yValue }) => {
|
|
116
|
+
const xSolutions = fSplinePoints
|
|
117
|
+
.filter((p) => p[1] === yValue)
|
|
118
|
+
.map((p) => p[0]);
|
|
119
|
+
const answerTree = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode(xSolutions.map((sol) => new numberNode_1.NumberNode(sol))));
|
|
120
|
+
const texs = answerTree.toAllValidTexs();
|
|
121
|
+
return texs.includes(ans);
|
|
122
|
+
};
|
|
123
|
+
exports.twoFunctionsEquation = {
|
|
124
|
+
id: "twoFunctionsEquation",
|
|
125
|
+
label: "Résoudre graphiquement une équation du type $f(x)=g(x)$",
|
|
126
|
+
levels: ["2nde"],
|
|
127
|
+
isSingleStep: true,
|
|
128
|
+
sections: ["Fonctions"],
|
|
129
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getTwoFunctionsEquationQuestion, nb),
|
|
130
|
+
qcmTimer: 60,
|
|
131
|
+
freeTimer: 60,
|
|
132
|
+
getPropositions,
|
|
133
|
+
isAnswerValid,
|
|
134
|
+
hasGeogebra: true,
|
|
135
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MathExercise } from "../../../exercises/exercise";
|
|
2
|
+
import { InegalitySymbols } from "../../../math/inequations/inequation";
|
|
3
|
+
import { ClosureType } from "../../../tree/nodes/sets/closure";
|
|
4
|
+
type Identifiers = {
|
|
5
|
+
yValue: number;
|
|
6
|
+
fSplinePoints: number[][];
|
|
7
|
+
gSplinePoints: number[][];
|
|
8
|
+
ineqSymbol: InegalitySymbols;
|
|
9
|
+
intervals: {
|
|
10
|
+
a: number;
|
|
11
|
+
b: number;
|
|
12
|
+
closure: ClosureType;
|
|
13
|
+
}[];
|
|
14
|
+
};
|
|
15
|
+
export declare const twoFunctionsInequation: MathExercise<Identifiers>;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=twoFunctionsInequation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"twoFunctionsInequation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/basics/twoFunctionsInequation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAK3C,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAQ5D,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,UAAU,EAAE,gBAAgB,CAAC;IAC7B,SAAS,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,WAAW,CAAA;KAAE,EAAE,CAAC;CAC7D,CAAC;AA0MF,eAAO,MAAM,sBAAsB,EAAE,YAAY,CAAC,WAAW,CAa5D,CAAC"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.twoFunctionsInequation = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const colors_1 = require("../../../geogebra/colors");
|
|
7
|
+
const geogebraConstructor_1 = require("../../../geogebra/geogebraConstructor");
|
|
8
|
+
const inequation_1 = require("../../../math/inequations/inequation");
|
|
9
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
10
|
+
const inequationSolutionNode_1 = require("../../../tree/nodes/inequations/inequationSolutionNode");
|
|
11
|
+
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
12
|
+
const closure_1 = require("../../../tree/nodes/sets/closure");
|
|
13
|
+
const intervalNode_1 = require("../../../tree/nodes/sets/intervalNode");
|
|
14
|
+
const unionIntervalNode_1 = require("../../../tree/nodes/sets/unionIntervalNode");
|
|
15
|
+
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
16
|
+
const random_1 = require("../../../utils/random");
|
|
17
|
+
const getTwoFunctionsInequationQuestion = () => {
|
|
18
|
+
const ineq = inequation_1.InequationSymbolConstructor.random();
|
|
19
|
+
const yValue = (0, randint_1.randint)(-5, 5);
|
|
20
|
+
let xSolutions = [];
|
|
21
|
+
const nb = (0, randint_1.randint)(2, 4);
|
|
22
|
+
for (let i = 0; i < nb; i++) {
|
|
23
|
+
xSolutions.push((0, randint_1.randint)(-9, 10, xSolutions));
|
|
24
|
+
}
|
|
25
|
+
xSolutions.sort((a, b) => a - b);
|
|
26
|
+
const fSplinePoints = [];
|
|
27
|
+
const gSplinePoints = [];
|
|
28
|
+
let prevYWasAbove = (0, coinFlip_1.coinFlip)();
|
|
29
|
+
const intervals = [];
|
|
30
|
+
const xStart = xSolutions[0] - (0, randint_1.randint)(1, 4);
|
|
31
|
+
fSplinePoints.push([
|
|
32
|
+
xStart,
|
|
33
|
+
yValue + (prevYWasAbove ? (0, randint_1.randint)(-2, 0) : (0, randint_1.randint)(1, 3)),
|
|
34
|
+
]);
|
|
35
|
+
gSplinePoints.push([
|
|
36
|
+
xStart,
|
|
37
|
+
yValue - (prevYWasAbove ? (0, randint_1.randint)(-2, 0) : (0, randint_1.randint)(1, 3)),
|
|
38
|
+
]);
|
|
39
|
+
if ((ineq.isSup && !prevYWasAbove) || (!ineq.isSup && prevYWasAbove))
|
|
40
|
+
intervals.push({
|
|
41
|
+
a: xStart,
|
|
42
|
+
b: xSolutions[0],
|
|
43
|
+
closure: ineq.isStrict ? closure_1.ClosureType.FO : closure_1.ClosureType.FF,
|
|
44
|
+
});
|
|
45
|
+
prevYWasAbove = !prevYWasAbove;
|
|
46
|
+
for (let i = 0; i < xSolutions.length; i++) {
|
|
47
|
+
fSplinePoints.push([xSolutions[i], yValue]);
|
|
48
|
+
gSplinePoints.push([xSolutions[i], yValue]);
|
|
49
|
+
if (i < xSolutions.length - 1) {
|
|
50
|
+
const mid = (xSolutions[i] + xSolutions[i + 1]) / 2;
|
|
51
|
+
const distance = xSolutions[i + 1] - xSolutions[i];
|
|
52
|
+
const x = mid + ((Math.random() * 2) / 5) * (distance / 2);
|
|
53
|
+
if ((!prevYWasAbove && ineq.isSup) || (prevYWasAbove && !ineq.isSup)) {
|
|
54
|
+
intervals.push({
|
|
55
|
+
a: xSolutions[i],
|
|
56
|
+
b: xSolutions[i + 1],
|
|
57
|
+
closure: ineq.isStrict ? closure_1.ClosureType.OO : closure_1.ClosureType.FF,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
fSplinePoints.push([
|
|
61
|
+
x,
|
|
62
|
+
yValue + (prevYWasAbove ? (0, randint_1.randint)(-2, 0) : (0, randint_1.randint)(1, 3)),
|
|
63
|
+
]);
|
|
64
|
+
gSplinePoints.push([
|
|
65
|
+
x,
|
|
66
|
+
yValue - (prevYWasAbove ? (0, randint_1.randint)(-2, 0) : (0, randint_1.randint)(1, 3)),
|
|
67
|
+
]);
|
|
68
|
+
prevYWasAbove = !prevYWasAbove;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const xEnd = xSolutions[xSolutions.length - 1] + (0, randint_1.randint)(1, 4);
|
|
72
|
+
fSplinePoints.push([
|
|
73
|
+
xEnd,
|
|
74
|
+
yValue + (prevYWasAbove ? (0, randint_1.randint)(-2, 0) : (0, randint_1.randint)(1, 3)),
|
|
75
|
+
]);
|
|
76
|
+
gSplinePoints.push([
|
|
77
|
+
xEnd,
|
|
78
|
+
yValue - (prevYWasAbove ? (0, randint_1.randint)(-2, 0) : (0, randint_1.randint)(1, 3)),
|
|
79
|
+
]);
|
|
80
|
+
if ((ineq.isSup && !prevYWasAbove) || (!ineq.isSup && prevYWasAbove))
|
|
81
|
+
intervals.push({
|
|
82
|
+
a: xSolutions[xSolutions.length - 1],
|
|
83
|
+
b: xEnd,
|
|
84
|
+
closure: ineq.isStrict ? closure_1.ClosureType.OF : closure_1.ClosureType.FF,
|
|
85
|
+
});
|
|
86
|
+
const xMin = Math.min(...[...fSplinePoints, ...gSplinePoints].map((point) => point[0]));
|
|
87
|
+
const yMin = Math.min(...[...fSplinePoints, ...gSplinePoints].map((point) => point[1]));
|
|
88
|
+
const xMax = Math.max(...[...fSplinePoints, ...gSplinePoints].map((point) => point[0]));
|
|
89
|
+
const yMax = Math.max(...[...fSplinePoints, ...gSplinePoints].map((point) => point[1]));
|
|
90
|
+
const fColor = (0, random_1.random)(colors_1.blues);
|
|
91
|
+
const gColor = (0, random_1.random)(colors_1.oranges);
|
|
92
|
+
const commands = [
|
|
93
|
+
`S = Spline(${fSplinePoints
|
|
94
|
+
.map((point) => `(${point[0]},${point[1]})`)
|
|
95
|
+
.join(",")})`,
|
|
96
|
+
"SetFixed(S, true)",
|
|
97
|
+
`SetColor(S, "${fColor}")`,
|
|
98
|
+
`SetCaption(S, "$f$")`,
|
|
99
|
+
`ShowLabel(S, true)`,
|
|
100
|
+
`T = Spline(${gSplinePoints
|
|
101
|
+
.map((point) => `(${point[0]},${point[1]})`)
|
|
102
|
+
.join(",")})`,
|
|
103
|
+
"SetFixed(T, true)",
|
|
104
|
+
`SetColor(T, "${gColor}")`,
|
|
105
|
+
`SetCaption(T, "$g$")`,
|
|
106
|
+
`ShowLabel(T, true)`,
|
|
107
|
+
];
|
|
108
|
+
const ggb = new geogebraConstructor_1.GeogebraConstructor(commands, {
|
|
109
|
+
isGridSimple: true,
|
|
110
|
+
});
|
|
111
|
+
const intervalsNodes = intervals.map((i) => new intervalNode_1.IntervalNode(new numberNode_1.NumberNode(i.a), new numberNode_1.NumberNode(i.b), i.closure));
|
|
112
|
+
const answer = intervalsNodes.length === 1
|
|
113
|
+
? `S=\\ ${intervalsNodes[0].toTex()}`
|
|
114
|
+
: `S=\\ ${new unionIntervalNode_1.UnionIntervalNode(intervalsNodes).toTex()}`;
|
|
115
|
+
const question = {
|
|
116
|
+
answer,
|
|
117
|
+
instruction: `Déterminer graphiquement les solutions de l'inéquation $f(x) ${ineq.symbol} g(x)$ où $f$ et $g$ sont les fonctions représentées ci-dessous.`,
|
|
118
|
+
keys: [
|
|
119
|
+
"S",
|
|
120
|
+
"equal",
|
|
121
|
+
"lbracket",
|
|
122
|
+
"semicolon",
|
|
123
|
+
"rbracket",
|
|
124
|
+
"cup",
|
|
125
|
+
"lbrace",
|
|
126
|
+
"rbrace",
|
|
127
|
+
"varnothing",
|
|
128
|
+
],
|
|
129
|
+
answerFormat: "tex",
|
|
130
|
+
identifiers: {
|
|
131
|
+
yValue,
|
|
132
|
+
fSplinePoints,
|
|
133
|
+
gSplinePoints,
|
|
134
|
+
ineqSymbol: ineq.symbol,
|
|
135
|
+
intervals,
|
|
136
|
+
},
|
|
137
|
+
commands: ggb.commands,
|
|
138
|
+
coords: ggb.getAdaptedCoords({ xMax, xMin, yMax, yMin }),
|
|
139
|
+
options: ggb.getOptions(),
|
|
140
|
+
};
|
|
141
|
+
return question;
|
|
142
|
+
};
|
|
143
|
+
const getPropositions = (n, { answer, intervals, fSplinePoints, ineqSymbol }) => {
|
|
144
|
+
const propositions = [];
|
|
145
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
146
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, `S=\\varnothing`);
|
|
147
|
+
while (propositions.length < n) {
|
|
148
|
+
const isStrict = ineqSymbol === "<" || ineqSymbol === ">";
|
|
149
|
+
const x1 = (0, randint_1.randint)(-10, -5);
|
|
150
|
+
const x2 = (0, randint_1.randint)(x1 + 1, x1 + 5);
|
|
151
|
+
const x3 = (0, randint_1.randint)(x2 + 3, x2 + 6);
|
|
152
|
+
const x4 = (0, randint_1.randint)(x3 + 1, x3 + 3);
|
|
153
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, `S=\\ ${new unionIntervalNode_1.UnionIntervalNode([
|
|
154
|
+
new intervalNode_1.IntervalNode(x1.toTree(), x2.toTree(), isStrict ? closure_1.ClosureType.FO : closure_1.ClosureType.FF),
|
|
155
|
+
new intervalNode_1.IntervalNode(x3.toTree(), x4.toTree(), isStrict ? closure_1.ClosureType.OF : closure_1.ClosureType.FF),
|
|
156
|
+
]).toTex()}`);
|
|
157
|
+
}
|
|
158
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
159
|
+
};
|
|
160
|
+
const isAnswerValid = (ans, { answer, fSplinePoints, yValue, intervals }) => {
|
|
161
|
+
const intervalsNodes = intervals.map((n) => new intervalNode_1.IntervalNode(new numberNode_1.NumberNode(n.a), new numberNode_1.NumberNode(n.b), n.closure));
|
|
162
|
+
const intervalsTree = intervalsNodes.length === 1
|
|
163
|
+
? intervalsNodes[0]
|
|
164
|
+
: new unionIntervalNode_1.UnionIntervalNode(intervalsNodes);
|
|
165
|
+
const answerTree = new inequationSolutionNode_1.InequationSolutionNode(intervalsTree);
|
|
166
|
+
const texs = answerTree.toAllValidTexs();
|
|
167
|
+
return texs.includes(ans);
|
|
168
|
+
};
|
|
169
|
+
exports.twoFunctionsInequation = {
|
|
170
|
+
id: "twoFunctionsInequation",
|
|
171
|
+
label: "Résoudre graphiquement une inéquation du type $f(x)<g(x)$",
|
|
172
|
+
levels: ["2nde"],
|
|
173
|
+
isSingleStep: true,
|
|
174
|
+
sections: ["Fonctions"],
|
|
175
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getTwoFunctionsInequationQuestion, nb),
|
|
176
|
+
qcmTimer: 60,
|
|
177
|
+
freeTimer: 60,
|
|
178
|
+
getPropositions,
|
|
179
|
+
isAnswerValid,
|
|
180
|
+
hasGeogebra: true,
|
|
181
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/functions/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/functions/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/square/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./squareImageInterval"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MathExercise } from "../../../exercises/exercise";
|
|
2
|
+
import { ClosureType } from "../../../tree/nodes/sets/closure";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
a: number;
|
|
5
|
+
b: number;
|
|
6
|
+
closure: ClosureType;
|
|
7
|
+
type: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const squareImageInterval: MathExercise<Identifiers>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=squareImageInterval.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"squareImageInterval.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/square/squareImageInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EAAW,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAGrE,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE,WAAW,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAgIF,eAAO,MAAM,mBAAmB,EAAE,YAAY,CAAC,WAAW,CAYzD,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.squareImageInterval = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
|
+
const closure_1 = require("../../../tree/nodes/sets/closure");
|
|
8
|
+
const intervalNode_1 = require("../../../tree/nodes/sets/intervalNode");
|
|
9
|
+
// a < x < b avec a > 0 ==> a^2 < x^2 < b^2
|
|
10
|
+
// a < x < b avec b < 0 ==> b^2 < x^2 < a^2
|
|
11
|
+
// a < x < b avec a<0 et b>0 ==> 0 < x^2 < max(|a|,|b|)^2
|
|
12
|
+
const getAnswer = (a, b, type, closure) => {
|
|
13
|
+
switch (type) {
|
|
14
|
+
case 1:
|
|
15
|
+
return new intervalNode_1.IntervalNode((a ** 2).toTree(), (b ** 2).toTree(), closure);
|
|
16
|
+
case 2:
|
|
17
|
+
return new intervalNode_1.IntervalNode((b ** 2).toTree(), (a ** 2).toTree(), closure_1.Closure.switch(closure));
|
|
18
|
+
case 3:
|
|
19
|
+
default:
|
|
20
|
+
const max = Math.max(Math.abs(a), Math.abs(b));
|
|
21
|
+
const maxClosure = Math.abs(a) === Math.abs(b)
|
|
22
|
+
? closure !== closure_1.ClosureType.OO
|
|
23
|
+
? "F"
|
|
24
|
+
: "O"
|
|
25
|
+
: max === Math.abs(a)
|
|
26
|
+
? closure === closure_1.ClosureType.FF || closure === closure_1.ClosureType.FO
|
|
27
|
+
? "F"
|
|
28
|
+
: "O"
|
|
29
|
+
: closure === closure_1.ClosureType.FF || closure === closure_1.ClosureType.OF
|
|
30
|
+
? "F"
|
|
31
|
+
: "O";
|
|
32
|
+
const ansClosure = maxClosure === "F" ? closure_1.ClosureType.FF : closure_1.ClosureType.FO;
|
|
33
|
+
return new intervalNode_1.IntervalNode((0).toTree(), (Math.max(Math.abs(a), Math.abs(b)) ** 2).toTree(), ansClosure);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const getSquareImageIntervalQuestion = () => {
|
|
37
|
+
let a;
|
|
38
|
+
let b;
|
|
39
|
+
let instruction = "";
|
|
40
|
+
let closure;
|
|
41
|
+
const type = (0, randint_1.randint)(1, 4);
|
|
42
|
+
switch (type) {
|
|
43
|
+
case 1:
|
|
44
|
+
a = (0, randint_1.randint)(0, 8);
|
|
45
|
+
b = (0, randint_1.randint)(a + 1, a + 5);
|
|
46
|
+
closure = closure_1.Closure.random();
|
|
47
|
+
instruction = new intervalNode_1.IntervalNode(a.toTree(), b.toTree(), closure)
|
|
48
|
+
.toInequality()
|
|
49
|
+
.toTex();
|
|
50
|
+
break;
|
|
51
|
+
case 2:
|
|
52
|
+
b = (0, randint_1.randint)(-5, 0);
|
|
53
|
+
a = (0, randint_1.randint)(b - 5, b);
|
|
54
|
+
closure = closure_1.Closure.random();
|
|
55
|
+
instruction = new intervalNode_1.IntervalNode(a.toTree(), b.toTree(), closure)
|
|
56
|
+
.toInequality()
|
|
57
|
+
.toTex();
|
|
58
|
+
break;
|
|
59
|
+
case 3:
|
|
60
|
+
default:
|
|
61
|
+
a = (0, randint_1.randint)(-9, 0);
|
|
62
|
+
b = (0, randint_1.randint)(1, 10);
|
|
63
|
+
closure = closure_1.Closure.random();
|
|
64
|
+
instruction = new intervalNode_1.IntervalNode(a.toTree(), b.toTree(), closure)
|
|
65
|
+
.toInequality()
|
|
66
|
+
.toTex();
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
const answer = getAnswer(a, b, type, closure).toTex();
|
|
70
|
+
const question = {
|
|
71
|
+
answer,
|
|
72
|
+
instruction: `Soit $${instruction}$. A quel intervalle appartient $x^2$ ?`,
|
|
73
|
+
keys: ["lbracket", "semicolon", "rbracket"],
|
|
74
|
+
answerFormat: "tex",
|
|
75
|
+
identifiers: { a, b, closure, type },
|
|
76
|
+
};
|
|
77
|
+
return question;
|
|
78
|
+
};
|
|
79
|
+
const getPropositions = (n, { answer, a, b, type, closure }) => {
|
|
80
|
+
const propositions = [];
|
|
81
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
82
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new intervalNode_1.IntervalNode(a.toTree(), b.toTree(), closure).toTex());
|
|
83
|
+
if (type === 3) {
|
|
84
|
+
const min = Math.min(Math.abs(a), Math.abs(b)) ** 2;
|
|
85
|
+
const max = Math.max(Math.abs(a), Math.abs(b)) ** 2;
|
|
86
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new intervalNode_1.IntervalNode(min.toTree(), max.toTree(), closure).toTex());
|
|
87
|
+
}
|
|
88
|
+
while (propositions.length < n) {
|
|
89
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, getAnswer(a, b, type, closure_1.Closure.random()).toTex());
|
|
90
|
+
}
|
|
91
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
92
|
+
};
|
|
93
|
+
const isAnswerValid = (ans, { answer, a, b, closure, type }) => {
|
|
94
|
+
const interval = getAnswer(a, b, type, closure);
|
|
95
|
+
const texs = interval.toAllValidTexs();
|
|
96
|
+
return texs.includes(ans);
|
|
97
|
+
};
|
|
98
|
+
exports.squareImageInterval = {
|
|
99
|
+
id: "squareImageInterval",
|
|
100
|
+
label: "Passer une inégalité au carré",
|
|
101
|
+
levels: ["2nde"],
|
|
102
|
+
isSingleStep: true,
|
|
103
|
+
sections: ["Fonctions de référence", "Ensembles et intervalles"],
|
|
104
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getSquareImageIntervalQuestion, nb),
|
|
105
|
+
qcmTimer: 60,
|
|
106
|
+
freeTimer: 60,
|
|
107
|
+
getPropositions,
|
|
108
|
+
isAnswerValid,
|
|
109
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secondDegreeInequation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/trinoms/secondDegreeInequation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"secondDegreeInequation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/trinoms/secondDegreeInequation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAc3C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,gBAAgB,CAAC;CAC5B,CAAC;AAuHF,eAAO,MAAM,sBAAsB,EAAE,YAAY,CAAC,WAAW,CAa5D,CAAC"}
|
|
@@ -9,14 +9,15 @@ const randint_1 = require("../../../math/utils/random/randint");
|
|
|
9
9
|
const inequationSolutionNode_1 = require("../../../tree/nodes/inequations/inequationSolutionNode");
|
|
10
10
|
const infiniteNode_1 = require("../../../tree/nodes/numbers/infiniteNode");
|
|
11
11
|
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
12
|
+
const closure_1 = require("../../../tree/nodes/sets/closure");
|
|
12
13
|
const intervalNode_1 = require("../../../tree/nodes/sets/intervalNode");
|
|
13
14
|
const unionIntervalNode_1 = require("../../../tree/nodes/sets/unionIntervalNode");
|
|
14
15
|
const getAnswer = ({ a, roots, ineqType }) => {
|
|
15
16
|
const aPositive = a > 0;
|
|
16
|
-
const insideInterval = new intervalNode_1.IntervalNode(roots[0], roots[1], ineqType.isStrict ?
|
|
17
|
+
const insideInterval = new intervalNode_1.IntervalNode(roots[0], roots[1], ineqType.isStrict ? closure_1.ClosureType.OO : closure_1.ClosureType.FF);
|
|
17
18
|
const outsideUnion = new unionIntervalNode_1.UnionIntervalNode([
|
|
18
|
-
new intervalNode_1.IntervalNode(infiniteNode_1.MinusInfinityNode, roots[0], ineqType.isStrict ?
|
|
19
|
-
new intervalNode_1.IntervalNode(roots[1], infiniteNode_1.PlusInfinityNode, ineqType.isStrict ?
|
|
19
|
+
new intervalNode_1.IntervalNode(infiniteNode_1.MinusInfinityNode, roots[0], ineqType.isStrict ? closure_1.ClosureType.OO : closure_1.ClosureType.OF),
|
|
20
|
+
new intervalNode_1.IntervalNode(roots[1], infiniteNode_1.PlusInfinityNode, ineqType.isStrict ? closure_1.ClosureType.OO : closure_1.ClosureType.FO),
|
|
20
21
|
]);
|
|
21
22
|
const tree = ineqType.isSup
|
|
22
23
|
? aPositive
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matrixInversibilityDomain.d.ts","sourceRoot":"","sources":["../../../src/exercises/matrices/matrixInversibilityDomain.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"matrixInversibilityDomain.d.ts","sourceRoot":"","sources":["../../../src/exercises/matrices/matrixInversibilityDomain.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AA0BlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA0FF,eAAO,MAAM,yBAAyB,EAAE,YAAY,CAAC,WAAW,CAY/D,CAAC"}
|
|
@@ -11,6 +11,7 @@ const infiniteNode_1 = require("../../tree/nodes/numbers/infiniteNode");
|
|
|
11
11
|
const fractionNode_1 = require("../../tree/nodes/operators/fractionNode");
|
|
12
12
|
const multiplyNode_1 = require("../../tree/nodes/operators/multiplyNode");
|
|
13
13
|
const substractNode_1 = require("../../tree/nodes/operators/substractNode");
|
|
14
|
+
const closure_1 = require("../../tree/nodes/sets/closure");
|
|
14
15
|
const discreteSetNode_1 = require("../../tree/nodes/sets/discreteSetNode");
|
|
15
16
|
const intervalNode_1 = require("../../tree/nodes/sets/intervalNode");
|
|
16
17
|
const unionIntervalNode_1 = require("../../tree/nodes/sets/unionIntervalNode");
|
|
@@ -44,8 +45,8 @@ const getMatrixInversibilityDomainQuestion = () => {
|
|
|
44
45
|
: isDZero
|
|
45
46
|
? "\\mathbb{R}"
|
|
46
47
|
: new unionIntervalNode_1.UnionIntervalNode([
|
|
47
|
-
new intervalNode_1.IntervalNode(infiniteNode_1.MinusInfinityNode, x,
|
|
48
|
-
new intervalNode_1.IntervalNode(x, infiniteNode_1.PlusInfinityNode,
|
|
48
|
+
new intervalNode_1.IntervalNode(infiniteNode_1.MinusInfinityNode, x, closure_1.ClosureType.OO),
|
|
49
|
+
new intervalNode_1.IntervalNode(x, infiniteNode_1.PlusInfinityNode, closure_1.ClosureType.OO),
|
|
49
50
|
]).toTex();
|
|
50
51
|
const question = {
|
|
51
52
|
answer,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MathExercise } from "../../../exercises/exercise";
|
|
2
|
-
import { ClosureType } from "../../../tree/nodes/sets/
|
|
2
|
+
import { ClosureType } from "../../../tree/nodes/sets/closure";
|
|
3
3
|
type Identifiers = {
|
|
4
4
|
isIntervalToInequality: boolean;
|
|
5
5
|
intervalMin: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inequalityToInterval.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sets/intervals/inequalityToInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AASlC,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"inequalityToInterval.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sets/intervals/inequalityToInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AASlC,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAK5D,KAAK,WAAW,GAAG;IACjB,sBAAsB,EAAE,OAAO,CAAC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,WAAW,CAAC;CAC9B,CAAC;AA8KF,eAAO,MAAM,oBAAoB,EAAE,YAAY,CAAC,WAAW,CAa1D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intervalsIntersection.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sets/intervals/intervalsIntersection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"intervalsIntersection.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sets/intervals/intervalsIntersection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAG5D,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,WAAW,CAAC;CAC1B,CAAC;AAwDF,eAAO,MAAM,qBAAqB,EAAE,YAAY,CAAC,WAAW,CAa3D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intervalsUnion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sets/intervals/intervalsUnion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"intervalsUnion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sets/intervals/intervalsUnion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAG5D,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,WAAW,CAAC;CAC1B,CAAC;AA6CF,eAAO,MAAM,cAAc,EAAE,YAAY,CAAC,WAAW,CAapD,CAAC"}
|