math-exercises 3.0.167 → 3.0.169
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/derivation/variations/index.d.ts +1 -0
- package/lib/exercises/math/derivation/variations/index.d.ts.map +1 -1
- package/lib/exercises/math/derivation/variations/index.js +2 -0
- package/lib/exercises/math/derivation/variations/signVarTable3dDegree.d.ts +2 -0
- package/lib/exercises/math/derivation/variations/signVarTable3dDegree.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/signVarTable3dDegree.js +203 -0
- package/lib/exercises/math/derivation/variations/signVarTableTrinom.d.ts +9 -0
- package/lib/exercises/math/derivation/variations/signVarTableTrinom.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/signVarTableTrinom.js +148 -0
- package/lib/exercises/math/functions/affines/affineAdjustmentComplete.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineAdjustmentComplete.js +1 -4
- 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/inverse/compareInverseValues.d.ts.map +1 -1
- package/lib/exercises/math/functions/inverse/compareInverseValues.js +1 -10
- package/lib/exercises/math/functions/periodicity/index.d.ts +2 -0
- package/lib/exercises/math/functions/periodicity/index.d.ts.map +1 -0
- package/lib/exercises/math/functions/periodicity/index.js +1 -0
- package/lib/exercises/math/functions/trinoms/equation/index.d.ts +2 -0
- package/lib/exercises/math/functions/trinoms/equation/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/equation/index.js +2 -0
- package/lib/exercises/math/functions/trinoms/equation/secondDegreeEquationWithRightMember.d.ts +11 -0
- package/lib/exercises/math/functions/trinoms/equation/secondDegreeEquationWithRightMember.d.ts.map +1 -0
- package/lib/exercises/math/functions/trinoms/equation/secondDegreeEquationWithRightMember.js +205 -0
- package/lib/exercises/math/functions/trinoms/equation/secondDegreeInequation.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/equation/secondDegreeInequation.js +78 -13
- package/lib/exercises/math/functions/trinoms/equation/solveBisquaredEquation.d.ts +9 -0
- package/lib/exercises/math/functions/trinoms/equation/solveBisquaredEquation.d.ts.map +1 -0
- package/lib/exercises/math/functions/trinoms/equation/solveBisquaredEquation.js +223 -0
- package/lib/exercises/math/functions/trinoms/equation/trinomSelectEquationWithoutDeltaNeeded.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/equation/trinomSelectEquationWithoutDeltaNeeded.js +3 -1
- package/lib/exercises/math/functions/trinoms/roots/niceRootsFromDevForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/niceRootsFromDevForm.js +1 -0
- package/lib/exercises/math/functions/trinoms/roots/rootsReading.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/rootsReading.js +27 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaFromDevForm.d.ts +4 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaFromDevForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaFromDevForm.js +133 -11
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/canonicalFromDevForm.d.ts +4 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/canonicalFromDevForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/canonicalFromDevForm.js +135 -14
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/findTrinomCanonicalFormFromGraph.d.ts +9 -0
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/findTrinomCanonicalFormFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/findTrinomCanonicalFormFromGraph.js +123 -0
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/index.d.ts +1 -0
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/index.js +1 -0
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPerpendicularLine.js +1 -1
- package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.js +2 -2
- package/lib/exercises/math/probaStat/probaFromTableNoContext.d.ts +1 -1
- package/lib/exercises/math/probaStat/probaFromTableNoContext.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaFromTableNoContext.js +17 -11
- package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.js +25 -14
- package/lib/exercises/math/probaStat/randomVariable/randomVariableValues.d.ts +2 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableValues.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableValues.js +83 -0
- package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.d.ts +12 -0
- package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.js +30 -0
- package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceOutcomes.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceOutcomes.js +1 -1
- package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromGraph.d.ts +4 -1
- package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromGraph.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromGraph.js +45 -20
- package/lib/exercises/math/sequences/arithmetic/recognizeReasonFromGraph.d.ts +4 -1
- package/lib/exercises/math/sequences/arithmetic/recognizeReasonFromGraph.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/recognizeReasonFromGraph.js +43 -9
- package/lib/exercises/math/sequences/geometric/geometricReasonUsage.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricReasonUsage.js +35 -0
- package/lib/exercises/math/sequences/index.d.ts +1 -0
- package/lib/exercises/math/sequences/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/index.js +2 -0
- package/lib/exercises/math/sequences/limits/index.d.ts +2 -0
- package/lib/exercises/math/sequences/limits/index.d.ts.map +1 -0
- package/lib/exercises/math/sequences/limits/index.js +1 -0
- package/lib/exercises/math/sequences/limits/sequenceLimitReading.d.ts +2 -0
- package/lib/exercises/math/sequences/limits/sequenceLimitReading.d.ts.map +1 -0
- package/lib/exercises/math/sequences/limits/sequenceLimitReading.js +163 -0
- package/lib/exercises/math/sequences/variations/expressConsecutiveTermsDifference.d.ts +11 -0
- package/lib/exercises/math/sequences/variations/expressConsecutiveTermsDifference.d.ts.map +1 -0
- package/lib/exercises/math/sequences/variations/expressConsecutiveTermsDifference.js +160 -0
- package/lib/exercises/math/sequences/variations/index.d.ts +2 -0
- package/lib/exercises/math/sequences/variations/index.d.ts.map +1 -0
- package/lib/exercises/math/sequences/variations/index.js +1 -0
- package/lib/exercises/math/trigonometry/circle/areReelsOnTheSameTrigoCirclePoint.js +2 -2
- package/lib/exercises/math/trigonometry/circle/findAngleFromCosAndSin.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/circle/findAngleFromCosAndSin.js +0 -1
- package/lib/exercises/math/trigonometry/circle/findAssociateAnglePointOnTrigoCircle.d.ts +8 -0
- package/lib/exercises/math/trigonometry/circle/findAssociateAnglePointOnTrigoCircle.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/circle/findAssociateAnglePointOnTrigoCircle.js +158 -0
- package/lib/exercises/math/trigonometry/circle/index.d.ts +2 -0
- package/lib/exercises/math/trigonometry/circle/index.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/circle/index.js +2 -0
- package/lib/exercises/math/trigonometry/circle/mainAngleMeasure.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/circle/mainAngleMeasure.js +8 -3
- package/lib/exercises/math/trigonometry/circle/placeAssociateAngleOnCircle.d.ts +8 -0
- package/lib/exercises/math/trigonometry/circle/placeAssociateAngleOnCircle.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/circle/placeAssociateAngleOnCircle.js +167 -0
- package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts +2 -0
- package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts.map +1 -1
- package/lib/exercises/utils/geogebra/toolBarConstructor.js +4 -0
- package/lib/exercises/vea/numberVEA.d.ts +1 -1
- package/lib/exercises/vea/numberVEA.d.ts.map +1 -1
- package/lib/exercises/vea/numberVEA.js +7 -2
- package/lib/exercises/vea/signLineVEA.d.ts +8 -0
- package/lib/exercises/vea/signLineVEA.d.ts.map +1 -0
- package/lib/exercises/vea/signLineVEA.js +9 -0
- package/lib/exercises/vea/signTableVEA.d.ts +2 -0
- package/lib/exercises/vea/signTableVEA.d.ts.map +1 -0
- package/lib/exercises/vea/signTableVEA.js +5 -0
- package/lib/exercises/vea/varLineVEA.d.ts +8 -0
- package/lib/exercises/vea/varLineVEA.d.ts.map +1 -0
- package/lib/exercises/vea/varLineVEA.js +44 -0
- package/lib/exercises/vea/varSignTableVEA.d.ts +2 -0
- package/lib/exercises/vea/varSignTableVEA.d.ts.map +1 -0
- package/lib/exercises/vea/varSignTableVEA.js +8 -0
- package/lib/exercises/vea/varTableVEA.d.ts +2 -0
- package/lib/exercises/vea/varTableVEA.d.ts.map +1 -0
- package/lib/exercises/vea/varTableVEA.js +6 -0
- package/lib/exercises/vea/xTableLineVEA.d.ts +8 -0
- package/lib/exercises/vea/xTableLineVEA.d.ts.map +1 -0
- package/lib/exercises/vea/xTableLineVEA.js +18 -0
- package/lib/index.d.ts +40 -5
- package/lib/index.d.ts.map +1 -1
- package/lib/math/polynomials/polynomial.d.ts +1 -1
- package/lib/math/polynomials/polynomial.d.ts.map +1 -1
- package/lib/math/polynomials/polynomial.js +4 -2
- package/lib/math/polynomials/trinom.d.ts +1 -1
- package/lib/math/polynomials/trinom.d.ts.map +1 -1
- package/lib/math/polynomials/trinom.js +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { toolBarConstructor } from "../../../../exercises/utils/geogebra/toolBarConstructor.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { pinkDark } from "../../../../geogebra/colors.js";
|
|
4
|
+
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
5
|
+
import { ggbPointToCoords } from "../../../../geogebra/parsers/ggbPointToCoords.js";
|
|
6
|
+
import { parseGGBPoints } from "../../../../geogebra/parsers/parseGGBPoints.js";
|
|
7
|
+
import { Point } from "../../../../math/geometry/point.js";
|
|
8
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
9
|
+
import { opposite } from "../../../../tree/nodes/functions/oppositeNode.js";
|
|
10
|
+
import { PiNode } from "../../../../tree/nodes/numbers/piNode.js";
|
|
11
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
12
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
13
|
+
import { doWhile } from "../../../../utils/doWhile.js";
|
|
14
|
+
const getAssociateAngle = (identifiers) => {
|
|
15
|
+
const { associateType } = identifiers;
|
|
16
|
+
switch (associateType) {
|
|
17
|
+
case 0:
|
|
18
|
+
return opposite("a");
|
|
19
|
+
case 1:
|
|
20
|
+
return add(PiNode, "a");
|
|
21
|
+
case 2:
|
|
22
|
+
default:
|
|
23
|
+
return substract(PiNode, "a");
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const getInstruction = (identifiers) => {
|
|
27
|
+
return `On considère un réel $a$, dont le point-image est $A$ sur le cercle trigonométrique ci-dessous.
|
|
28
|
+
|
|
29
|
+
Avec les outils disponibles, construire sur la figure le point-image du réel $${getAssociateAngle(identifiers).toTex()}$.
|
|
30
|
+
`;
|
|
31
|
+
};
|
|
32
|
+
const getHint = (identifiers) => {
|
|
33
|
+
const { associateType } = identifiers;
|
|
34
|
+
switch (associateType) {
|
|
35
|
+
case 0:
|
|
36
|
+
return `Sur le cercle trigonométrique, le point image de $-a$ est le symétrique du point image de $a$ par rapport à l'axe des abscisses.`;
|
|
37
|
+
case 1:
|
|
38
|
+
return `Sur le cercle trigonométrique, le point image de $\\pi+a$ est le symétrique du point image de $a$ par rapport à l'origine du repère.`;
|
|
39
|
+
case 2:
|
|
40
|
+
default:
|
|
41
|
+
return `Sur le cercle trigonométrique, le point image de $\\pi-a$ est le symétrique du point image de $a$ par rapport à l'axe des ordonnées.`;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const getCorrection = (identifiers) => {
|
|
45
|
+
const { associateType } = identifiers;
|
|
46
|
+
switch (associateType) {
|
|
47
|
+
case 0:
|
|
48
|
+
return `Sur le cercle trigonométrique, le point image de $-a$ est le symétrique du point image de $a$ par rapport à l'axe des abscisses.
|
|
49
|
+
|
|
50
|
+
On utilise donc l'outil "Symétrie linéaire", on sélectionne le point $A$ puis l'axe des abscisses. Cela nous donne le point $A'$, associé à l'angle $${getAssociateAngle(identifiers).toTex()}$.`;
|
|
51
|
+
case 1:
|
|
52
|
+
return `Sur le cercle trigonométrique, le point image de $\\pi+a$ est le symétrique du point image de $a$ par rapport à l'origine du repère.
|
|
53
|
+
|
|
54
|
+
On utilise donc l'outil "Symétrie centrale", on sélectionne le point $A$ puis l'origine du repère. Cela nous donne le point $A'$, associé à l'angle $${getAssociateAngle(identifiers).toTex()}$.`;
|
|
55
|
+
case 2:
|
|
56
|
+
default:
|
|
57
|
+
return `Sur le cercle trigonométrique, le point image de $\\pi-a$ est le symétrique du point image de $a$ par rapport à l'axe des ordonnées.
|
|
58
|
+
|
|
59
|
+
On utilise donc l'outil "Symétrie linéaire", on sélectionne le point $A$ puis l'axe des ordonnées. Cela nous donne le point $A'$, associé à l'angle $${getAssociateAngle(identifiers).toTex()}$. `;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
const getAnswerPoint = (identifiers) => {
|
|
63
|
+
const { associateType, degree } = identifiers;
|
|
64
|
+
switch (associateType) {
|
|
65
|
+
case 0:
|
|
66
|
+
return new Point("A'", Math.cos((-degree * Math.PI) / 180), Math.sin((-degree * Math.PI) / 180));
|
|
67
|
+
case 1:
|
|
68
|
+
return new Point("A'", Math.cos(((180 + degree) * Math.PI) / 180), Math.sin(((180 + degree) * Math.PI) / 180));
|
|
69
|
+
case 2:
|
|
70
|
+
default:
|
|
71
|
+
return new Point("A'", Math.cos(((180 - degree) * Math.PI) / 180), Math.sin(((180 - degree) * Math.PI) / 180));
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
const getGGBAnswer = (identifiers) => {
|
|
75
|
+
const point = getAnswerPoint(identifiers);
|
|
76
|
+
return [
|
|
77
|
+
...point.toGGBCommand({
|
|
78
|
+
showLabel: true,
|
|
79
|
+
}),
|
|
80
|
+
`S = Segment(A, A')`,
|
|
81
|
+
`SetFixed(S, true, false)`,
|
|
82
|
+
`SetColor(S, "${pinkDark}")`,
|
|
83
|
+
];
|
|
84
|
+
};
|
|
85
|
+
const getStudentGGBOptions = (identifiers) => {
|
|
86
|
+
const { degree } = identifiers;
|
|
87
|
+
const point = new Point("A", Math.cos((degree * Math.PI) / 180), Math.sin((degree * Math.PI) / 180));
|
|
88
|
+
const ggb = new GeogebraConstructor({
|
|
89
|
+
commands: [
|
|
90
|
+
`O = (0,0)`,
|
|
91
|
+
`SetFixed(O, true, true)`,
|
|
92
|
+
`C = Circle((0,0),1)`,
|
|
93
|
+
`ShowLabel(C, false)`,
|
|
94
|
+
`SetFixed(C, true, false)`,
|
|
95
|
+
// `I = (1,0)`,
|
|
96
|
+
// `SetFixed(I, true, false)`,
|
|
97
|
+
// `J = (0, 1)`,
|
|
98
|
+
// `SetFixed(J, true, false)`,
|
|
99
|
+
...point.toGGBCommand({
|
|
100
|
+
showLabel: true,
|
|
101
|
+
isSelectionnable: true,
|
|
102
|
+
}),
|
|
103
|
+
// `Text("$\\small A$", (1.4*cos(${degree} * pi / 180), 1.4*sin(${degree} * pi / 180)), true, true, 0,0)`,
|
|
104
|
+
],
|
|
105
|
+
customToolBar: toolBarConstructor({
|
|
106
|
+
intersect: true,
|
|
107
|
+
centralSymetric: true,
|
|
108
|
+
lineSymetric: true,
|
|
109
|
+
}),
|
|
110
|
+
hideGrid: true,
|
|
111
|
+
xAxis: {
|
|
112
|
+
hideNumbers: true,
|
|
113
|
+
},
|
|
114
|
+
yAxis: {
|
|
115
|
+
hideNumbers: true,
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
return ggb.getOptions({
|
|
119
|
+
coords: [-1.1, 1.1, -1.1, 1.1],
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
const isGGBAnswerValid = (ans, { ggbAnswer, ...identifiers }) => {
|
|
123
|
+
const points = parseGGBPoints(ans)
|
|
124
|
+
.map((p) => ggbPointToCoords(p))
|
|
125
|
+
.map((coords, i) => new Point(`K_${i}`, coords.x, coords.y));
|
|
126
|
+
const answerPoint = getAnswerPoint(identifiers);
|
|
127
|
+
console.log(points.map((e) => [e.x.toTex(), e.y.toTex()]));
|
|
128
|
+
console.log(answerPoint.x.toTex(), answerPoint.y.toTex());
|
|
129
|
+
return (points.length < 5 &&
|
|
130
|
+
points.some((point) => point.distanceTo(answerPoint) < 0.1));
|
|
131
|
+
};
|
|
132
|
+
const getPlaceAssociateAngleOnCircleQuestion = () => {
|
|
133
|
+
const degree = doWhile(() => randint(0, 360), (x) => Math.min(x % 90, 90 - (x % 90)) < 20);
|
|
134
|
+
const associateType = randint(0, 3);
|
|
135
|
+
const identifiers = {
|
|
136
|
+
degree,
|
|
137
|
+
associateType,
|
|
138
|
+
};
|
|
139
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
140
|
+
};
|
|
141
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
142
|
+
return {
|
|
143
|
+
ggbAnswer: getGGBAnswer(identifiers),
|
|
144
|
+
instruction: getInstruction(identifiers),
|
|
145
|
+
studentGgbOptions: getStudentGGBOptions(identifiers),
|
|
146
|
+
identifiers,
|
|
147
|
+
hint: getHint(identifiers),
|
|
148
|
+
correction: getCorrection(identifiers),
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
export const placeAssociateAngleOnCircle = {
|
|
152
|
+
id: "placeAssociateAngleOnCircle",
|
|
153
|
+
label: "Construire le point-image d'un angle associé à un autre sur le cercle trigonométrique",
|
|
154
|
+
isSingleStep: true,
|
|
155
|
+
generator: (nb, opts) => getDistinctQuestions(() => getPlaceAssociateAngleOnCircleQuestion(opts), nb),
|
|
156
|
+
ggbTimer: 60,
|
|
157
|
+
isGGBAnswerValid,
|
|
158
|
+
subject: "Mathématiques",
|
|
159
|
+
getHint,
|
|
160
|
+
getInstruction,
|
|
161
|
+
getCorrection,
|
|
162
|
+
getGGBAnswer,
|
|
163
|
+
getStudentGGBOptions,
|
|
164
|
+
answerType: "GGB",
|
|
165
|
+
getQuestionFromIdentifiers,
|
|
166
|
+
hasHintAndCorrection: true,
|
|
167
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolBarConstructor.d.ts","sourceRoot":"","sources":["../../../../src/exercises/utils/geogebra/toolBarConstructor.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,GAAI,SAAS;IAC1C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"toolBarConstructor.d.ts","sourceRoot":"","sources":["../../../../src/exercises/utils/geogebra/toolBarConstructor.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,GAAI,SAAS;IAC1C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,WAkBA,CAAC"}
|
|
@@ -24,5 +24,9 @@ export const toolBarConstructor = (options) => {
|
|
|
24
24
|
customToolBar += "||34";
|
|
25
25
|
if (options.polygon)
|
|
26
26
|
customToolBar += "||16";
|
|
27
|
+
if (options.centralSymetric)
|
|
28
|
+
customToolBar += "||29";
|
|
29
|
+
if (options.lineSymetric)
|
|
30
|
+
customToolBar += "||30";
|
|
27
31
|
return customToolBar;
|
|
28
32
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const numberVEA: (studentAns: string, answer: string, roundTo?: number) => boolean;
|
|
1
|
+
export declare const numberVEA: (studentAns: string, answer: string, roundTo?: number, margin?: number) => boolean;
|
|
2
2
|
//# sourceMappingURL=numberVEA.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numberVEA.d.ts","sourceRoot":"","sources":["../../../src/exercises/vea/numberVEA.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,GACpB,YAAY,MAAM,EAClB,QAAQ,MAAM,EACd,UAAU,MAAM,
|
|
1
|
+
{"version":3,"file":"numberVEA.d.ts","sourceRoot":"","sources":["../../../src/exercises/vea/numberVEA.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,GACpB,YAAY,MAAM,EAClB,QAAQ,MAAM,EACd,UAAU,MAAM,EAChB,SAAS,MAAM,YAShB,CAAC"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { numberParser } from "../../tree/parsers/numberParser.js";
|
|
2
|
-
export const numberVEA = (studentAns, answer, roundTo) => {
|
|
2
|
+
export const numberVEA = (studentAns, answer, roundTo, margin) => {
|
|
3
3
|
const parsed = numberParser(studentAns, roundTo);
|
|
4
4
|
if (!parsed)
|
|
5
5
|
return false;
|
|
6
|
-
|
|
6
|
+
if (margin === undefined) {
|
|
7
|
+
return parsed === answer;
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
return Math.abs(parsed.unfrenchify() - answer.unfrenchify()) < margin;
|
|
11
|
+
}
|
|
7
12
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param ans ligne des signes du student
|
|
4
|
+
* @param answerTable ligne des signes de la réponse
|
|
5
|
+
* cette fonction ne check que la ligne des signes
|
|
6
|
+
*/
|
|
7
|
+
export declare const signLineVEA: (ans: string[], answerTable: string[]) => boolean;
|
|
8
|
+
//# sourceMappingURL=signLineVEA.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signLineVEA.d.ts","sourceRoot":"","sources":["../../../src/exercises/vea/signLineVEA.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,EAAE,EAAE,aAAa,MAAM,EAAE,YAE/D,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param ans ligne des signes du student
|
|
4
|
+
* @param answerTable ligne des signes de la réponse
|
|
5
|
+
* cette fonction ne check que la ligne des signes
|
|
6
|
+
*/
|
|
7
|
+
export const signLineVEA = (ans, answerTable) => {
|
|
8
|
+
return ans.slice(1).every((cell, i) => cell === answerTable[i + 1]);
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signTableVEA.d.ts","sourceRoot":"","sources":["../../../src/exercises/vea/signTableVEA.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,EAAE,EAAE,EAAE,aAAa,MAAM,EAAE,EAAE,YAIpE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param ans lignes des variations du student
|
|
4
|
+
* @param answerTable lignes de variations de la réponse
|
|
5
|
+
* cette fonction ne check que la ligne des variations
|
|
6
|
+
*/
|
|
7
|
+
export declare const varLineVEA: (ans: string[][], answerTable: string[][]) => boolean;
|
|
8
|
+
//# sourceMappingURL=varLineVEA.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"varLineVEA.d.ts","sourceRoot":"","sources":["../../../src/exercises/vea/varLineVEA.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,EAAE,EAAE,EAAE,aAAa,MAAM,EAAE,EAAE,YAiClE,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param ans lignes des variations du student
|
|
4
|
+
* @param answerTable lignes de variations de la réponse
|
|
5
|
+
* cette fonction ne check que la ligne des variations
|
|
6
|
+
*/
|
|
7
|
+
import { rationalVEA } from "./rationalVEA.js";
|
|
8
|
+
export const varLineVEA = (ans, answerTable) => {
|
|
9
|
+
const isValue = (s) => s !== "" && s !== "\\ " && s !== " ";
|
|
10
|
+
const flattenTable = (table) => {
|
|
11
|
+
const flattenedAns = [];
|
|
12
|
+
for (let i = 1; i < table[0].length; i++) {
|
|
13
|
+
const value = [table[0][i], table[1][i], table[2][i]].filter(isValue);
|
|
14
|
+
//plusieurs valeurs dans une même colonne
|
|
15
|
+
if (value.length !== 1)
|
|
16
|
+
return false;
|
|
17
|
+
flattenedAns.push(value[0]);
|
|
18
|
+
}
|
|
19
|
+
return flattenedAns;
|
|
20
|
+
};
|
|
21
|
+
const flattenedAns = flattenTable(ans);
|
|
22
|
+
if (!flattenedAns)
|
|
23
|
+
return false;
|
|
24
|
+
const flattenedAnswerTable = flattenTable(answerTable);
|
|
25
|
+
if (!flattenedAnswerTable)
|
|
26
|
+
return false;
|
|
27
|
+
for (let i = 0; i < flattenedAns.length; i++) {
|
|
28
|
+
const value = flattenedAns[i];
|
|
29
|
+
if (value === "\\nearrow") {
|
|
30
|
+
if (flattenedAnswerTable[i] !== "\\nearrow")
|
|
31
|
+
return false;
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
else if (value === "\\searrow") {
|
|
35
|
+
if (flattenedAnswerTable[i] !== "\\searrow")
|
|
36
|
+
return false;
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
return rationalVEA(value, flattenedAnswerTable[i]);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return true;
|
|
44
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"varSignTableVEA.d.ts","sourceRoot":"","sources":["../../../src/exercises/vea/varSignTableVEA.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe,GAAI,KAAK,MAAM,EAAE,EAAE,EAAE,aAAa,MAAM,EAAE,EAAE,YAMvE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { signLineVEA } from "./signLineVEA.js";
|
|
2
|
+
import { varLineVEA } from "./varLineVEA.js";
|
|
3
|
+
import { xTableLineVEA } from "./xTableLineVEA.js";
|
|
4
|
+
export const varSignTableVEA = (ans, answerTable) => {
|
|
5
|
+
return (xTableLineVEA(ans[0], answerTable[0]) &&
|
|
6
|
+
signLineVEA(ans[1], answerTable[1]) &&
|
|
7
|
+
varLineVEA(ans.slice(2), answerTable.slice(2)));
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"varTableVEA.d.ts","sourceRoot":"","sources":["../../../src/exercises/vea/varTableVEA.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,EAAE,EAAE,EAAE,aAAa,MAAM,EAAE,EAAE,YAKnE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param ans ligne des x du student
|
|
4
|
+
* @param answerTable ligne des x de la réponse
|
|
5
|
+
* cette fonction ne check que la ligne des x dans un tableau de variations / signes
|
|
6
|
+
*/
|
|
7
|
+
export declare const xTableLineVEA: (ans: string[], answerTable: string[]) => boolean;
|
|
8
|
+
//# sourceMappingURL=xTableLineVEA.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xTableLineVEA.d.ts","sourceRoot":"","sources":["../../../src/exercises/vea/xTableLineVEA.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,EAAE,EAAE,aAAa,MAAM,EAAE,YAYjE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param ans ligne des x du student
|
|
4
|
+
* @param answerTable ligne des x de la réponse
|
|
5
|
+
* cette fonction ne check que la ligne des x dans un tableau de variations / signes
|
|
6
|
+
*/
|
|
7
|
+
import { rationalVEA } from "./rationalVEA.js";
|
|
8
|
+
export const xTableLineVEA = (ans, answerTable) => {
|
|
9
|
+
return ans.slice(1).every((cell, i) => {
|
|
10
|
+
const answerCell = answerTable[i + 1];
|
|
11
|
+
if (answerCell === "\\ " ||
|
|
12
|
+
answerCell === "" ||
|
|
13
|
+
answerCell === " " ||
|
|
14
|
+
answerCell.includes("\\infty"))
|
|
15
|
+
return cell === answerCell;
|
|
16
|
+
return rationalVEA(cell, answerCell);
|
|
17
|
+
});
|
|
18
|
+
};
|
package/lib/index.d.ts
CHANGED
|
@@ -1047,6 +1047,10 @@ declare const mathExercises: (Exercise<{
|
|
|
1047
1047
|
type: number;
|
|
1048
1048
|
coeffs: number[];
|
|
1049
1049
|
initTable: string[][];
|
|
1050
|
+
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
1051
|
+
a: number;
|
|
1052
|
+
b: number;
|
|
1053
|
+
c: number;
|
|
1050
1054
|
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
1051
1055
|
coeffs: number[];
|
|
1052
1056
|
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
@@ -1386,6 +1390,15 @@ declare const mathExercises: (Exercise<{
|
|
|
1386
1390
|
aIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
1387
1391
|
bIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
1388
1392
|
cIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
1393
|
+
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
1394
|
+
fCoeffs: number[];
|
|
1395
|
+
gCoeffs: number[];
|
|
1396
|
+
}, {
|
|
1397
|
+
gType: "Affine" | "Trin\u00F4me" | "L'un ou l'autre";
|
|
1398
|
+
}> | Exercise<{
|
|
1399
|
+
a: number;
|
|
1400
|
+
b: number;
|
|
1401
|
+
c: number;
|
|
1389
1402
|
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
1390
1403
|
roots: number[];
|
|
1391
1404
|
a: number;
|
|
@@ -1446,7 +1459,9 @@ declare const mathExercises: (Exercise<{
|
|
|
1446
1459
|
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
1447
1460
|
param: string;
|
|
1448
1461
|
coeffs: number[];
|
|
1449
|
-
},
|
|
1462
|
+
}, {
|
|
1463
|
+
correctionType: "Mise sous forme canonique" | "Formule $\\alpha=\\frac{-b}{2a}$";
|
|
1464
|
+
}> | Exercise<{
|
|
1450
1465
|
param: string;
|
|
1451
1466
|
a: number;
|
|
1452
1467
|
alpha: number;
|
|
@@ -1455,7 +1470,9 @@ declare const mathExercises: (Exercise<{
|
|
|
1455
1470
|
a: number;
|
|
1456
1471
|
b: number;
|
|
1457
1472
|
c: number;
|
|
1458
|
-
},
|
|
1473
|
+
}, {
|
|
1474
|
+
correctionType: "Mise sous forme canonique" | "Formule $\\alpha=\\frac{-b}{2a}$";
|
|
1475
|
+
}> | Exercise<{
|
|
1459
1476
|
a: number;
|
|
1460
1477
|
b: number;
|
|
1461
1478
|
c: number;
|
|
@@ -1485,6 +1502,10 @@ declare const mathExercises: (Exercise<{
|
|
|
1485
1502
|
}, {
|
|
1486
1503
|
expectedForm: string;
|
|
1487
1504
|
}> | Exercise<{
|
|
1505
|
+
a: number;
|
|
1506
|
+
b: number;
|
|
1507
|
+
c: number;
|
|
1508
|
+
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
1488
1509
|
type: number;
|
|
1489
1510
|
points: number[][];
|
|
1490
1511
|
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
@@ -2874,7 +2895,7 @@ declare const mathExercises: (Exercise<{
|
|
|
2874
2895
|
type: string;
|
|
2875
2896
|
probaFrac: number[];
|
|
2876
2897
|
}, {
|
|
2877
|
-
|
|
2898
|
+
probaTypes?: string[];
|
|
2878
2899
|
}> | Exercise<{
|
|
2879
2900
|
indexSituation: number;
|
|
2880
2901
|
values: {
|
|
@@ -3104,10 +3125,14 @@ declare const mathExercises: (Exercise<{
|
|
|
3104
3125
|
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
3105
3126
|
reason: number;
|
|
3106
3127
|
sequence: number[];
|
|
3107
|
-
},
|
|
3128
|
+
}, {
|
|
3129
|
+
firstTermRankOne?: boolean;
|
|
3130
|
+
}> | Exercise<{
|
|
3108
3131
|
isAri: boolean;
|
|
3109
3132
|
sequence: number[];
|
|
3110
|
-
},
|
|
3133
|
+
}, {
|
|
3134
|
+
firstTermRankOne?: boolean;
|
|
3135
|
+
}> | Exercise<{
|
|
3111
3136
|
firstRank: number;
|
|
3112
3137
|
firstValue: number;
|
|
3113
3138
|
reason: number;
|
|
@@ -3237,6 +3262,10 @@ declare const mathExercises: (Exercise<{
|
|
|
3237
3262
|
askedTerm: number;
|
|
3238
3263
|
}, {
|
|
3239
3264
|
firstRank: string;
|
|
3265
|
+
}> | Exercise<{
|
|
3266
|
+
formulaIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
3267
|
+
}, {
|
|
3268
|
+
sequenceTypes: string[];
|
|
3240
3269
|
}> | Exercise<{
|
|
3241
3270
|
intervalIdentifiers: import("./tree/nodes/sets/intervalNode.js").IntervalNodeIdentifiers;
|
|
3242
3271
|
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
@@ -3436,6 +3465,12 @@ declare const mathExercises: (Exercise<{
|
|
|
3436
3465
|
}, {
|
|
3437
3466
|
solutionInterval: string;
|
|
3438
3467
|
}> | Exercise<{
|
|
3468
|
+
degree: number;
|
|
3469
|
+
associateType: number;
|
|
3470
|
+
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
3471
|
+
associateType: number;
|
|
3472
|
+
startPoint: string;
|
|
3473
|
+
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
3439
3474
|
trigFunction: string;
|
|
3440
3475
|
trigValue: number;
|
|
3441
3476
|
angleInDegrees: 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,E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;;;;;;;;;;;;;;;;;;;;;;;;;;;kDAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -37,7 +37,7 @@ export declare class Polynomial {
|
|
|
37
37
|
opposite(): Polynomial;
|
|
38
38
|
derivate(): Polynomial;
|
|
39
39
|
secondDerivate(): Polynomial;
|
|
40
|
-
integrateToNode(opts?: NodeOptions): AlgebraicNode;
|
|
40
|
+
integrateToNode(opts?: NodeOptions, withoutC?: boolean): AlgebraicNode;
|
|
41
41
|
calculate(x: number): number;
|
|
42
42
|
getLimit(to: "+\\infty" | "-\\infty"): string;
|
|
43
43
|
getLimitNode(to: "+\\infty" | "-\\infty"): import("../../tree/nodes/numbers/constantNode.js").ConstantNode | NumberNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polynomial.d.ts","sourceRoot":"","sources":["../../../src/math/polynomials/polynomial.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAapE,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAElE,8BAAsB,qBAAqB;IACzC,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAY;IAa5D,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAY;IActD;;;;;;OAMG;IACH,MAAM,CAAC,gBAAgB,CACrB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,QAAQ,GAAE,MAAY;IAoBxB,MAAM,CAAC,4BAA4B,CACjC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,QAAQ,GAAE,MAAY;IAqBxB,MAAM,CAAC,UAAU,CACf,QAAQ,EAAE,MAAM,EAChB,EAAE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newCoefficients.unshift(0);
|
|
253
253
|
// return new Polynomial(newCoefficients, this.variable);
|
|
254
254
|
// }
|
|
255
|
-
integrateToNode(opts) {
|
|
256
|
-
let integralPolynomial =
|
|
255
|
+
integrateToNode(opts, withoutC) {
|
|
256
|
+
let integralPolynomial = withoutC
|
|
257
|
+
? (0).toTree()
|
|
258
|
+
: new VariableNode("C");
|
|
257
259
|
const varNode = new VariableNode(this.variable);
|
|
258
260
|
for (let i = 0; i < this.degree + 1; i++) {
|
|
259
261
|
const coeff = this.coefficients[i];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trinom.d.ts","sourceRoot":"","sources":["../../../src/math/polynomials/trinom.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAO,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAErE,OAAO,EAEL,YAAY,EACb,MAAM,4CAA4C,CAAC;AAGpD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAG7C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAM7C,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAMlE,8BAAsB,iBAAiB;IACrC,MAAM,CAAC,MAAM,CACX,KAAK,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,EAC3D,KAAK,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,EAC3D,KAAK,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;KAA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GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAC1C,qBAAa,MAAO,SAAQ,UAAU;IACpC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;gBAEL,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,aAAa;IAQjE,QAAQ;IAGR,YAAY,IAAI,UAAU;IAI1B,QAAQ;IAUR,YAAY,IAAI,aAAa,EAAE;IAyD/B,2BAA2B,CAAC,eAAe,CAAC,EAAE,OAAO;IAarD,QAAQ;IAGR,YAAY;IAIZ,OAAO;IAIP,WAAW;IAIX,YAAY;IAeZ,gBAAgB;IAsBhB,SAAS;IAIT,SAAS;IAYT,QAAQ;IAkCR,aAAa,CACX,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE;;;;KAA4C;CAYrE"}
|
|
@@ -16,11 +16,11 @@ import { random } from "../../utils/alea/random.js";
|
|
|
16
16
|
import { blueMain } from "../../geogebra/colors.js";
|
|
17
17
|
import { round } from "../utils/round.js";
|
|
18
18
|
export class TrinomConstructor {
|
|
19
|
-
static random(aOpts, bOpts, cOpts) {
|
|
19
|
+
static random(aOpts, bOpts, cOpts, variable) {
|
|
20
20
|
const a = randint(aOpts?.min ?? -9, aOpts?.max ?? 10, aOpts?.excludes ?? [0]);
|
|
21
21
|
const b = randint(bOpts?.min ?? -9, bOpts?.max ?? 10, bOpts?.excludes ?? []);
|
|
22
22
|
const c = randint(cOpts?.min ?? -9, cOpts?.max ?? 10, cOpts?.excludes ?? []);
|
|
23
|
-
return new Trinom(a, b, c);
|
|
23
|
+
return new Trinom(a, b, c, variable ? { variable } : undefined);
|
|
24
24
|
}
|
|
25
25
|
static randomCanonical(aOpts, alphaOpts, betaOpts) {
|
|
26
26
|
const a = aOpts?.from
|