math-exercises 3.0.139 → 3.0.141
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/arithmetics/euclideanDivision.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/euclideanDivision.js +65 -8
- package/lib/exercises/math/calcul/arithmetics/findRightPrimeDecomposition.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/findRightPrimeDecomposition.js +3 -6
- package/lib/exercises/math/calcul/arithmetics/index.d.ts +3 -0
- package/lib/exercises/math/calcul/arithmetics/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/index.js +3 -1
- package/lib/exercises/math/calcul/arithmetics/primeNumbersAffirmations.d.ts +8 -0
- package/lib/exercises/math/calcul/arithmetics/primeNumbersAffirmations.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/primeNumbersAffirmations.js +128 -0
- package/lib/exercises/math/calcul/proportionality/fourthProportionalFromProblem.d.ts +8 -0
- package/lib/exercises/math/calcul/proportionality/fourthProportionalFromProblem.d.ts.map +1 -0
- package/lib/exercises/math/calcul/proportionality/fourthProportionalFromProblem.js +392 -0
- package/lib/exercises/math/calcul/proportionality/index.d.ts +2 -0
- package/lib/exercises/math/calcul/proportionality/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/index.js +2 -0
- package/lib/exercises/math/calcul/proportionality/isProportionalFromProblem.d.ts +8 -0
- package/lib/exercises/math/calcul/proportionality/isProportionalFromProblem.d.ts.map +1 -0
- package/lib/exercises/math/calcul/proportionality/isProportionalFromProblem.js +349 -0
- package/lib/exercises/math/calculLitteral/equation/isEqualityTrue.js +4 -4
- package/lib/exercises/math/dataRepresentations/index.js +1 -0
- package/lib/exercises/math/dataRepresentations/placePointsFromDataTable.d.ts +12 -0
- package/lib/exercises/math/dataRepresentations/placePointsFromDataTable.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/placePointsFromDataTable.js +175 -0
- package/lib/exercises/math/functions/affines/index.d.ts +2 -0
- package/lib/exercises/math/functions/affines/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/index.js +2 -0
- package/lib/exercises/math/functions/affines/placePointsFromAffine.d.ts +8 -0
- package/lib/exercises/math/functions/affines/placePointsFromAffine.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/placePointsFromAffine.js +135 -0
- package/lib/exercises/math/functions/affines/recognizeAffinePointsFromPoints.d.ts +10 -0
- package/lib/exercises/math/functions/affines/recognizeAffinePointsFromPoints.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/recognizeAffinePointsFromPoints.js +208 -0
- package/lib/exercises/math/functions/basics/index.d.ts +1 -0
- package/lib/exercises/math/functions/basics/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/index.js +1 -0
- package/lib/exercises/math/functions/basics/placePointsFromValueTable.d.ts +8 -0
- package/lib/exercises/math/functions/basics/placePointsFromValueTable.d.ts.map +1 -0
- package/lib/exercises/math/functions/basics/placePointsFromValueTable.js +128 -0
- package/lib/exercises/math/geometry/pythagore/isTriangleRight.d.ts.map +1 -1
- package/lib/exercises/math/geometry/pythagore/isTriangleRight.js +19 -9
- package/lib/exercises/utils/data/boxXY.d.ts +7 -0
- package/lib/exercises/utils/data/boxXY.d.ts.map +1 -0
- package/lib/exercises/utils/data/boxXY.js +16 -0
- package/lib/exercises/utils/data/isBoxable.d.ts +2 -0
- package/lib/exercises/utils/data/isBoxable.d.ts.map +1 -0
- package/lib/exercises/utils/data/isBoxable.js +5 -0
- package/lib/exercises/utils/data/randomDataTable.d.ts +11 -0
- package/lib/exercises/utils/data/randomDataTable.d.ts.map +1 -0
- package/lib/exercises/utils/data/randomDataTable.js +65 -0
- package/lib/index.d.ts +21 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/math/utils/random/randfloat.d.ts +1 -0
- package/lib/math/utils/random/randfloat.d.ts.map +1 -1
- package/lib/math/utils/random/randfloat.js +35 -0
- package/lib/utils/arrays/transpose.d.ts +2 -0
- package/lib/utils/arrays/transpose.d.ts.map +1 -0
- package/lib/utils/arrays/transpose.js +10 -0
- package/package.json +1 -1
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { toolBarConstructor } from "../../../../exercises/utils/geogebra/toolBarConstructor.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { greenMain } from "../../../../geogebra/colors.js";
|
|
4
|
+
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
5
|
+
import { GeogebraParser } from "../../../../geogebra/parsers/geogebraParser.js";
|
|
6
|
+
import { Point } from "../../../../math/geometry/point.js";
|
|
7
|
+
import { AffineConstructor } from "../../../../math/polynomials/affine.js";
|
|
8
|
+
import { nodeBySubstitutingVar } from "../../../../math/utils/functions/functionComposition.js";
|
|
9
|
+
import { randfloat } from "../../../../math/utils/random/randfloat.js";
|
|
10
|
+
import { NodeConstructor, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
11
|
+
import { joinanded } from "../../../../utils/strings/joinanded.js";
|
|
12
|
+
const getInstruction = (identifiers) => {
|
|
13
|
+
const { nodeIds } = identifiers;
|
|
14
|
+
const nodeF = NodeConstructor.fromIdentifiers(nodeIds);
|
|
15
|
+
return `Placer trois points appartenant à la courbe de la fonction $f$, d'expression :
|
|
16
|
+
|
|
17
|
+
$$
|
|
18
|
+
f(x) = ${nodeF.toTex()}
|
|
19
|
+
$$
|
|
20
|
+
|
|
21
|
+
`;
|
|
22
|
+
};
|
|
23
|
+
const getHint = () => {
|
|
24
|
+
return `En calculant $f(0)$ et $f(1)$, tu pourras déjà placer deux points.`;
|
|
25
|
+
};
|
|
26
|
+
const getCorrection = (identifiers) => {
|
|
27
|
+
const { nodeIds } = identifiers;
|
|
28
|
+
const nodeF = NodeConstructor.fromIdentifiers(nodeIds);
|
|
29
|
+
const arrValueAndNodeFAtValue = [-1, 0, 1].map((value) => {
|
|
30
|
+
const nodeFAtValue = nodeBySubstitutingVar(nodeF, value.toTree(), "x".toTree());
|
|
31
|
+
return [value, nodeFAtValue];
|
|
32
|
+
});
|
|
33
|
+
return `On a :
|
|
34
|
+
${arrValueAndNodeFAtValue
|
|
35
|
+
.map(([value, nodeFAtValue]) => `
|
|
36
|
+
|
|
37
|
+
$$
|
|
38
|
+
f(${value}) = ${nodeFAtValue.toTex()} = ${nodeFAtValue.simplify().toTex()}
|
|
39
|
+
$$
|
|
40
|
+
|
|
41
|
+
`)
|
|
42
|
+
.join("")}
|
|
43
|
+
|
|
44
|
+
Donc on peut placer les points de coordonnées ${joinanded(arrValueAndNodeFAtValue.map(([value, nodeFAtValue]) => `$(${value};${nodeFAtValue.simplify().toTex()})$`), ", ", " et ")}.
|
|
45
|
+
|
|
46
|
+
On aurait pu choisir d'autre valeurs de $x$ mais on préfère choisir des valeurs qui facilitent les calculs.`;
|
|
47
|
+
};
|
|
48
|
+
const getSolutionPoints = (identifiers) => {
|
|
49
|
+
const { nodeIds } = identifiers;
|
|
50
|
+
const nodeF = NodeConstructor.fromIdentifiers(nodeIds);
|
|
51
|
+
return [-1, 0, 1].map((x, i) => {
|
|
52
|
+
const y = nodeF.evaluate({ x });
|
|
53
|
+
return new Point(`S_${i}`, x, y);
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
const getOtherSolutionPoints = (identifiers) => {
|
|
57
|
+
const { nodeIds } = identifiers;
|
|
58
|
+
const nodeF = NodeConstructor.fromIdentifiers(nodeIds);
|
|
59
|
+
const nbOther = 10;
|
|
60
|
+
const arrX = [...Array(nbOther).keys()].reduce((acc, _) => [...acc, randfloat(-10, 10, 2, acc)], []);
|
|
61
|
+
return arrX.map((x, i) => {
|
|
62
|
+
const y = nodeF.evaluate({ x });
|
|
63
|
+
return new Point(`U_${i}`, x, y);
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
const getGGBAnswer = (identifiers) => {
|
|
67
|
+
const solutionPoints = getSolutionPoints(identifiers);
|
|
68
|
+
const otherSolutionPoints = getOtherSolutionPoints(identifiers);
|
|
69
|
+
return [
|
|
70
|
+
...solutionPoints.flatMap((point) => point.toGGBCommand({ color: `${greenMain}`, showLabel: false })),
|
|
71
|
+
...otherSolutionPoints.flatMap((point) => point.toGGBCommand({ color: `black`, showLabel: false })),
|
|
72
|
+
];
|
|
73
|
+
};
|
|
74
|
+
const getStudentGGBOptions = (identifiers) => {
|
|
75
|
+
const points = getSolutionPoints(identifiers);
|
|
76
|
+
const ggb = new GeogebraConstructor({
|
|
77
|
+
commands: [],
|
|
78
|
+
customToolBar: toolBarConstructor({
|
|
79
|
+
point: true,
|
|
80
|
+
}),
|
|
81
|
+
});
|
|
82
|
+
return ggb.getOptions({
|
|
83
|
+
coords: ggb.getCoordsForPoints(points),
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
const isGGBAnswerValid = (ans, { ggbAnswer, ...identifiers }) => {
|
|
87
|
+
const { nodeIds } = identifiers;
|
|
88
|
+
const nodeF = NodeConstructor.fromIdentifiers(nodeIds);
|
|
89
|
+
const commands = ans;
|
|
90
|
+
const ggbParser = new GeogebraParser(commands);
|
|
91
|
+
const objectDict = ggbParser.objectDict();
|
|
92
|
+
const pointsCoords = Object.keys(objectDict).map((name) => ggbParser.pointCoords(name));
|
|
93
|
+
return (pointsCoords.length == 3 &&
|
|
94
|
+
pointsCoords.every(([x, y]) => {
|
|
95
|
+
const studentPoint = new Point("StudentPoint", x, y);
|
|
96
|
+
const answerY = nodeF.evaluate({ x });
|
|
97
|
+
const solutionPoint = new Point("SolutionPoint", x, answerY);
|
|
98
|
+
const distance = studentPoint.distanceTo(solutionPoint);
|
|
99
|
+
return distance < 1;
|
|
100
|
+
}));
|
|
101
|
+
};
|
|
102
|
+
const getPlacePointsFromAffineQuestion = () => {
|
|
103
|
+
const affine = AffineConstructor.random({ min: -5, max: 6 });
|
|
104
|
+
const identifiers = {
|
|
105
|
+
nodeIds: affine.toTree().toIdentifiers(),
|
|
106
|
+
};
|
|
107
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
108
|
+
};
|
|
109
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
110
|
+
return {
|
|
111
|
+
ggbAnswer: getGGBAnswer(identifiers),
|
|
112
|
+
instruction: getInstruction(identifiers),
|
|
113
|
+
studentGgbOptions: getStudentGGBOptions(identifiers),
|
|
114
|
+
identifiers,
|
|
115
|
+
hint: getHint(identifiers),
|
|
116
|
+
correction: getCorrection(identifiers),
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
export const placePointsFromAffine = {
|
|
120
|
+
id: "placePointsFromAffine",
|
|
121
|
+
label: "Placer des points issus de l'expression algébrique d'une fonction affine",
|
|
122
|
+
isSingleStep: true,
|
|
123
|
+
generator: (nb, opts) => getDistinctQuestions(() => getPlacePointsFromAffineQuestion(opts), nb),
|
|
124
|
+
ggbTimer: 60,
|
|
125
|
+
isGGBAnswerValid,
|
|
126
|
+
subject: "Mathématiques",
|
|
127
|
+
getHint,
|
|
128
|
+
getInstruction,
|
|
129
|
+
getCorrection,
|
|
130
|
+
getGGBAnswer,
|
|
131
|
+
getStudentGGBOptions,
|
|
132
|
+
answerType: "GGB",
|
|
133
|
+
getQuestionFromIdentifiers,
|
|
134
|
+
hasHintAndCorrection: true,
|
|
135
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { PointIdentifiers } from "../../../../math/geometry/point.js";
|
|
3
|
+
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
|
|
4
|
+
type Identifiers = {
|
|
5
|
+
nodeIds: NodeIdentifiers;
|
|
6
|
+
pointIds: PointIdentifiers[];
|
|
7
|
+
};
|
|
8
|
+
export declare const recognizeAffinePointsFromPoints: Exercise<Identifiers>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=recognizeAffinePointsFromPoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recognizeAffinePointsFromPoints.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/recognizeAffinePointsFromPoints.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAKtC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAK7C,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,eAAe,CAAC;IACzB,QAAQ,EAAE,gBAAgB,EAAE,CAAC;CAC9B,CAAC;AA4OF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAkBjE,CAAC"}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { greenMain } from "../../../../geogebra/colors.js";
|
|
4
|
+
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
5
|
+
import { Point, PointConstructor, } from "../../../../math/geometry/point.js";
|
|
6
|
+
import { AffineConstructor } from "../../../../math/polynomials/affine.js";
|
|
7
|
+
import { nodeBySubstitutingVar } from "../../../../math/utils/functions/functionComposition.js";
|
|
8
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
9
|
+
import { NodeConstructor, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
10
|
+
import { power } from "../../../../tree/nodes/operators/powerNode.js";
|
|
11
|
+
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
12
|
+
import { random, randomMany } from "../../../../utils/alea/random.js";
|
|
13
|
+
const getInstruction = (identifiers) => {
|
|
14
|
+
const { nodeIds } = identifiers;
|
|
15
|
+
const nodeF = NodeConstructor.fromIdentifiers(nodeIds);
|
|
16
|
+
return `Soit la fonction $f$, d'expression :
|
|
17
|
+
|
|
18
|
+
$$
|
|
19
|
+
f(x) = ${nodeF.toTex()}
|
|
20
|
+
$$
|
|
21
|
+
|
|
22
|
+
Parmi les points ci-dessous, lequel ou lesquels appartiennent à la courbe représentative de $f$ ?
|
|
23
|
+
`;
|
|
24
|
+
};
|
|
25
|
+
const getHint = () => {
|
|
26
|
+
return `Un point $I$ de coordonnées $(x;y)$ appartient à la courbe $\\mathcal C_f$ d'une fonction $f$ si et seulement si $f(x)=y$.
|
|
27
|
+
|
|
28
|
+
Pour chaque point, il faut donc vérifier si son ordonnée est égale à l'image par $f$ de son abscisse.`;
|
|
29
|
+
};
|
|
30
|
+
const getCorrection = (identifiers) => {
|
|
31
|
+
const { nodeIds, pointIds } = identifiers;
|
|
32
|
+
const nodeF = NodeConstructor.fromIdentifiers(nodeIds);
|
|
33
|
+
const points = pointIds.map((pointIds) => PointConstructor.fromIdentifiers(pointIds));
|
|
34
|
+
const pointsDict = getValidAndInvalidPointsDict(identifiers);
|
|
35
|
+
return `${points.map((point) => {
|
|
36
|
+
const isValid = !!pointsDict.valid[point.name];
|
|
37
|
+
const nodeFAtX = nodeBySubstitutingVar(nodeF, point.x);
|
|
38
|
+
return `Pour le point $${point.name}$, on lit les coordonnées $(${point.x.toTex()};${point.y.toTex()})$.
|
|
39
|
+
|
|
40
|
+
$$
|
|
41
|
+
f(${point.x.toTex()}) = ${nodeFAtX.toTex()} = ${nodeFAtX.simplify().toTex()}
|
|
42
|
+
$$
|
|
43
|
+
|
|
44
|
+
donc
|
|
45
|
+
|
|
46
|
+
$$
|
|
47
|
+
f(x_${point.name}) ${isValid ? "=" : "\\neq"} y_${point.name}
|
|
48
|
+
$$
|
|
49
|
+
|
|
50
|
+
$${point.name}$ ${isValid ? "appartient" : "n'appartient pas"} à $\\mathcal C_f$.
|
|
51
|
+
`;
|
|
52
|
+
}).join(`
|
|
53
|
+
|
|
54
|
+
`)}`;
|
|
55
|
+
};
|
|
56
|
+
const getValidAndInvalidPointsDict = (identifiers) => {
|
|
57
|
+
const { nodeIds, pointIds } = identifiers;
|
|
58
|
+
const nodeF = NodeConstructor.fromIdentifiers(nodeIds);
|
|
59
|
+
const points = pointIds.map((pointIds) => PointConstructor.fromIdentifiers(pointIds));
|
|
60
|
+
const pointsDict = {
|
|
61
|
+
valid: {},
|
|
62
|
+
invalid: {},
|
|
63
|
+
};
|
|
64
|
+
return points.reduce((acc, point) => {
|
|
65
|
+
const x = point.x.evaluate();
|
|
66
|
+
const yF = nodeF.evaluate({ x });
|
|
67
|
+
//imperfect check
|
|
68
|
+
const isValid = Math.abs(point.y.evaluate() - yF) < power(10, -7).evaluate();
|
|
69
|
+
if (isValid) {
|
|
70
|
+
acc.valid[point.name] = point;
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
acc.invalid[point.name] = point;
|
|
74
|
+
}
|
|
75
|
+
return acc;
|
|
76
|
+
}, pointsDict);
|
|
77
|
+
};
|
|
78
|
+
const getCorrectionGGBOptions = (identifiers) => {
|
|
79
|
+
const { nodeIds } = identifiers;
|
|
80
|
+
const nodeF = NodeConstructor.fromIdentifiers(nodeIds);
|
|
81
|
+
const fName = "f";
|
|
82
|
+
const pointsDict = getValidAndInvalidPointsDict(identifiers);
|
|
83
|
+
const points = [
|
|
84
|
+
...Object.values(pointsDict.valid),
|
|
85
|
+
...Object.values(pointsDict.invalid),
|
|
86
|
+
];
|
|
87
|
+
const commands = [
|
|
88
|
+
...[
|
|
89
|
+
`${fName} = Function(${nodeF.toMathString()}, x, -20, 20)`,
|
|
90
|
+
`ShowLabel(${fName}, true)`,
|
|
91
|
+
`SetCaption(${fName}, "$\\mathcal C_${fName}$")`,
|
|
92
|
+
`SetColor(${fName}, "black")`,
|
|
93
|
+
],
|
|
94
|
+
...Object.values(pointsDict.valid).flatMap((point) => point.toGGBCommand({ color: `${greenMain}` })),
|
|
95
|
+
...Object.values(pointsDict.invalid).flatMap((point) => point.toGGBCommand({ color: `red` })),
|
|
96
|
+
];
|
|
97
|
+
const ggb = new GeogebraConstructor({
|
|
98
|
+
commands,
|
|
99
|
+
lockedAxesRatio: false,
|
|
100
|
+
});
|
|
101
|
+
return ggb.getOptions({
|
|
102
|
+
coords: ggb.getCoordsForPoints(points),
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
const getGGBOptions = (identifiers) => {
|
|
106
|
+
const { pointIds } = identifiers;
|
|
107
|
+
const points = pointIds.map((pointIds) => PointConstructor.fromIdentifiers(pointIds));
|
|
108
|
+
const ggb = new GeogebraConstructor({
|
|
109
|
+
commands: [...points.flatMap((point) => point.toGGBCommand())],
|
|
110
|
+
lockedAxesRatio: false,
|
|
111
|
+
});
|
|
112
|
+
return ggb.getOptions({
|
|
113
|
+
coords: ggb.getCoordsForPoints(points),
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
const getPropositions = (_, { answer, ...identifiers }) => {
|
|
117
|
+
const propositions = [];
|
|
118
|
+
const pointsDict = getValidAndInvalidPointsDict(identifiers);
|
|
119
|
+
//keep same order on each question
|
|
120
|
+
["A", "B", "C", "D"].forEach((pointName) => {
|
|
121
|
+
if (pointsDict.valid[pointName]) {
|
|
122
|
+
addValidProp(propositions, pointName);
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
tryToAddWrongProp(propositions, pointName);
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
return propositions;
|
|
129
|
+
};
|
|
130
|
+
const getPlacePointsFromAffineQuestion = () => {
|
|
131
|
+
const affine = AffineConstructor.random({ min: -3, max: 4 }, { min: -5, max: 6 });
|
|
132
|
+
const [xMin, xMax] = [-3, 3];
|
|
133
|
+
const x1 = randint(xMin, 0);
|
|
134
|
+
const x2 = randint(xMin, 0, [x1]);
|
|
135
|
+
const x3 = randint(0, xMax + 1, [0]);
|
|
136
|
+
const x4 = randint(0, xMax + 1, [0, x3]);
|
|
137
|
+
const arrX = [x1, x2, x3, x4].toSorted((x1, x2) => x1 - x2);
|
|
138
|
+
const arrYF = arrX.map((x) => affine.calculate(x));
|
|
139
|
+
const [yFMin, yFMax] = arrYF
|
|
140
|
+
.slice(1)
|
|
141
|
+
.reduce((acc, y) => [Math.min(acc[0], y), Math.max(acc[1], y)], [arrYF[0], arrYF[0]]);
|
|
142
|
+
const validIndexesDict = Object.fromEntries(randomMany([0, 1, 2, 3], randint(1, 5)).map((i) => [i, true]));
|
|
143
|
+
const points = ["A", "B", "C", "D"].map((name, i) => {
|
|
144
|
+
const x = arrX[i];
|
|
145
|
+
const yF = arrYF[i];
|
|
146
|
+
if (validIndexesDict[i]) {
|
|
147
|
+
return new Point(name, x, yF);
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
const coeffs = affine.coefficients;
|
|
151
|
+
let yWrong;
|
|
152
|
+
if (coinFlip()) {
|
|
153
|
+
//wrongAffine (wrong signs)
|
|
154
|
+
const wrongCoeffs = [
|
|
155
|
+
[+1, -1],
|
|
156
|
+
[-1, +1],
|
|
157
|
+
[-1, -1],
|
|
158
|
+
].map((arrSign) => arrSign.map((sign, i) => sign * coeffs[i]));
|
|
159
|
+
const wrongCoeffsDistinct = [...new Set(wrongCoeffs)]; //maudit 0
|
|
160
|
+
const wrongAffine = AffineConstructor.fromCoeffs(random(wrongCoeffsDistinct));
|
|
161
|
+
yWrong = wrongAffine.calculate(x);
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
//wrongPoints (random offset)
|
|
165
|
+
if (coinFlip()) {
|
|
166
|
+
yWrong = random([yF + 1, yF - 1]);
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
yWrong = randint(yFMin, yFMax, [yF]);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return new Point(name, x, yWrong);
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
const identifiers = {
|
|
176
|
+
nodeIds: affine.toTree().toIdentifiers(),
|
|
177
|
+
pointIds: points.map((point) => point.toIdentifiers()),
|
|
178
|
+
};
|
|
179
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
180
|
+
};
|
|
181
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
182
|
+
return {
|
|
183
|
+
instruction: getInstruction(identifiers),
|
|
184
|
+
ggbOptions: getGGBOptions(identifiers),
|
|
185
|
+
identifiers,
|
|
186
|
+
hint: getHint(identifiers),
|
|
187
|
+
correction: getCorrection(identifiers),
|
|
188
|
+
correctionGgbOptions: getCorrectionGGBOptions(identifiers),
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
export const recognizeAffinePointsFromPoints = {
|
|
192
|
+
id: "recognizeAffinePointsFromPoints",
|
|
193
|
+
label: "Repérer les points pouvant appartenir à la courbe d'une fonction",
|
|
194
|
+
isSingleStep: true,
|
|
195
|
+
generator: (nb, opts) => getDistinctQuestions(() => getPlacePointsFromAffineQuestion(opts), nb),
|
|
196
|
+
ggbTimer: 60,
|
|
197
|
+
subject: "Mathématiques",
|
|
198
|
+
getHint,
|
|
199
|
+
getInstruction,
|
|
200
|
+
getCorrection,
|
|
201
|
+
getPropositions,
|
|
202
|
+
getGGBOptions,
|
|
203
|
+
hasGeogebra: true,
|
|
204
|
+
getQuestionFromIdentifiers,
|
|
205
|
+
hasHintAndCorrection: true,
|
|
206
|
+
answerType: "QCM",
|
|
207
|
+
isQCM: true,
|
|
208
|
+
};
|
|
@@ -16,4 +16,5 @@ export * from "./isPointOnFunction.js";
|
|
|
16
16
|
export * from "./countFunctionZeroes.js";
|
|
17
17
|
export * from "./findZeroesProductQuotient.js";
|
|
18
18
|
export * from "./coordsOfPointOnCurveFindY.js";
|
|
19
|
+
export * from "./placePointsFromValueTable.js";
|
|
19
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
arrCoordsAsNodeIds: NodeIdentifiers[][];
|
|
5
|
+
};
|
|
6
|
+
export declare const placePointsFromValueTable: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=placePointsFromValueTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placePointsFromValueTable.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/placePointsFromValueTable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAI7C,KAAK,WAAW,GAAG;IACjB,kBAAkB,EAAE,eAAe,EAAE,EAAE,CAAC;CACzC,CAAC;AAwJF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAiB3D,CAAC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { toolBarConstructor } from "../../../../exercises/utils/geogebra/toolBarConstructor.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { greenMain } from "../../../../geogebra/colors.js";
|
|
4
|
+
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
5
|
+
import { GeogebraParser } from "../../../../geogebra/parsers/geogebraParser.js";
|
|
6
|
+
import { Point } from "../../../../math/geometry/point.js";
|
|
7
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
8
|
+
import { NodeConstructor, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
9
|
+
import { mdTable } from "../../../../utils/markdown/mdTable.js";
|
|
10
|
+
import { joinanded } from "../../../../utils/strings/joinanded.js";
|
|
11
|
+
const getValueTable = (arrPoint) => {
|
|
12
|
+
return [
|
|
13
|
+
["x", ...arrPoint.map((p) => p.x.toTex())].map((str) => `$${str}$`),
|
|
14
|
+
["f(x)", ...arrPoint.map((p) => p.y.toTex())].map((str) => `$${str}$`),
|
|
15
|
+
];
|
|
16
|
+
};
|
|
17
|
+
const getInstruction = (identifiers) => {
|
|
18
|
+
const valueTable = getValueTable(getSolutionPoints(identifiers));
|
|
19
|
+
return `Placer les points correspondant au tableau de valeurs ci-dessous de la fonction $f$.
|
|
20
|
+
|
|
21
|
+
${mdTable(valueTable)}
|
|
22
|
+
|
|
23
|
+
`;
|
|
24
|
+
};
|
|
25
|
+
const getHint = () => {
|
|
26
|
+
return `Place chaque point de coordonnées $(x;f(x))$.`;
|
|
27
|
+
};
|
|
28
|
+
const getCorrection = (identifiers) => {
|
|
29
|
+
const solutionPoints = getSolutionPoints(identifiers);
|
|
30
|
+
return `On place chaque point de coordonnées $(x;f(x))$.
|
|
31
|
+
|
|
32
|
+
On place donc les points de coordonnées ${joinanded(solutionPoints.map((p) => `$(${p.x.toTex()};${p.y.toTex()})$`), ", ", " et ")}.`;
|
|
33
|
+
};
|
|
34
|
+
const getSolutionPoints = (identifiers) => {
|
|
35
|
+
const { arrCoordsAsNodeIds } = identifiers;
|
|
36
|
+
const arrCoordsAsNodes = arrCoordsAsNodeIds.map(([nodeIdsX, nodeIdsY]) => [nodeIdsX, nodeIdsY].map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds)));
|
|
37
|
+
return arrCoordsAsNodes.map(([nodeX, nodeY], i) => {
|
|
38
|
+
return new Point(`S_${i}`, nodeX, nodeY);
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
const getGGBAnswer = (identifiers) => {
|
|
42
|
+
const solutionPoints = getSolutionPoints(identifiers);
|
|
43
|
+
return [
|
|
44
|
+
...solutionPoints.flatMap((point) => point.toGGBCommand({ color: `${greenMain}`, showLabel: false })),
|
|
45
|
+
];
|
|
46
|
+
};
|
|
47
|
+
const getStudentGGBOptions = (identifiers) => {
|
|
48
|
+
const points = getSolutionPoints(identifiers);
|
|
49
|
+
const ggb = new GeogebraConstructor({
|
|
50
|
+
commands: [],
|
|
51
|
+
customToolBar: toolBarConstructor({
|
|
52
|
+
point: true,
|
|
53
|
+
}),
|
|
54
|
+
});
|
|
55
|
+
return ggb.getOptions({
|
|
56
|
+
coords: ggb.getCoordsForPoints(points),
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
const isGGBAnswerValid = (ans, { ggbAnswer, ...identifiers }) => {
|
|
60
|
+
const commands = ans;
|
|
61
|
+
const ggbParser = new GeogebraParser(commands);
|
|
62
|
+
const objectDict = ggbParser.objectDict();
|
|
63
|
+
const pointsCoords = Object.keys(objectDict).map((name) => ggbParser.pointCoords(name));
|
|
64
|
+
const pointsCoordsSortedByAscX = pointsCoords.toSorted(([x1], [x2]) => {
|
|
65
|
+
return x1 - x2;
|
|
66
|
+
});
|
|
67
|
+
const solutionPointsSortedByAscX = getSolutionPoints(identifiers).toSorted((p1, p2) => {
|
|
68
|
+
return p1.x.evaluate() - p2.x.evaluate();
|
|
69
|
+
});
|
|
70
|
+
return (pointsCoordsSortedByAscX.length === solutionPointsSortedByAscX.length &&
|
|
71
|
+
pointsCoordsSortedByAscX.every(([x, y], i) => {
|
|
72
|
+
const studentPoint = new Point("StudentPoint", x, y);
|
|
73
|
+
const solutionPoint = solutionPointsSortedByAscX[i];
|
|
74
|
+
const distance = studentPoint.distanceTo(solutionPoint);
|
|
75
|
+
return distance < 1;
|
|
76
|
+
}));
|
|
77
|
+
};
|
|
78
|
+
const getPlacePointsFromValueTableQuestion = () => {
|
|
79
|
+
function createArrCoordsAsNodes() {
|
|
80
|
+
const xs = [
|
|
81
|
+
randint(-10, -5),
|
|
82
|
+
randint(-5, 0),
|
|
83
|
+
randint(0, 5),
|
|
84
|
+
randint(6, 10),
|
|
85
|
+
];
|
|
86
|
+
const points = [[xs[0], randint(-9, 10)]];
|
|
87
|
+
for (let i = 1; i < xs.length; i++) {
|
|
88
|
+
const y = points[i - 1][1] + randint(-5, 6);
|
|
89
|
+
points.push([xs[i], y]);
|
|
90
|
+
}
|
|
91
|
+
const arrCoordsAsNodeIds = points.map(([x, y]) => {
|
|
92
|
+
return [x, y].map((v) => v.toTree());
|
|
93
|
+
});
|
|
94
|
+
return arrCoordsAsNodeIds;
|
|
95
|
+
}
|
|
96
|
+
const arrCoordsAsNodes = createArrCoordsAsNodes();
|
|
97
|
+
const identifiers = {
|
|
98
|
+
arrCoordsAsNodeIds: arrCoordsAsNodes.map(([nodeX, nodeY]) => [nodeX, nodeY].map((node) => node.toIdentifiers())),
|
|
99
|
+
};
|
|
100
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
101
|
+
};
|
|
102
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
103
|
+
return {
|
|
104
|
+
ggbAnswer: getGGBAnswer(identifiers),
|
|
105
|
+
instruction: getInstruction(identifiers),
|
|
106
|
+
studentGgbOptions: getStudentGGBOptions(identifiers),
|
|
107
|
+
identifiers,
|
|
108
|
+
hint: getHint(identifiers),
|
|
109
|
+
correction: getCorrection(identifiers),
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
export const placePointsFromValueTable = {
|
|
113
|
+
id: "placePointsFromValueTable",
|
|
114
|
+
label: "Placer des points issus d'un tableau de valeurs d'une fonction",
|
|
115
|
+
isSingleStep: true,
|
|
116
|
+
generator: (nb, opts) => getDistinctQuestions(() => getPlacePointsFromValueTableQuestion(opts), nb),
|
|
117
|
+
ggbTimer: 60,
|
|
118
|
+
isGGBAnswerValid,
|
|
119
|
+
subject: "Mathématiques",
|
|
120
|
+
getHint,
|
|
121
|
+
getInstruction,
|
|
122
|
+
getCorrection,
|
|
123
|
+
getGGBAnswer,
|
|
124
|
+
getStudentGGBOptions,
|
|
125
|
+
answerType: "GGB",
|
|
126
|
+
getQuestionFromIdentifiers,
|
|
127
|
+
hasHintAndCorrection: true,
|
|
128
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isTriangleRight.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/pythagore/isTriangleRight.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;
|
|
1
|
+
{"version":3,"file":"isTriangleRight.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/pythagore/isTriangleRight.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AA2HF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAkBjD,CAAC"}
|
|
@@ -2,8 +2,8 @@ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exer
|
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { pythagoricianTriplets } from "../../../../math/utils/geometry/pythagoricianTriplets.js";
|
|
4
4
|
import { round } from "../../../../math/utils/round.js";
|
|
5
|
-
import { AddNode } from "../../../../tree/nodes/operators/addNode.js";
|
|
6
|
-
import { SquareNode } from "../../../../tree/nodes/operators/powerNode.js";
|
|
5
|
+
import { add, AddNode } from "../../../../tree/nodes/operators/addNode.js";
|
|
6
|
+
import { square, SquareNode } from "../../../../tree/nodes/operators/powerNode.js";
|
|
7
7
|
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
8
8
|
import { random } from "../../../../utils/alea/random.js";
|
|
9
9
|
import { doWhile } from "../../../../utils/doWhile.js";
|
|
@@ -28,16 +28,24 @@ const getInstruction = (identifiers) => {
|
|
|
28
28
|
Le triangle $${triangleName}$ est-il rectangle ?`;
|
|
29
29
|
};
|
|
30
30
|
const getHint = () => {
|
|
31
|
-
return `Si la somme des carrés des côtés est égale au carré
|
|
31
|
+
return `Si la somme des carrés des côtés est égale au carré du plus grand côté, alors le triangle est rectangle, d'après la réciproque du théorème de Pythagore.
|
|
32
|
+
|
|
33
|
+
Si ce n'est pas le cas, alors le triangle n'est pas rectangle, d'après la contraposée du théorème de Pythagore.`;
|
|
32
34
|
};
|
|
33
35
|
const getCorrection = (identifiers) => {
|
|
34
36
|
const hypo = Math.max(identifiers.a, identifiers.b, identifiers.c);
|
|
35
37
|
const sides = [identifiers.a, identifiers.b, identifiers.c].filter((e) => e !== hypo);
|
|
38
|
+
const sideNames = identifiers.vertices.map((vertex, index) => vertex + identifiers.vertices[(index + 1) % 3]);
|
|
36
39
|
return `La somme des carrés des côtés est égale à :
|
|
37
40
|
|
|
38
41
|
${alignTex([
|
|
39
42
|
[
|
|
43
|
+
add(square(sideNames[0]), square(sideNames[1])).toTex(),
|
|
44
|
+
"=",
|
|
40
45
|
new AddNode(new SquareNode(sides[0].toTree()), new SquareNode(sides[1].toTree())).toTex(),
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
"",
|
|
41
49
|
"=",
|
|
42
50
|
round(sides[0] ** 2, 6).frenchify() +
|
|
43
51
|
"+" +
|
|
@@ -46,15 +54,17 @@ ${alignTex([
|
|
|
46
54
|
["", "=", round(sides[0] ** 2 + sides[1] ** 2, 6).frenchify()],
|
|
47
55
|
])}
|
|
48
56
|
|
|
49
|
-
Le carré
|
|
57
|
+
Le carré du plus grand côté vaut :
|
|
58
|
+
|
|
59
|
+
${alignTex([
|
|
60
|
+
[square(sideNames[2]).toTex(), "=", square(hypo).toTex()],
|
|
61
|
+
["", "=", round(hypo ** 2, 6).frenchify()],
|
|
62
|
+
])}
|
|
50
63
|
|
|
51
|
-
$$
|
|
52
|
-
${new SquareNode(hypo.toTree()).toTex()} = ${round(hypo ** 2, 6).frenchify()}
|
|
53
|
-
$$
|
|
54
64
|
|
|
55
65
|
${identifiers.isRight
|
|
56
|
-
? "La somme des carrés des côtés est donc égale au carré
|
|
57
|
-
: "La somme des carrés des côtés n'est donc pas égale au carré
|
|
66
|
+
? "La somme des carrés des côtés est donc égale au carré du plus grand côté. D'après la réciproque du théorème de Pythagore, le triangle est donc rectangle."
|
|
67
|
+
: "La somme des carrés des côtés n'est donc pas égale au carré du plus grand côté. D'après la contraposée du théorème de Pythagore, le triangle n'est donc pas rectangle."}`;
|
|
58
68
|
};
|
|
59
69
|
const getKeys = () => {
|
|
60
70
|
return [];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boxXY.d.ts","sourceRoot":"","sources":["../../../../src/exercises/utils/data/boxXY.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,GAAI,OAAO,MAAM,EAAE,EAAE;;;;;CAkBtC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const boxXY = (arrXY) => {
|
|
2
|
+
const { xMin, xMax, yMin, yMax } = arrXY.slice(1).reduce((acc, [x, y]) => {
|
|
3
|
+
return {
|
|
4
|
+
xMin: Math.min(x, acc.xMin),
|
|
5
|
+
xMax: Math.max(x, acc.xMax),
|
|
6
|
+
yMin: Math.min(y, acc.yMin),
|
|
7
|
+
yMax: Math.max(y, acc.yMax),
|
|
8
|
+
};
|
|
9
|
+
}, {
|
|
10
|
+
xMin: arrXY[0][0],
|
|
11
|
+
xMax: arrXY[0][0],
|
|
12
|
+
yMin: arrXY[0][1],
|
|
13
|
+
yMax: arrXY[0][1],
|
|
14
|
+
});
|
|
15
|
+
return { xMin, xMax, yMin, yMax };
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isBoxable.d.ts","sourceRoot":"","sources":["../../../../src/exercises/utils/data/isBoxable.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,EAAE,EAAE,YAG1C,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type DataCategory = {
|
|
2
|
+
nameTex: string;
|
|
3
|
+
gen: (min?: number, max?: number) => number;
|
|
4
|
+
};
|
|
5
|
+
export declare const randomDataCategAndValues: (nbCateg: number, nbValues: number) => {
|
|
6
|
+
categ: DataCategory;
|
|
7
|
+
values: number[];
|
|
8
|
+
}[];
|
|
9
|
+
export declare const randomDataTable: (nbCateg?: number, nbValues?: number, isRowBased?: boolean) => string[][];
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=randomDataTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"randomDataTable.d.ts","sourceRoot":"","sources":["../../../../src/exercises/utils/data/randomDataTable.ts"],"names":[],"mappings":"AAKA,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;CAC7C,CAAC;AA6DF,eAAO,MAAM,wBAAwB,GAAI,SAAS,MAAM,EAAE,UAAU,MAAM;;;GAazE,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,UAAS,MAAU,EACnB,WAAU,MAAU,EACpB,aAAY,OAAc,eAW3B,CAAC"}
|