math-exercises 3.0.173 → 3.0.175

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.
Files changed (65) hide show
  1. package/lib/exercises/math/functions/trinoms/parabole/parabolaVarTable.js +2 -2
  2. package/lib/exercises/math/functions/trinoms/parabole/paraboleSolveGraphEquation.js +1 -1
  3. package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.d.ts.map +1 -1
  4. package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.js +0 -1
  5. package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.d.ts +2 -0
  6. package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.d.ts.map +1 -0
  7. package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.js +68 -0
  8. package/lib/exercises/math/probaStat/trees/fillProbaTreeWithComplementaryProbabilities.d.ts +15 -0
  9. package/lib/exercises/math/probaStat/trees/fillProbaTreeWithComplementaryProbabilities.d.ts.map +1 -0
  10. package/lib/exercises/math/probaStat/trees/fillProbaTreeWithComplementaryProbabilities.js +206 -0
  11. package/lib/exercises/math/probaStat/trees/probaTreeSituations.d.ts +2 -0
  12. package/lib/exercises/math/probaStat/trees/probaTreeSituations.d.ts.map +1 -0
  13. package/lib/exercises/math/probaStat/trees/probaTreeSituations.js +108 -0
  14. package/lib/exercises/math/probaStat/trees/probabilityTree.d.ts +25 -0
  15. package/lib/exercises/math/probaStat/trees/probabilityTree.d.ts.map +1 -0
  16. package/lib/exercises/math/probaStat/trees/probabilityTree.js +625 -0
  17. package/lib/exercises/math/probaStat/trees/treeInAnswer.d.ts +9 -0
  18. package/lib/exercises/math/probaStat/trees/treeInAnswer.d.ts.map +1 -0
  19. package/lib/exercises/math/probaStat/trees/treeInAnswer.js +107 -0
  20. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormula.js +1 -1
  21. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstRankOne.js +1 -1
  22. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstTermRandom.d.ts +4 -1
  23. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstTermRandom.d.ts.map +1 -1
  24. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstTermRandom.js +66 -24
  25. package/lib/exercises/math/trigonometry/circle/index.d.ts +1 -0
  26. package/lib/exercises/math/trigonometry/circle/index.d.ts.map +1 -1
  27. package/lib/exercises/math/trigonometry/circle/index.js +1 -0
  28. package/lib/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.d.ts +2 -0
  29. package/lib/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.d.ts.map +1 -0
  30. package/lib/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.js +94 -0
  31. package/lib/exercises/math/trigonometry/circle/trigoFunctionsFundamentalEquation.d.ts +10 -0
  32. package/lib/exercises/math/trigonometry/circle/trigoFunctionsFundamentalEquation.d.ts.map +1 -0
  33. package/lib/exercises/math/trigonometry/circle/trigoFunctionsFundamentalEquation.js +223 -0
  34. package/lib/exercises/math/trigonometry/functions/basicEquationCos.d.ts.map +1 -1
  35. package/lib/exercises/math/trigonometry/functions/basicEquationCos.js +2 -1
  36. package/lib/exercises/math/trigonometry/functions/cosInequationMainInterval.d.ts +10 -0
  37. package/lib/exercises/math/trigonometry/functions/cosInequationMainInterval.d.ts.map +1 -0
  38. package/lib/exercises/math/trigonometry/functions/cosInequationMainInterval.js +208 -0
  39. package/lib/exercises/math/trigonometry/functions/equationSinOnRandomInterval.d.ts +0 -6
  40. package/lib/exercises/math/trigonometry/functions/equationSinOnRandomInterval.d.ts.map +1 -1
  41. package/lib/exercises/math/trigonometry/functions/equationSinOnRandomInterval.js +162 -99
  42. package/lib/exercises/math/trigonometry/functions/index.d.ts +3 -0
  43. package/lib/exercises/math/trigonometry/functions/index.d.ts.map +1 -1
  44. package/lib/exercises/math/trigonometry/functions/index.js +3 -0
  45. package/lib/exercises/math/trigonometry/functions/readPeriodicityOnFunctionGraph.d.ts +12 -0
  46. package/lib/exercises/math/trigonometry/functions/readPeriodicityOnFunctionGraph.d.ts.map +1 -0
  47. package/lib/exercises/math/trigonometry/functions/readPeriodicityOnFunctionGraph.js +159 -0
  48. package/lib/exercises/math/trigonometry/functions/sinInequationMainInterval.d.ts +10 -0
  49. package/lib/exercises/math/trigonometry/functions/sinInequationMainInterval.d.ts.map +1 -0
  50. package/lib/exercises/math/trigonometry/functions/sinInequationMainInterval.js +224 -0
  51. package/lib/exercises/math/trigonometry/trigoFundamentalEquation.js +1 -1
  52. package/lib/exercises/vea/treeTableVEA.d.ts +2 -0
  53. package/lib/exercises/vea/treeTableVEA.d.ts.map +1 -0
  54. package/lib/exercises/vea/treeTableVEA.js +7 -0
  55. package/lib/exercises/vea/varLineVEA.d.ts.map +1 -1
  56. package/lib/exercises/vea/varLineVEA.js +9 -6
  57. package/lib/index.d.ts +19 -1
  58. package/lib/index.d.ts.map +1 -1
  59. package/lib/tree/nodes/inequations/inequationNode.d.ts +1 -0
  60. package/lib/tree/nodes/inequations/inequationNode.d.ts.map +1 -1
  61. package/lib/tree/nodes/inequations/inequationNode.js +16 -0
  62. package/lib/utils/latex/poundify.d.ts +2 -0
  63. package/lib/utils/latex/poundify.d.ts.map +1 -0
  64. package/lib/utils/latex/poundify.js +3 -0
  65. package/package.json +1 -1
@@ -0,0 +1,159 @@
1
+ import { addValidProp, shuffleProps, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { blueDark, red } from "../../../../geogebra/colors.js";
4
+ import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
5
+ import { randfloat } from "../../../../math/utils/random/randfloat.js";
6
+ import { randint } from "../../../../math/utils/random/randint.js";
7
+ import { cos } from "../../../../tree/nodes/functions/cosNode.js";
8
+ import { sin } from "../../../../tree/nodes/functions/sinNode.js";
9
+ import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
10
+ import { PiNode } from "../../../../tree/nodes/numbers/piNode.js";
11
+ import { add } from "../../../../tree/nodes/operators/addNode.js";
12
+ import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
13
+ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
14
+ import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
15
+ import { coinFlip } from "../../../../utils/alea/coinFlip.js";
16
+ import { random } from "../../../../utils/alea/random.js";
17
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
18
+ const getPropositions = (n, { answer }) => {
19
+ const propositions = [];
20
+ addValidProp(propositions, answer);
21
+ propWhile(propositions, n, () => {
22
+ const b = randint(1, 10);
23
+ tryToAddWrongProp(propositions, frac(multiply(2, PiNode), b).simplify().toTex());
24
+ });
25
+ return shuffleProps(propositions, n);
26
+ };
27
+ const getAnswer = (identifiers) => {
28
+ const { bIds } = identifiers;
29
+ return frac(multiply(2, PiNode), reifyAlgebraic(bIds)).simplify().toTex();
30
+ };
31
+ const getInstruction = () => {
32
+ return `On représente ci-dessous la courbe d'une fonction périodique $f$.
33
+
34
+ Quelle est la période de $f$ ?`;
35
+ };
36
+ const getHint = () => {
37
+ return `Repère un motif de la courbe qui se repète à l'infini. La longueur en abscisse de ce motif est la période recherchée.`;
38
+ };
39
+ const buildFunction = (identifiers) => {
40
+ const { isCos, bIds, aIds, cIds } = identifiers;
41
+ const a = reifyAlgebraic(aIds);
42
+ const b = reifyAlgebraic(bIds);
43
+ const c = reifyAlgebraic(cIds);
44
+ return multiply(a, (isCos ? cos : sin)(add(multiply(b, "x"), c)));
45
+ };
46
+ const getCorrection = (identifiers) => {
47
+ const { bIds } = identifiers;
48
+ const period = frac(multiply(2, PiNode), reifyAlgebraic(bIds))
49
+ .simplify()
50
+ .toTex();
51
+ return `On repère sur la courbe un motif de longueur $${period}$ qui se répète à l'infini.
52
+
53
+ $f$ est donc une fonction périodique de période $${period}$.`;
54
+ };
55
+ const getCorrectionGGBOptions = (identifiers) => {
56
+ const { aIds, bIds } = identifiers;
57
+ const func = buildFunction(identifiers);
58
+ const commands = [`f(x) = ${func.toMathString()}`];
59
+ const a = reifyAlgebraic(aIds).evaluate();
60
+ const b = reifyAlgebraic(bIds).evaluate();
61
+ const step = b === 6 ? Math.PI / 3 : b === 4 ? Math.PI / 2 : Math.PI;
62
+ const period = frac(multiply(2, PiNode), reifyAlgebraic(bIds))
63
+ .simplify()
64
+ .evaluate();
65
+ for (let i = -2; i < 3; i++) {
66
+ commands.push(`f_{${i}}(x) = Function(f, ${i}*${period}, ${i + 1}*${period})`);
67
+ commands.push(`SetColor(f_{${i}}, "${i % 2 === 0 ? red : blueDark}")`);
68
+ }
69
+ const ggb = new GeogebraConstructor({
70
+ commands,
71
+ xAxis: {
72
+ steps: step,
73
+ },
74
+ gridDistance: [step, 1],
75
+ lockedAxesRatio: false,
76
+ });
77
+ return ggb.getOptions({
78
+ coords: [-2 * period, 2 * period, -a - 0.1 * a, a + 0.1 * a],
79
+ });
80
+ };
81
+ const getGGBOptions = (identifiers) => {
82
+ const { aIds, bIds } = identifiers;
83
+ const a = reifyAlgebraic(aIds).evaluate();
84
+ const b = reifyAlgebraic(bIds).evaluate();
85
+ const func = buildFunction(identifiers);
86
+ const period = frac(multiply(2, PiNode), reifyAlgebraic(bIds)).evaluate();
87
+ const step = b === 6 ? Math.PI / 3 : b === 4 ? Math.PI / 2 : Math.PI;
88
+ const ggb = new GeogebraConstructor({
89
+ commands: [`f(x) = ${func.toMathString()}`],
90
+ xAxis: {
91
+ steps: step,
92
+ },
93
+ gridDistance: [step, 1],
94
+ lockedAxesRatio: false,
95
+ });
96
+ return ggb.getOptions({
97
+ coords: [-2 * period, 2 * period, -a - 0.1 * a, a + 0.1 * a],
98
+ });
99
+ };
100
+ const getKeys = () => {
101
+ return ["pi"];
102
+ };
103
+ const isAnswerValid = (ans, { bIds }) => {
104
+ try {
105
+ const period = frac(multiply(2, PiNode), reifyAlgebraic(bIds)).evaluate();
106
+ const parsed = parseAlgebraic(ans);
107
+ if (!parsed)
108
+ return false;
109
+ return Math.abs(parsed.evaluate() - period) < 0.1;
110
+ }
111
+ catch (err) {
112
+ return handleVEAError(err);
113
+ }
114
+ };
115
+ const getReadPeriodicityOnFunctionGraphQuestion = () => {
116
+ const isCos = coinFlip();
117
+ const aIds = randfloat(0.5, 5, 1).toTree().toIdentifiers();
118
+ const bIds = random([1, 2, 4, 6]).toTree().toIdentifiers();
119
+ const cIds = randint(-8, 8).toTree().toIdentifiers();
120
+ const identifiers = {
121
+ aIds,
122
+ bIds,
123
+ cIds,
124
+ isCos,
125
+ };
126
+ return getQuestionFromIdentifiers(identifiers);
127
+ };
128
+ const getQuestionFromIdentifiers = (identifiers) => {
129
+ return {
130
+ answer: getAnswer(identifiers),
131
+ instruction: getInstruction(identifiers),
132
+ keys: getKeys(identifiers),
133
+ answerFormat: "tex",
134
+ identifiers,
135
+ hint: getHint(identifiers),
136
+ correction: getCorrection(identifiers),
137
+ ggbOptions: getGGBOptions(identifiers),
138
+ correctionGgbOptions: getCorrectionGGBOptions(identifiers),
139
+ };
140
+ };
141
+ export const readPeriodicityOnFunctionGraph = {
142
+ id: "readPeriodicityOnFunctionGraph",
143
+ label: "Déterminer graphiquement la périodicité d'une fonction trigonométrique",
144
+ isSingleStep: true,
145
+ generator: (nb, opts) => getDistinctQuestions(() => getReadPeriodicityOnFunctionGraphQuestion(opts), nb),
146
+ qcmTimer: 60,
147
+ freeTimer: 60,
148
+ getPropositions,
149
+ isAnswerValid,
150
+ subject: "Mathématiques",
151
+ getHint,
152
+ getCorrection,
153
+ getInstruction,
154
+ getAnswer,
155
+ getGGBOptions,
156
+ hasGeogebra: true,
157
+ getQuestionFromIdentifiers,
158
+ hasHintAndCorrection: true,
159
+ };
@@ -0,0 +1,10 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { InegalitySymbols } from "../../../../math/inequations/inequation.js";
3
+ import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
4
+ type Identifiers = {
5
+ sinIds: NodeIdentifiers;
6
+ ineqType: InegalitySymbols;
7
+ };
8
+ export declare const sinInequationMainInterval: Exercise<Identifiers>;
9
+ export {};
10
+ //# sourceMappingURL=sinInequationMainInterval.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sinInequationMainInterval.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/functions/sinInequationMainInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EACL,gBAAgB,EAEjB,MAAM,sCAAsC,CAAC;AAI9C,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAS7C,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,EAAE,gBAAgB,CAAC;CAC5B,CAAC;AAkPF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAuB3D,CAAC"}
@@ -0,0 +1,224 @@
1
+ import { addValidProp, shuffleProps, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { red } from "../../../../geogebra/colors.js";
4
+ import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
5
+ import { InequationSymbolConstructor, } from "../../../../math/inequations/inequation.js";
6
+ import { mainTrigoValues } from "../../../../math/trigonometry/remarkableValues.js";
7
+ import { opposite } from "../../../../tree/nodes/functions/oppositeNode.js";
8
+ import { InequationNode } from "../../../../tree/nodes/inequations/inequationNode.js";
9
+ import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
10
+ import { PiNode } from "../../../../tree/nodes/numbers/piNode.js";
11
+ import { ClosureType } from "../../../../tree/nodes/sets/closure.js";
12
+ import { IntervalNode } from "../../../../tree/nodes/sets/intervalNode.js";
13
+ import { UnionIntervalNode } from "../../../../tree/nodes/sets/unionIntervalNode.js";
14
+ import { unionIntervalParser } from "../../../../tree/parsers/unionIntervalParser.js";
15
+ import { random } from "../../../../utils/alea/random.js";
16
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
17
+ const getPropositions = (n, { answer, ineqType, sinIds }) => {
18
+ const propositions = [];
19
+ addValidProp(propositions, answer);
20
+ tryToAddWrongProp(propositions, getAnswer({
21
+ ineqType: InequationSymbolConstructor.reverse(ineqType),
22
+ sinIds: sinIds,
23
+ }));
24
+ propWhile(propositions, n, () => {
25
+ const value = random(mainTrigoValues.filter((v) => Math.abs(v.sin.evaluate()) !== 1));
26
+ tryToAddWrongProp(propositions, getAnswer({
27
+ ineqType: ineqType,
28
+ sinIds: value.sin.toIdentifiers(),
29
+ }));
30
+ });
31
+ return shuffleProps(propositions, n);
32
+ };
33
+ const getAnswer = (identifiers) => {
34
+ const { sinIds, ineqType } = identifiers;
35
+ const sinValue = reifyAlgebraic(sinIds);
36
+ //trouve la premiere value dans ]-pi; 0]
37
+ const values = mainTrigoValues
38
+ .filter((v) => Math.abs(v.sin.evaluate() - sinValue.evaluate()) < 0.0001)
39
+ .map((e) => e.angle);
40
+ const isPos = sinValue.evaluate() > 0;
41
+ const isNeg = sinValue.evaluate() < 0;
42
+ switch (ineqType) {
43
+ //sin(x)<1/2 -> ]-pi; pi/6]U[5PI/6; pi]
44
+ //sin(x)<-1/2 -> ]-5PI/6, -pi/6[
45
+ //sin(x)<0 : ]-pi; 0[
46
+ case "<":
47
+ case "\\le":
48
+ if (isPos)
49
+ return new UnionIntervalNode([
50
+ new IntervalNode(opposite(PiNode), values[0], ineqType === "<" ? ClosureType.OO : ClosureType.FF),
51
+ new IntervalNode(values[1], PiNode, ineqType === "<" ? ClosureType.OF : ClosureType.FF),
52
+ ]).toTex();
53
+ else
54
+ return new IntervalNode(values[0], values[1], ineqType === "<" ? ClosureType.OO : ClosureType.FF).toTex();
55
+ //sin(x)>1/2 -> [pi/6, 5PI/6]
56
+ //sin(x) > -1/2 -> ]-pi; -5PI/6]U[5PI/6; pi]
57
+ //sin(x)>0 : [0;Pi]
58
+ case ">":
59
+ case "\\ge":
60
+ if (isNeg)
61
+ return new UnionIntervalNode([
62
+ new IntervalNode(opposite(PiNode), values[0], ineqType === ">" ? ClosureType.OO : ClosureType.FF),
63
+ new IntervalNode(values[1], PiNode, ineqType === ">" ? ClosureType.OF : ClosureType.FF),
64
+ ]).toTex();
65
+ return new IntervalNode(values[0], values[1], ineqType === ">" ? ClosureType.OO : ClosureType.FF).toTex();
66
+ }
67
+ };
68
+ const getInstruction = (identifiers) => {
69
+ const { sinIds, ineqType } = identifiers;
70
+ const sinValue = reifyAlgebraic(sinIds);
71
+ return `Résoudre dans $]-\\pi; \\pi]$ l'inéquation suivante :
72
+
73
+ $$
74
+ \\sin(x)${ineqType}${sinValue.toTex()}
75
+ $$`;
76
+ };
77
+ const getHint = (identifiers) => {
78
+ const { sinIds } = identifiers;
79
+ const sinValue = reifyAlgebraic(sinIds);
80
+ return `Commence par résoudre sur $]-\\pi; \\pi]$ l'équation :
81
+
82
+ $$
83
+ \\sin(x)=${sinValue.toTex()}
84
+ $$
85
+
86
+ Puis, sers-toi du cercle trigonométrique pour en déduire l'ensemble des solutions de l'inéquation proposée.`;
87
+ };
88
+ const getCorrection = (identifiers) => {
89
+ const { sinIds, ineqType } = identifiers;
90
+ const sinValue = reifyAlgebraic(sinIds);
91
+ //trouve la premiere value dans ]-pi; 0]
92
+ const values = mainTrigoValues
93
+ .filter((v) => Math.abs(v.sin.evaluate() - sinValue.evaluate()) < 0.0001)
94
+ .map((e) => e.angle);
95
+ return `On commence par résoudre sur $]-\\pi; \\pi]$ l'équation :
96
+
97
+ $$
98
+ \\sin(x)=${sinValue.toTex()}
99
+ $$
100
+
101
+ Les solutions sont $${values[0].toTex()}$ et $${values[1].toTex()}$.
102
+
103
+ Puis on se sers du cercle trigonométrique ci-dessous, pour en déduire que l'ensemble des solutions de l'inéquation $\\sin(x)${ineqType}${sinValue.toTex()}$ est :
104
+
105
+ $$
106
+ ${getAnswer(identifiers)}
107
+ $$
108
+ `;
109
+ };
110
+ const getCorrectionGGBOptions = (identifiers) => {
111
+ const { sinIds, ineqType } = identifiers;
112
+ const sinValue = reifyAlgebraic(sinIds);
113
+ const values = mainTrigoValues
114
+ .filter((v) => Math.abs(v.sin.evaluate() - sinValue.evaluate()) < 0.0001)
115
+ .map((e) => e.angle);
116
+ const commands = [
117
+ `C : x^2 + y^2 = 1`,
118
+ `O = (0,0)`,
119
+ `ShowLabel(O, false)`,
120
+ `SetVisibleInView(O, 1, false)`,
121
+ `ShowLabel(C, false)`,
122
+ `SetFixed(C, true ,false)`,
123
+ `d : y = ${sinValue.evaluate()}`,
124
+ `SetLineThickness(d, 1.7)`,
125
+ `SetLineStyle(d, 1)`,
126
+ `A = (cos(${values[0].evaluate()}), sin(${values[0].evaluate()}))`,
127
+ `ShowLabel(A, false)`,
128
+ `Text("$\\tiny ${values[0].toTex()}$", A+0.3*Vector(O,A), false, true, 0, 0)`,
129
+ `B = (cos(${values[1].evaluate()}), sin(${values[1].evaluate()}))`,
130
+ `Text("$\\tiny ${values[1].toTex()}$", B+0.3*Vector(O,B), false, true, 0, 0)`,
131
+ `ShowLabel(B, false)`,
132
+ `D = (0, ${sinValue.evaluate()})`,
133
+ `SetCaption(D, "$\\tiny ${sinValue.toTex()}$")`,
134
+ `Text("$\\tiny ${sinValue.toTex()}$", D, false, true, 0, 0)`,
135
+ `SetPointSize(D, 1.3)`,
136
+ `ShowLabel(D, false)`,
137
+ `E = (-1,0)`,
138
+ `I = (1,0)`,
139
+ `SetVisibleInView(E, 1, false)`,
140
+ `SetVisibleInView(I, 1, false)`,
141
+ `v = Vector(E, I)`,
142
+ `w = Vector((0, -1), (0, 1))`,
143
+ `SetLineThickness(v, 1.3)`,
144
+ `SetLineThickness(w, 1.3)`,
145
+ `N = (0, -1)`,
146
+ `SetVisibleInView(N, 1, false)`,
147
+ `M = (0, 1)`,
148
+ `SetVisibleInView(M, 1, false)`,
149
+ ];
150
+ const ineq = new InequationNode([(-1).toTree(), sinValue], ineqType);
151
+ if (ineq.isVerified()) {
152
+ commands.push(`S = CircumcircularArc(A,N,B)`);
153
+ }
154
+ else {
155
+ commands.push(`S = CircumcircularArc(A,M,B)`);
156
+ }
157
+ commands.push(`SetFixed(S, true, false)`);
158
+ commands.push(`SetColor(S, "${red}")`);
159
+ const ggb = new GeogebraConstructor({
160
+ commands,
161
+ hideAxes: true,
162
+ hideGrid: true,
163
+ });
164
+ return ggb.getOptions({
165
+ coords: sinValue.evaluate() === 0
166
+ ? [-1.1, 1.1, -1.5, 1.5]
167
+ : [-1.1, 1.1, -1.3, 1.3],
168
+ });
169
+ };
170
+ const getKeys = () => {
171
+ return ["pi", "cup", "lbracket", "semicolon", "rbracket"];
172
+ };
173
+ const isAnswerValid = (ans, { answer }) => {
174
+ try {
175
+ const parsed = unionIntervalParser(ans, {
176
+ allowCommaInsteadOfSemicolon: true,
177
+ allowNoBrackets: true,
178
+ });
179
+ if (!parsed)
180
+ return false;
181
+ return parsed.simplify().toTex() === answer;
182
+ }
183
+ catch (err) {
184
+ return handleVEAError(err);
185
+ }
186
+ };
187
+ const getCosInequationMainIntervalQuestion = () => {
188
+ const value = random(mainTrigoValues.filter((v) => Math.abs(v.sin.evaluate()) !== 1));
189
+ const identifiers = {
190
+ sinIds: value.sin.toIdentifiers(),
191
+ ineqType: random(["<", ">", "\\le", "\\ge"]),
192
+ };
193
+ return getQuestionFromIdentifiers(identifiers);
194
+ };
195
+ const getQuestionFromIdentifiers = (identifiers) => {
196
+ return {
197
+ answer: getAnswer(identifiers),
198
+ instruction: getInstruction(identifiers),
199
+ keys: getKeys(identifiers),
200
+ answerFormat: "tex",
201
+ identifiers,
202
+ hint: getHint(identifiers),
203
+ correction: getCorrection(identifiers),
204
+ correctionGgbOptions: getCorrectionGGBOptions(identifiers),
205
+ };
206
+ };
207
+ export const sinInequationMainInterval = {
208
+ id: "sinInequationMainInterval",
209
+ label: "Résoudre une inéquation du type $\\sin(x)\\leq k$ sur $]-\\pi; \\pi]$",
210
+ isSingleStep: true,
211
+ generator: (nb, opts) => getDistinctQuestions(() => getCosInequationMainIntervalQuestion(opts), nb, 20),
212
+ qcmTimer: 60,
213
+ freeTimer: 60,
214
+ getPropositions,
215
+ isAnswerValid,
216
+ subject: "Mathématiques",
217
+ getInstruction,
218
+ getHint,
219
+ getCorrection,
220
+ getAnswer,
221
+ getQuestionFromIdentifiers,
222
+ hasHintAndCorrection: true,
223
+ maxAllowedQuestions: 20,
224
+ };
@@ -134,7 +134,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
134
134
  export const trigoFundamentalEquation = {
135
135
  id: "trigoFundamentalEquation",
136
136
  connector: "=",
137
- label: "Calculer le cosinus d'un angle à partir de son sinus (ou inversement)",
137
+ label: "Calculer le cosinus d'un angle à partir de son sinus (ou inversement) dans un triangle",
138
138
  isSingleStep: true,
139
139
  generator: (nb, opts) => getDistinctQuestions(() => getTrigoFundamentalEquationQuestion(opts), nb),
140
140
  qcmTimer: 60,
@@ -0,0 +1,2 @@
1
+ export declare const treeTableVEA: (ans: string[][][][], answerTable: string[][][][]) => boolean;
2
+ //# sourceMappingURL=treeTableVEA.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"treeTableVEA.d.ts","sourceRoot":"","sources":["../../../src/exercises/vea/treeTableVEA.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY,GACvB,KAAK,MAAM,EAAE,EAAE,EAAE,EAAE,EACnB,aAAa,MAAM,EAAE,EAAE,EAAE,EAAE,YAa5B,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { rationalVEA } from "./rationalVEA.js";
2
+ // type Options = {
3
+ // }
4
+ export const treeTableVEA = (ans, answerTable) => {
5
+ return ans.every((step, i) => step.every((block, j) => block.every((branch, k) => branch.every((value, l) => value === answerTable[i][j][k][l] ||
6
+ rationalVEA(value, answerTable[i][j][k][l])))));
7
+ };
@@ -1 +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,YAmClE,CAAC"}
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,YAoClE,CAAC"}
@@ -29,19 +29,22 @@ export const varLineVEA = (ans, answerTable) => {
29
29
  return false;
30
30
  for (let i = 0; i < flattenedAns.length; i++) {
31
31
  const value = flattenedAns[i];
32
- if (value === "\\nearrow") {
33
- if (flattenedAnswerTable[i] !== "\\nearrow")
32
+ if (flattenedAnswerTable[i] === "\\nearrow") {
33
+ if (value !== "\\nearrow")
34
34
  return false;
35
35
  continue;
36
36
  }
37
- else if (value === "\\searrow") {
38
- if (flattenedAnswerTable[i] !== "\\searrow")
37
+ else if (flattenedAnswerTable[i] === "\\searrow") {
38
+ if (value !== "\\searrow")
39
39
  return false;
40
40
  continue;
41
41
  }
42
42
  else {
43
- return ((!isValue(value) && !isValue(flattenedAnswerTable[i])) ||
44
- rationalVEA(value, flattenedAnswerTable[i]));
43
+ const isValid = (!isValue(value) && !isValue(flattenedAnswerTable[i])) ||
44
+ rationalVEA(value, flattenedAnswerTable[i]);
45
+ if (!isValid)
46
+ return false;
47
+ continue;
45
48
  }
46
49
  }
47
50
  return true;
package/lib/index.d.ts CHANGED
@@ -3342,7 +3342,9 @@ declare const mathExercises: (Exercise<{
3342
3342
  reason: number;
3343
3343
  firstValue: number;
3344
3344
  firstRank: number;
3345
- }, Record<string, string | boolean | string[]>> | Exercise<{
3345
+ }, {
3346
+ firstTermRankOne: boolean;
3347
+ }> | Exercise<{
3346
3348
  firstRank: number;
3347
3349
  firstTerm: number;
3348
3350
  reason: number;
@@ -3608,6 +3610,10 @@ declare const mathExercises: (Exercise<{
3608
3610
  }, Record<string, string | boolean | string[]>> | Exercise<{
3609
3611
  associateType: number;
3610
3612
  startPoint: string;
3613
+ }, Record<string, string | boolean | string[]>> | Exercise<{
3614
+ isCos: boolean;
3615
+ valueIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
3616
+ quadrant: number;
3611
3617
  }, Record<string, string | boolean | string[]>> | Exercise<{
3612
3618
  trigFunction: string;
3613
3619
  trigValue: number;
@@ -3628,6 +3634,18 @@ declare const mathExercises: (Exercise<{
3628
3634
  isCos: boolean;
3629
3635
  value: number;
3630
3636
  associateType: number;
3637
+ }, Record<string, string | boolean | string[]>> | Exercise<{
3638
+ cosIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
3639
+ ineqType: import("./math/inequations/inequation.js").InegalitySymbols;
3640
+ }, Record<string, string | boolean | string[]>> | Exercise<{
3641
+ sinIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
3642
+ ineqType: import("./math/inequations/inequation.js").InegalitySymbols;
3643
+ }, Record<string, string | boolean | string[]>> | Exercise<{
3644
+ axisStep?: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
3645
+ isCos: boolean;
3646
+ aIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
3647
+ bIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
3648
+ cIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
3631
3649
  }, Record<string, string | boolean | string[]>> | Exercise<{
3632
3650
  degree: number;
3633
3651
  radianNodeIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAA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;;;;;;;;;;;;;;;kDAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC"}
@@ -35,6 +35,7 @@ export declare class InequationNode implements AlgebraicNode {
35
35
  equals(): boolean;
36
36
  evaluate(): number;
37
37
  toDetailedEvaluation(): AlgebraicNode;
38
+ isVerified(): boolean;
38
39
  }
39
40
  export declare const firstDegreeInequationResolutionTex: (affine: Affine, order: InegalitySymbols, right: AlgebraicNode) => string;
40
41
  //# sourceMappingURL=inequationNode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"inequationNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/inequations/inequationNode.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAEjB,MAAM,sCAAsC,CAAC;AAG9C,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAM5D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAK1D,qBAAa,cAAe,YAAW,aAAa;IAClD,IAAI,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,SAAS,EAAE,OAAO,CAAC;gBAEjB,QAAQ,EAAE,aAAa,EAAE,EACzB,OAAO,EAAE,gBAAgB,EAAE,GAAG,gBAAgB;IAwBhD,aAAa;;;;;;;IAOb,mBAAmB;IAOnB,UAAU;IA8CV,wBAAwB;IACxB,UAAU;IAQV,UAAU;IAMV,mBAAmB,IAAI,MAAM;IAG7B,oBAAoB;IAMpB,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AAK;IAGL,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,cAAc;IAehD,UAAU,IAAI,aAAa;IAG3B,MAAM,IAAI,OAAO;IAGjB,QAAQ,IAAI,MAAM;IAGlB,oBAAoB,IAAI,aAAa;IAGrC,UAAU,IAAI,OAAO;CAYtB;AAED,eAAO,MAAM,kCAAkC,GAC7C,QAAQ,MAAM,EACd,OAAO,gBAAgB,EACvB,OAAO,aAAa,WAuBrB,CAAC"}
@@ -149,6 +149,22 @@ export class InequationNode {
149
149
  toDetailedEvaluation() {
150
150
  throw new Error("unimplemented");
151
151
  }
152
+ isVerified() {
153
+ const values = this.children.map((e) => e.evaluate());
154
+ for (let i = 0; i < this.symbols.length; i++) {
155
+ const curr = values[i];
156
+ const next = values[i + 1];
157
+ if (this.symbols[i] === "<" && curr >= next)
158
+ return false;
159
+ if (this.symbols[i] === ">" && curr <= next)
160
+ return false;
161
+ if (this.symbols[i] === "\\le" && curr > next)
162
+ return false;
163
+ if (this.symbols[i] === "\\ge" && curr < next)
164
+ return false;
165
+ }
166
+ return true;
167
+ }
152
168
  }
153
169
  export const firstDegreeInequationResolutionTex = (affine, order, right) => {
154
170
  if (!right.isNumeric)
@@ -0,0 +1,2 @@
1
+ export declare const poundify: (s: string) => string;
2
+ //# sourceMappingURL=poundify.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"poundify.d.ts","sourceRoot":"","sources":["../../../src/utils/latex/poundify.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,GAAI,GAAG,MAAM,WAEjC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export const poundify = (s) => {
2
+ return `£${s}£`;
3
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "math-exercises",
3
3
  "type": "module",
4
- "version": "3.0.173",
4
+ "version": "3.0.175",
5
5
  "description": "Math exercises generator for middle school and high school",
6
6
  "main": "lib/index.js",
7
7
  "files": [