math-exercises 2.2.48 → 2.2.50
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/exercise.d.ts +11 -2
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/exercise.js +1 -0
- package/lib/exercises/math/calcul/fractions/fractionsSum.d.ts +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSum.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSum.js +12 -4
- package/lib/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.js +33 -5
- package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.js +39 -5
- package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.js +33 -8
- package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSubNoRelative.d.ts.map +1 -1
- package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSubNoRelative.js +2 -1
- package/lib/exercises/math/calcul/mentalCaluls/mentalPercentage.d.ts.map +1 -1
- package/lib/exercises/math/calcul/mentalCaluls/mentalPercentage.js +2 -4
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.js +8 -0
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.js +8 -0
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq3.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq3.js +10 -0
- package/lib/exercises/math/conversion/lengthConversion.d.ts +4 -1
- package/lib/exercises/math/conversion/lengthConversion.d.ts.map +1 -1
- package/lib/exercises/math/conversion/lengthConversion.js +60 -19
- package/lib/exercises/math/conversion/massConversion.d.ts.map +1 -1
- package/lib/exercises/math/conversion/massConversion.js +5 -1
- package/lib/exercises/math/functions/trinoms/index.d.ts +1 -0
- package/lib/exercises/math/functions/trinoms/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/index.js +1 -0
- package/lib/exercises/math/functions/trinoms/trinomSignFromRoots.d.ts +8 -0
- package/lib/exercises/math/functions/trinoms/trinomSignFromRoots.d.ts.map +1 -0
- package/lib/exercises/math/functions/trinoms/trinomSignFromRoots.js +114 -0
- package/lib/exercises/math/geometry/cartesian/readAbscissOnLine.js +1 -1
- package/lib/exercises/math/geometry/index.d.ts +1 -0
- package/lib/exercises/math/geometry/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/index.js +1 -0
- package/lib/exercises/math/geometry/parametric/extractPointFromParametricLine.d.ts +8 -0
- package/lib/exercises/math/geometry/parametric/extractPointFromParametricLine.d.ts.map +1 -0
- package/lib/exercises/math/geometry/parametric/extractPointFromParametricLine.js +110 -0
- package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.d.ts +8 -0
- package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.d.ts.map +1 -0
- package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.js +108 -0
- package/lib/exercises/math/geometry/parametric/index.d.ts +4 -0
- package/lib/exercises/math/geometry/parametric/index.d.ts.map +1 -0
- package/lib/exercises/math/geometry/parametric/index.js +19 -0
- package/lib/exercises/math/geometry/parametric/pointFromParametricLine.d.ts +12 -0
- package/lib/exercises/math/geometry/parametric/pointFromParametricLine.d.ts.map +1 -0
- package/lib/exercises/math/geometry/parametric/pointFromParametricLine.js +95 -0
- package/lib/exercises/math/geometry/volumes/coneVolume.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/coneVolume.js +5 -3
- package/lib/exercises/math/probaStat/probaFromTableWithContext.js +2 -2
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormula.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormula.js +66 -24
- package/lib/exercises/math/squareRoots/squareRootIdentities.js +3 -3
- package/lib/exercises/vea/numberVEA.d.ts +2 -0
- package/lib/exercises/vea/numberVEA.d.ts.map +1 -0
- package/lib/exercises/vea/numberVEA.js +11 -0
- package/lib/index.d.ts +20 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/parametricLine.d.ts +15 -0
- package/lib/math/geometry/parametricLine.d.ts.map +1 -0
- package/lib/math/geometry/parametricLine.js +46 -0
- package/lib/math/geometry/spacePoint.d.ts +3 -0
- package/lib/math/geometry/spacePoint.d.ts.map +1 -1
- package/lib/math/geometry/spacePoint.js +12 -0
- package/lib/math/geometry/spaceVector.d.ts +5 -0
- package/lib/math/geometry/spaceVector.d.ts.map +1 -1
- package/lib/math/geometry/spaceVector.js +20 -0
- package/lib/math/polynomials/affine.d.ts.map +1 -1
- package/lib/math/polynomials/affine.js +3 -1
- package/lib/math/polynomials/generalTrinom.d.ts +52 -0
- package/lib/math/polynomials/generalTrinom.d.ts.map +1 -0
- package/lib/math/polynomials/generalTrinom.js +102 -0
- package/lib/math/polynomials/trinom.d.ts +5 -1
- package/lib/math/polynomials/trinom.d.ts.map +1 -1
- package/lib/math/polynomials/trinom.js +9 -4
- package/lib/playground.js +5 -4
- package/lib/server.js +7 -3
- package/lib/tree/nodes/algebraicNode.d.ts +1 -1
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/absNode.d.ts +1 -1
- package/lib/tree/nodes/functions/absNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/arcSinNode.d.ts +1 -1
- package/lib/tree/nodes/functions/arcSinNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/arccosNode.d.ts +1 -1
- package/lib/tree/nodes/functions/arccosNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/arctanNode.d.ts +1 -1
- package/lib/tree/nodes/functions/arctanNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/cosNode.d.ts +1 -1
- package/lib/tree/nodes/functions/cosNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/expNode.d.ts +1 -1
- package/lib/tree/nodes/functions/expNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/log10Node.d.ts +1 -1
- package/lib/tree/nodes/functions/log10Node.d.ts.map +1 -1
- package/lib/tree/nodes/functions/logNode.d.ts +1 -1
- package/lib/tree/nodes/functions/logNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/oppositeNode.d.ts +2 -1
- package/lib/tree/nodes/functions/oppositeNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/oppositeNode.js +6 -1
- package/lib/tree/nodes/functions/sinNode.d.ts +1 -1
- package/lib/tree/nodes/functions/sinNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sqrtNode.d.ts +2 -1
- package/lib/tree/nodes/functions/sqrtNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sqrtNode.js +6 -1
- package/lib/tree/nodes/functions/tanNode.d.ts +1 -1
- package/lib/tree/nodes/functions/tanNode.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/degree.d.ts +1 -1
- package/lib/tree/nodes/geometry/degree.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/lengthNode.d.ts +1 -1
- package/lib/tree/nodes/geometry/lengthNode.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/lengthNode.js +2 -2
- package/lib/tree/nodes/node.d.ts +2 -1
- package/lib/tree/nodes/node.d.ts.map +1 -1
- package/lib/tree/nodes/node.js +1 -0
- package/lib/tree/nodes/nodeSuperset.d.ts +1 -0
- package/lib/tree/nodes/nodeSuperset.d.ts.map +1 -0
- package/lib/tree/nodes/nodeSuperset.js +1 -0
- package/lib/tree/nodes/numbers/constantNode.d.ts +1 -1
- package/lib/tree/nodes/numbers/constantNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/numberNode.d.ts +1 -1
- package/lib/tree/nodes/numbers/numberNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.d.ts +2 -1
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +7 -1
- package/lib/tree/nodes/operators/divideNode.d.ts +1 -1
- package/lib/tree/nodes/operators/divideNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.d.ts +2 -1
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +14 -1
- package/lib/tree/nodes/operators/limitNode.d.ts +1 -1
- package/lib/tree/nodes/operators/limitNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.d.ts +2 -1
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +7 -1
- package/lib/tree/nodes/operators/powerNode.d.ts +2 -1
- package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/powerNode.js +6 -1
- package/lib/tree/nodes/operators/substractNode.d.ts +2 -1
- package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/substractNode.js +7 -1
- package/lib/tree/nodes/variables/variableNode.d.ts +1 -1
- package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
- package/lib/tree/nodes/variables/variableNode.js +1 -1
- package/lib/tree/parsers/rationalParser.d.ts +2 -0
- package/lib/tree/parsers/rationalParser.d.ts.map +1 -1
- package/lib/tree/parsers/rationalParser.js +33 -8
- package/lib/tree/parsers/spacePointParser.d.ts +3 -0
- package/lib/tree/parsers/spacePointParser.d.ts.map +1 -0
- package/lib/tree/parsers/spacePointParser.js +18 -0
- package/lib/tree/parsers/spaceVectorParser.d.ts +3 -0
- package/lib/tree/parsers/spaceVectorParser.d.ts.map +1 -0
- package/lib/tree/parsers/spaceVectorParser.js +18 -0
- package/lib/tree/parsers/valueParser.d.ts +2 -0
- package/lib/tree/parsers/valueParser.d.ts.map +1 -0
- package/lib/tree/parsers/valueParser.js +10 -0
- package/lib/utils/alea/random.d.ts +1 -1
- package/lib/utils/alea/random.d.ts.map +1 -1
- package/lib/utils/alea/random.js +5 -1
- package/package.json +1 -1
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.lengthConversion = void 0;
|
|
4
|
+
const numberVEA_1 = require("../../../exercises/vea/numberVEA");
|
|
4
5
|
const decimal_1 = require("../../../math/numbers/decimals/decimal");
|
|
5
6
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
6
7
|
const measure_1 = require("../../../pc/measure/measure");
|
|
7
8
|
const distanceUnits_1 = require("../../../pc/units/distanceUnits");
|
|
9
|
+
const random_1 = require("../../../utils/alea/random");
|
|
8
10
|
const shuffle_1 = require("../../../utils/alea/shuffle");
|
|
9
11
|
const exercise_1 = require("../../exercise");
|
|
10
12
|
const getDistinctQuestions_1 = require("../../utils/getDistinctQuestions");
|
|
@@ -18,30 +20,45 @@ const unitsObj = [
|
|
|
18
20
|
distanceUnits_1.DistanceUnit.hm,
|
|
19
21
|
distanceUnits_1.DistanceUnit.km,
|
|
20
22
|
];
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
const getInstruction = (identifiers, options) => {
|
|
24
|
+
const measure = new measure_1.Measure(identifiers.randomLength, 0, unitsObj[identifiers.randomUnitIndex]);
|
|
25
|
+
return `Compléter : $${measure.toTex({
|
|
26
|
+
notScientific: true,
|
|
27
|
+
})} = \\ldots ${unitsObj[identifiers.randomUnitInstructionIndex].toTex()}$`;
|
|
28
|
+
};
|
|
29
|
+
const getAnswer = (identifiers, options) => {
|
|
30
|
+
const measure = new measure_1.Measure(identifiers.randomLength, 0, unitsObj[identifiers.randomUnitIndex]);
|
|
26
31
|
const answer = measure
|
|
27
|
-
.convert(units[randomUnitInstructionIndex])
|
|
28
|
-
.toTex({ notScientific: true });
|
|
32
|
+
.convert(units[identifiers.randomUnitInstructionIndex])
|
|
33
|
+
.toTex({ notScientific: true, hideUnit: true });
|
|
34
|
+
return answer;
|
|
35
|
+
};
|
|
36
|
+
const getLengthConversion = (options) => {
|
|
37
|
+
if (options && !validateOptions(options).valid)
|
|
38
|
+
throw Error("options invalides, gen lengthConversion");
|
|
39
|
+
const availableUnitsIndexes = units
|
|
40
|
+
.map((e, i) => i)
|
|
41
|
+
.filter((i) => !options?.units?.length || options.units.includes(units[i]));
|
|
42
|
+
const randomUnitIndex = (0, random_1.random)(availableUnitsIndexes);
|
|
43
|
+
const randomUnitInstructionIndex = (0, random_1.random)(availableUnitsIndexes, [
|
|
44
|
+
randomUnitIndex,
|
|
45
|
+
]);
|
|
46
|
+
const randomLength = decimal_1.DecimalConstructor.random(0, 1000, (0, randint_1.randint)(0, 4));
|
|
47
|
+
const identifiers = {
|
|
48
|
+
randomLength: randomLength.value,
|
|
49
|
+
randomUnitIndex,
|
|
50
|
+
randomUnitInstructionIndex,
|
|
51
|
+
};
|
|
29
52
|
const question = {
|
|
30
|
-
instruction:
|
|
31
|
-
|
|
32
|
-
})} = \\ldots ${unitsObj[randomUnitInstructionIndex].toTex()}$`,
|
|
33
|
-
answer,
|
|
53
|
+
instruction: getInstruction(identifiers, options),
|
|
54
|
+
answer: getAnswer(identifiers, options),
|
|
34
55
|
keys: [],
|
|
35
56
|
answerFormat: "tex",
|
|
36
|
-
identifiers
|
|
37
|
-
randomLength: randomLength.value,
|
|
38
|
-
randomUnitIndex,
|
|
39
|
-
randomUnitInstructionIndex,
|
|
40
|
-
},
|
|
57
|
+
identifiers,
|
|
41
58
|
};
|
|
42
59
|
return question;
|
|
43
60
|
};
|
|
44
|
-
const getPropositions = (n, { answer, randomLength, randomUnitIndex, randomUnitInstructionIndex }) => {
|
|
61
|
+
const getPropositions = (n, { answer, randomLength, randomUnitIndex, randomUnitInstructionIndex }, options) => {
|
|
45
62
|
const propositions = [];
|
|
46
63
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
47
64
|
const lengthDecimal = new decimal_1.Decimal(randomLength);
|
|
@@ -55,7 +72,27 @@ const getPropositions = (n, { answer, randomLength, randomUnitIndex, randomUnitI
|
|
|
55
72
|
return (0, shuffle_1.shuffle)(propositions);
|
|
56
73
|
};
|
|
57
74
|
const isAnswerValid = (ans, { answer }) => {
|
|
58
|
-
return ans
|
|
75
|
+
return (0, numberVEA_1.numberVEA)(ans, answer);
|
|
76
|
+
};
|
|
77
|
+
const options = [
|
|
78
|
+
{
|
|
79
|
+
id: "units",
|
|
80
|
+
label: "N'utiliser que les unités suivantes :",
|
|
81
|
+
type: exercise_1.GeneratorOptionType.multiSelect,
|
|
82
|
+
target: exercise_1.GeneratorOptionTarget.generation,
|
|
83
|
+
values: units,
|
|
84
|
+
},
|
|
85
|
+
];
|
|
86
|
+
const validateOptions = (opts) => {
|
|
87
|
+
if (opts.units.length < 2)
|
|
88
|
+
return {
|
|
89
|
+
message: "Vous devez choisir au moins deux unités.",
|
|
90
|
+
valid: false,
|
|
91
|
+
};
|
|
92
|
+
return {
|
|
93
|
+
message: "Options valides",
|
|
94
|
+
valid: true,
|
|
95
|
+
};
|
|
59
96
|
};
|
|
60
97
|
exports.lengthConversion = {
|
|
61
98
|
id: "lengthConversion",
|
|
@@ -64,10 +101,14 @@ exports.lengthConversion = {
|
|
|
64
101
|
levels: ["6ème", "5ème", "CAP", "2ndPro"],
|
|
65
102
|
sections: ["Conversions"],
|
|
66
103
|
isSingleStep: true,
|
|
67
|
-
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getLengthConversion, nb),
|
|
104
|
+
generator: (nb, opts) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getLengthConversion(opts), nb),
|
|
68
105
|
qcmTimer: 60,
|
|
69
106
|
freeTimer: 60,
|
|
70
107
|
getPropositions,
|
|
71
108
|
isAnswerValid,
|
|
72
109
|
subject: "Mathématiques",
|
|
110
|
+
getAnswer,
|
|
111
|
+
getInstruction,
|
|
112
|
+
options,
|
|
113
|
+
validateOptions,
|
|
73
114
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"massConversion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/massConversion.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"massConversion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/massConversion.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAGxB,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,0BAA0B,EAAE,MAAM,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAyDF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAahD,CAAC"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.massConversion = void 0;
|
|
4
4
|
const decimal_1 = require("../../../math/numbers/decimals/decimal");
|
|
5
5
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
6
|
+
const numberParser_1 = require("../../../tree/parsers/numberParser");
|
|
6
7
|
const shuffle_1 = require("../../../utils/alea/shuffle");
|
|
7
8
|
const exercise_1 = require("../../exercise");
|
|
8
9
|
const getDistinctQuestions_1 = require("../../utils/getDistinctQuestions");
|
|
@@ -41,7 +42,10 @@ const getPropositions = (n, { answer, randomMass, randomUnitIndex, randomUnitIns
|
|
|
41
42
|
return (0, shuffle_1.shuffle)(propositions);
|
|
42
43
|
};
|
|
43
44
|
const isAnswerValid = (ans, { answer }) => {
|
|
44
|
-
|
|
45
|
+
const parsed = (0, numberParser_1.numberParser)(ans);
|
|
46
|
+
if (!parsed)
|
|
47
|
+
return false;
|
|
48
|
+
return parsed === answer;
|
|
45
49
|
};
|
|
46
50
|
exports.massConversion = {
|
|
47
51
|
id: "massConversion",
|
|
@@ -17,4 +17,5 @@ export * from "./summitAbscissFromDevForm";
|
|
|
17
17
|
export * from "./trinomialMeanValue";
|
|
18
18
|
export * from "./solveSecondDegreeEquationByFactorisation";
|
|
19
19
|
export * from "./solveSecondDegreeEquationFromCano";
|
|
20
|
+
export * from "./trinomSignFromRoots";
|
|
20
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC;AAC9B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC;AAC9B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC;AACpD,cAAc,uBAAuB,CAAC"}
|
|
@@ -33,3 +33,4 @@ __exportStar(require("./summitAbscissFromDevForm"), exports);
|
|
|
33
33
|
__exportStar(require("./trinomialMeanValue"), exports);
|
|
34
34
|
__exportStar(require("./solveSecondDegreeEquationByFactorisation"), exports);
|
|
35
35
|
__exportStar(require("./solveSecondDegreeEquationFromCano"), exports);
|
|
36
|
+
__exportStar(require("./trinomSignFromRoots"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
trinomCoeffs: number[];
|
|
4
|
+
isAskingPositive: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const trinomSignFromRoots: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=trinomSignFromRoots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trinomSignFromRoots.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/trinomSignFromRoots.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,0BAA0B,CAAC;AAalC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAmHF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAgBrD,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.trinomSignFromRoots = void 0;
|
|
4
|
+
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const generalTrinom_1 = require("../../../../math/polynomials/generalTrinom");
|
|
7
|
+
const intervals_1 = require("../../../../math/sets/intervals/intervals");
|
|
8
|
+
const infiniteNode_1 = require("../../../../tree/nodes/numbers/infiniteNode");
|
|
9
|
+
const closure_1 = require("../../../../tree/nodes/sets/closure");
|
|
10
|
+
const intervalNode_1 = require("../../../../tree/nodes/sets/intervalNode");
|
|
11
|
+
const unionIntervalNode_1 = require("../../../../tree/nodes/sets/unionIntervalNode");
|
|
12
|
+
const coinFlip_1 = require("../../../../utils/alea/coinFlip");
|
|
13
|
+
const getPropositions = (n, { answer, trinomCoeffs, isAskingPositive }) => {
|
|
14
|
+
const propositions = [];
|
|
15
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
16
|
+
const trinom = generalTrinom_1.GeneralTrinomConstructor.fromCoeffs(trinomCoeffs);
|
|
17
|
+
const roots = trinom.getRoots();
|
|
18
|
+
const a = trinomCoeffs[2];
|
|
19
|
+
const b = trinomCoeffs[1];
|
|
20
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, getAnswer({ trinomCoeffs, isAskingPositive: !isAskingPositive }));
|
|
21
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new intervalNode_1.IntervalNode(trinom.a, trinom.b, closure_1.ClosureType.FF).toTex());
|
|
22
|
+
while (propositions.length < n) {
|
|
23
|
+
const interval = intervals_1.IntervalConstructor.random();
|
|
24
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, interval.toTree().toTex());
|
|
25
|
+
}
|
|
26
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
27
|
+
};
|
|
28
|
+
const getAnswerNode = (identifiers) => {
|
|
29
|
+
const trinom = generalTrinom_1.GeneralTrinomConstructor.fromCoeffs(identifiers.trinomCoeffs);
|
|
30
|
+
const roots = trinom.getRoots();
|
|
31
|
+
const a = identifiers.trinomCoeffs[2];
|
|
32
|
+
return a > 0 === identifiers.isAskingPositive
|
|
33
|
+
? new unionIntervalNode_1.UnionIntervalNode([
|
|
34
|
+
new intervalNode_1.IntervalNode(infiniteNode_1.MinusInfinityNode, roots[0], closure_1.ClosureType.OF),
|
|
35
|
+
new intervalNode_1.IntervalNode(roots[1], infiniteNode_1.PlusInfinityNode, closure_1.ClosureType.FO),
|
|
36
|
+
])
|
|
37
|
+
: new intervalNode_1.IntervalNode(roots[0], roots[1], closure_1.ClosureType.FF);
|
|
38
|
+
};
|
|
39
|
+
const getAnswer = (identifiers) => {
|
|
40
|
+
return getAnswerNode(identifiers).toTex();
|
|
41
|
+
};
|
|
42
|
+
const getInstruction = (identifiers) => {
|
|
43
|
+
const trinom = generalTrinom_1.GeneralTrinomConstructor.fromCoeffs(identifiers.trinomCoeffs);
|
|
44
|
+
const roots = trinom.getRoots();
|
|
45
|
+
return `Soit $f$ une fonction polynôme de degré $2$ définie sur $\\mathbb{R}$ par $f(x) = ${trinom.toTex()}$.
|
|
46
|
+
|
|
47
|
+
Les racines de $f$ sont $x_1 = ${roots[0].toTex()}$ et $x_2=${roots[1].toTex()}$.
|
|
48
|
+
|
|
49
|
+
Sur quel(s) intervalle(s) les valeurs de la fonction $f$ sont-elles ${identifiers.isAskingPositive ? "positives" : "négatives"} ?`;
|
|
50
|
+
};
|
|
51
|
+
const getHint = (identifiers) => {
|
|
52
|
+
return `Une fonction polynôme de degré $2$ est du signe de son coefficient $a$, sauf entre ses racines.`;
|
|
53
|
+
};
|
|
54
|
+
const getCorrection = (identifiers) => {
|
|
55
|
+
const trinom = generalTrinom_1.GeneralTrinomConstructor.fromCoeffs(identifiers.trinomCoeffs);
|
|
56
|
+
const roots = trinom.getRoots();
|
|
57
|
+
const a = identifiers.trinomCoeffs[2];
|
|
58
|
+
const answer = getAnswer(identifiers);
|
|
59
|
+
const ineqSign = a > 0 ? ">" : "<";
|
|
60
|
+
const sign = a > 0 ? "positive" : "négative";
|
|
61
|
+
return `On sait qu'une fonction polynôme de degré $2$ est du signe de son coefficient $a$, sauf entre ses racines.
|
|
62
|
+
|
|
63
|
+
Ici, $a = ${a}${ineqSign}0$.
|
|
64
|
+
|
|
65
|
+
$f$ est donc ${sign} sauf sur l'intervalle $${new intervalNode_1.IntervalNode(roots[0], roots[1], closure_1.ClosureType.FF).toTex()}$.
|
|
66
|
+
|
|
67
|
+
On en déduit que $f$ est ${identifiers.isAskingPositive ? "positive" : "négative"} sur :
|
|
68
|
+
|
|
69
|
+
$$
|
|
70
|
+
${answer}
|
|
71
|
+
$$`;
|
|
72
|
+
};
|
|
73
|
+
const getKeys = (identifiers) => {
|
|
74
|
+
return ["lbracket", "semicolon", "rbracket", "infty", "cup"];
|
|
75
|
+
};
|
|
76
|
+
const isAnswerValid = (ans, { answer, isAskingPositive, trinomCoeffs }) => {
|
|
77
|
+
const ansNode = getAnswerNode({ isAskingPositive, trinomCoeffs });
|
|
78
|
+
const texs = ansNode.toAllValidTexs();
|
|
79
|
+
return texs.includes(ans);
|
|
80
|
+
};
|
|
81
|
+
const getTrinomSignFromRootsQuestion = () => {
|
|
82
|
+
const trinom = generalTrinom_1.GeneralTrinomConstructor.randomNiceRoots(2);
|
|
83
|
+
const isAskingPositive = (0, coinFlip_1.coinFlip)();
|
|
84
|
+
const identifiers = {
|
|
85
|
+
isAskingPositive,
|
|
86
|
+
trinomCoeffs: trinom.getCoeffs(),
|
|
87
|
+
};
|
|
88
|
+
const question = {
|
|
89
|
+
answer: getAnswer(identifiers),
|
|
90
|
+
instruction: getInstruction(identifiers),
|
|
91
|
+
keys: getKeys(identifiers),
|
|
92
|
+
answerFormat: "tex",
|
|
93
|
+
identifiers,
|
|
94
|
+
hint: getHint(identifiers),
|
|
95
|
+
correction: getCorrection(identifiers),
|
|
96
|
+
};
|
|
97
|
+
return question;
|
|
98
|
+
};
|
|
99
|
+
exports.trinomSignFromRoots = {
|
|
100
|
+
id: "trinomSignFromRoots",
|
|
101
|
+
connector: "\\iff",
|
|
102
|
+
label: "Déterminer le signe d'un trinôme en connaissant ses racines",
|
|
103
|
+
isSingleStep: true,
|
|
104
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getTrinomSignFromRootsQuestion, nb),
|
|
105
|
+
qcmTimer: 60,
|
|
106
|
+
freeTimer: 60,
|
|
107
|
+
getPropositions,
|
|
108
|
+
isAnswerValid,
|
|
109
|
+
subject: "Mathématiques",
|
|
110
|
+
getHint,
|
|
111
|
+
getCorrection,
|
|
112
|
+
getAnswer,
|
|
113
|
+
hasHintAndCorrection: true,
|
|
114
|
+
};
|
|
@@ -105,7 +105,7 @@ const getReadAbscissOnLineQuestion = () => {
|
|
|
105
105
|
break;
|
|
106
106
|
case nombre_1.NumberType.Decimal:
|
|
107
107
|
default:
|
|
108
|
-
axisUnit = (0, randfloat_1.randfloat)(0, 5, 1);
|
|
108
|
+
axisUnit = (0, randfloat_1.randfloat)(0.1, 5, 1);
|
|
109
109
|
coeff = (0, randint_1.randint)(-6, 7, [0, 1]);
|
|
110
110
|
absciss = (0, round_1.round)(axisUnit * coeff, 2);
|
|
111
111
|
oneUnitTex = axisUnit.frenchify();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/geometry/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAE1B,cAAc,0BAA0B,CAAC;AACzC,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/geometry/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAE1B,cAAc,0BAA0B,CAAC;AACzC,cAAc,UAAU,CAAC;AAEzB,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
startPoint: number[];
|
|
4
|
+
vector: number[];
|
|
5
|
+
};
|
|
6
|
+
export declare const extractPointFromParametricLine: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=extractPointFromParametricLine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractPointFromParametricLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/parametric/extractPointFromParametricLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAyHF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,CAiBhE,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.extractPointFromParametricLine = void 0;
|
|
4
|
+
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const parametricLine_1 = require("../../../../math/geometry/parametricLine");
|
|
7
|
+
const spacePoint_1 = require("../../../../math/geometry/spacePoint");
|
|
8
|
+
const spaceVector_1 = require("../../../../math/geometry/spaceVector");
|
|
9
|
+
const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
|
|
10
|
+
const spacePointParser_1 = require("../../../../tree/parsers/spacePointParser");
|
|
11
|
+
const doWhile_1 = require("../../../../utils/doWhile");
|
|
12
|
+
const getPropositions = (n, { answer, startPoint, vector }) => {
|
|
13
|
+
const propositions = [];
|
|
14
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
15
|
+
const line = new parametricLine_1.ParametricLine(spacePoint_1.SpacePointConstructor.fromScalars(startPoint), spaceVector_1.SpaceVectorConstructor.fromScalars(vector));
|
|
16
|
+
while (propositions.length < n) {
|
|
17
|
+
const point = (0, doWhile_1.doWhile)(() => spacePoint_1.SpacePointConstructor.random("A"), (p) => line.hasPoint(p));
|
|
18
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, point.toCoords());
|
|
19
|
+
}
|
|
20
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
21
|
+
};
|
|
22
|
+
const getAnswer = (identifiers) => {
|
|
23
|
+
const line = new parametricLine_1.ParametricLine(spacePoint_1.SpacePointConstructor.fromScalars(identifiers.startPoint), spaceVector_1.SpaceVectorConstructor.fromScalars(identifiers.vector));
|
|
24
|
+
const point = line.getPoint(new numberNode_1.NumberNode(0));
|
|
25
|
+
return point.toCoords();
|
|
26
|
+
};
|
|
27
|
+
const getInstruction = (identifiers) => {
|
|
28
|
+
const line = new parametricLine_1.ParametricLine(spacePoint_1.SpacePointConstructor.fromScalars(identifiers.startPoint), spaceVector_1.SpaceVectorConstructor.fromScalars(identifiers.vector));
|
|
29
|
+
return `Soit $d$ la droite d'équation paramétrique :
|
|
30
|
+
|
|
31
|
+
$$
|
|
32
|
+
${line.toTex()}
|
|
33
|
+
$$
|
|
34
|
+
|
|
35
|
+
où $t\\in \\mathbb{R}$.
|
|
36
|
+
|
|
37
|
+
Donner les coordonnées d'un point appartenant à $d$.
|
|
38
|
+
`;
|
|
39
|
+
};
|
|
40
|
+
const getHint = (identifiers) => {
|
|
41
|
+
return `Il suffit de remplacer $t$ par une valeur afin d'obtenir les coordonnées d'un point de la droite.`;
|
|
42
|
+
};
|
|
43
|
+
const getCorrection = (identifiers) => {
|
|
44
|
+
const line = new parametricLine_1.ParametricLine(spacePoint_1.SpacePointConstructor.fromScalars(identifiers.startPoint), spaceVector_1.SpaceVectorConstructor.fromScalars(identifiers.vector));
|
|
45
|
+
const detailedEquations = line.toDetailedEvaluation(new numberNode_1.NumberNode(0));
|
|
46
|
+
const point = line.getPointCoords(new numberNode_1.NumberNode(0));
|
|
47
|
+
return `Pour obtenir les coordonnées d'un point appartenant à la droite, il suffit de remplacer $t$ par n'importe quelle valeur dans les trois équations. Par simplicité, prenons $t = 0$. On obtient alors :
|
|
48
|
+
|
|
49
|
+
$$
|
|
50
|
+
\\left\\{\\begin{matrix}
|
|
51
|
+
x=${detailedEquations[0].toTex()} \\\\
|
|
52
|
+
y=${detailedEquations[1].toTex()} \\\\
|
|
53
|
+
z=${detailedEquations[2].toTex()}
|
|
54
|
+
\\end{matrix}
|
|
55
|
+
\\right.
|
|
56
|
+
$$
|
|
57
|
+
|
|
58
|
+
On en déduit que le point de coordonnées $\\left(${point
|
|
59
|
+
.map((e) => e.toTex())
|
|
60
|
+
.join(";")}\\right)$ appartient à la droite $d$.`;
|
|
61
|
+
};
|
|
62
|
+
const getKeys = (identifiers) => {
|
|
63
|
+
return ["semicolon"];
|
|
64
|
+
};
|
|
65
|
+
const isAnswerValid = (ans, { answer, startPoint, vector }) => {
|
|
66
|
+
try {
|
|
67
|
+
const line = new parametricLine_1.ParametricLine(spacePoint_1.SpacePointConstructor.fromScalars(startPoint), spaceVector_1.SpaceVectorConstructor.fromScalars(vector));
|
|
68
|
+
const point = (0, spacePointParser_1.spacePointParser)(ans);
|
|
69
|
+
if (!point)
|
|
70
|
+
return false;
|
|
71
|
+
return line.hasPoint(point);
|
|
72
|
+
}
|
|
73
|
+
catch (err) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const getExtractPointFromParametricLineQuestion = () => {
|
|
78
|
+
const startPoint = spacePoint_1.SpacePointConstructor.random("A");
|
|
79
|
+
const vector = spaceVector_1.SpaceVectorConstructor.random("B");
|
|
80
|
+
const identifiers = {
|
|
81
|
+
startPoint: startPoint.getEvaluatedCoords(),
|
|
82
|
+
vector: vector.getEvaluatedCoords(),
|
|
83
|
+
};
|
|
84
|
+
const question = {
|
|
85
|
+
answer: getAnswer(identifiers),
|
|
86
|
+
instruction: getInstruction(identifiers),
|
|
87
|
+
keys: getKeys(identifiers),
|
|
88
|
+
answerFormat: "tex",
|
|
89
|
+
identifiers,
|
|
90
|
+
hint: getHint(identifiers),
|
|
91
|
+
correction: getCorrection(identifiers),
|
|
92
|
+
};
|
|
93
|
+
return question;
|
|
94
|
+
};
|
|
95
|
+
exports.extractPointFromParametricLine = {
|
|
96
|
+
id: "extractPointFromParametricLine",
|
|
97
|
+
connector: "=",
|
|
98
|
+
label: "Trouver un point appartenant à une droite à partir de sa représentation paramétrique",
|
|
99
|
+
isSingleStep: true,
|
|
100
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getExtractPointFromParametricLineQuestion, nb),
|
|
101
|
+
qcmTimer: 60,
|
|
102
|
+
freeTimer: 60,
|
|
103
|
+
getPropositions,
|
|
104
|
+
isAnswerValid,
|
|
105
|
+
subject: "Mathématiques",
|
|
106
|
+
getHint,
|
|
107
|
+
getCorrection,
|
|
108
|
+
getAnswer,
|
|
109
|
+
hasHintAndCorrection: true,
|
|
110
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
startPoint: number[];
|
|
4
|
+
vector: number[];
|
|
5
|
+
};
|
|
6
|
+
export declare const extractVectorFromParametricLine: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=extractVectorFromParametricLine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractVectorFromParametricLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/parametric/extractVectorFromParametricLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AA6GF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAgBjE,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.extractVectorFromParametricLine = void 0;
|
|
4
|
+
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const parametricLine_1 = require("../../../../math/geometry/parametricLine");
|
|
7
|
+
const spacePoint_1 = require("../../../../math/geometry/spacePoint");
|
|
8
|
+
const spaceVector_1 = require("../../../../math/geometry/spaceVector");
|
|
9
|
+
const spaceVectorParser_1 = require("../../../../tree/parsers/spaceVectorParser");
|
|
10
|
+
const doWhile_1 = require("../../../../utils/doWhile");
|
|
11
|
+
const getPropositions = (n, { answer, startPoint, vector }) => {
|
|
12
|
+
const propositions = [];
|
|
13
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
14
|
+
const lineVector = spaceVector_1.SpaceVectorConstructor.fromScalars(vector);
|
|
15
|
+
while (propositions.length < n) {
|
|
16
|
+
const vector = (0, doWhile_1.doWhile)(() => spaceVector_1.SpaceVectorConstructor.random("A"), (v) => lineVector.isColinear(v));
|
|
17
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, vector.toInlineCoordsTex());
|
|
18
|
+
}
|
|
19
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
20
|
+
};
|
|
21
|
+
const getAnswer = (identifiers) => {
|
|
22
|
+
const vector = spaceVector_1.SpaceVectorConstructor.fromScalars(identifiers.vector);
|
|
23
|
+
return vector.toInlineCoordsTex();
|
|
24
|
+
};
|
|
25
|
+
const getInstruction = (identifiers) => {
|
|
26
|
+
const line = new parametricLine_1.ParametricLine(spacePoint_1.SpacePointConstructor.fromScalars(identifiers.startPoint), spaceVector_1.SpaceVectorConstructor.fromScalars(identifiers.vector));
|
|
27
|
+
return `Soit $d$ la droite d'équation paramétrique :
|
|
28
|
+
|
|
29
|
+
$$
|
|
30
|
+
${line.toTex()}
|
|
31
|
+
$$
|
|
32
|
+
|
|
33
|
+
où $t\\in \\mathbb{R}$.
|
|
34
|
+
|
|
35
|
+
Donner les coordonnées d'un vecteur directeur de la droite $d$.
|
|
36
|
+
`;
|
|
37
|
+
};
|
|
38
|
+
// const getHint: GetHint<Identifiers> = (identifiers) => {
|
|
39
|
+
// return `Il suffit de remplacer $t$ par une valeur afin d'obtenir les coordonnées d'un point de la droite.`;
|
|
40
|
+
// };
|
|
41
|
+
// const getCorrection: GetCorrection<Identifiers> = (identifiers) => {
|
|
42
|
+
// const line = new ParametricLine(
|
|
43
|
+
// SpacePointConstructor.fromScalars(identifiers.startPoint),
|
|
44
|
+
// SpaceVectorConstructor.fromScalars(identifiers.vector),
|
|
45
|
+
// );
|
|
46
|
+
// const detailedEquations = line.toDetailedEvaluation(new NumberNode(0));
|
|
47
|
+
// const point = line.getPointCoords(new NumberNode(0));
|
|
48
|
+
// return `Pour obtenir les coordonnées d'un point appartenant à la droite, il suffit de remplacer $t$ par n'importe quelle valeur dans les trois équations. Par simplicité, prenons $t = 0$. On obtient alors :
|
|
49
|
+
// $$
|
|
50
|
+
// \\left\\{\\begin{matrix}
|
|
51
|
+
// x=${detailedEquations[0].toTex()} \\\\
|
|
52
|
+
// y=${detailedEquations[1].toTex()} \\\\
|
|
53
|
+
// z=${detailedEquations[2].toTex()}
|
|
54
|
+
// \\end{matrix}
|
|
55
|
+
// \\right.
|
|
56
|
+
// $$
|
|
57
|
+
// On en déduit que le point de coordonnées $\\left(${point
|
|
58
|
+
// .map((e) => e.toTex())
|
|
59
|
+
// .join(";")}\\right)$ appartient à la droite $d$.`;
|
|
60
|
+
// };
|
|
61
|
+
const getKeys = (identifiers) => {
|
|
62
|
+
return ["semicolon"];
|
|
63
|
+
};
|
|
64
|
+
const isAnswerValid = (ans, { answer, startPoint, vector }) => {
|
|
65
|
+
try {
|
|
66
|
+
const v = spaceVector_1.SpaceVectorConstructor.fromScalars(vector);
|
|
67
|
+
const vecAnswer = (0, spaceVectorParser_1.spaceVectorParser)(ans);
|
|
68
|
+
if (!vecAnswer)
|
|
69
|
+
return false;
|
|
70
|
+
return v.isColinear(vecAnswer);
|
|
71
|
+
}
|
|
72
|
+
catch (err) {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
const getExtractVectorFromParametricLineQuestion = () => {
|
|
77
|
+
const startPoint = spacePoint_1.SpacePointConstructor.random("A");
|
|
78
|
+
const vector = spaceVector_1.SpaceVectorConstructor.random("B");
|
|
79
|
+
const identifiers = {
|
|
80
|
+
startPoint: startPoint.getEvaluatedCoords(),
|
|
81
|
+
vector: vector.getEvaluatedCoords(),
|
|
82
|
+
};
|
|
83
|
+
const question = {
|
|
84
|
+
answer: getAnswer(identifiers),
|
|
85
|
+
instruction: getInstruction(identifiers),
|
|
86
|
+
keys: getKeys(identifiers),
|
|
87
|
+
answerFormat: "tex",
|
|
88
|
+
identifiers,
|
|
89
|
+
// hint: getHint(identifiers),
|
|
90
|
+
// correction: getCorrection(identifiers),
|
|
91
|
+
};
|
|
92
|
+
return question;
|
|
93
|
+
};
|
|
94
|
+
exports.extractVectorFromParametricLine = {
|
|
95
|
+
id: "extractVectorFromParametricLine",
|
|
96
|
+
connector: "=",
|
|
97
|
+
label: "Trouver un vecteur directeur d'une droite à partir de son équation paramétrique",
|
|
98
|
+
isSingleStep: true,
|
|
99
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getExtractVectorFromParametricLineQuestion, nb),
|
|
100
|
+
qcmTimer: 60,
|
|
101
|
+
freeTimer: 60,
|
|
102
|
+
getPropositions,
|
|
103
|
+
isAnswerValid,
|
|
104
|
+
subject: "Mathématiques",
|
|
105
|
+
// getHint,
|
|
106
|
+
// getCorrection,
|
|
107
|
+
getAnswer,
|
|
108
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/parametric/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./pointFromParametricLine"), exports);
|
|
18
|
+
__exportStar(require("./extractPointFromParametricLine"), exports);
|
|
19
|
+
__exportStar(require("./extractVectorFromParametricLine"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
startPoint: number[];
|
|
4
|
+
vector: number[];
|
|
5
|
+
askedPointCoords: number[];
|
|
6
|
+
askedPointName: string;
|
|
7
|
+
isOnLine: boolean;
|
|
8
|
+
coeff?: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const pointFromParametricLine: Exercise<Identifiers>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=pointFromParametricLine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pointFromParametricLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/parametric/pointFromParametricLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAiBlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAqFF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAkBzD,CAAC"}
|