math-exercises 3.0.189 → 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 (138) hide show
  1. package/lib/exercises/math/calcul/decimals/decimalFractionToDecimal.d.ts.map +1 -1
  2. package/lib/exercises/math/calcul/decimals/decimalFractionToDecimal.js +5 -4
  3. package/lib/exercises/math/calculLitteral/equation/factorizeEquation.d.ts.map +1 -1
  4. package/lib/exercises/math/calculLitteral/equation/factorizeEquation.js +9 -8
  5. package/lib/exercises/math/calculLitteral/equation/isEqualityTrue.d.ts.map +1 -1
  6. package/lib/exercises/math/calculLitteral/equation/isEqualityTrue.js +7 -6
  7. package/lib/exercises/math/dataRepresentations/barChartInterpreting.d.ts.map +1 -1
  8. package/lib/exercises/math/dataRepresentations/barChartInterpreting.js +5 -4
  9. package/lib/exercises/math/dataRepresentations/scatterPlot/index.d.ts +6 -0
  10. package/lib/exercises/math/dataRepresentations/scatterPlot/index.d.ts.map +1 -0
  11. package/lib/exercises/math/dataRepresentations/scatterPlot/index.js +5 -0
  12. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotBuildScatterPlotFromDataTable.d.ts +12 -0
  13. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotBuildScatterPlotFromDataTable.d.ts.map +1 -0
  14. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotBuildScatterPlotFromDataTable.js +206 -0
  15. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotCommenting.d.ts +9 -0
  16. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotCommenting.d.ts.map +1 -0
  17. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotCommenting.js +210 -0
  18. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableFromScatterPlotData.d.ts +10 -0
  19. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableFromScatterPlotData.d.ts.map +1 -0
  20. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableFromScatterPlotData.js +252 -0
  21. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableWithDataClassesFromScatterPlotData.d.ts +12 -0
  22. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableWithDataClassesFromScatterPlotData.d.ts.map +1 -0
  23. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableWithDataClassesFromScatterPlotData.js +352 -0
  24. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotInterpreting.d.ts +11 -0
  25. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotInterpreting.d.ts.map +1 -0
  26. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotInterpreting.js +403 -0
  27. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.d.ts.map +1 -1
  28. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.js +3 -2
  29. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.d.ts.map +1 -1
  30. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.js +3 -2
  31. package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.d.ts.map +1 -1
  32. package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.js +3 -2
  33. package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.d.ts.map +1 -1
  34. package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.js +3 -2
  35. package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.d.ts.map +1 -1
  36. package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.js +3 -2
  37. package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.d.ts.map +1 -1
  38. package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.js +4 -3
  39. package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.d.ts.map +1 -1
  40. package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.js +4 -3
  41. package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.d.ts.map +1 -1
  42. package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.js +4 -3
  43. package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.d.ts.map +1 -1
  44. package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.js +3 -2
  45. package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.d.ts.map +1 -1
  46. package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.js +3 -2
  47. package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.d.ts.map +1 -1
  48. package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.js +8 -4
  49. package/lib/exercises/math/functions/affines/affineCompareTwoImagesFromVariations.d.ts +13 -0
  50. package/lib/exercises/math/functions/affines/affineCompareTwoImagesFromVariations.d.ts.map +1 -0
  51. package/lib/exercises/math/functions/affines/affineCompareTwoImagesFromVariations.js +205 -0
  52. package/lib/exercises/math/functions/affines/affineVarTableOnBoundedInterval.d.ts +9 -0
  53. package/lib/exercises/math/functions/affines/affineVarTableOnBoundedInterval.d.ts.map +1 -0
  54. package/lib/exercises/math/functions/affines/affineVarTableOnBoundedInterval.js +157 -0
  55. package/lib/exercises/math/functions/affines/affineVariations.d.ts +12 -0
  56. package/lib/exercises/math/functions/affines/affineVariations.d.ts.map +1 -0
  57. package/lib/exercises/math/functions/affines/affineVariations.js +176 -0
  58. package/lib/exercises/math/functions/affines/affineVariationsFromGraph.d.ts +8 -0
  59. package/lib/exercises/math/functions/affines/affineVariationsFromGraph.d.ts.map +1 -0
  60. package/lib/exercises/math/functions/affines/affineVariationsFromGraph.js +203 -0
  61. package/lib/exercises/math/functions/affines/affineVariationsFromTwoImages.d.ts +12 -0
  62. package/lib/exercises/math/functions/affines/affineVariationsFromTwoImages.d.ts.map +1 -0
  63. package/lib/exercises/math/functions/affines/affineVariationsFromTwoImages.js +259 -0
  64. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.d.ts.map +1 -1
  65. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.js +8 -6
  66. package/lib/exercises/math/functions/exponentials/estimateExponentialFunctionImageFromGeometricScatterplot.d.ts +2 -0
  67. package/lib/exercises/math/functions/exponentials/estimateExponentialFunctionImageFromGeometricScatterplot.d.ts.map +1 -0
  68. package/lib/exercises/math/functions/exponentials/estimateExponentialFunctionImageFromGeometricScatterplot.js +155 -0
  69. package/lib/exercises/math/functions/exponentials/exponentialFunctionImage.d.ts +9 -0
  70. package/lib/exercises/math/functions/exponentials/exponentialFunctionImage.d.ts.map +1 -0
  71. package/lib/exercises/math/functions/exponentials/exponentialFunctionImage.js +99 -0
  72. package/lib/exercises/math/functions/exponentials/exponentialsRawVariations.d.ts +8 -0
  73. package/lib/exercises/math/functions/exponentials/exponentialsRawVariations.d.ts.map +1 -0
  74. package/lib/exercises/math/functions/exponentials/exponentialsRawVariations.js +99 -0
  75. package/lib/exercises/math/functions/exponentials/index.d.ts +8 -0
  76. package/lib/exercises/math/functions/exponentials/index.d.ts.map +1 -1
  77. package/lib/exercises/math/functions/exponentials/index.js +9 -0
  78. package/lib/exercises/math/functions/exponentials/plausibleExponentialFunctionExpressionFromGraph.d.ts +12 -0
  79. package/lib/exercises/math/functions/exponentials/plausibleExponentialFunctionExpressionFromGraph.d.ts.map +1 -0
  80. package/lib/exercises/math/functions/exponentials/plausibleExponentialFunctionExpressionFromGraph.js +138 -0
  81. package/lib/exercises/math/functions/exponentials/readExponentialFunctionParamsOnGraph.d.ts +8 -0
  82. package/lib/exercises/math/functions/exponentials/readExponentialFunctionParamsOnGraph.d.ts.map +1 -0
  83. package/lib/exercises/math/functions/exponentials/readExponentialFunctionParamsOnGraph.js +142 -0
  84. package/lib/exercises/math/functions/exponentials/realPowersFraction.d.ts +10 -0
  85. package/lib/exercises/math/functions/exponentials/realPowersFraction.d.ts.map +1 -0
  86. package/lib/exercises/math/functions/exponentials/realPowersFraction.js +125 -0
  87. package/lib/exercises/math/functions/exponentials/realPowersMixOperations.d.ts +12 -0
  88. package/lib/exercises/math/functions/exponentials/realPowersMixOperations.d.ts.map +1 -0
  89. package/lib/exercises/math/functions/exponentials/realPowersMixOperations.js +148 -0
  90. package/lib/exercises/math/functions/exponentials/realPowersPower.d.ts +10 -0
  91. package/lib/exercises/math/functions/exponentials/realPowersPower.d.ts.map +1 -0
  92. package/lib/exercises/math/functions/exponentials/realPowersPower.js +128 -0
  93. package/lib/exercises/math/functions/exponentials/realPowersProduct.d.ts +10 -0
  94. package/lib/exercises/math/functions/exponentials/realPowersProduct.d.ts.map +1 -0
  95. package/lib/exercises/math/functions/exponentials/realPowersProduct.js +128 -0
  96. package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLineV2.d.ts.map +1 -1
  97. package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLineV2.js +7 -6
  98. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.d.ts.map +1 -1
  99. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.js +3 -2
  100. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.d.ts.map +1 -1
  101. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.js +7 -6
  102. package/lib/exercises/math/percent/percentToDecimal.d.ts.map +1 -1
  103. package/lib/exercises/math/percent/percentToDecimal.js +5 -4
  104. package/lib/exercises/math/probaStat/basicStats/calculateFrequencyInList.d.ts.map +1 -1
  105. package/lib/exercises/math/probaStat/basicStats/calculateFrequencyInList.js +5 -4
  106. package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
  107. package/lib/exercises/math/probaStat/probaFromTableWithContext.js +7 -8
  108. package/lib/exercises/math/probaStat/stats1var/medianWithList.d.ts.map +1 -1
  109. package/lib/exercises/math/probaStat/stats1var/medianWithList.js +5 -4
  110. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.d.ts.map +1 -1
  111. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.js +9 -9
  112. package/lib/exercises/math/sequences/geometric/geometricFindNextTermFromTwoConsecutiveTerms.d.ts +12 -0
  113. package/lib/exercises/math/sequences/geometric/geometricFindNextTermFromTwoConsecutiveTerms.d.ts.map +1 -0
  114. package/lib/exercises/math/sequences/geometric/geometricFindNextTermFromTwoConsecutiveTerms.js +217 -0
  115. package/lib/exercises/math/sequences/geometric/geometricFindRecurrenceFormula.d.ts +10 -0
  116. package/lib/exercises/math/sequences/geometric/geometricFindRecurrenceFormula.d.ts.map +1 -0
  117. package/lib/exercises/math/sequences/geometric/geometricFindRecurrenceFormula.js +186 -0
  118. package/lib/exercises/math/sequences/geometric/graph/geometricPlaceFirstPoints.d.ts +14 -0
  119. package/lib/exercises/math/sequences/geometric/graph/geometricPlaceFirstPoints.d.ts.map +1 -0
  120. package/lib/exercises/math/sequences/geometric/graph/geometricPlaceFirstPoints.js +189 -0
  121. package/lib/exercises/math/sequences/geometric/graph/index.d.ts +2 -0
  122. package/lib/exercises/math/sequences/geometric/graph/index.d.ts.map +1 -0
  123. package/lib/exercises/math/sequences/geometric/graph/index.js +1 -0
  124. package/lib/exercises/utils/options/arrayedOptions.d.ts +2 -0
  125. package/lib/exercises/utils/options/arrayedOptions.d.ts.map +1 -0
  126. package/lib/exercises/utils/options/arrayedOptions.js +16 -0
  127. package/lib/index.d.ts +33 -0
  128. package/lib/index.d.ts.map +1 -1
  129. package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts.map +1 -1
  130. package/lib/math/utils/sequences/situations/seqArithmeticSituations.js +20 -20
  131. package/lib/tree/nodes/algebraicNode.d.ts +3 -0
  132. package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
  133. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  134. package/lib/tree/nodes/operators/fractionNode.js +5 -3
  135. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  136. package/lib/tree/nodes/operators/multiplyNode.js +5 -3
  137. package/lib/tree/nodes/operators/powerNode.js +1 -1
  138. package/package.json +1 -1
@@ -0,0 +1,403 @@
1
+ import { tryToAddWrongProp, addValidProp, propWhile, shuffleProps, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { numberVEA } from "../../../../exercises/vea/numberVEA.js";
4
+ import { greenMain, orange, red } from "../../../../geogebra/colors.js";
5
+ import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
6
+ import { Point, PointConstructor, } from "../../../../math/geometry/point.js";
7
+ import { randint } from "../../../../math/utils/random/randint.js";
8
+ import { NodeConstructor, } from "../../../../tree/nodes/nodeConstructor.js";
9
+ import { add } from "../../../../tree/nodes/operators/addNode.js";
10
+ import { ClosureType } from "../../../../tree/nodes/sets/closure.js";
11
+ import { IntervalNode } from "../../../../tree/nodes/sets/intervalNode.js";
12
+ import { NodeComparator } from "../../../../tree/utilities/nodeComparator.js";
13
+ import { coinFlip } from "../../../../utils/alea/coinFlip.js";
14
+ import { probaFlip } from "../../../../utils/alea/probaFlip.js";
15
+ import { probaLawFlip } from "../../../../utils/alea/probaLawFlip.js";
16
+ import { random } from "../../../../utils/alea/random.js";
17
+ import { shuffle } from "../../../../utils/alea/shuffle.js";
18
+ import { getCartesiansProducts } from "../../../../utils/arrays/cartesianProducts.js";
19
+ const getComponentOfPointForStrGroupBy = (point, strGroupBy) => {
20
+ switch (strGroupBy) {
21
+ case "x":
22
+ return point.x;
23
+ case "y":
24
+ return point.y;
25
+ default:
26
+ throw new Error("Unsupported strGroupBy: " + strGroupBy);
27
+ }
28
+ };
29
+ const getTexCondition = (strGroupBy, nodeDataClass) => {
30
+ if (NodeComparator.isEqualViaSub(nodeDataClass.a, nodeDataClass.b)) {
31
+ return `${strGroupBy} = ${nodeDataClass.a.toTex()}`;
32
+ }
33
+ else {
34
+ switch (nodeDataClass.closure) {
35
+ case ClosureType.FF:
36
+ return `${nodeDataClass.a.toTex()} \\leq ${strGroupBy} \\leq ${nodeDataClass.b.toTex()}`;
37
+ case ClosureType.FO:
38
+ return `${nodeDataClass.a.toTex()} \\leq ${strGroupBy} < ${nodeDataClass.b.toTex()}`;
39
+ case ClosureType.OF:
40
+ return `${nodeDataClass.a.toTex()} < ${strGroupBy} \\leq ${nodeDataClass.b.toTex()}`;
41
+ case ClosureType.OO:
42
+ return `${nodeDataClass.a.toTex()} < ${strGroupBy} < ${nodeDataClass.b.toTex()}`;
43
+ }
44
+ }
45
+ };
46
+ const getInstruction = (identifiers) => {
47
+ const { strGroupBy, nodeIdsDataClass } = identifiers;
48
+ const nodeDataClass = NodeConstructor.fromIdentifiers(nodeIdsDataClass);
49
+ return `Si l'on considère le nuage de points ci-dessous,
50
+ combien y a-t-il d'éléments avec $${getTexCondition(strGroupBy, nodeDataClass)}$ ?`;
51
+ };
52
+ const getAnswerNode = (identifiers) => {
53
+ const { pointIds, strGroupBy, nodeIdsDataClass } = identifiers;
54
+ const arrPoint = pointIds.map((pointIds) => PointConstructor.fromIdentifiers(pointIds));
55
+ const nodeDataClass = NodeConstructor.fromIdentifiers(nodeIdsDataClass);
56
+ const count = arrPoint.filter((point) => {
57
+ const nodeComponent = getComponentOfPointForStrGroupBy(point, strGroupBy);
58
+ return nodeDataClass.includes(nodeComponent);
59
+ }).length;
60
+ return count.toTree();
61
+ };
62
+ const getAnswer = (identifiers) => {
63
+ return getAnswerNode(identifiers).toTex();
64
+ };
65
+ const getHint = (identifiers) => {
66
+ const { strGroupBy, nodeIdsDataClass } = identifiers;
67
+ const nodeDataClass = NodeConstructor.fromIdentifiers(nodeIdsDataClass);
68
+ return `Compte le nombre de points qui ont $${getTexCondition(strGroupBy, nodeDataClass)}$.`;
69
+ };
70
+ const getCorrection = (identifiers) => {
71
+ const { strGroupBy, nodeIdsDataClass } = identifiers;
72
+ const nodeDataClass = NodeConstructor.fromIdentifiers(nodeIdsDataClass);
73
+ return `On compte le nombre de points qui ont $${getTexCondition(strGroupBy, nodeDataClass)}$.
74
+
75
+ Il y en a $${getAnswer(identifiers)}$.
76
+ `;
77
+ };
78
+ const getCorrectionGGBOptions = (identifiers) => {
79
+ const { pointIds, strGroupBy, nodeIdsDataClass } = identifiers;
80
+ const arrPoint = pointIds.map((pointIds) => PointConstructor.fromIdentifiers(pointIds));
81
+ const nodeDataClass = NodeConstructor.fromIdentifiers(nodeIdsDataClass);
82
+ const [arrPointFiltered, arrPointDropped] = arrPoint.reduce((acc, point) => {
83
+ const nodeComponent = getComponentOfPointForStrGroupBy(point, strGroupBy);
84
+ if (nodeDataClass.includes(nodeComponent)) {
85
+ acc[0].push(point);
86
+ }
87
+ else {
88
+ acc[1].push(point);
89
+ }
90
+ return acc;
91
+ }, [[], []]);
92
+ const commands = [
93
+ ...[arrPointFiltered, arrPointDropped].flatMap((arrPoint, i) => arrPoint.flatMap((point) => point.toGGBCommand({
94
+ isFixed: true,
95
+ isSelectionnable: true,
96
+ showLabel: false,
97
+ size: 6,
98
+ style: 3,
99
+ color: i % 2 === 0 ? greenMain : "#000000",
100
+ }))),
101
+ ...(() => {
102
+ switch (strGroupBy) {
103
+ case "x":
104
+ return [nodeDataClass].flatMap((nodeInterval, i) => {
105
+ return [
106
+ ...(() => {
107
+ const value = nodeInterval.a.evaluate();
108
+ return [
109
+ `l${i}l = Line((${value}, 0),(${value}, 1))`,
110
+ `SetColor(l${i}l, "${(() => {
111
+ switch (nodeInterval.closure) {
112
+ case ClosureType.FF:
113
+ case ClosureType.FO:
114
+ return orange;
115
+ case ClosureType.OF:
116
+ case ClosureType.OO:
117
+ return red;
118
+ }
119
+ })()}")`,
120
+ ];
121
+ })(),
122
+ ...(() => {
123
+ const value = nodeInterval.b.evaluate();
124
+ return [
125
+ `l${i}h = Line((${value}, 0),(${value}, 1))`,
126
+ `SetColor(l${i}h, "${(() => {
127
+ switch (nodeInterval.closure) {
128
+ case ClosureType.FF:
129
+ case ClosureType.OF:
130
+ return orange;
131
+ case ClosureType.FO:
132
+ case ClosureType.OO:
133
+ return red;
134
+ }
135
+ })()}")`,
136
+ ];
137
+ })(),
138
+ ];
139
+ });
140
+ case "y":
141
+ return [nodeDataClass].flatMap((nodeInterval, i) => {
142
+ return [
143
+ ...(() => {
144
+ const value = nodeInterval.a.evaluate();
145
+ return [
146
+ `l${i}l = Line((0, ${value}),(1,${value}))`,
147
+ `SetColor(l${i}l, "${(() => {
148
+ switch (nodeInterval.closure) {
149
+ case ClosureType.FF:
150
+ case ClosureType.FO:
151
+ return orange;
152
+ case ClosureType.OF:
153
+ case ClosureType.OO:
154
+ return red;
155
+ }
156
+ })()}")`,
157
+ ];
158
+ })(),
159
+ ...(() => {
160
+ const value = nodeInterval.b.evaluate();
161
+ return [
162
+ `l${i}h = Line((0, ${value}),(1,${value}))`,
163
+ `SetColor(l${i}h, "${(() => {
164
+ switch (nodeInterval.closure) {
165
+ case ClosureType.FF:
166
+ case ClosureType.OF:
167
+ return orange;
168
+ case ClosureType.FO:
169
+ case ClosureType.OO:
170
+ return red;
171
+ }
172
+ })()}")`,
173
+ ];
174
+ })(),
175
+ ];
176
+ });
177
+ default:
178
+ throw new Error("Unsupported strGroupBy: " + strGroupBy);
179
+ }
180
+ })(),
181
+ ];
182
+ const ggb = new GeogebraConstructor({
183
+ commands,
184
+ hideGrid: true,
185
+ fontSize: 16,
186
+ xAxis: {
187
+ showPositive: true,
188
+ label: "x",
189
+ steps: 1,
190
+ },
191
+ yAxis: {
192
+ showPositive: true,
193
+ label: "y",
194
+ steps: 1,
195
+ },
196
+ });
197
+ return ggb.getOptions({
198
+ coords: ggb.getAdaptedCoords({
199
+ xMin: -1,
200
+ xMax: 6,
201
+ yMin: -1,
202
+ yMax: 6,
203
+ }),
204
+ });
205
+ };
206
+ const getGGBOptions = (identifiers) => {
207
+ const { pointIds } = identifiers;
208
+ const arrPoint = pointIds.map((pointIds) => PointConstructor.fromIdentifiers(pointIds));
209
+ const commands = [
210
+ ...arrPoint.flatMap((point) => point.toGGBCommand({
211
+ isFixed: true,
212
+ isSelectionnable: true,
213
+ showLabel: false,
214
+ size: 5,
215
+ style: 3,
216
+ })),
217
+ ];
218
+ const ggb = new GeogebraConstructor({
219
+ commands,
220
+ hideGrid: false,
221
+ fontSize: 16,
222
+ xAxis: {
223
+ showPositive: true,
224
+ label: "x",
225
+ steps: 1,
226
+ },
227
+ yAxis: {
228
+ showPositive: true,
229
+ label: "y",
230
+ steps: 1,
231
+ },
232
+ });
233
+ return ggb.getOptions({
234
+ coords: ggb.getAdaptedCoords({
235
+ xMin: -1,
236
+ xMax: 6,
237
+ yMin: -1,
238
+ yMax: 6,
239
+ }),
240
+ });
241
+ };
242
+ const getPropositions = (n, { answer, ...identifiers }) => {
243
+ const { strGroupBy, nodeIdsDataClass } = identifiers;
244
+ const nodeDataClass = NodeConstructor.fromIdentifiers(nodeIdsDataClass);
245
+ const propositions = [];
246
+ addValidProp(propositions, answer);
247
+ const arrTerror = [answer];
248
+ //student: wrong groupBy
249
+ {
250
+ const identifiersWrong = {
251
+ ...identifiers,
252
+ strGroupBy: strGroupBy === "x" ? "y" : "x",
253
+ };
254
+ const texWrong = getAnswer(identifiersWrong);
255
+ tryToAddWrongProp(propositions, texWrong);
256
+ arrTerror.push(texWrong);
257
+ }
258
+ //student: wrong closure
259
+ {
260
+ [ClosureType.FF, ClosureType.FO, ClosureType.OF].forEach((closure) => {
261
+ const nodeDataClassWrong = new IntervalNode(nodeDataClass.a, nodeDataClass.b, closure);
262
+ const identifiersWrong = {
263
+ ...identifiers,
264
+ nodeIdsDataClass: nodeDataClassWrong.toIdentifiers(),
265
+ };
266
+ const texWrong = getAnswer(identifiersWrong);
267
+ tryToAddWrongProp(propositions, texWrong);
268
+ arrTerror.push(texWrong);
269
+ });
270
+ }
271
+ //filler
272
+ {
273
+ propWhile(propositions, n, () => {
274
+ const vTerrorTarget = parseInt(random(arrTerror));
275
+ const vTerrorAround = vTerrorTarget + randint(-5, 5);
276
+ if (vTerrorAround >= 0) {
277
+ tryToAddWrongProp(propositions, vTerrorAround.frenchify());
278
+ }
279
+ });
280
+ }
281
+ return shuffleProps(propositions, n);
282
+ };
283
+ const getKeys = () => {
284
+ return [];
285
+ };
286
+ const isAnswerValid = (ans, { answer }) => {
287
+ return numberVEA(ans, answer);
288
+ };
289
+ const getScatterPlotInterpretingQuestion = () => {
290
+ const length = 6;
291
+ const height = 6;
292
+ const arrArrDict1 = getCartesiansProducts([
293
+ [...Array(length).keys()].map((i) => i + 1),
294
+ [...Array(height).keys()].map((i) => i + 1),
295
+ ]).map(([x, y]) => {
296
+ return {
297
+ x,
298
+ y,
299
+ isActivated: probaFlip(0.14),
300
+ };
301
+ });
302
+ const arrArrDict2 = getCartesiansProducts([
303
+ [...Array(length - 1).keys()].map((i) => i + 1),
304
+ [...Array(height - 1).keys()].map((i) => i + 1),
305
+ ]).map(([x, y]) => {
306
+ return {
307
+ x: x + 0.333,
308
+ y: y + 0.333,
309
+ isActivated: probaFlip(0.14),
310
+ };
311
+ });
312
+ const arrArrDict3 = getCartesiansProducts([
313
+ [...Array(length - 1).keys()].map((i) => i + 1),
314
+ [...Array(height - 1).keys()].map((i) => i + 1),
315
+ ]).map(([x, y]) => {
316
+ return {
317
+ x: x + 0.666,
318
+ y: y + 0.666,
319
+ isActivated: probaFlip(0.14),
320
+ };
321
+ });
322
+ //at least one point should be activated
323
+ {
324
+ const dictRandom = random(arrArrDict1);
325
+ dictRandom.isActivated = true;
326
+ }
327
+ const arrPoint = [...arrArrDict1, ...arrArrDict2, ...arrArrDict3]
328
+ .filter(({ isActivated }) => isActivated)
329
+ .map(({ x, y }, i) => new Point(`P${i}`, x, y));
330
+ const strGroupBy = coinFlip() ? "x" : "y";
331
+ const nodeDataClass = (() => {
332
+ if (coinFlip()) {
333
+ const nodeV = randint(1, 1 + length).toTree();
334
+ return new IntervalNode(nodeV, nodeV, ClosureType.FF);
335
+ }
336
+ else {
337
+ const templateArrLengthDataClass = probaLawFlip([
338
+ [[1, 1, 1, 2], 0.2],
339
+ [[1, 2, 2], 0.4],
340
+ [[1, 1, 3], 0.3],
341
+ [[2, 3], 0.1],
342
+ ]);
343
+ const arrLengthDataClass = shuffle(templateArrLengthDataClass);
344
+ const arrDataClass = arrLengthDataClass.reduce((acc, lengthDataClass) => {
345
+ const nodeBoundLow = acc.nodeBoundLowWork;
346
+ const nodeBoundHigh = add(nodeBoundLow, lengthDataClass).simplify({
347
+ towardsDistribute: true,
348
+ });
349
+ const closure = random([
350
+ ClosureType.FF,
351
+ ClosureType.FO,
352
+ ClosureType.OF,
353
+ ]);
354
+ const nodeDataClass = new IntervalNode(nodeBoundLow, nodeBoundHigh, closure);
355
+ acc.dataClasses.push(nodeDataClass);
356
+ acc.nodeBoundLowWork = nodeBoundHigh;
357
+ return acc;
358
+ }, {
359
+ nodeBoundLowWork: (1).toTree(),
360
+ dataClasses: [],
361
+ }).dataClasses;
362
+ return random(arrDataClass);
363
+ }
364
+ })();
365
+ const identifiers = {
366
+ pointIds: arrPoint.map((point) => point.toIdentifiers()),
367
+ strGroupBy,
368
+ nodeIdsDataClass: nodeDataClass.toIdentifiers(),
369
+ };
370
+ return getQuestionFromIdentifiers(identifiers);
371
+ };
372
+ const getQuestionFromIdentifiers = (identifiers) => {
373
+ return {
374
+ instruction: getInstruction(identifiers),
375
+ answer: getAnswer(identifiers),
376
+ answerFormat: "tex",
377
+ keys: getKeys(identifiers),
378
+ identifiers,
379
+ hint: getHint(identifiers),
380
+ correction: getCorrection(identifiers),
381
+ correctionGgbOptions: getCorrectionGGBOptions(identifiers),
382
+ ggbOptions: getGGBOptions(identifiers),
383
+ };
384
+ };
385
+ export const scatterPlotInterpreting = {
386
+ id: "scatterPlotInterpreting",
387
+ label: "Interpréter un nuage de points",
388
+ isSingleStep: true,
389
+ generator: (nb, opts) => getDistinctQuestions(() => getScatterPlotInterpretingQuestion(opts), nb),
390
+ qcmTimer: 60,
391
+ freeTimer: 60,
392
+ subject: "Mathématiques",
393
+ getAnswer,
394
+ isAnswerValid,
395
+ getPropositions,
396
+ getInstruction,
397
+ getGGBOptions,
398
+ hasGeogebra: true,
399
+ getQuestionFromIdentifiers,
400
+ getHint,
401
+ getCorrection,
402
+ hasHintAndCorrection: true,
403
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"derivativeEquationSolving1.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/derivativeEquationSolving1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAYrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA6B7C,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,eAAe,CAAC;IAC9B,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,eAAe,EAAE,CAAC;CACjC,CAAC;AA6SF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAoCF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAerE,CAAC"}
1
+ {"version":3,"file":"derivativeEquationSolving1.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/derivativeEquationSolving1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAarC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA6B7C,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,eAAe,CAAC;IAC9B,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,eAAe,EAAE,CAAC;CACjC,CAAC;AA4SF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAoCF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAerE,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { defaultArrayedOptsWhereNeeded } from "../../../../exercises/utils/options/arrayedOptions.js";
3
4
  import { SetVEA } from "../../../../exercises/vea/setVEA.js";
4
5
  import { createIntegratedPolynomialNode, createNodeFPolynomialFromRoots, } from "../../../../math/utils/polynomial/polynomialUtils.js";
5
6
  import { randint } from "../../../../math/utils/random/randint.js";
@@ -223,8 +224,8 @@ const createRandomIdentifiers = (typeF) => {
223
224
  return identifiers;
224
225
  };
225
226
  const getDerivativeEquationSolving1Question = (optsIn) => {
226
- const arrayedOptions = optsIn ?? arrayedOptsDefault;
227
- const typeF = random(arrayedOptions.typeF);
227
+ const arrayedOpts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
228
+ const typeF = random(arrayedOpts.typeF);
228
229
  const identifiers = createRandomIdentifiers(typeF);
229
230
  return getQuestionFromIdentifiers(identifiers);
230
231
  };
@@ -1 +1 @@
1
- {"version":3,"file":"derivativeEquationSolving3.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/derivativeEquationSolving3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAarC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA6B7C,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,eAAe,CAAC;IAC9B,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AA6TF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAoCF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAerE,CAAC"}
1
+ {"version":3,"file":"derivativeEquationSolving3.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/derivativeEquationSolving3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAcrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA6B7C,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,eAAe,CAAC;IAC9B,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AA4TF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAoCF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAerE,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { defaultArrayedOptsWhereNeeded } from "../../../../exercises/utils/options/arrayedOptions.js";
3
4
  import { SetVEA } from "../../../../exercises/vea/setVEA.js";
4
5
  import { nodeBySubstitutingVar } from "../../../../math/utils/functions/functionComposition.js";
5
6
  import { createIntegratedPolynomialNode, createNodeFPolynomialFromRoots, } from "../../../../math/utils/polynomial/polynomialUtils.js";
@@ -236,8 +237,8 @@ const createRandomIdentifiers = (typeF) => {
236
237
  return identifiers;
237
238
  };
238
239
  const getDerivativeEquationSolving3Question = (optsIn) => {
239
- const arrayedOptions = optsIn ?? arrayedOptsDefault;
240
- const typeF = random(arrayedOptions.typeF);
240
+ const arrayedOpts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
241
+ const typeF = random(arrayedOpts.typeF);
241
242
  const identifiers = createRandomIdentifiers(typeF);
242
243
  return getQuestionFromIdentifiers(identifiers);
243
244
  };
@@ -1 +1 @@
1
- {"version":3,"file":"valueDerivativeFromFunctionExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAgF7C,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,eAAe,CAAC;IAC/B,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAqQF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAgDF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAC1D,WAAW,EACX,OAAO,CAoBR,CAAC"}
1
+ {"version":3,"file":"valueDerivativeFromFunctionExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAUrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAgF7C,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,eAAe,CAAC;IAC/B,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAoQF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAgDF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAC1D,WAAW,EACX,OAAO,CAoBR,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { addValidProp, tryToAddWrongProp, propWhile, shuffleProps, GeneratorOptionTarget, GeneratorOptionType, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { defaultArrayedOptsWhereNeeded } from "../../../../exercises/utils/options/arrayedOptions.js";
3
4
  import { AffineConstructor } from "../../../../math/polynomials/affine.js";
4
5
  import { PolynomialConstructor } from "../../../../math/polynomials/polynomial.js";
5
6
  import { TrinomConstructor } from "../../../../math/polynomials/trinom.js";
@@ -260,8 +261,8 @@ const createQCPassedIdentifiers = (typeF) => {
260
261
  return identifiers;
261
262
  };
262
263
  const getValueDerivativeFromFunctionExpressionQuestion = (optsIn) => {
263
- const arrayedOptions = optsIn ?? arrayedOptsDefault;
264
- const typeF = random(arrayedOptions.typeF);
264
+ const arrayedOpts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
265
+ const typeF = random(arrayedOpts.typeF);
265
266
  const identifiers = createQCPassedIdentifiers(typeF);
266
267
  return getQuestionFromIdentifiers(identifiers);
267
268
  };
@@ -1 +1 @@
1
- {"version":3,"file":"problemMaximizeProfitFindProduction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAIL,0BAA0B,EAC3B,MAAM,6DAA6D,CAAC;AAYrE,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAQ7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,MAAM,EAAE,0BAA0B,EAAE,CAAC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAqaF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAsBF,eAAO,MAAM,mCAAmC,EAAE,QAAQ,CACxD,WAAW,EACX,OAAO,CAoBR,CAAC"}
1
+ {"version":3,"file":"problemMaximizeProfitFindProduction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAQrC,OAAO,EAIL,0BAA0B,EAC3B,MAAM,6DAA6D,CAAC;AAYrE,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAQ7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,MAAM,EAAE,0BAA0B,EAAE,CAAC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAoaF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAsBF,eAAO,MAAM,mCAAmC,EAAE,QAAQ,CACxD,WAAW,EACX,OAAO,CAoBR,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { addValidProp, tryToAddWrongProp, propWhile, GeneratorOptionTarget, GeneratorOptionType, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { defaultArrayedOptsWhereNeeded } from "../../../../exercises/utils/options/arrayedOptions.js";
3
4
  import { numberVEA } from "../../../../exercises/vea/numberVEA.js";
4
5
  import { blueMain, orange, red } from "../../../../geogebra/colors.js";
5
6
  import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
@@ -294,8 +295,8 @@ const isIdentifiersQCPassed = (identifiers) => {
294
295
  return !isExploding(identifiers);
295
296
  };
296
297
  const getProblemMaximizeProfitFindProductionQuestion = (optsIn) => {
297
- const arrayedOptions = optsIn ?? arrayedOptsDefault;
298
- const typeF = random(arrayedOptions.typeF);
298
+ const arrayedOpts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
299
+ const typeF = random(arrayedOpts.typeF);
299
300
  let identifiers;
300
301
  let counter = -1;
301
302
  let isValid = false;
@@ -1 +1 @@
1
- {"version":3,"file":"problemMovementOnLineFindSpeedAtPoint.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA0E7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,oBAAoB,EAAE,eAAe,CAAC;IACtC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AA0RF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAoCF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAC1D,WAAW,EACX,OAAO,CAqBR,CAAC"}
1
+ {"version":3,"file":"problemMovementOnLineFindSpeedAtPoint.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAUrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA0E7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,oBAAoB,EAAE,eAAe,CAAC;IACtC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAyRF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAoCF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAC1D,WAAW,EACX,OAAO,CAqBR,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { addValidProp, tryToAddWrongProp, propWhile, GeneratorOptionTarget, GeneratorOptionType, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { defaultArrayedOptsWhereNeeded } from "../../../../exercises/utils/options/arrayedOptions.js";
3
4
  import { AffineConstructor } from "../../../../math/polynomials/affine.js";
4
5
  import { nodeBySubstitutingVar } from "../../../../math/utils/functions/functionComposition.js";
5
6
  import { getArrNodeCoeffOfPolynomialNode } from "../../../../math/utils/polynomial/polynomialUtils.js";
@@ -247,8 +248,8 @@ const isIdentifiersQCPassed = (identifiers) => {
247
248
  return !isExploding(identifiers);
248
249
  };
249
250
  const getProblemMovementOnLineFindSpeedAtPointQuestion = (optsIn) => {
250
- const arrayedOptions = optsIn ?? arrayedOptsDefault;
251
- const typeF = random(arrayedOptions.typeF);
251
+ const arrayedOpts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
252
+ const typeF = random(arrayedOpts.typeF);
252
253
  let identifiers;
253
254
  let counter = -1;
254
255
  let isValid = false;
@@ -1 +1 @@
1
- {"version":3,"file":"tangentEquationFromFunctionExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAUrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAgF7C,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,eAAe,CAAC;IAC/B,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAqXF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAgDF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAC1D,WAAW,EACX,OAAO,CAqBR,CAAC"}
1
+ {"version":3,"file":"tangentEquationFromFunctionExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAWrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAgF7C,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,eAAe,CAAC;IAC/B,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAoXF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAgDF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAC1D,WAAW,EACX,OAAO,CAqBR,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { addValidProp, tryToAddWrongProp, propWhile, shuffleProps, GeneratorOptionTarget, GeneratorOptionType, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { defaultArrayedOptsWhereNeeded } from "../../../../exercises/utils/options/arrayedOptions.js";
3
4
  import { polynomialVEA } from "../../../../exercises/vea/polynomialVEA.js";
4
5
  import { AffineConstructor } from "../../../../math/polynomials/affine.js";
5
6
  import { PolynomialConstructor } from "../../../../math/polynomials/polynomial.js";
@@ -253,7 +254,7 @@ const getPropositions = (n, { answer, ...identifiers }) => {
253
254
  ]);
254
255
  };
255
256
  const getKeys = () => {
256
- return [];
257
+ return ["x", "y", "equal"];
257
258
  };
258
259
  const isAnswerValid = (ans, { answer }) => {
259
260
  try {
@@ -305,8 +306,8 @@ const isIdentifiersQCPassed = (identifiers) => {
305
306
  return !isExploding(identifiers) && isVEAOk(identifiers);
306
307
  };
307
308
  const getTangentEquationFromFunctionExpressionQuestion = (optsIn) => {
308
- const arrayedOptions = optsIn ?? arrayedOptsDefault;
309
- const typeF = random(arrayedOptions.typeF);
309
+ const arrayedOpts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
310
+ const typeF = random(arrayedOpts.typeF);
310
311
  let identifiers;
311
312
  let isValid = false;
312
313
  let counter = -1;
@@ -1 +1 @@
1
- {"version":3,"file":"findAbscissaOfExtremaFromFunctionExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA4R7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA2LF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAoCF,eAAO,MAAM,2CAA2C,EAAE,QAAQ,CAChE,WAAW,EACX,OAAO,CAqBR,CAAC"}
1
+ {"version":3,"file":"findAbscissaOfExtremaFromFunctionExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA6R7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA0LF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAoCF,eAAO,MAAM,2CAA2C,EAAE,QAAQ,CAChE,WAAW,EACX,OAAO,CAqBR,CAAC"}
@@ -13,6 +13,7 @@ import { discreteSetParser } from "../../../../tree/parsers/discreteSetParser.js
13
13
  import { SetVEA } from "../../../../exercises/vea/setVEA.js";
14
14
  import { dividersOf } from "../../../../math/utils/arithmetic/dividersOf.js";
15
15
  import { probaFlip } from "../../../../utils/alea/probaFlip.js";
16
+ import { defaultArrayedOptsWhereNeeded } from "../../../../exercises/utils/options/arrayedOptions.js";
16
17
  const tryToSimplify = (node, simplifyOptions) => {
17
18
  try {
18
19
  return node.simplify(simplifyOptions);
@@ -353,9 +354,9 @@ const createRandomIdentifiers = (typeF, typeRoots) => {
353
354
  return identifiers;
354
355
  };
355
356
  const getFindAbscissaOfExtremaFromFunctionExpressionQuestion = (optsIn) => {
356
- const arrayedOptions = optsIn ?? arrayedOptsDefault;
357
- const typeF = random(arrayedOptions.typeF);
358
- const typeRoots = random(arrayedOptions.typeRoots);
357
+ const arrayedOpts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
358
+ const typeF = random(arrayedOpts.typeF);
359
+ const typeRoots = random(arrayedOpts.typeRoots);
359
360
  const identifiers = createRandomIdentifiers(typeF, typeRoots);
360
361
  return getQuestionFromIdentifiers(identifiers);
361
362
  };
@@ -1 +1 @@
1
- {"version":3,"file":"findExtremaFromFunctionExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/findExtremaFromFunctionExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAkS7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAiSF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAoCF,eAAO,MAAM,iCAAiC,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAqB1E,CAAC"}
1
+ {"version":3,"file":"findExtremaFromFunctionExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/findExtremaFromFunctionExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAmS7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAiSF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAqCF,eAAO,MAAM,iCAAiC,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAqB1E,CAAC"}
@@ -19,6 +19,7 @@ import { NodeUtils } from "../../../../tree/utilities/nodeUtils.js";
19
19
  import { add } from "../../../../tree/nodes/operators/addNode.js";
20
20
  import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
21
21
  import { power } from "../../../../tree/nodes/operators/powerNode.js";
22
+ import { defaultArrayedOptsWhereNeeded } from "../../../../exercises/utils/options/arrayedOptions.js";
22
23
  const tryToSimplify = (node, simplifyOptions) => {
23
24
  try {
24
25
  return node.simplify(simplifyOptions);
@@ -415,9 +416,9 @@ const isIdentifiersQCPassed = (identifiers) => {
415
416
  return isSolutionPrettyAndNotExploding(identifiers) && isVEAOk(identifiers);
416
417
  };
417
418
  const getFindExtremaFromFunctionExpressionQuestion = (optsIn) => {
418
- const arrayedOptions = optsIn ?? arrayedOptsDefault;
419
- const typeF = random(arrayedOptions.typeF);
420
- const typeRoots = random(arrayedOptions.typeRoots);
419
+ const arrayedOpts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
420
+ const typeF = random(arrayedOpts.typeF);
421
+ const typeRoots = random(arrayedOpts.typeRoots);
421
422
  let identifiers;
422
423
  let isValid = false;
423
424
  let counter = -1;
@@ -1 +1 @@
1
- {"version":3,"file":"plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAQtC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA6J7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,eAAe,EAAE,eAAe,EAAE,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAubF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAoCF,eAAO,MAAM,iEAAiE,EAAE,QAAQ,CACtF,WAAW,EACX,OAAO,CAuBR,CAAC"}
1
+ {"version":3,"file":"plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAQtC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA6J7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,eAAe,EAAE,eAAe,EAAE,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAqbF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAoCF,eAAO,MAAM,iEAAiE,EAAE,QAAQ,CACtF,WAAW,EACX,OAAO,CAuBR,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { GeneratorOptionTarget, GeneratorOptionType, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { defaultArrayedOptsWhereNeeded } from "../../../../exercises/utils/options/arrayedOptions.js";
3
4
  import { blueMain, greenMain } from "../../../../geogebra/colors.js";
4
5
  import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
5
6
  import { ggbPointToCoords } from "../../../../geogebra/parsers/ggbPointToCoords.js";
@@ -313,8 +314,8 @@ const isGGBAnswerValid = (ggbAns, { ggbAnswer: _ggbAnswer, ...identifiers }) =>
313
314
  }
314
315
  };
315
316
  const getPlausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomialQuestion = (optsIn) => {
316
- const arrayedOptions = optsIn ?? arrayedOptsDefault;
317
- const typeF = random(arrayedOptions.typeF);
317
+ const arrayedOpts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
318
+ const typeF = random(arrayedOpts.typeF);
318
319
  const [arrX, nodeF] = (() => {
319
320
  let arrX;
320
321
  let nodeF;