math-exercises 3.0.190 → 3.0.191

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 (76) hide show
  1. package/lib/exercises/math/dataRepresentations/scatterPlot/index.d.ts +6 -0
  2. package/lib/exercises/math/dataRepresentations/scatterPlot/index.d.ts.map +1 -0
  3. package/lib/exercises/math/dataRepresentations/scatterPlot/index.js +5 -0
  4. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotBuildScatterPlotFromDataTable.d.ts +12 -0
  5. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotBuildScatterPlotFromDataTable.d.ts.map +1 -0
  6. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotBuildScatterPlotFromDataTable.js +206 -0
  7. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotCommenting.d.ts +9 -0
  8. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotCommenting.d.ts.map +1 -0
  9. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotCommenting.js +210 -0
  10. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableFromScatterPlotData.d.ts +10 -0
  11. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableFromScatterPlotData.d.ts.map +1 -0
  12. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableFromScatterPlotData.js +252 -0
  13. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableWithDataClassesFromScatterPlotData.d.ts +12 -0
  14. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableWithDataClassesFromScatterPlotData.d.ts.map +1 -0
  15. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableWithDataClassesFromScatterPlotData.js +352 -0
  16. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotInterpreting.d.ts +11 -0
  17. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotInterpreting.d.ts.map +1 -0
  18. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotInterpreting.js +403 -0
  19. package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.js +1 -1
  20. package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.d.ts.map +1 -1
  21. package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.js +4 -1
  22. package/lib/exercises/math/functions/affines/affineCompareTwoImagesFromVariations.d.ts +13 -0
  23. package/lib/exercises/math/functions/affines/affineCompareTwoImagesFromVariations.d.ts.map +1 -0
  24. package/lib/exercises/math/functions/affines/affineCompareTwoImagesFromVariations.js +205 -0
  25. package/lib/exercises/math/functions/affines/affineVarTableOnBoundedInterval.d.ts +9 -0
  26. package/lib/exercises/math/functions/affines/affineVarTableOnBoundedInterval.d.ts.map +1 -0
  27. package/lib/exercises/math/functions/affines/affineVarTableOnBoundedInterval.js +157 -0
  28. package/lib/exercises/math/functions/affines/affineVariations.d.ts +12 -0
  29. package/lib/exercises/math/functions/affines/affineVariations.d.ts.map +1 -0
  30. package/lib/exercises/math/functions/affines/affineVariations.js +176 -0
  31. package/lib/exercises/math/functions/affines/affineVariationsFromGraph.d.ts +8 -0
  32. package/lib/exercises/math/functions/affines/affineVariationsFromGraph.d.ts.map +1 -0
  33. package/lib/exercises/math/functions/affines/affineVariationsFromGraph.js +203 -0
  34. package/lib/exercises/math/functions/affines/affineVariationsFromTwoImages.d.ts +12 -0
  35. package/lib/exercises/math/functions/affines/affineVariationsFromTwoImages.d.ts.map +1 -0
  36. package/lib/exercises/math/functions/affines/affineVariationsFromTwoImages.js +259 -0
  37. package/lib/exercises/math/functions/exponentials/exponentialFunctionImage.d.ts +9 -0
  38. package/lib/exercises/math/functions/exponentials/exponentialFunctionImage.d.ts.map +1 -0
  39. package/lib/exercises/math/functions/exponentials/exponentialFunctionImage.js +99 -0
  40. package/lib/exercises/math/functions/exponentials/index.d.ts +5 -0
  41. package/lib/exercises/math/functions/exponentials/index.d.ts.map +1 -1
  42. package/lib/exercises/math/functions/exponentials/index.js +5 -0
  43. package/lib/exercises/math/functions/exponentials/realPowersFraction.d.ts +10 -0
  44. package/lib/exercises/math/functions/exponentials/realPowersFraction.d.ts.map +1 -0
  45. package/lib/exercises/math/functions/exponentials/realPowersFraction.js +125 -0
  46. package/lib/exercises/math/functions/exponentials/realPowersMixOperations.d.ts +12 -0
  47. package/lib/exercises/math/functions/exponentials/realPowersMixOperations.d.ts.map +1 -0
  48. package/lib/exercises/math/functions/exponentials/realPowersMixOperations.js +148 -0
  49. package/lib/exercises/math/functions/exponentials/realPowersPower.d.ts +10 -0
  50. package/lib/exercises/math/functions/exponentials/realPowersPower.d.ts.map +1 -0
  51. package/lib/exercises/math/functions/exponentials/realPowersPower.js +128 -0
  52. package/lib/exercises/math/functions/exponentials/realPowersProduct.d.ts +10 -0
  53. package/lib/exercises/math/functions/exponentials/realPowersProduct.d.ts.map +1 -0
  54. package/lib/exercises/math/functions/exponentials/realPowersProduct.js +128 -0
  55. package/lib/exercises/math/sequences/geometric/geometricFindNextTermFromTwoConsecutiveTerms.d.ts +12 -0
  56. package/lib/exercises/math/sequences/geometric/geometricFindNextTermFromTwoConsecutiveTerms.d.ts.map +1 -0
  57. package/lib/exercises/math/sequences/geometric/geometricFindNextTermFromTwoConsecutiveTerms.js +217 -0
  58. package/lib/exercises/math/sequences/geometric/geometricFindRecurrenceFormula.d.ts +10 -0
  59. package/lib/exercises/math/sequences/geometric/geometricFindRecurrenceFormula.d.ts.map +1 -0
  60. package/lib/exercises/math/sequences/geometric/geometricFindRecurrenceFormula.js +186 -0
  61. package/lib/exercises/math/sequences/geometric/graph/geometricPlaceFirstPoints.d.ts +14 -0
  62. package/lib/exercises/math/sequences/geometric/graph/geometricPlaceFirstPoints.d.ts.map +1 -0
  63. package/lib/exercises/math/sequences/geometric/graph/geometricPlaceFirstPoints.js +189 -0
  64. package/lib/exercises/math/sequences/geometric/graph/index.d.ts +2 -0
  65. package/lib/exercises/math/sequences/geometric/graph/index.d.ts.map +1 -0
  66. package/lib/exercises/math/sequences/geometric/graph/index.js +1 -0
  67. package/lib/index.d.ts +21 -0
  68. package/lib/index.d.ts.map +1 -1
  69. package/lib/tree/nodes/algebraicNode.d.ts +3 -0
  70. package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
  71. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  72. package/lib/tree/nodes/operators/fractionNode.js +5 -3
  73. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  74. package/lib/tree/nodes/operators/multiplyNode.js +5 -3
  75. package/lib/tree/nodes/operators/powerNode.js +1 -1
  76. package/package.json +1 -1
@@ -0,0 +1,186 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getOptionFirstTermRankOneStuff, } from "../../../../exercises/options/optionFirstTermRankOne.js";
3
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
4
+ import { nodeBySubstitutingVar } from "../../../../math/utils/functions/functionComposition.js";
5
+ import { randint } from "../../../../math/utils/random/randint.js";
6
+ import { EqualNode } from "../../../../tree/nodes/equations/equalNode.js";
7
+ import { add } from "../../../../tree/nodes/operators/addNode.js";
8
+ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
9
+ import { power } from "../../../../tree/nodes/operators/powerNode.js";
10
+ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
11
+ import { VariableNode } from "../../../../tree/nodes/variables/variableNode.js";
12
+ import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
13
+ import { NodeComparator } from "../../../../tree/utilities/nodeComparator.js";
14
+ import { NodeRewriter } from "../../../../tree/utilities/nodeRewriter.js";
15
+ import { probaFlip } from "../../../../utils/alea/probaFlip.js";
16
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
17
+ const getInstruction = (identifiers, optsIn) => {
18
+ const opts = optsIn ?? optsDefault;
19
+ const firstRank = opts.firstTermRankOne ? 1 : 0;
20
+ const { firstValue, reason } = identifiers;
21
+ return `$(u_n)$ est une suite géométrique de premier terme $u_{${firstRank}} = ${firstValue}$ et de raison $q = ${reason}$.
22
+
23
+ Donner la relation de récurrence de $(u_n)$.`;
24
+ };
25
+ const getAnswerNode = (identifiers) => {
26
+ const { reason } = identifiers;
27
+ const nodeFormula = multiply(new VariableNode("u_{n}"), reason);
28
+ const equalNode = new EqualNode(new VariableNode("u_{n+1}"), nodeFormula);
29
+ return equalNode;
30
+ };
31
+ const getAnswer = (identifiers) => {
32
+ return getAnswerNode(identifiers).toTex();
33
+ };
34
+ const getHint = () => {
35
+ return `Quelle est la formule qui relie deux termes consécutifs d'une suite géométrique ?
36
+
37
+ $$
38
+ u_{n+1} = ...
39
+ $$
40
+
41
+ `;
42
+ };
43
+ const getCorrection = (identifiers) => {
44
+ const { reason } = identifiers;
45
+ const answer = getAnswer(identifiers);
46
+ return `La relation de récurrence d'une suite géométrique de raison $q$ est :
47
+
48
+ $$
49
+ u_{n+1} = u_{n} \\ \\times \\ q
50
+ $$
51
+
52
+ Ici, puisque $q = ${reason}$, on a :
53
+
54
+ $$
55
+ ${answer}
56
+ $$`;
57
+ };
58
+ const getPropositions = (n, { answer, reason, firstValue }, optsIn) => {
59
+ const opts = optsIn ?? optsDefault;
60
+ const firstRank = opts?.firstTermRankOne ? 1 : 0;
61
+ const propositions = [];
62
+ addValidProp(propositions, answer);
63
+ //student: no lhs
64
+ {
65
+ const texWrong = answer.replace("u_{n+1}=", "");
66
+ tryToAddWrongProp(propositions, texWrong);
67
+ }
68
+ //student: geometric -> arithmetic
69
+ {
70
+ const nodeFormula = add(new VariableNode("u_{n}"), reason);
71
+ const texWrong = "u_{n+1}=" + nodeFormula.toTex();
72
+ tryToAddWrongProp(propositions, texWrong);
73
+ //student: no lhs
74
+ {
75
+ tryToAddWrongProp(propositions, nodeFormula.toTex());
76
+ }
77
+ }
78
+ //student: recurrence formula -> explicit formula
79
+ {
80
+ const nodeFormula = multiply(firstValue, power(reason, substract("n".toTree(), firstRank).simplify()));
81
+ const equalNode = new EqualNode("u_n".toTree(), nodeFormula);
82
+ tryToAddWrongProp(propositions, equalNode.toTex());
83
+ if (probaFlip(0.1)) {
84
+ const equalNode = new EqualNode("u_{n+1}".toTree(), nodeFormula);
85
+ tryToAddWrongProp(propositions, equalNode.toTex());
86
+ }
87
+ //student: no lhs
88
+ {
89
+ tryToAddWrongProp(propositions, nodeFormula.toTex());
90
+ }
91
+ }
92
+ if (probaFlip(0.9)) {
93
+ //student: swap(initial, reason)
94
+ {
95
+ const nodeFormula = multiply(firstValue, power(reason, new VariableNode("n")));
96
+ const texWrong = "u_n=" + nodeFormula.toTex();
97
+ tryToAddWrongProp(propositions, texWrong);
98
+ }
99
+ }
100
+ else {
101
+ //student: u_n = u_n * q
102
+ {
103
+ const texWrong = answer.replace("u_{n+1}", "u_{n}");
104
+ tryToAddWrongProp(propositions, texWrong);
105
+ }
106
+ }
107
+ return shuffleProps(propositions, n);
108
+ };
109
+ const isAnswerValid = (ans, { answer, ...identifiers }) => {
110
+ try {
111
+ //TODO faire fonctionner parseAlgebraic("u_n=3+2n") (token _ not implemented)
112
+ if (!ans.includes("=")) {
113
+ return false;
114
+ }
115
+ // const nodeAns = parseAlgebraic(ans);
116
+ const nodeAns = (() => {
117
+ const [lhs, rhs] = ans.split("=");
118
+ const lhsRefined = lhs.replace("u_{n+1}", "v");
119
+ const nodeLhs = lhsRefined.toTree();
120
+ const rhsRefined = rhs.replace("u_n", "u").replace("u_{n}", "u");
121
+ const nodeRhs = parseAlgebraic(rhsRefined);
122
+ return new EqualNode(nodeLhs, nodeRhs);
123
+ })();
124
+ const nodeAnswer = (() => {
125
+ const nodeAnswer = getAnswerNode(identifiers);
126
+ const nodeAnswerRefined = nodeBySubstitutingVar(nodeBySubstitutingVar(nodeAnswer, new VariableNode("v"), new VariableNode("u_{n+1}")), new VariableNode("u"), new VariableNode("u_{n}"));
127
+ return nodeAnswerRefined;
128
+ })();
129
+ const isValidLhs = () => nodeAns.leftChild.toTex() === nodeAnswer.leftChild.toTex();
130
+ const isValidRhs = () => {
131
+ const nodeAnsRhs = nodeAns.rightChild;
132
+ const nodeAnswerRhs = nodeAnswer.rightChild;
133
+ const isEquivalentFound = () => {
134
+ const nodeAns = nodeAnsRhs;
135
+ const nodeAnswer = nodeAnswerRhs;
136
+ const arrNodeAnswerEquivalent = NodeRewriter.getArrNodeEquivalent(nodeAnswer);
137
+ return arrNodeAnswerEquivalent.some((nodeAnswerRefined) => {
138
+ const isEqual = NodeComparator.isEqualViaFrac(nodeAns, nodeAnswerRefined);
139
+ return isEqual;
140
+ });
141
+ };
142
+ return isEquivalentFound();
143
+ };
144
+ return isValidLhs() && isValidRhs();
145
+ }
146
+ catch (e) {
147
+ handleVEAError(e);
148
+ return false;
149
+ }
150
+ };
151
+ const getGeometricFindRecurrenceFormulaQuestion = () => {
152
+ const firstValue = randint(-10, 10, [0]);
153
+ const reason = randint(-10, 10, [0, 1, firstValue]);
154
+ const identifiers = { reason, firstValue };
155
+ return getQuestionFromIdentifiers(identifiers);
156
+ };
157
+ const getQuestionFromIdentifiers = (identifiers) => {
158
+ const question = {
159
+ instruction: getInstruction(identifiers),
160
+ answer: getAnswer(identifiers),
161
+ keys: ["un", "unplus1", "equal", "n"],
162
+ answerFormat: "tex",
163
+ identifiers,
164
+ hint: getHint(identifiers),
165
+ correction: getCorrection(identifiers),
166
+ };
167
+ return question;
168
+ };
169
+ const { optsDefaultFirstTermRankOne, generatorOptionFirstTermRankOne } = getOptionFirstTermRankOneStuff(false);
170
+ const optsDefault = Object.assign({}, optsDefaultFirstTermRankOne);
171
+ const options = [generatorOptionFirstTermRankOne];
172
+ export const geometricFindRecurrenceFormula = {
173
+ id: "geometricFindRecurrenceFormula",
174
+ connector: "=",
175
+ label: "Déterminer la relation de récurrence d'une suite géométrique à partir de la raison et de $u_0$",
176
+ isSingleStep: false,
177
+ generator: (nb, opts) => getDistinctQuestions(() => getGeometricFindRecurrenceFormulaQuestion(opts), nb),
178
+ options,
179
+ qcmTimer: 60,
180
+ freeTimer: 60,
181
+ getPropositions,
182
+ isAnswerValid,
183
+ subject: "Mathématiques",
184
+ hasHintAndCorrection: true,
185
+ getQuestionFromIdentifiers,
186
+ };
@@ -0,0 +1,14 @@
1
+ import { Exercise } from "../../../../../exercises/exercise.js";
2
+ import { OptionFirstTermRankOne } from "../../../../../exercises/options/optionFirstTermRankOne.js";
3
+ import { NodeIdentifiers } from "../../../../../tree/nodes/nodeConstructor.js";
4
+ type Identifiers = {
5
+ nodeIdsInitial: NodeIdentifiers;
6
+ nodeIdsReason: NodeIdentifiers;
7
+ firstRank: number;
8
+ };
9
+ type Options = OptionFirstTermRankOne & {
10
+ typeSignReason: string[];
11
+ };
12
+ export declare const geometricPlaceFirstPoints: Exercise<Identifiers, Options>;
13
+ export {};
14
+ //# sourceMappingURL=geometricPlaceFirstPoints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometricPlaceFirstPoints.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/sequences/geometric/graph/geometricPlaceFirstPoints.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,sBAAsB,EACvB,MAAM,mDAAmD,CAAC;AAQ3D,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAY7C,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,eAAe,CAAC;IAChC,aAAa,EAAE,eAAe,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA0LF,KAAK,OAAO,GAAG,sBAAsB,GAAG;IAAE,cAAc,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAkBrE,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAmBpE,CAAC"}
@@ -0,0 +1,189 @@
1
+ import { GeneratorOptionTarget, GeneratorOptionType, } from "../../../../../exercises/exercise.js";
2
+ import { getOptionFirstTermRankOneStuff, } from "../../../../../exercises/options/optionFirstTermRankOne.js";
3
+ import { toolBarConstructor } from "../../../../../exercises/utils/geogebra/toolBarConstructor.js";
4
+ import { greenMain } from "../../../../../geogebra/colors.js";
5
+ import { GeogebraConstructor } from "../../../../../geogebra/geogebraConstructor.js";
6
+ import { ggbPointToCoords } from "../../../../../geogebra/parsers/ggbPointToCoords.js";
7
+ import { parseGGBPoints } from "../../../../../geogebra/parsers/parseGGBPoints.js";
8
+ import { Point } from "../../../../../math/geometry/point.js";
9
+ import { NodeConstructor, } from "../../../../../tree/nodes/nodeConstructor.js";
10
+ import { frac } from "../../../../../tree/nodes/operators/fractionNode.js";
11
+ import { multiply } from "../../../../../tree/nodes/operators/multiplyNode.js";
12
+ import { power } from "../../../../../tree/nodes/operators/powerNode.js";
13
+ import { substract } from "../../../../../tree/nodes/operators/substractNode.js";
14
+ import { VariableNode } from "../../../../../tree/nodes/variables/variableNode.js";
15
+ import { probaFlip } from "../../../../../utils/alea/probaFlip.js";
16
+ import { random } from "../../../../../utils/alea/random.js";
17
+ import { alignTex } from "../../../../../utils/latex/alignTex.js";
18
+ const nbPoints = 4;
19
+ const getInstruction = (identifiers) => {
20
+ const { firstRank, nodeIdsInitial, nodeIdsReason } = identifiers;
21
+ const [nodeInitial, nodeReason] = [nodeIdsInitial, nodeIdsReason].map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
22
+ return `On considère une suite géométrique $u$ de premier rang $u_{${firstRank}}=${nodeInitial.toTex()}$ et de raison $${nodeReason.toTex()}$.
23
+ Dans le repère ci-dessous, placer les points représentant les $${nbPoints}$ premiers termes de de $u$.`;
24
+ };
25
+ const getAnswerStuff = (identifiers) => {
26
+ const { firstRank, nodeIdsInitial, nodeIdsReason } = identifiers;
27
+ const [nodeInitial, nodeReason] = [nodeIdsInitial, nodeIdsReason].map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
28
+ const arrNodeTerm = [...Array(nbPoints).keys()].map((i) => multiply(nodeInitial, power(nodeReason, i))
29
+ .simplify({
30
+ towardsDistribute: true,
31
+ calculatePowers: true,
32
+ distributePowersOnFrac: true,
33
+ })
34
+ .simplify({ towardsDistribute: false }));
35
+ const arrPoint = arrNodeTerm.map((nodeTerm, i) => {
36
+ const nodeX = (firstRank + i).toTree();
37
+ return new Point(`P${firstRank + i}`, nodeX, nodeTerm);
38
+ });
39
+ return {
40
+ arrPoint,
41
+ };
42
+ };
43
+ const getHint = () => {
44
+ return `Une suite est représentée par un nuage de point. L'abscisse de chaque point est le rang du terme, et l'ordonnée est le terme en lui-même.`;
45
+ };
46
+ const getCorrection = (identifiers) => {
47
+ const { firstRank, nodeIdsInitial, nodeIdsReason } = identifiers;
48
+ const [nodeInitial, nodeReason] = [nodeIdsInitial, nodeIdsReason].map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
49
+ const { arrPoint } = getAnswerStuff(identifiers);
50
+ return `Une suite est représentée par un nuage de point. L'abscisse de chaque point est le rang du terme, et l'ordonnée est le terme en lui-même.
51
+
52
+ La formule générale de la suite $u$ est :
53
+
54
+ $$
55
+ u_{n} = ${nodeInitial.toTex()} \\ \\times \\ (${nodeReason.toTex()})^{${substract(new VariableNode("n"), firstRank)
56
+ .simplify({ towardsDistribute: true })
57
+ .toTex()}}
58
+ $$
59
+
60
+ Les points du nuage sont donc ici les suivants :
61
+
62
+ ${alignTex(arrPoint.map((point, i) => {
63
+ const rank = firstRank + i;
64
+ return [`(${rank};u_{${rank}})`, "=", point.toCoords()];
65
+ }))}
66
+
67
+ En pratique, on place le premier point. Puis, pour placer le point suivant :
68
+ - pour l'abscisse : on se décale d'une unité sur l'axe des abscisses
69
+ - pour l'ordonnée : on multiplie l'ordonnée du point précédent par la raison (attention au changement de signe si la raison est négative)
70
+
71
+ `;
72
+ };
73
+ const getGGBAnswer = (identifiers) => {
74
+ const { arrPoint } = getAnswerStuff(identifiers);
75
+ return [
76
+ ...arrPoint.flatMap((point) => point.toGGBCommand({ color: `${greenMain}`, showLabel: false })),
77
+ ];
78
+ };
79
+ const getStudentGGBOptions = (identifiers) => {
80
+ const { arrPoint } = getAnswerStuff(identifiers);
81
+ const values = arrPoint.map((point) => point.y.evaluate());
82
+ const ggb = new GeogebraConstructor({
83
+ commands: [],
84
+ customToolBar: toolBarConstructor({
85
+ point: true,
86
+ }),
87
+ });
88
+ const yMin = Math.min(...values);
89
+ const yMax = Math.max(...values);
90
+ return ggb.getOptions({
91
+ coords: [-1, 6, Math.min(yMin, 0) - 1, Math.max(yMax, 1) + 1],
92
+ });
93
+ };
94
+ const isGGBAnswerValid = (ans, { ggbAnswer: _ggbAnswer, ...identifiers }) => {
95
+ const points = parseGGBPoints(ans)
96
+ .map((p) => ggbPointToCoords(p))
97
+ .sort((a, b) => a.x - b.x);
98
+ const validPoints = getAnswerStuff(identifiers).arrPoint;
99
+ return points.every((p, i) => Math.abs(p.x - validPoints[i].x.evaluate()) < 0.4 &&
100
+ Math.abs(p.y - validPoints[i].y.evaluate()) < 0.4);
101
+ };
102
+ const getPlaceFirstSequencePointsQuestion = (optsIn) => {
103
+ const opts = optsIn ?? optsDefault;
104
+ const firstRank = opts?.firstTermRankOne ? 1 : 0;
105
+ const typeSignReason = opts?.typeSignReason
106
+ ? random(opts.typeSignReason)
107
+ : random(optsDefault.typeSignReason);
108
+ const [nodeInitialAbs, nodeReasonAbs] = random([
109
+ //increasing
110
+ [(1).toTree(), (2).toTree()],
111
+ [(1).toTree(), frac(3, 2)],
112
+ [(1).toTree(), frac(4, 3)],
113
+ // [(1).toTree(), frac(5, 3)],
114
+ [frac(1, 2), (2).toTree()],
115
+ [frac(1, 2), frac(3, 2)],
116
+ [frac(1, 3), (3).toTree()],
117
+ [(2).toTree(), frac(3, 2)],
118
+ [(2).toTree(), frac(4, 3)],
119
+ //decreasing
120
+ [(8).toTree(), frac(1, 2)],
121
+ [(9).toTree(), frac(1, 3)],
122
+ [(9).toTree(), frac(2, 3)],
123
+ [(8).toTree(), frac(3, 4)],
124
+ // [(10).toTree(), frac(3, 5)],
125
+ ]);
126
+ const nodeInitial = (() => {
127
+ const sign = probaFlip(0.7) ? +1 : -1;
128
+ return multiply(sign, nodeInitialAbs).simplify({
129
+ towardsDistribute: true,
130
+ });
131
+ })();
132
+ const nodeReason = (() => {
133
+ const sign = typeSignReason === "positive" ? +1 : -1;
134
+ return multiply(sign, nodeReasonAbs).simplify({
135
+ towardsDistribute: true,
136
+ });
137
+ })();
138
+ const identifiers = {
139
+ firstRank,
140
+ nodeIdsInitial: nodeInitial.toIdentifiers(),
141
+ nodeIdsReason: nodeReason.toIdentifiers(),
142
+ };
143
+ return getQuestionFromIdentifiers(identifiers, opts);
144
+ };
145
+ const getQuestionFromIdentifiers = (identifiers) => {
146
+ return {
147
+ ggbAnswer: getGGBAnswer(identifiers),
148
+ instruction: getInstruction(identifiers),
149
+ studentGgbOptions: getStudentGGBOptions(identifiers),
150
+ identifiers,
151
+ hint: getHint(identifiers),
152
+ correction: getCorrection(identifiers),
153
+ };
154
+ };
155
+ const { optsDefaultFirstTermRankOne, generatorOptionFirstTermRankOne } = getOptionFirstTermRankOneStuff(false);
156
+ const optsDefault = Object.assign({}, optsDefaultFirstTermRankOne, {
157
+ typeSignReason: ["positive"],
158
+ });
159
+ const options = [
160
+ generatorOptionFirstTermRankOne,
161
+ {
162
+ id: "typeSignReason",
163
+ label: "Signe de la raison",
164
+ target: GeneratorOptionTarget.generation,
165
+ type: GeneratorOptionType.multiselect,
166
+ values: ["positive", "négative"],
167
+ defaultValue: optsDefault.typeSignReason,
168
+ },
169
+ ];
170
+ export const geometricPlaceFirstPoints = {
171
+ id: "geometricPlaceFirstPoints",
172
+ label: "Placer les premiers termes d'une suite géométrique dans un repère",
173
+ isSingleStep: true,
174
+ generator: (nb, opts) =>
175
+ // getDistinctQuestions(() => getPlaceFirstSequencePointsQuestion(opts), nb),
176
+ [...Array(nb).keys()].map(() => getPlaceFirstSequencePointsQuestion(opts)),
177
+ ggbTimer: 60,
178
+ isGGBAnswerValid,
179
+ subject: "Mathématiques",
180
+ getHint,
181
+ getCorrection,
182
+ hasHintAndCorrection: true,
183
+ getInstruction,
184
+ getGGBAnswer,
185
+ getStudentGGBOptions,
186
+ answerType: "GGB",
187
+ getQuestionFromIdentifiers,
188
+ options,
189
+ };
@@ -0,0 +1,2 @@
1
+ export * from "./geometricPlaceFirstPoints.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/sequences/geometric/graph/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC"}
@@ -0,0 +1 @@
1
+ export * from "./geometricPlaceFirstPoints.js";
package/lib/index.d.ts CHANGED
@@ -1947,6 +1947,27 @@ declare const mathExercises: (Exercise<{
1947
1947
  a: number;
1948
1948
  k: number;
1949
1949
  }[];
1950
+ }, Record<string, string | boolean | string[]>> | Exercise<{
1951
+ aIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1952
+ xIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1953
+ }, Record<string, string | boolean | string[]>> | Exercise<{
1954
+ aIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1955
+ xIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1956
+ yIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1957
+ }, Record<string, string | boolean | string[]>> | Exercise<{
1958
+ aIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1959
+ xIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1960
+ yIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1961
+ }, Record<string, string | boolean | string[]>> | Exercise<{
1962
+ aIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1963
+ xIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1964
+ yIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1965
+ }, Record<string, string | boolean | string[]>> | Exercise<{
1966
+ aIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1967
+ xIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1968
+ yIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1969
+ zIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1970
+ tIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1950
1971
  }, Record<string, string | boolean | string[]>> | Exercise<{
1951
1972
  affine1Ids: import("./math/polynomials/generalAffine.js").GeneralAffineIdentifiers;
1952
1973
  affine2Ids: import("./math/polynomials/generalAffine.js").GeneralAffineIdentifiers;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAE3D,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kDAA+B,CAAC;AACnD,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kDAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC"}
@@ -16,6 +16,9 @@ export type SimplifyOptions = {
16
16
  forceSeparateSqrts?: boolean;
17
17
  forceAddFractions?: boolean;
18
18
  noAddOrder?: boolean;
19
+ forbidPowerMultiply?: boolean;
20
+ forbidPowerDivision?: boolean;
21
+ forbidPowerPower?: boolean;
19
22
  };
20
23
  export type EvaluateOptions = {
21
24
  degreeMode?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"algebraicNode.d.ts","sourceRoot":"","sources":["../../../src/tree/nodes/algebraicNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,I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,WAAW;IAiBpB,YAAY,IAAI,MAAM;IAItB,aAAa,IAAI,uBAAuB;IAQxC,UAAU;IAGV,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW;IA+BpC,cAAc,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,MAAM,EAAE;IAG5C,mBAAmB;IAOnB,SAAS;IAoBT,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,MAAM;IA8BrC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAMtC,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe,EAAE,GAAG,UAAQ,GAAG,aAAa;IA+M5D,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;IAOpC,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;IAOxD,mBAAmB;IAQnB,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,aAAa;CAQ5C"}
@@ -259,9 +259,11 @@ export class FractionNode {
259
259
  if (isFractionNode(denum) && isFractionNode(num)) {
260
260
  return new MultiplyNode(num, new FractionNode(denum.rightChild, denum.leftChild)).simplify(opts);
261
261
  }
262
- const powerSimp = powerSimplify(num, denum, opts);
263
- if (powerSimp)
264
- return powerSimp;
262
+ if (!opts?.forbidPowerDivision) {
263
+ const powerSimp = powerSimplify(num, denum, opts);
264
+ if (powerSimp)
265
+ return powerSimp;
266
+ }
265
267
  if (num.equals(denum))
266
268
  return new NumberNode(1);
267
269
  return null;
@@ -1 +1 @@
1
- {"version":3,"file":"multiplyNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/operators/multiplyNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAChF,OAAO,EACL,uBAAuB,EACvB,WAAW,EAEZ,MAAM,mBAAmB,CAAC;AAgB3B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D,cAAc,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,MAAM,EAAE;IAG5C,aAAa;;;;;;;;;IAYb,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAOtC,IAAI;IAGJ,cAAc;IACd,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe,EAAE,GAAG,UAAQ,GAAG,aAAa;IAkK5D,mBAAmB,CAAC,IAAI,CAAC,EAAE,eAAe;IAM1C,mBAAmB;IAOnB,MAAM,CAAC,IAAI,EAAE,aAAa;IAU1B,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;IAQxD,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa;CAMxD"}
@@ -348,9 +348,11 @@ export class MultiplyNode {
348
348
  const fracSimplified = fractionSimplify(a, b, opts, log);
349
349
  if (fracSimplified)
350
350
  return fracSimplified;
351
- const powerSimplified = powerSimplify(a, b, opts, log);
352
- if (powerSimplified)
353
- return powerSimplified;
351
+ if (!opts?.forbidPowerMultiply) {
352
+ const powerSimplified = powerSimplify(a, b, opts, log);
353
+ if (powerSimplified)
354
+ return powerSimplified;
355
+ }
354
356
  if (opts?.towardsDistribute && (isAddNode(a) || isSubstractNode(a))) {
355
357
  return add(multiply(a.leftChild, b), multiply(a.rightChild, b)).simplify(opts, log);
356
358
  }
@@ -131,7 +131,7 @@ export class PowerNode {
131
131
  isNumberNode(rightSimplified)) {
132
132
  return new NumberNode(round(leftSimplified.value ** rightSimplified.value, 8));
133
133
  }
134
- if (isPowerNode(leftSimplified)) {
134
+ if (!opts?.forbidPowerPower && isPowerNode(leftSimplified)) {
135
135
  return new PowerNode(leftSimplified.leftChild, new MultiplyNode(rightSimplified, leftSimplified.rightChild).simplify(opts)).simplify(opts);
136
136
  }
137
137
  if (isSqrtNode(leftSimplified) &&
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "math-exercises",
3
3
  "type": "module",
4
- "version": "3.0.190",
4
+ "version": "3.0.191",
5
5
  "description": "Math exercises generator for middle school and high school",
6
6
  "main": "lib/index.js",
7
7
  "files": [