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.
- package/lib/exercises/math/calcul/decimals/decimalFractionToDecimal.d.ts.map +1 -1
- package/lib/exercises/math/calcul/decimals/decimalFractionToDecimal.js +5 -4
- package/lib/exercises/math/calculLitteral/equation/factorizeEquation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/factorizeEquation.js +9 -8
- package/lib/exercises/math/calculLitteral/equation/isEqualityTrue.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/isEqualityTrue.js +7 -6
- package/lib/exercises/math/dataRepresentations/barChartInterpreting.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/barChartInterpreting.js +5 -4
- package/lib/exercises/math/dataRepresentations/scatterPlot/index.d.ts +6 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/index.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/index.js +5 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotBuildScatterPlotFromDataTable.d.ts +12 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotBuildScatterPlotFromDataTable.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotBuildScatterPlotFromDataTable.js +206 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotCommenting.d.ts +9 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotCommenting.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotCommenting.js +210 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableFromScatterPlotData.d.ts +10 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableFromScatterPlotData.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableFromScatterPlotData.js +252 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableWithDataClassesFromScatterPlotData.d.ts +12 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableWithDataClassesFromScatterPlotData.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableWithDataClassesFromScatterPlotData.js +352 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotInterpreting.d.ts +11 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotInterpreting.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotInterpreting.js +403 -0
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.js +3 -2
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.js +3 -2
- package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.js +3 -2
- package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.d.ts.map +1 -1
- package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.js +3 -2
- package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.d.ts.map +1 -1
- package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.js +3 -2
- package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.d.ts.map +1 -1
- package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.js +4 -3
- package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.d.ts.map +1 -1
- package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.js +4 -3
- package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.d.ts.map +1 -1
- package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.js +4 -3
- package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.d.ts.map +1 -1
- package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.js +3 -2
- package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.d.ts.map +1 -1
- package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.js +3 -2
- package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.d.ts.map +1 -1
- package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.js +8 -4
- package/lib/exercises/math/functions/affines/affineCompareTwoImagesFromVariations.d.ts +13 -0
- package/lib/exercises/math/functions/affines/affineCompareTwoImagesFromVariations.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/affineCompareTwoImagesFromVariations.js +205 -0
- package/lib/exercises/math/functions/affines/affineVarTableOnBoundedInterval.d.ts +9 -0
- package/lib/exercises/math/functions/affines/affineVarTableOnBoundedInterval.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/affineVarTableOnBoundedInterval.js +157 -0
- package/lib/exercises/math/functions/affines/affineVariations.d.ts +12 -0
- package/lib/exercises/math/functions/affines/affineVariations.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/affineVariations.js +176 -0
- package/lib/exercises/math/functions/affines/affineVariationsFromGraph.d.ts +8 -0
- package/lib/exercises/math/functions/affines/affineVariationsFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/affineVariationsFromGraph.js +203 -0
- package/lib/exercises/math/functions/affines/affineVariationsFromTwoImages.d.ts +12 -0
- package/lib/exercises/math/functions/affines/affineVariationsFromTwoImages.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/affineVariationsFromTwoImages.js +259 -0
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.js +8 -6
- package/lib/exercises/math/functions/exponentials/estimateExponentialFunctionImageFromGeometricScatterplot.d.ts +2 -0
- package/lib/exercises/math/functions/exponentials/estimateExponentialFunctionImageFromGeometricScatterplot.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/estimateExponentialFunctionImageFromGeometricScatterplot.js +155 -0
- package/lib/exercises/math/functions/exponentials/exponentialFunctionImage.d.ts +9 -0
- package/lib/exercises/math/functions/exponentials/exponentialFunctionImage.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/exponentialFunctionImage.js +99 -0
- package/lib/exercises/math/functions/exponentials/exponentialsRawVariations.d.ts +8 -0
- package/lib/exercises/math/functions/exponentials/exponentialsRawVariations.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/exponentialsRawVariations.js +99 -0
- package/lib/exercises/math/functions/exponentials/index.d.ts +8 -0
- package/lib/exercises/math/functions/exponentials/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponentials/index.js +9 -0
- package/lib/exercises/math/functions/exponentials/plausibleExponentialFunctionExpressionFromGraph.d.ts +12 -0
- package/lib/exercises/math/functions/exponentials/plausibleExponentialFunctionExpressionFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/plausibleExponentialFunctionExpressionFromGraph.js +138 -0
- package/lib/exercises/math/functions/exponentials/readExponentialFunctionParamsOnGraph.d.ts +8 -0
- package/lib/exercises/math/functions/exponentials/readExponentialFunctionParamsOnGraph.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/readExponentialFunctionParamsOnGraph.js +142 -0
- package/lib/exercises/math/functions/exponentials/realPowersFraction.d.ts +10 -0
- package/lib/exercises/math/functions/exponentials/realPowersFraction.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/realPowersFraction.js +125 -0
- package/lib/exercises/math/functions/exponentials/realPowersMixOperations.d.ts +12 -0
- package/lib/exercises/math/functions/exponentials/realPowersMixOperations.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/realPowersMixOperations.js +148 -0
- package/lib/exercises/math/functions/exponentials/realPowersPower.d.ts +10 -0
- package/lib/exercises/math/functions/exponentials/realPowersPower.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/realPowersPower.js +128 -0
- package/lib/exercises/math/functions/exponentials/realPowersProduct.d.ts +10 -0
- package/lib/exercises/math/functions/exponentials/realPowersProduct.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/realPowersProduct.js +128 -0
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLineV2.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLineV2.js +7 -6
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.js +3 -2
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.js +7 -6
- package/lib/exercises/math/percent/percentToDecimal.d.ts.map +1 -1
- package/lib/exercises/math/percent/percentToDecimal.js +5 -4
- package/lib/exercises/math/probaStat/basicStats/calculateFrequencyInList.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/basicStats/calculateFrequencyInList.js +5 -4
- package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaFromTableWithContext.js +7 -8
- package/lib/exercises/math/probaStat/stats1var/medianWithList.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/medianWithList.js +5 -4
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.js +9 -9
- package/lib/exercises/math/sequences/geometric/geometricFindNextTermFromTwoConsecutiveTerms.d.ts +12 -0
- package/lib/exercises/math/sequences/geometric/geometricFindNextTermFromTwoConsecutiveTerms.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/geometricFindNextTermFromTwoConsecutiveTerms.js +217 -0
- package/lib/exercises/math/sequences/geometric/geometricFindRecurrenceFormula.d.ts +10 -0
- package/lib/exercises/math/sequences/geometric/geometricFindRecurrenceFormula.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/geometricFindRecurrenceFormula.js +186 -0
- package/lib/exercises/math/sequences/geometric/graph/geometricPlaceFirstPoints.d.ts +14 -0
- package/lib/exercises/math/sequences/geometric/graph/geometricPlaceFirstPoints.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/graph/geometricPlaceFirstPoints.js +189 -0
- package/lib/exercises/math/sequences/geometric/graph/index.d.ts +2 -0
- package/lib/exercises/math/sequences/geometric/graph/index.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/graph/index.js +1 -0
- package/lib/exercises/utils/options/arrayedOptions.d.ts +2 -0
- package/lib/exercises/utils/options/arrayedOptions.d.ts.map +1 -0
- package/lib/exercises/utils/options/arrayedOptions.js +16 -0
- package/lib/index.d.ts +33 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts.map +1 -1
- package/lib/math/utils/sequences/situations/seqArithmeticSituations.js +20 -20
- package/lib/tree/nodes/algebraicNode.d.ts +3 -0
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +5 -3
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +5 -3
- package/lib/tree/nodes/operators/powerNode.js +1 -1
- 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;
|
|
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
|
|
227
|
-
const typeF = random(
|
|
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;
|
|
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
|
|
240
|
-
const typeF = random(
|
|
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
|
};
|
package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.d.ts.map
CHANGED
|
@@ -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;
|
|
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
|
|
264
|
-
const typeF = random(
|
|
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;
|
|
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
|
|
298
|
-
const typeF = random(
|
|
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;
|
package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.d.ts.map
CHANGED
|
@@ -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;
|
|
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
|
|
251
|
-
const typeF = random(
|
|
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;
|
package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.d.ts.map
CHANGED
|
@@ -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;
|
|
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
|
|
309
|
-
const typeF = random(
|
|
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;
|
|
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"}
|
package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.js
CHANGED
|
@@ -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
|
|
357
|
-
const typeF = random(
|
|
358
|
-
const typeRoots = random(
|
|
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;
|
|
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
|
|
419
|
-
const typeF = random(
|
|
420
|
-
const typeRoots = random(
|
|
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;
|
|
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
|
|
317
|
-
const typeF = random(
|
|
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;
|