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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decimalFractionToDecimal.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/decimals/decimalFractionToDecimal.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"decimalFractionToDecimal.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/decimals/decimalFractionToDecimal.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAqBrC,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AA+PF,KAAK,OAAO,GAAG;IACb,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AA4BF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgBnE,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, shuffleProps, 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 { Decimal } from "../../../../math/numbers/decimals/decimal.js";
|
|
4
5
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
5
6
|
import { isNumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
|
|
@@ -167,9 +168,9 @@ const isAnswerValid = (ans, { answer, isFractionToDigital, nb }) => {
|
|
|
167
168
|
}
|
|
168
169
|
};
|
|
169
170
|
const getDecimalFractionToDecimalQuestion = (optsIn) => {
|
|
170
|
-
const
|
|
171
|
+
const arrayedOpts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
|
|
171
172
|
const opts = {
|
|
172
|
-
conversionType: random(
|
|
173
|
+
conversionType: random(arrayedOpts.conversionType),
|
|
173
174
|
};
|
|
174
175
|
const isFractionToDigital = opts.conversionType === "Fraction vers nombre à virgule";
|
|
175
176
|
const nb = (() => {
|
|
@@ -205,7 +206,7 @@ const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
|
205
206
|
};
|
|
206
207
|
return question;
|
|
207
208
|
};
|
|
208
|
-
const
|
|
209
|
+
const arrayedOptsDefault = {
|
|
209
210
|
conversionType: [
|
|
210
211
|
"Fraction vers nombre à virgule",
|
|
211
212
|
"Nombre à virgule vers fraction",
|
|
@@ -221,7 +222,7 @@ const options = [
|
|
|
221
222
|
"Fraction vers nombre à virgule",
|
|
222
223
|
"Nombre à virgule vers fraction",
|
|
223
224
|
],
|
|
224
|
-
defaultValue:
|
|
225
|
+
defaultValue: arrayedOptsDefault.conversionType,
|
|
225
226
|
},
|
|
226
227
|
];
|
|
227
228
|
export const decimalFractionToDecimal = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factorizeEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/factorizeEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"factorizeEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/factorizeEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AA0CrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,OAAO,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAsRF,KAAK,OAAO,GAAG;IACb,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC;AAsBF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAyB5D,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { addValidProp, shuffleProps, 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 { SetVEA } from "../../../../exercises/vea/setVEA.js";
|
|
4
5
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
5
6
|
import { EquationSolutionNode } from "../../../../tree/nodes/equations/equationSolutionNode.js";
|
|
@@ -33,7 +34,7 @@ const getTexForEquationSolutionNode = (nodeAnswer, opts) => {
|
|
|
33
34
|
}
|
|
34
35
|
};
|
|
35
36
|
const getPropositions = (n, { answer, ...identifiers }, optsIn) => {
|
|
36
|
-
const opts = optsIn
|
|
37
|
+
const opts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
|
|
37
38
|
const { a, isSum, b } = identifiers;
|
|
38
39
|
const propositions = [];
|
|
39
40
|
addValidProp(propositions, answer);
|
|
@@ -65,7 +66,7 @@ const getAnswerNode = (identifiers) => {
|
|
|
65
66
|
return nodeAnswer;
|
|
66
67
|
};
|
|
67
68
|
const getAnswer = (identifiers, optsIn) => {
|
|
68
|
-
const opts = optsIn
|
|
69
|
+
const opts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
|
|
69
70
|
const answerNode = getAnswerNode(identifiers);
|
|
70
71
|
return getTexForEquationSolutionNode(answerNode, opts);
|
|
71
72
|
};
|
|
@@ -95,7 +96,7 @@ ${left.toTex()} = ${multiply(isSum ? -1 : 1, right).toTex()} \\iff ${eq
|
|
|
95
96
|
$$`;
|
|
96
97
|
};
|
|
97
98
|
const getCorrection = (identifiers, optsIn) => {
|
|
98
|
-
const opts = optsIn
|
|
99
|
+
const opts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
|
|
99
100
|
const answerInputTypeDefault = "S={...;...}";
|
|
100
101
|
const answerInputType = opts.answerInputTypes.includes(answerInputTypeDefault)
|
|
101
102
|
? answerInputTypeDefault
|
|
@@ -138,7 +139,7 @@ ${getAnswer(identifiers, opts)}
|
|
|
138
139
|
$$`;
|
|
139
140
|
};
|
|
140
141
|
const getKeys = (_, optsIn) => {
|
|
141
|
-
const opts = optsIn
|
|
142
|
+
const opts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
|
|
142
143
|
const { answerInputTypes } = opts;
|
|
143
144
|
return [
|
|
144
145
|
...answerInputTypes.reduce((acc, answerInputType) => {
|
|
@@ -164,7 +165,7 @@ const getKeys = (_, optsIn) => {
|
|
|
164
165
|
];
|
|
165
166
|
};
|
|
166
167
|
const isAnswerValid = (ans, { answer: _, ...identifiers }, optsIn) => {
|
|
167
|
-
const opts = optsIn
|
|
168
|
+
const opts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
|
|
168
169
|
const answerNode = getAnswerNode(identifiers);
|
|
169
170
|
const arrNodeAnswer = answerNode.solutionsSet.elements;
|
|
170
171
|
function getParsedNodesForAnswerInputType(ans, answerInputType) {
|
|
@@ -209,7 +210,7 @@ const isAnswerValid = (ans, { answer: _, ...identifiers }, optsIn) => {
|
|
|
209
210
|
return opts.answerInputTypes.some((answerInputType) => isAnswerValidForAnswerInputType(answerInputType));
|
|
210
211
|
};
|
|
211
212
|
const getFactorizeEquationQuestion = (optsIn) => {
|
|
212
|
-
const opts = optsIn
|
|
213
|
+
const opts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
|
|
213
214
|
const a = randint(1, 10);
|
|
214
215
|
const b = randint(1, 10);
|
|
215
216
|
const isSum = coinFlip();
|
|
@@ -228,7 +229,7 @@ const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
|
228
229
|
options: opts,
|
|
229
230
|
};
|
|
230
231
|
};
|
|
231
|
-
const
|
|
232
|
+
const arrayedOptsDefault = {
|
|
232
233
|
answerInputTypes: ["x=... ou x=...", "S={...;...}"],
|
|
233
234
|
};
|
|
234
235
|
const options = [
|
|
@@ -238,7 +239,7 @@ const options = [
|
|
|
238
239
|
target: GeneratorOptionTarget.generation,
|
|
239
240
|
type: GeneratorOptionType.multiselect,
|
|
240
241
|
values: ["x=... ou x=...", "S={...;...}"],
|
|
241
|
-
defaultValue:
|
|
242
|
+
defaultValue: arrayedOptsDefault.answerInputTypes,
|
|
242
243
|
},
|
|
243
244
|
];
|
|
244
245
|
export const factorizeEquation = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isEqualityTrue.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/isEqualityTrue.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"isEqualityTrue.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/isEqualityTrue.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAQrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAkB7C,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAChD,YAAY,EAAE,eAAe,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAgUF,KAAK,OAAO,GAAG;IACb,SAAS,EAAE,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;IAC7C,aAAa,EAAE,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;CAClD,CAAC;AA6BF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkB1D,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { addValidProp, tryToAddWrongProp, 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 { nodeBySubstitutingVar } from "../../../../math/utils/functions/functionComposition.js";
|
|
4
5
|
import { randfloat } from "../../../../math/utils/random/randfloat.js";
|
|
5
6
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
@@ -102,10 +103,10 @@ const getKeys = () => {
|
|
|
102
103
|
return [];
|
|
103
104
|
};
|
|
104
105
|
const getIsEqualityTrue1Question = (optsIn) => {
|
|
105
|
-
const
|
|
106
|
+
const arrayedOpts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
|
|
106
107
|
const opts = {
|
|
107
|
-
typeCoeff: random(
|
|
108
|
-
typeTestValue: random(
|
|
108
|
+
typeCoeff: random(arrayedOpts.typeCoeff),
|
|
109
|
+
typeTestValue: random(arrayedOpts.typeTestValue),
|
|
109
110
|
};
|
|
110
111
|
const roundDecimalTo = 1;
|
|
111
112
|
const varName = random(varNames);
|
|
@@ -272,7 +273,7 @@ const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
|
272
273
|
};
|
|
273
274
|
return question;
|
|
274
275
|
};
|
|
275
|
-
const
|
|
276
|
+
const arrayedOptsDefault = {
|
|
276
277
|
typeCoeff: ["Entier"],
|
|
277
278
|
typeTestValue: ["Entier", "Fraction", "Décimal"],
|
|
278
279
|
};
|
|
@@ -283,7 +284,7 @@ const options = [
|
|
|
283
284
|
target: GeneratorOptionTarget.generation,
|
|
284
285
|
type: GeneratorOptionType.multiselect,
|
|
285
286
|
values: ["Entier", "Fraction", "Décimal"],
|
|
286
|
-
defaultValue:
|
|
287
|
+
defaultValue: arrayedOptsDefault.typeCoeff,
|
|
287
288
|
},
|
|
288
289
|
{
|
|
289
290
|
id: "typeTestValue",
|
|
@@ -291,7 +292,7 @@ const options = [
|
|
|
291
292
|
target: GeneratorOptionTarget.generation,
|
|
292
293
|
type: GeneratorOptionType.multiselect,
|
|
293
294
|
values: ["Entier", "Fraction", "Décimal"],
|
|
294
|
-
defaultValue:
|
|
295
|
+
defaultValue: arrayedOptsDefault.typeTestValue,
|
|
295
296
|
},
|
|
296
297
|
];
|
|
297
298
|
export const isEqualityTrue1 = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"barChartInterpreting.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/barChartInterpreting.ts"],"names":[],"mappings":"AAAA,OAAO,EAYL,QAAQ,EAKT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"barChartInterpreting.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/barChartInterpreting.ts"],"names":[],"mappings":"AAAA,OAAO,EAYL,QAAQ,EAKT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,cAAc,GAAG,cAAc,CAAC;IACtC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,UAAU,GAAG;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,aAAa,GAAG,UAAU,GAAG,SAAS,CAAC;AAE5C,KAAK,QAAQ,GAAG;IACd,KAAK,EAAE,aAAa,CAAC;IACrB,KAAK,EAAE,aAAa,CAAC;CACtB,CAAC;AAEF,KAAK,QAAQ,GAAG;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,GAAG,GAAG;IACT,KAAK,EAAE,QAAQ,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;AAEF,KAAK,QAAQ,GAAG;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,UAAU,EAAE,QAAQ,EAAE,CAAC;CACxB,CAAC;AA4tBF,KAAK,OAAO,GAAG;IACb,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAsBF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAe/D,CAAC"}
|
|
@@ -8,6 +8,7 @@ import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuesti
|
|
|
8
8
|
import { randint } from "../../../math/utils/random/randint.js";
|
|
9
9
|
import { GeogebraConstructor } from "../../../geogebra/geogebraConstructor.js";
|
|
10
10
|
import { capitalize } from "../../../utils/strings/capitalize.js";
|
|
11
|
+
import { defaultArrayedOptsWhereNeeded } from "../../../exercises/utils/options/arrayedOptions.js";
|
|
11
12
|
class BarChartConstructor {
|
|
12
13
|
static stylesPools = {
|
|
13
14
|
color: [
|
|
@@ -427,9 +428,9 @@ const getGGBOptions = (identifiers, opts) => {
|
|
|
427
428
|
}
|
|
428
429
|
};
|
|
429
430
|
const getBarChartInterpretingQuestion = (optsIn) => {
|
|
430
|
-
const
|
|
431
|
+
const arrayedOpts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
|
|
431
432
|
const opts = {
|
|
432
|
-
displayType: random(
|
|
433
|
+
displayType: random(arrayedOpts.displayType),
|
|
433
434
|
};
|
|
434
435
|
const styleType = "color";
|
|
435
436
|
const displayType = opts.displayType;
|
|
@@ -512,7 +513,7 @@ const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
|
512
513
|
};
|
|
513
514
|
return question;
|
|
514
515
|
};
|
|
515
|
-
const
|
|
516
|
+
const arrayedOptsDefault = {
|
|
516
517
|
displayType: ["faisceaux", "empilements"],
|
|
517
518
|
};
|
|
518
519
|
const options = [
|
|
@@ -522,7 +523,7 @@ const options = [
|
|
|
522
523
|
target: GeneratorOptionTarget.generation,
|
|
523
524
|
type: GeneratorOptionType.multiselect,
|
|
524
525
|
values: ["faisceaux", "empilements"],
|
|
525
|
-
defaultValue:
|
|
526
|
+
defaultValue: arrayedOptsDefault.displayType,
|
|
526
527
|
},
|
|
527
528
|
];
|
|
528
529
|
export const barChartInterpreting = {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from "./scatterPlotCommenting.js";
|
|
2
|
+
export * from "./scatterPlotFillDataTableFromScatterPlotData.js";
|
|
3
|
+
export * from "./scatterPlotFillDataTableWithDataClassesFromScatterPlotData.js";
|
|
4
|
+
export * from "./scatterPlotInterpreting.js";
|
|
5
|
+
export * from "./scatterPlotBuildScatterPlotFromDataTable.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/dataRepresentations/scatterPlot/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kDAAkD,CAAC;AACjE,cAAc,iEAAiE,CAAC;AAChF,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+CAA+C,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from "./scatterPlotCommenting.js";
|
|
2
|
+
export * from "./scatterPlotFillDataTableFromScatterPlotData.js";
|
|
3
|
+
export * from "./scatterPlotFillDataTableWithDataClassesFromScatterPlotData.js";
|
|
4
|
+
export * from "./scatterPlotInterpreting.js";
|
|
5
|
+
export * from "./scatterPlotBuildScatterPlotFromDataTable.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
isRowBased: boolean;
|
|
5
|
+
rowBasedDataTable: string[][];
|
|
6
|
+
indexX: number;
|
|
7
|
+
indexY: number;
|
|
8
|
+
arrCoordsAsNodeIds: NodeIdentifiers[][];
|
|
9
|
+
};
|
|
10
|
+
export declare const scatterPlotBuildScatterPlotFromDataTable: Exercise<Identifiers>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=scatterPlotBuildScatterPlotFromDataTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scatterPlotBuildScatterPlotFromDataTable.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/dataRepresentations/scatterPlot/scatterPlotBuildScatterPlotFromDataTable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAUrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAQ7C,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,iBAAiB,EAAE,MAAM,EAAE,EAAE,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,eAAe,EAAE,EAAE,CAAC;CACzC,CAAC;AA0QF,eAAO,MAAM,wCAAwC,EAAE,QAAQ,CAAC,WAAW,CAoB1E,CAAC"}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { randomDataTable } from "../../../../exercises/utils/data/randomDataTable.js";
|
|
2
|
+
import { toolBarConstructor } from "../../../../exercises/utils/geogebra/toolBarConstructor.js";
|
|
3
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
4
|
+
import { greenMain } from "../../../../geogebra/colors.js";
|
|
5
|
+
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
6
|
+
import { GeogebraParser } from "../../../../geogebra/parsers/geogebraParser.js";
|
|
7
|
+
import { Point } from "../../../../math/geometry/point.js";
|
|
8
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
9
|
+
import { NodeConstructor, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
10
|
+
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
11
|
+
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
12
|
+
import { randomMany } from "../../../../utils/alea/random.js";
|
|
13
|
+
import { transpose } from "../../../../utils/arrays/transpose.js";
|
|
14
|
+
import { mdTable } from "../../../../utils/markdown/mdTable.js";
|
|
15
|
+
import { joinanded } from "../../../../utils/strings/joinanded.js";
|
|
16
|
+
const getStrGraphName = (identifiers) => {
|
|
17
|
+
const { rowBasedDataTable, indexX, indexY } = identifiers;
|
|
18
|
+
const [nameTexX, nameTexY] = [indexX, indexY].map((i) => rowBasedDataTable[i][0]);
|
|
19
|
+
const graphName = `${nameTexY} en fonction de ${nameTexX}`;
|
|
20
|
+
return graphName;
|
|
21
|
+
};
|
|
22
|
+
const getDataTable = (identifiers) => {
|
|
23
|
+
const { isRowBased, rowBasedDataTable } = identifiers;
|
|
24
|
+
return isRowBased ? rowBasedDataTable : transpose(rowBasedDataTable);
|
|
25
|
+
};
|
|
26
|
+
const getInstruction = (identifiers) => {
|
|
27
|
+
return `À partir du tableau de données ci-dessous, construire le nuage de points "${getStrGraphName(identifiers)}".
|
|
28
|
+
|
|
29
|
+
${mdTable(getDataTable(identifiers))}
|
|
30
|
+
|
|
31
|
+
`;
|
|
32
|
+
};
|
|
33
|
+
const getHint = () => {
|
|
34
|
+
return `Quand on construit un nuage de points "$u$ en fonction de $v$", $u$ se lira sur l'axe des ordonnées et $v$ sur l'axe des abscisses.`;
|
|
35
|
+
};
|
|
36
|
+
const getCorrection = (identifiers) => {
|
|
37
|
+
const { rowBasedDataTable, indexX, indexY } = identifiers;
|
|
38
|
+
const [nameTexX, nameTexY] = [indexX, indexY].map((i) => rowBasedDataTable[i][0]);
|
|
39
|
+
const solutionPoints = getSolutionPoints(identifiers);
|
|
40
|
+
return `On place chaque point de coordonnées (${nameTexX};${nameTexY}).
|
|
41
|
+
|
|
42
|
+
On place donc les points de coordonnées ${joinanded(solutionPoints.map((p) => `$(${p.x.toTex()};${p.y.toTex()})$`), ", ", " et ")}.`;
|
|
43
|
+
};
|
|
44
|
+
const getSolutionPoints = (identifiers) => {
|
|
45
|
+
const { arrCoordsAsNodeIds } = identifiers;
|
|
46
|
+
const arrCoordsAsNodes = arrCoordsAsNodeIds.map(([nodeIdsX, nodeIdsY]) => [nodeIdsX, nodeIdsY].map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds)));
|
|
47
|
+
return arrCoordsAsNodes.map(([nodeX, nodeY], i) => {
|
|
48
|
+
return new Point(`S_${i}`, nodeX, nodeY);
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
const getGGBAnswer = (identifiers) => {
|
|
52
|
+
const solutionPoints = getSolutionPoints(identifiers);
|
|
53
|
+
return [
|
|
54
|
+
...solutionPoints.flatMap((point) => point.toGGBCommand({ color: `${greenMain}`, showLabel: false })),
|
|
55
|
+
];
|
|
56
|
+
};
|
|
57
|
+
const getStudentGGBOptions = (identifiers) => {
|
|
58
|
+
const { indexX, indexY, rowBasedDataTable } = identifiers;
|
|
59
|
+
const [nameTexX, nameTexY] = [indexX, indexY].map((i) => rowBasedDataTable[i][0]);
|
|
60
|
+
const ggb = new GeogebraConstructor({
|
|
61
|
+
commands: [],
|
|
62
|
+
customToolBar: toolBarConstructor({
|
|
63
|
+
point: true,
|
|
64
|
+
}),
|
|
65
|
+
forbidShiftDragZoom: true,
|
|
66
|
+
xAxis: {
|
|
67
|
+
label: nameTexX,
|
|
68
|
+
steps: 1,
|
|
69
|
+
},
|
|
70
|
+
yAxis: {
|
|
71
|
+
label: nameTexY,
|
|
72
|
+
steps: 1,
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
return ggb.getOptions({
|
|
76
|
+
coords: [-1, 7, -1, 7],
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
const isGGBAnswerValid = (ans, { ggbAnswer, ...identifiers }) => {
|
|
80
|
+
const commands = ans;
|
|
81
|
+
const ggbParser = new GeogebraParser(commands);
|
|
82
|
+
const objectDict = ggbParser.objectDict();
|
|
83
|
+
const pointsCoords = Object.keys(objectDict).map((name) => ggbParser.pointCoords(name));
|
|
84
|
+
const pointsCoordsSortedByAscXSortedByAscY = pointsCoords
|
|
85
|
+
.toSorted(([x1], [x2]) => {
|
|
86
|
+
return x1 - x2;
|
|
87
|
+
})
|
|
88
|
+
.toSorted(([_x1, y1], [_x2, y2]) => {
|
|
89
|
+
return y1 - y2;
|
|
90
|
+
});
|
|
91
|
+
const solutionPointsSortedByAscXSortedByAscY = getSolutionPoints(identifiers)
|
|
92
|
+
.toSorted((p1, p2) => {
|
|
93
|
+
return p1.x.evaluate() - p2.x.evaluate();
|
|
94
|
+
})
|
|
95
|
+
.toSorted((p1, p2) => {
|
|
96
|
+
return p1.y.evaluate() - p2.y.evaluate();
|
|
97
|
+
});
|
|
98
|
+
return (pointsCoordsSortedByAscXSortedByAscY.length ===
|
|
99
|
+
solutionPointsSortedByAscXSortedByAscY.length &&
|
|
100
|
+
pointsCoordsSortedByAscXSortedByAscY.every(([x, y], i) => {
|
|
101
|
+
const studentPoint = new Point("StudentPoint", x, y);
|
|
102
|
+
const solutionPoint = solutionPointsSortedByAscXSortedByAscY[i];
|
|
103
|
+
const distance = studentPoint.distanceTo(solutionPoint);
|
|
104
|
+
return distance < 1;
|
|
105
|
+
}));
|
|
106
|
+
};
|
|
107
|
+
const getScatterPlotBuildScatterPlotFromDataTableQuestion = () => {
|
|
108
|
+
function createArrCoordsAsNodes(rowBasedDataTable, indexX, indexY) {
|
|
109
|
+
const [nodesX, nodesY] = [indexX, indexY].map((i) => rowBasedDataTable[i]
|
|
110
|
+
.slice(1)
|
|
111
|
+
.map((strValue) => parseAlgebraic(strValue)));
|
|
112
|
+
const arrCoordsAsNodes = nodesX.map((nodeX, i) => {
|
|
113
|
+
const nodeY = nodesY[i];
|
|
114
|
+
return [nodeX, nodeY];
|
|
115
|
+
});
|
|
116
|
+
return arrCoordsAsNodes;
|
|
117
|
+
}
|
|
118
|
+
const isRowBased = coinFlip();
|
|
119
|
+
const nbValues = 4;
|
|
120
|
+
const dictCateg = {
|
|
121
|
+
a: {
|
|
122
|
+
nameTex: "a",
|
|
123
|
+
gen: (min = 1, max = 6) => Math.max(min, Math.min(max, randint(min, max + 1))),
|
|
124
|
+
},
|
|
125
|
+
b: {
|
|
126
|
+
nameTex: "b",
|
|
127
|
+
gen: (min = 1, max = 6) => Math.max(min, Math.min(max, randint(min, max + 1))),
|
|
128
|
+
},
|
|
129
|
+
c: {
|
|
130
|
+
nameTex: "c",
|
|
131
|
+
gen: (min = 1, max = 6) => Math.max(min, Math.min(max, randint(min, max + 1))),
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
let rowBasedDataTable = [];
|
|
135
|
+
let indexX = -1;
|
|
136
|
+
let indexY = -1;
|
|
137
|
+
let arrCoordsAsNodes = [];
|
|
138
|
+
let counter = -1;
|
|
139
|
+
let isValidTable = false;
|
|
140
|
+
while (!isValidTable && counter < 100) {
|
|
141
|
+
counter++;
|
|
142
|
+
const arrCategAndValues = Object.values(dictCateg).map((categ) => {
|
|
143
|
+
return {
|
|
144
|
+
categ,
|
|
145
|
+
values: [...Array(nbValues).keys()].map(() => categ.gen()),
|
|
146
|
+
};
|
|
147
|
+
});
|
|
148
|
+
rowBasedDataTable = randomDataTable(arrCategAndValues, true);
|
|
149
|
+
[indexX, indexY] = randomMany([...Array(rowBasedDataTable.length).keys()], 2);
|
|
150
|
+
arrCoordsAsNodes = createArrCoordsAsNodes(rowBasedDataTable, indexX, indexY);
|
|
151
|
+
const arrXY = arrCoordsAsNodes.map(([nodeX, nodeY]) => [nodeX, nodeY].map((node) => node.evaluate()));
|
|
152
|
+
const isDuplicateData = () => [...new Set(arrXY.map(([x, y]) => `${x};${y}`))].length < arrXY.length;
|
|
153
|
+
isValidTable = !isDuplicateData();
|
|
154
|
+
}
|
|
155
|
+
if (!isValidTable) {
|
|
156
|
+
rowBasedDataTable = [
|
|
157
|
+
["a", "3", "2", "3"],
|
|
158
|
+
["b", "1", "2", "3"],
|
|
159
|
+
["c", "1", "1", "2"],
|
|
160
|
+
];
|
|
161
|
+
[indexX, indexY] = [0, 1];
|
|
162
|
+
arrCoordsAsNodes = createArrCoordsAsNodes(rowBasedDataTable, indexX, indexY);
|
|
163
|
+
}
|
|
164
|
+
const identifiers = {
|
|
165
|
+
isRowBased,
|
|
166
|
+
rowBasedDataTable,
|
|
167
|
+
indexX,
|
|
168
|
+
indexY,
|
|
169
|
+
arrCoordsAsNodeIds: arrCoordsAsNodes.map(([nodeX, nodeY]) => [nodeX, nodeY].map((node) => node.toIdentifiers())),
|
|
170
|
+
};
|
|
171
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
172
|
+
};
|
|
173
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
174
|
+
return {
|
|
175
|
+
ggbAnswer: getGGBAnswer(identifiers),
|
|
176
|
+
instruction: getInstruction(identifiers),
|
|
177
|
+
studentGgbOptions: getStudentGGBOptions(identifiers),
|
|
178
|
+
identifiers,
|
|
179
|
+
hint: getHint(identifiers),
|
|
180
|
+
correction: getCorrection(identifiers),
|
|
181
|
+
style: {
|
|
182
|
+
tableOptions: {
|
|
183
|
+
firstCellIsDivided: false,
|
|
184
|
+
firstColumnIsHeader: identifiers.isRowBased,
|
|
185
|
+
firstRowIsHeader: !identifiers.isRowBased,
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
export const scatterPlotBuildScatterPlotFromDataTable = {
|
|
191
|
+
id: "scatterPlotBuildScatterPlotFromDataTable",
|
|
192
|
+
label: "Construire un nuage de points à partir d'un tableau de données",
|
|
193
|
+
isSingleStep: true,
|
|
194
|
+
generator: (nb, opts) => getDistinctQuestions(() => getScatterPlotBuildScatterPlotFromDataTableQuestion(opts), nb),
|
|
195
|
+
ggbTimer: 60,
|
|
196
|
+
isGGBAnswerValid,
|
|
197
|
+
subject: "Mathématiques",
|
|
198
|
+
getHint,
|
|
199
|
+
getInstruction,
|
|
200
|
+
getCorrection,
|
|
201
|
+
getGGBAnswer,
|
|
202
|
+
getStudentGGBOptions,
|
|
203
|
+
answerType: "GGB",
|
|
204
|
+
getQuestionFromIdentifiers,
|
|
205
|
+
hasHintAndCorrection: true,
|
|
206
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { CloudPointsIdentifiers } from "../../../../math/geometry/CloudPoints.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
cloudPointsIdentifiers: CloudPointsIdentifiers;
|
|
5
|
+
evolutionType: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const scatterPlotCommenting: Exercise<Identifiers>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=scatterPlotCommenting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scatterPlotCommenting.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/dataRepresentations/scatterPlot/scatterPlotCommenting.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAGL,sBAAsB,EACvB,MAAM,oCAAoC,CAAC;AAK5C,KAAK,WAAW,GAAG;IACjB,sBAAsB,EAAE,sBAAsB,CAAC;IAC/C,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAmQF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAgBvD,CAAC"}
|