math-exercises 2.2.83 → 2.2.85
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/fractions/fractionToPercentToDecimal.js +2 -2
- package/lib/exercises/math/calculLitteral/equation/equationType3Exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/expDerivativeFour.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/expDerivativeFour.js +36 -16
- package/lib/exercises/math/derivation/derivative/expDerivativeThree.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/expDerivativeThree.js +34 -11
- package/lib/exercises/math/derivation/derivative/quotientDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/quotientDerivative.js +57 -26
- package/lib/exercises/math/functions/absolute/absolueValueAffineEquation.d.ts.map +1 -1
- package/lib/exercises/math/functions/absolute/absolueValueAffineEquation.js +1 -0
- package/lib/exercises/math/functions/affines/affineAdjustment.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineAdjustment.js +2 -0
- package/lib/exercises/math/functions/affines/affineAdjustmentComplete.js +1 -1
- package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.js +58 -22
- package/lib/exercises/math/functions/exponential/expEquation.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/expEquation.js +55 -24
- package/lib/exercises/math/functions/index.d.ts +1 -0
- package/lib/exercises/math/functions/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/index.js +1 -0
- package/lib/exercises/math/functions/logarithm/logPowerEquation.d.ts.map +1 -1
- package/lib/exercises/math/functions/logarithm/logPowerEquation.js +15 -12
- package/lib/exercises/math/functions/sign/affineProductSign.d.ts +13 -0
- package/lib/exercises/math/functions/sign/affineProductSign.d.ts.map +1 -0
- package/lib/exercises/math/functions/sign/affineProductSign.js +147 -0
- package/lib/exercises/math/functions/sign/index.d.ts +2 -0
- package/lib/exercises/math/functions/sign/index.d.ts.map +1 -0
- package/lib/exercises/math/functions/sign/index.js +17 -0
- package/lib/exercises/math/geometry/parametric/extractPointFromParametricLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/parametric/extractPointFromParametricLine.js +1 -2
- package/lib/exercises/math/percent/averageEvolutionRate.d.ts.map +1 -1
- package/lib/exercises/math/percent/averageEvolutionRate.js +36 -17
- package/lib/exercises/math/percent/cmToEvolution.js +1 -1
- package/lib/exercises/math/sets/intervals/inequalityToInterval.d.ts.map +1 -1
- package/lib/exercises/math/sets/intervals/inequalityToInterval.js +8 -2
- package/lib/exercises/math/sets/intervals/intervalToInequality.d.ts.map +1 -1
- package/lib/exercises/math/sets/intervals/intervalToInequality.js +8 -2
- package/lib/exercises/math/sets/intervals/intervalsIntersection.d.ts.map +1 -1
- package/lib/exercises/math/sets/intervals/intervalsIntersection.js +16 -4
- package/lib/exercises/math/sets/intervals/intervalsUnion.d.ts.map +1 -1
- package/lib/exercises/math/sets/intervals/intervalsUnion.js +16 -4
- package/lib/exercises/math/trigonometry/degreeToRadians.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/degreeToRadians.js +17 -6
- package/lib/index.d.ts +6 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/parametricLine.d.ts.map +1 -1
- package/lib/math/geometry/parametricLine.js +2 -4
- package/lib/math/polynomials/generalAffine.d.ts +3 -0
- package/lib/math/polynomials/generalAffine.d.ts.map +1 -1
- package/lib/math/polynomials/generalAffine.js +21 -0
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +1 -6
- package/lib/tree/nodes/algebraicNode.d.ts +1 -0
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equationSolutionNode.d.ts +1 -1
- package/lib/tree/nodes/equations/equationSolutionNode.js +1 -1
- package/lib/tree/nodes/functions/log10Node.d.ts.map +1 -1
- package/lib/tree/nodes/functions/log10Node.js +4 -3
- package/lib/tree/nodes/functions/logNode.d.ts +2 -2
- package/lib/tree/nodes/functions/logNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/logNode.js +8 -8
- package/lib/tree/nodes/functions/oppositeNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/oppositeNode.js +0 -1
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +30 -0
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +9 -3
- package/lib/tree/nodes/polynomials/monomNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/discreteSetNode.d.ts +1 -0
- package/lib/tree/nodes/sets/discreteSetNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/discreteSetNode.js +3 -0
- package/lib/tree/nodes/sets/intervalNode.d.ts +1 -0
- package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/intervalNode.js +3 -0
- package/lib/tree/nodes/sets/setNode.d.ts +1 -0
- package/lib/tree/nodes/sets/setNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/unionIntervalNode.d.ts +1 -0
- package/lib/tree/nodes/sets/unionIntervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/unionIntervalNode.js +3 -0
- package/lib/tree/parsers/degreeParser.d.ts +2 -0
- package/lib/tree/parsers/degreeParser.d.ts.map +1 -0
- package/lib/tree/parsers/degreeParser.js +12 -0
- package/lib/tree/parsers/discreteSetParser.d.ts.map +1 -1
- package/lib/tree/parsers/latexParser.d.ts.map +1 -1
- package/lib/tree/parsers/latexParser.js +14 -1
- package/lib/utils/latex/alignTex.js +1 -1
- package/package.json +1 -1
|
@@ -15,6 +15,8 @@ const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
|
15
15
|
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
16
16
|
const discreteSetNode_1 = require("../../../../tree/nodes/sets/discreteSetNode");
|
|
17
17
|
const variableNode_1 = require("../../../../tree/nodes/variables/variableNode");
|
|
18
|
+
const discreteSetParser_1 = require("../../../../tree/parsers/discreteSetParser");
|
|
19
|
+
const equationSolutionParser_1 = require("../../../../tree/parsers/equationSolutionParser");
|
|
18
20
|
/**a*b^x+c=d */
|
|
19
21
|
const getKeys = (identifiers, opts) => {
|
|
20
22
|
const keys = ["x", "equal", "S", "lbrace", "semicolon", "rbrace"];
|
|
@@ -59,23 +61,24 @@ const getPropositions = (n, { answer, isLog10, a, c, k, powered }) => {
|
|
|
59
61
|
}
|
|
60
62
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
61
63
|
};
|
|
62
|
-
const isAnswerValid = (ans, { a, c, k, powered, isLog10 }) => {
|
|
64
|
+
const isAnswerValid = (ans, { a, c, k, powered, isLog10, answer }) => {
|
|
63
65
|
try {
|
|
64
|
-
|
|
66
|
+
const eqParsed = (0, equationSolutionParser_1.equationSolutionParser)(ans);
|
|
67
|
+
if (eqParsed) {
|
|
68
|
+
const set = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode([eqParsed]));
|
|
69
|
+
return set.simplify().toTex() === answer;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
const setParsed = (0, discreteSetParser_1.discreteSetParser)(ans);
|
|
73
|
+
if (!setParsed) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
return "S=" + setParsed.simplify().toTex() === answer;
|
|
77
|
+
}
|
|
65
78
|
}
|
|
66
79
|
catch (err) {
|
|
67
80
|
return false;
|
|
68
81
|
}
|
|
69
|
-
const LNode = isLog10 ? log10Node_1.Log10Node : logNode_1.LogNode;
|
|
70
|
-
const poweredNode = new numberNode_1.NumberNode(powered);
|
|
71
|
-
const answerSimp = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode([
|
|
72
|
-
new fractionNode_1.FractionNode(new LNode(new numberNode_1.NumberNode(k)), new LNode(poweredNode)).simplify(),
|
|
73
|
-
]));
|
|
74
|
-
const answer = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode([
|
|
75
|
-
new fractionNode_1.FractionNode(new LNode(new numberNode_1.NumberNode(k)), new LNode(poweredNode)),
|
|
76
|
-
]));
|
|
77
|
-
const texs = [...answerSimp.toAllValidTexs(), ...answer.toAllValidTexs()];
|
|
78
|
-
return texs.includes(ans);
|
|
79
82
|
};
|
|
80
83
|
exports.logPowerEquation = {
|
|
81
84
|
id: "logPowerEquation",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
+
import { GeneralAffineIdentifiers } from "../../../../math/polynomials/generalAffine";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
affine1Ids: GeneralAffineIdentifiers;
|
|
5
|
+
affine2Ids: GeneralAffineIdentifiers;
|
|
6
|
+
isAskingPositive: boolean;
|
|
7
|
+
};
|
|
8
|
+
type Options = {
|
|
9
|
+
instructionType: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const affineProductSign: Exercise<Identifiers, Options>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=affineProductSign.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"affineProductSign.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/sign/affineProductSign.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAGL,wBAAwB,EACzB,MAAM,sCAAsC,CAAC;AAc9C,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,wBAAwB,CAAC;IACrC,UAAU,EAAE,wBAAwB,CAAC;IACrC,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AA8IF,KAAK,OAAO,GAAG;IACb,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAaF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAiB5D,CAAC"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.affineProductSign = void 0;
|
|
4
|
+
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const generalAffine_1 = require("../../../../math/polynomials/generalAffine");
|
|
7
|
+
const randint_1 = require("../../../../math/utils/random/randint");
|
|
8
|
+
const infiniteNode_1 = require("../../../../tree/nodes/numbers/infiniteNode");
|
|
9
|
+
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
10
|
+
const closure_1 = require("../../../../tree/nodes/sets/closure");
|
|
11
|
+
const intervalNode_1 = require("../../../../tree/nodes/sets/intervalNode");
|
|
12
|
+
const unionIntervalNode_1 = require("../../../../tree/nodes/sets/unionIntervalNode");
|
|
13
|
+
const unionIntervalParser_1 = require("../../../../tree/parsers/unionIntervalParser");
|
|
14
|
+
const coinFlip_1 = require("../../../../utils/alea/coinFlip");
|
|
15
|
+
const doWhile_1 = require("../../../../utils/doWhile");
|
|
16
|
+
const getPropositions = (n, { answer, ...identifiers }, opts) => {
|
|
17
|
+
const propositions = [];
|
|
18
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
19
|
+
const { affine1Ids, affine2Ids, isAskingPositive } = identifiers;
|
|
20
|
+
const affine1 = generalAffine_1.GeneralAffineConstructor.fromIdentifiers(affine1Ids);
|
|
21
|
+
const affine2 = generalAffine_1.GeneralAffineConstructor.fromIdentifiers(affine2Ids);
|
|
22
|
+
let root1 = affine1.getRoot();
|
|
23
|
+
let root2 = affine2.getRoot();
|
|
24
|
+
if (root1.evaluate() > root2.evaluate()) {
|
|
25
|
+
[root1, root2] = [root2, root1];
|
|
26
|
+
}
|
|
27
|
+
const insideInt = new intervalNode_1.IntervalNode(root1, root2, closure_1.ClosureType.FF);
|
|
28
|
+
const outsideInt = new unionIntervalNode_1.UnionIntervalNode([
|
|
29
|
+
new intervalNode_1.IntervalNode(infiniteNode_1.MinusInfinityNode, root1, closure_1.ClosureType.OF),
|
|
30
|
+
new intervalNode_1.IntervalNode(root2, infiniteNode_1.PlusInfinityNode, closure_1.ClosureType.FO),
|
|
31
|
+
]);
|
|
32
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, insideInt.toTex());
|
|
33
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, outsideInt.toTex());
|
|
34
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new intervalNode_1.IntervalNode(infiniteNode_1.MinusInfinityNode, root1, closure_1.ClosureType.OF).toTex());
|
|
35
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new intervalNode_1.IntervalNode(root2, infiniteNode_1.PlusInfinityNode, closure_1.ClosureType.FO).toTex());
|
|
36
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
37
|
+
};
|
|
38
|
+
const getAnswerNode = (identifiers) => {
|
|
39
|
+
const { affine1Ids, affine2Ids, isAskingPositive } = identifiers;
|
|
40
|
+
const affine1 = generalAffine_1.GeneralAffineConstructor.fromIdentifiers(affine1Ids);
|
|
41
|
+
const affine2 = generalAffine_1.GeneralAffineConstructor.fromIdentifiers(affine2Ids);
|
|
42
|
+
let root1 = affine1.getRoot();
|
|
43
|
+
let root2 = affine2.getRoot();
|
|
44
|
+
if (root1.evaluate() > root2.evaluate()) {
|
|
45
|
+
[root1, root2] = [root2, root1];
|
|
46
|
+
}
|
|
47
|
+
const trinomA = (0, multiplyNode_1.multiply)(affine1.a, affine2.a).evaluate();
|
|
48
|
+
const insideInt = new intervalNode_1.IntervalNode(root1, root2, closure_1.ClosureType.FF);
|
|
49
|
+
const outsideInt = new unionIntervalNode_1.UnionIntervalNode([
|
|
50
|
+
new intervalNode_1.IntervalNode(infiniteNode_1.MinusInfinityNode, root1, closure_1.ClosureType.OF),
|
|
51
|
+
new intervalNode_1.IntervalNode(root2, infiniteNode_1.PlusInfinityNode, closure_1.ClosureType.FO),
|
|
52
|
+
]);
|
|
53
|
+
if (trinomA > 0 === isAskingPositive)
|
|
54
|
+
return outsideInt;
|
|
55
|
+
else
|
|
56
|
+
return insideInt;
|
|
57
|
+
};
|
|
58
|
+
const getAnswer = (identifiers, opts) => {
|
|
59
|
+
return getAnswerNode(identifiers).toTex();
|
|
60
|
+
};
|
|
61
|
+
const getInstruction = (identifiers, opts) => {
|
|
62
|
+
const { affine1Ids, affine2Ids, isAskingPositive } = identifiers;
|
|
63
|
+
const affine1 = generalAffine_1.GeneralAffineConstructor.fromIdentifiers(affine1Ids);
|
|
64
|
+
const affine2 = generalAffine_1.GeneralAffineConstructor.fromIdentifiers(affine2Ids);
|
|
65
|
+
const isInequation = opts?.instructionType === "Résoudre l'inéquation";
|
|
66
|
+
return isInequation
|
|
67
|
+
? `Résoudre l'inéquation :
|
|
68
|
+
|
|
69
|
+
$$
|
|
70
|
+
${(0, multiplyNode_1.multiply)(affine1.toTree(), affine2.toTree()).toTex()} ${isAskingPositive ? "\\ge" : "\\le"}0
|
|
71
|
+
$$`
|
|
72
|
+
: `Soit $f$ la fonction définie sur $\\mathbb{R}$ par :
|
|
73
|
+
|
|
74
|
+
$$
|
|
75
|
+
f(x) = ${(0, multiplyNode_1.multiply)(affine1.toTree(), affine2.toTree()).toTex()}
|
|
76
|
+
$$
|
|
77
|
+
|
|
78
|
+
Sur quel(s) intervalle(s) $f$ est-elle ${isAskingPositive ? "positive" : "négative"} ?`;
|
|
79
|
+
};
|
|
80
|
+
// const getHint: GetHint<Identifiers, Options> = (identifiers, opts) => {};
|
|
81
|
+
// const getCorrection: GetCorrection<Identifiers, Options> = (identifiers) => {};
|
|
82
|
+
const getKeys = (identifiers, opts) => {
|
|
83
|
+
return ["lbracket", "semicolon", "rbracket", "cup", "infty"];
|
|
84
|
+
};
|
|
85
|
+
const isAnswerValid = (ans, { answer, ...identifiers }, opts) => {
|
|
86
|
+
try {
|
|
87
|
+
const parsed = (0, unionIntervalParser_1.unionIntervalParser)(ans, { allowNoBrackets: true });
|
|
88
|
+
if (!parsed)
|
|
89
|
+
return false;
|
|
90
|
+
const ansNode = getAnswerNode(identifiers);
|
|
91
|
+
return (parsed.simplify().toClosedForm().toTex() ===
|
|
92
|
+
ansNode.toClosedForm().toTex());
|
|
93
|
+
}
|
|
94
|
+
catch (err) {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
const getAffineProductSignQuestion = (opts) => {
|
|
99
|
+
const a = (0, randint_1.randint)(-9, 10, [0]);
|
|
100
|
+
const b = (0, randint_1.randint)(-9, 10, [0]);
|
|
101
|
+
const c = (0, randint_1.randint)(-10, 10, [0]);
|
|
102
|
+
const d = (0, doWhile_1.doWhile)(() => (0, randint_1.randint)(-10, 10, [0]), (x) => c / a === x / b);
|
|
103
|
+
const affine1 = new generalAffine_1.GeneralAffine(a, b);
|
|
104
|
+
const affine2 = new generalAffine_1.GeneralAffine(c, d);
|
|
105
|
+
const identifiers = {
|
|
106
|
+
affine1Ids: affine1.toIdentifiers(),
|
|
107
|
+
affine2Ids: affine2.toIdentifiers(),
|
|
108
|
+
isAskingPositive: (0, coinFlip_1.coinFlip)(),
|
|
109
|
+
};
|
|
110
|
+
const question = {
|
|
111
|
+
answer: getAnswer(identifiers, opts),
|
|
112
|
+
instruction: getInstruction(identifiers, opts),
|
|
113
|
+
keys: getKeys(identifiers, opts),
|
|
114
|
+
answerFormat: "tex",
|
|
115
|
+
identifiers,
|
|
116
|
+
// hint: getHint(identifiers, opts),
|
|
117
|
+
// correction: getCorrection(identifiers, opts),
|
|
118
|
+
};
|
|
119
|
+
return question;
|
|
120
|
+
};
|
|
121
|
+
const options = [
|
|
122
|
+
{
|
|
123
|
+
id: "instructionType",
|
|
124
|
+
label: "Type de consigne",
|
|
125
|
+
target: exercise_1.GeneratorOptionTarget.instruction,
|
|
126
|
+
type: exercise_1.GeneratorOptionType.select,
|
|
127
|
+
defaultValue: "Déterminer le signe de la fonction",
|
|
128
|
+
values: ["Résoudre l'inéquation", "Déterminer le signe de la fonction"],
|
|
129
|
+
},
|
|
130
|
+
];
|
|
131
|
+
exports.affineProductSign = {
|
|
132
|
+
id: "affineProductSign",
|
|
133
|
+
connector: "\\iff",
|
|
134
|
+
label: "Déterminer le signe de $(ax+b)(cx+d)$",
|
|
135
|
+
isSingleStep: true,
|
|
136
|
+
generator: (nb, opts) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getAffineProductSignQuestion(opts), nb),
|
|
137
|
+
qcmTimer: 60,
|
|
138
|
+
freeTimer: 60,
|
|
139
|
+
getPropositions,
|
|
140
|
+
isAnswerValid,
|
|
141
|
+
subject: "Mathématiques",
|
|
142
|
+
getInstruction,
|
|
143
|
+
// getHint,
|
|
144
|
+
// getCorrection,
|
|
145
|
+
getAnswer,
|
|
146
|
+
options,
|
|
147
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/sign/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,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("./affineProductSign"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractPointFromParametricLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/parametric/extractPointFromParametricLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;
|
|
1
|
+
{"version":3,"file":"extractPointFromParametricLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/parametric/extractPointFromParametricLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAwHF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,CAiBhE,CAAC"}
|
|
@@ -46,8 +46,7 @@ const getCorrection = (identifiers) => {
|
|
|
46
46
|
const point = line.getPointCoords(new numberNode_1.NumberNode(0));
|
|
47
47
|
return `Pour obtenir les coordonnées d'un point appartenant à la droite, il suffit de remplacer $t$ par n'importe quelle valeur dans les trois équations. Par simplicité, prenons $t = 0$. On obtient alors :
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
\\left\\{\\begin{matrix}
|
|
49
|
+
$$\\left\\{\\begin{matrix}
|
|
51
50
|
x=${detailedEquations[0].toTex()} \\\\
|
|
52
51
|
y=${detailedEquations[1].toTex()} \\\\
|
|
53
52
|
z=${detailedEquations[2].toTex()}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"averageEvolutionRate.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/averageEvolutionRate.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"averageEvolutionRate.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/averageEvolutionRate.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,QAAQ,EAYT,MAAM,gBAAgB,CAAC;AAGxB,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAgGF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CActD,CAAC"}
|
|
@@ -6,38 +6,57 @@ const round_1 = require("../../../math/utils/round");
|
|
|
6
6
|
const shuffle_1 = require("../../../utils/alea/shuffle");
|
|
7
7
|
const exercise_1 = require("../../exercise");
|
|
8
8
|
const getDistinctQuestions_1 = require("../../utils/getDistinctQuestions");
|
|
9
|
-
const
|
|
10
|
-
const rate
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
const getInstruction = (identifiers) => {
|
|
10
|
+
const { rate, nbMois } = identifiers;
|
|
11
|
+
return `Un prix augmente de $${rate}\\%$ en $${nbMois}$ mois. Quel est le taux d'évolution mensuel moyen ? Arrondir au centième de pourcentage.`;
|
|
12
|
+
};
|
|
13
|
+
const getAnswer = (identifiers) => {
|
|
14
|
+
const { rate, nbMois } = identifiers;
|
|
13
15
|
const answer = (0, round_1.round)((Math.pow(1 + rate / 100, 1 / nbMois) - 1) * 100, 2);
|
|
14
16
|
const answerTex = (answer + "").replace(".", ",") + `\\%`;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
return answerTex;
|
|
18
|
+
};
|
|
19
|
+
const getHint = (identifiers) => {
|
|
20
|
+
const { rate, nbMois } = identifiers;
|
|
21
|
+
return `Commence par déterminer le coefficient multiplicateur assoicié à une hausse de $${rate}\\%$. Puis, élève ce coefficient à la puissance $\\frac{1}{${nbMois}}$. Enfin, transforme le coefficient multiplicateur obtenu en taux d'évolution.`;
|
|
22
|
+
};
|
|
23
|
+
const getCorrection = (identifiers) => {
|
|
24
|
+
const { rate, nbMois } = identifiers;
|
|
25
|
+
const answer = getAnswer(identifiers);
|
|
26
|
+
const cm = (0, round_1.round)(1 + rate / 100, 2);
|
|
27
|
+
const answerNoPercent = answer.split("\\%")[0];
|
|
28
|
+
return `Le coefficient multiplicateur associé à une hausse de $${rate}\\%$ est :
|
|
23
29
|
|
|
24
30
|
$$
|
|
25
|
-
1+\\frac{${rate}}{100} = ${
|
|
31
|
+
1+\\frac{${rate}}{100} = ${cm.frenchify()}
|
|
26
32
|
$$
|
|
27
33
|
|
|
28
34
|
Le coefficient multiplicateur moyen pour chaque mois sur une période de $${nbMois}$ mois est donc de :
|
|
29
35
|
|
|
30
|
-
|
|
31
|
-
|
|
36
|
+
$$
|
|
37
|
+
${cm.frenchify()}^{\\frac{1}{${nbMois}}} = ${(0, round_1.round)(Math.pow(cm, 1 / nbMois), 4).frenchify()}
|
|
32
38
|
$$
|
|
33
39
|
|
|
34
40
|
On transforme alors ce coefficient multiplicateur en taux d'évolution :
|
|
35
41
|
|
|
36
42
|
$$
|
|
37
|
-
t = (${(0, round_1.round)(Math.pow(
|
|
43
|
+
t = (${(0, round_1.round)(Math.pow(cm, 1 / nbMois), 4).frenchify()}-1)\\times 100 = ${answerNoPercent}
|
|
38
44
|
$$
|
|
39
45
|
|
|
40
|
-
Le taux d'évoution mensuel moyen est donc de $${
|
|
46
|
+
Le taux d'évoution mensuel moyen est donc de $${answer}$.`;
|
|
47
|
+
};
|
|
48
|
+
const getAverageEvolutionRate = () => {
|
|
49
|
+
const rate = (0, randint_1.randint)(1, 100);
|
|
50
|
+
const nbMois = (0, randint_1.randint)(2, 13);
|
|
51
|
+
const identifiers = { nbMois, rate };
|
|
52
|
+
const question = {
|
|
53
|
+
instruction: getInstruction(identifiers),
|
|
54
|
+
answer: getAnswer(identifiers),
|
|
55
|
+
keys: ["percent"],
|
|
56
|
+
answerFormat: "tex",
|
|
57
|
+
identifiers,
|
|
58
|
+
hint: getHint(identifiers),
|
|
59
|
+
correction: getCorrection(identifiers),
|
|
41
60
|
};
|
|
42
61
|
return question;
|
|
43
62
|
};
|
|
@@ -40,7 +40,7 @@ Le taux d'évolution est donc de $${answer}$.
|
|
|
40
40
|
const getPropositions = (n, { answer, evolution }) => {
|
|
41
41
|
const propositions = [];
|
|
42
42
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
43
|
-
(0, exercise_1.tryToAddWrongProp)(propositions, "+" + ((0, round_1.round)(
|
|
43
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "+" + ((0, round_1.round)(100 + evolution, 2) + "\\%").replaceAll(".", ","));
|
|
44
44
|
while (propositions.length < n) {
|
|
45
45
|
const wrongAnswer = ((0, coinFlip_1.coinFlip)() ? "+" : "-") + (0, randint_1.randint)(1, 100) + "\\%";
|
|
46
46
|
(0, exercise_1.tryToAddWrongProp)(propositions, wrongAnswer);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inequalityToInterval.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sets/intervals/inequalityToInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAQlC,OAAO,EAGL,uBAAuB,EACxB,MAAM,oCAAoC,CAAC;AAI5C,KAAK,WAAW,GAAG;IAIjB,mBAAmB,EAAE,uBAAuB,CAAC;CAC9C,CAAC;
|
|
1
|
+
{"version":3,"file":"inequalityToInterval.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sets/intervals/inequalityToInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAQlC,OAAO,EAGL,uBAAuB,EACxB,MAAM,oCAAoC,CAAC;AAI5C,KAAK,WAAW,GAAG;IAIjB,mBAAmB,EAAE,uBAAuB,CAAC;CAC9C,CAAC;AA2FF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAetD,CAAC"}
|
|
@@ -10,10 +10,16 @@ const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
|
10
10
|
const rebuildIdentifiers = (oldIds) => {
|
|
11
11
|
if (!!oldIds.intervalIdentifiers)
|
|
12
12
|
return oldIds;
|
|
13
|
-
const a = oldIds.intervalMin === "-infty" ||
|
|
13
|
+
const a = oldIds.intervalMin === "-infty" ||
|
|
14
|
+
oldIds.intervalMin === -Infinity ||
|
|
15
|
+
oldIds.intervalMin === null ||
|
|
16
|
+
oldIds.intervalMin === undefined
|
|
14
17
|
? infiniteNode_1.MinusInfinityNode
|
|
15
18
|
: oldIds.intervalMin.toTree();
|
|
16
|
-
const b = oldIds.intervalMax === "infty" ||
|
|
19
|
+
const b = oldIds.intervalMax === "infty" ||
|
|
20
|
+
oldIds.intervalMax === Infinity ||
|
|
21
|
+
oldIds.intervalMax === null ||
|
|
22
|
+
oldIds.intervalMax === undefined
|
|
17
23
|
? infiniteNode_1.PlusInfinityNode
|
|
18
24
|
: oldIds.intervalMax.toTree();
|
|
19
25
|
const closure = oldIds.intervalClosure;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intervalToInequality.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sets/intervals/intervalToInequality.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,0BAA0B,CAAC;AAWlC,OAAO,EAGL,uBAAuB,EACxB,MAAM,oCAAoC,CAAC;AAK5C,KAAK,WAAW,GAAG;IAIjB,mBAAmB,EAAE,uBAAuB,CAAC;CAC9C,CAAC;
|
|
1
|
+
{"version":3,"file":"intervalToInequality.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sets/intervals/intervalToInequality.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,0BAA0B,CAAC;AAWlC,OAAO,EAGL,uBAAuB,EACxB,MAAM,oCAAoC,CAAC;AAK5C,KAAK,WAAW,GAAG;IAIjB,mBAAmB,EAAE,uBAAuB,CAAC;CAC9C,CAAC;AAsFF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAetD,CAAC"}
|
|
@@ -9,10 +9,16 @@ const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
|
9
9
|
const rebuildIdentifiers = (oldIds) => {
|
|
10
10
|
if (!!oldIds.intervalIdentifiers)
|
|
11
11
|
return oldIds;
|
|
12
|
-
const a = oldIds.intervalMin === "-infty" ||
|
|
12
|
+
const a = oldIds.intervalMin === "-infty" ||
|
|
13
|
+
oldIds.intervalMin === -Infinity ||
|
|
14
|
+
oldIds.intervalMin === null ||
|
|
15
|
+
oldIds.intervalMin === undefined
|
|
13
16
|
? infiniteNode_1.MinusInfinityNode
|
|
14
17
|
: oldIds.intervalMin.toTree();
|
|
15
|
-
const b = oldIds.intervalMax === "infty" ||
|
|
18
|
+
const b = oldIds.intervalMax === "infty" ||
|
|
19
|
+
oldIds.intervalMax === Infinity ||
|
|
20
|
+
oldIds.intervalMax === null ||
|
|
21
|
+
oldIds.intervalMax === undefined
|
|
16
22
|
? infiniteNode_1.PlusInfinityNode
|
|
17
23
|
: oldIds.intervalMax.toTree();
|
|
18
24
|
const closure = oldIds.intervalClosure;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intervalsIntersection.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sets/intervals/intervalsIntersection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,0BAA0B,CAAC;AAYlC,OAAO,EAGL,uBAAuB,EAExB,MAAM,oCAAoC,CAAC;AAK5C,KAAK,WAAW,GAAG;IAOjB,eAAe,EAAE,uBAAuB,CAAC;IACzC,eAAe,EAAE,uBAAuB,CAAC;CAC1C,CAAC;
|
|
1
|
+
{"version":3,"file":"intervalsIntersection.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sets/intervals/intervalsIntersection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,0BAA0B,CAAC;AAYlC,OAAO,EAGL,uBAAuB,EAExB,MAAM,oCAAoC,CAAC;AAK5C,KAAK,WAAW,GAAG;IAOjB,eAAe,EAAE,uBAAuB,CAAC;IACzC,eAAe,EAAE,uBAAuB,CAAC;CAC1C,CAAC;AAgKF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAgBvD,CAAC"}
|
|
@@ -12,18 +12,30 @@ const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
|
12
12
|
const rebuildIdentifiers = (oldIds) => {
|
|
13
13
|
if (!!oldIds.int1Identifiers)
|
|
14
14
|
return oldIds;
|
|
15
|
-
const a1 = oldIds.int1Min === "-infty" ||
|
|
15
|
+
const a1 = oldIds.int1Min === "-infty" ||
|
|
16
|
+
oldIds.int2Min === -Infinity ||
|
|
17
|
+
oldIds.int1Min === null ||
|
|
18
|
+
oldIds.int1Min === undefined
|
|
16
19
|
? infiniteNode_1.MinusInfinityNode
|
|
17
20
|
: oldIds.int1Min.toTree();
|
|
18
|
-
const b1 = oldIds.int1Max === "infty" ||
|
|
21
|
+
const b1 = oldIds.int1Max === "infty" ||
|
|
22
|
+
oldIds.int1Max === Infinity ||
|
|
23
|
+
oldIds.int1Max === null ||
|
|
24
|
+
oldIds.int1Max === undefined
|
|
19
25
|
? infiniteNode_1.PlusInfinityNode
|
|
20
26
|
: oldIds.int1Max.toTree();
|
|
21
27
|
const closure1 = oldIds.int1Closure;
|
|
22
28
|
const interval1 = new intervalNode_1.IntervalNode(a1, b1, closure1);
|
|
23
|
-
const a2 = oldIds.int2Min === "-infty" ||
|
|
29
|
+
const a2 = oldIds.int2Min === "-infty" ||
|
|
30
|
+
oldIds.int2Min === -Infinity ||
|
|
31
|
+
oldIds.int2Min === null ||
|
|
32
|
+
oldIds.int2Min === undefined
|
|
24
33
|
? infiniteNode_1.MinusInfinityNode
|
|
25
34
|
: oldIds.int2Min.toTree();
|
|
26
|
-
const b2 = oldIds.int2Max === "infty" ||
|
|
35
|
+
const b2 = oldIds.int2Max === "infty" ||
|
|
36
|
+
oldIds.int2Max === Infinity ||
|
|
37
|
+
oldIds.int2Max === null ||
|
|
38
|
+
oldIds.int2Max === undefined
|
|
27
39
|
? infiniteNode_1.PlusInfinityNode
|
|
28
40
|
: oldIds.int2Max.toTree();
|
|
29
41
|
const closure2 = oldIds.int2Closure;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intervalsUnion.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sets/intervals/intervalsUnion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAGL,uBAAuB,EACxB,MAAM,oCAAoC,CAAC;AAI5C,KAAK,WAAW,GAAG;IAOjB,eAAe,EAAE,uBAAuB,CAAC;IACzC,eAAe,EAAE,uBAAuB,CAAC;CAC1C,CAAC;
|
|
1
|
+
{"version":3,"file":"intervalsUnion.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sets/intervals/intervalsUnion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAGL,uBAAuB,EACxB,MAAM,oCAAoC,CAAC;AAI5C,KAAK,WAAW,GAAG;IAOjB,eAAe,EAAE,uBAAuB,CAAC;IACzC,eAAe,EAAE,uBAAuB,CAAC;CAC1C,CAAC;AA8GF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAehD,CAAC"}
|
|
@@ -10,18 +10,30 @@ const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
|
10
10
|
const rebuildIdentifiers = (oldIds) => {
|
|
11
11
|
if (!!oldIds.int1Identifiers)
|
|
12
12
|
return oldIds;
|
|
13
|
-
const a1 = oldIds.int1Min === "-infty" ||
|
|
13
|
+
const a1 = oldIds.int1Min === "-infty" ||
|
|
14
|
+
oldIds.int2Min === -Infinity ||
|
|
15
|
+
oldIds.int1Min === null ||
|
|
16
|
+
oldIds.int1Min === undefined
|
|
14
17
|
? infiniteNode_1.MinusInfinityNode
|
|
15
18
|
: oldIds.int1Min.toTree();
|
|
16
|
-
const b1 = oldIds.int1Max === "infty" ||
|
|
19
|
+
const b1 = oldIds.int1Max === "infty" ||
|
|
20
|
+
oldIds.int1Max === Infinity ||
|
|
21
|
+
oldIds.int1Max === null ||
|
|
22
|
+
oldIds.int1Max === undefined
|
|
17
23
|
? infiniteNode_1.PlusInfinityNode
|
|
18
24
|
: oldIds.int1Max.toTree();
|
|
19
25
|
const closure1 = oldIds.int1Closure;
|
|
20
26
|
const interval1 = new intervalNode_1.IntervalNode(a1, b1, closure1);
|
|
21
|
-
const a2 = oldIds.int2Min === "-infty" ||
|
|
27
|
+
const a2 = oldIds.int2Min === "-infty" ||
|
|
28
|
+
oldIds.int2Min === -Infinity ||
|
|
29
|
+
oldIds.int2Min === null ||
|
|
30
|
+
oldIds.int2Min === undefined
|
|
22
31
|
? infiniteNode_1.MinusInfinityNode
|
|
23
32
|
: oldIds.int2Min.toTree();
|
|
24
|
-
const b2 = oldIds.int2Max === "infty" ||
|
|
33
|
+
const b2 = oldIds.int2Max === "infty" ||
|
|
34
|
+
oldIds.int2Max === Infinity ||
|
|
35
|
+
oldIds.int2Max === null ||
|
|
36
|
+
oldIds.int2Max === undefined
|
|
25
37
|
? infiniteNode_1.PlusInfinityNode
|
|
26
38
|
: oldIds.int2Max.toTree();
|
|
27
39
|
const closure2 = oldIds.int2Closure;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"degreeToRadians.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/degreeToRadians.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"degreeToRadians.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/degreeToRadians.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAgBlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,GAAG,CAAC;IACnB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAwJF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAiBjD,CAAC"}
|
|
@@ -10,6 +10,8 @@ const nodeConstructor_1 = require("../../../tree/nodes/nodeConstructor");
|
|
|
10
10
|
const piNode_1 = require("../../../tree/nodes/numbers/piNode");
|
|
11
11
|
const fractionNode_1 = require("../../../tree/nodes/operators/fractionNode");
|
|
12
12
|
const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
|
|
13
|
+
const degreeParser_1 = require("../../../tree/parsers/degreeParser");
|
|
14
|
+
const latexParser_1 = require("../../../tree/parsers/latexParser");
|
|
13
15
|
const coinFlip_1 = require("../../../utils/alea/coinFlip");
|
|
14
16
|
const random_1 = require("../../../utils/alea/random");
|
|
15
17
|
const getPropositions = (n, { answer, isDegreeToRadian }) => {
|
|
@@ -76,13 +78,22 @@ const getKeys = (identifiers) => {
|
|
|
76
78
|
return ["pi", "degree"];
|
|
77
79
|
};
|
|
78
80
|
const isAnswerValid = (ans, { answer, degree, isDegreeToRadian, radianNodeIds }) => {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
.
|
|
82
|
-
|
|
81
|
+
try {
|
|
82
|
+
if (isDegreeToRadian) {
|
|
83
|
+
const parsed = (0, latexParser_1.parseAlgebraic)(ans);
|
|
84
|
+
if (!parsed)
|
|
85
|
+
return false;
|
|
86
|
+
return parsed.simplify({ decimalToFractions: true }).toTex() === answer;
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
const parsed = (0, degreeParser_1.degreeParser)(ans, true);
|
|
90
|
+
if (!parsed)
|
|
91
|
+
return false;
|
|
92
|
+
return parsed === answer;
|
|
93
|
+
}
|
|
83
94
|
}
|
|
84
|
-
|
|
85
|
-
return
|
|
95
|
+
catch (err) {
|
|
96
|
+
return false;
|
|
86
97
|
}
|
|
87
98
|
};
|
|
88
99
|
const getIdentifiers = (prevIds) => {
|
package/lib/index.d.ts
CHANGED
|
@@ -919,6 +919,12 @@ declare const mathExercises: (Exercise<{
|
|
|
919
919
|
q: import("./tree/nodes/nodeConstructor").NodeIdentifiers;
|
|
920
920
|
a: number;
|
|
921
921
|
}, {}> | Exercise<{
|
|
922
|
+
affine1Ids: import("./math/polynomials/generalAffine").GeneralAffineIdentifiers;
|
|
923
|
+
affine2Ids: import("./math/polynomials/generalAffine").GeneralAffineIdentifiers;
|
|
924
|
+
isAskingPositive: boolean;
|
|
925
|
+
}, {
|
|
926
|
+
instructionType: string;
|
|
927
|
+
}> | Exercise<{
|
|
922
928
|
coin: boolean;
|
|
923
929
|
radius: number;
|
|
924
930
|
diametre: number;
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,yBAAyB,CAAC;AAEjC,QAAA,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parametricLine.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/parametricLine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAI/D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAA0B,MAAM,eAAe,CAAC;AAEpE,qBAAa,cAAc;IACzB,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,EAAE,aAAa,EAAE,CAAC;gBACf,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW;IAavD,oBAAoB,CAAC,CAAC,EAAE,aAAa;IAIrC,cAAc,CAAC,CAAC,EAAE,aAAa;IAG/B,QAAQ,CAAC,CAAC,EAAE,aAAa;IAKzB,QAAQ,CAAC,CAAC,EAAE,UAAU;IAYtB,KAAK;
|
|
1
|
+
{"version":3,"file":"parametricLine.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/parametricLine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAI/D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAA0B,MAAM,eAAe,CAAC;AAEpE,qBAAa,cAAc;IACzB,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,EAAE,aAAa,EAAE,CAAC;gBACf,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW;IAavD,oBAAoB,CAAC,CAAC,EAAE,aAAa;IAIrC,cAAc,CAAC,CAAC,EAAE,aAAa;IAG/B,QAAQ,CAAC,CAAC,EAAE,aAAa;IAKzB,QAAQ,CAAC,CAAC,EAAE,UAAU;IAYtB,KAAK;CAQN"}
|
|
@@ -33,14 +33,12 @@ class ParametricLine {
|
|
|
33
33
|
return vector1.isColinear(vector2);
|
|
34
34
|
}
|
|
35
35
|
toTex() {
|
|
36
|
-
return
|
|
37
|
-
\\left\\{\\begin{matrix}
|
|
36
|
+
return `\\left\\{\\begin{matrix}
|
|
38
37
|
x=${this.equations[0].toTex()} \\\\
|
|
39
38
|
y=${this.equations[1].toTex()} \\\\
|
|
40
39
|
z=${this.equations[2].toTex()}
|
|
41
40
|
\\end{matrix}
|
|
42
|
-
\\right
|
|
43
|
-
`;
|
|
41
|
+
\\right.`;
|
|
44
42
|
}
|
|
45
43
|
}
|
|
46
44
|
exports.ParametricLine = ParametricLine;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AlgebraicNode } from "../../tree/nodes/algebraicNode";
|
|
2
2
|
import { NodeIdentifiers } from "../../tree/nodes/nodeConstructor";
|
|
3
|
+
import { IntervalNode } from "../../tree/nodes/sets/intervalNode";
|
|
3
4
|
export declare abstract class GeneralAffineConstructor {
|
|
4
5
|
static fromIdentifiers(identifiers: GeneralAffineIdentifiers): GeneralAffine;
|
|
5
6
|
static randomInts({ allowBNull }: {
|
|
@@ -19,6 +20,8 @@ export declare class GeneralAffine {
|
|
|
19
20
|
constructor(a: number | AlgebraicNode, b: number | AlgebraicNode, variable?: string);
|
|
20
21
|
toIdentifiers(): GeneralAffineIdentifiers;
|
|
21
22
|
getRoot(): AlgebraicNode;
|
|
23
|
+
getPositiveInterval(): IntervalNode;
|
|
24
|
+
getNegativeInterval(): IntervalNode;
|
|
22
25
|
toTree(): import("../../tree/nodes/operators/addNode").AddNode | import("../../tree/nodes/operators/multiplyNode").MultiplyNode;
|
|
23
26
|
xIntersect(aff: GeneralAffine): AlgebraicNode | undefined;
|
|
24
27
|
opposite(): GeneralAffine;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generalAffine.d.ts","sourceRoot":"","sources":["../../../src/math/polynomials/generalAffine.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAG/D,OAAO,EAEL,eAAe,EAEhB,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"generalAffine.d.ts","sourceRoot":"","sources":["../../../src/math/polynomials/generalAffine.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAG/D,OAAO,EAEL,eAAe,EAEhB,MAAM,kCAAkC,CAAC;AAU1C,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAKlE,8BAAsB,wBAAwB;IAC5C,MAAM,CAAC,eAAe,CAAC,WAAW,EAAE,wBAAwB;IAM5D,MAAM,CAAC,UAAU,CAAC,EAAE,UAAiB,EAAE;;KAAA,EAAE,QAAQ,SAAM;CAOxD;AACD,MAAM,MAAM,wBAAwB,GAAG;IACrC,EAAE,EAAE,QAAQ,CAAC;IACb,CAAC,EAAE,eAAe,CAAC;IACnB,CAAC,EAAE,eAAe,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AACF,qBAAa,aAAa;IACxB,CAAC,EAAE,aAAa,CAAC;IACjB,CAAC,EAAE,aAAa,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;gBAGf,CAAC,EAAE,MAAM,GAAG,aAAa,EACzB,CAAC,EAAE,MAAM,GAAG,aAAa,EACzB,QAAQ,GAAE,MAAY;IAUxB,aAAa,IAAI,wBAAwB;IAQzC,OAAO,IAAI,aAAa;IAGxB,mBAAmB,IAAI,YAAY;IAQnC,mBAAmB,IAAI,YAAY;IASnC,MAAM;IAMN,UAAU,CAAC,GAAG,EAAE,aAAa;IAI7B,QAAQ;CAMT"}
|