math-exercises 3.0.62 → 3.0.63
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/calculLitteral/distributivity/simpleDistri.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationSimpleSquare.js +3 -3
- package/lib/exercises/math/calculLitteral/systems/basicSystemResolution.js +3 -3
- package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.js +7 -9
- package/lib/exercises/math/conversion/aeraConversion.js +1 -1
- package/lib/exercises/math/conversion/capacityConversion.js +2 -2
- package/lib/exercises/math/derivation/tangent/derivativeTangentEquationReading.d.ts.map +1 -1
- package/lib/exercises/math/derivation/tangent/derivativeTangentEquationReading.js +17 -9
- package/lib/exercises/math/derivation/variations/thirdDegreeFunctionVariation.d.ts.map +1 -1
- package/lib/exercises/math/derivation/variations/thirdDegreeFunctionVariation.js +3 -0
- package/lib/exercises/math/functions/affines/interceptReading.js +1 -1
- package/lib/exercises/math/functions/affines/leadingCoefficient.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/leadingCoefficient.js +8 -2
- package/lib/exercises/math/functions/affines/leadingCoefficientCalculV2.js +1 -1
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.js +1 -1
- package/lib/exercises/math/geometry/cartesian/cartesianFromTwoPoints.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/cartesianFromTwoPoints.js +12 -8
- package/lib/exercises/math/geometry/cartesian/cartesianFromVectorAndPoint.js +3 -3
- package/lib/exercises/math/geometry/cartesian/directionVector.js +1 -1
- package/lib/exercises/math/geometry/cartesian/directionVectorEquation.js +1 -1
- package/lib/exercises/math/geometry/cartesian/drawAlineInGGB.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/drawAlineInGGB.js +3 -3
- package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.js +5 -5
- package/lib/exercises/math/geometry/lines/cartesianEquationsIntersection.js +2 -2
- package/lib/exercises/math/geometry/lines/directorVectorFromAnother.js +1 -1
- package/lib/exercises/math/geometry/lines/directorVectorFromReductEquation.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/directorVectorFromReductEquation.js +11 -6
- package/lib/exercises/math/geometry/lines/drawLineFromCartesianEquation.js +5 -5
- package/lib/exercises/math/geometry/lines/drawLineFromPointAndVector.js +3 -3
- package/lib/exercises/math/geometry/lines/findParallelLineFromCartesianEquation.js +3 -3
- package/lib/exercises/math/geometry/lines/findParallelLineFromReductEquation.js +1 -1
- package/lib/exercises/math/geometry/lines/isPointOnCartesianLine.js +2 -2
- package/lib/exercises/math/geometry/lines/isPointOnLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/isPointOnLine.js +2 -2
- package/lib/exercises/math/geometry/lines/reductEquationFindY.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/reductEquationFindY.js +12 -3
- package/lib/exercises/math/geometry/lines/reductEquationFromTwoPoints.js +3 -3
- package/lib/exercises/math/geometry/parametric/extractPointFromParametricLine.js +1 -1
- package/lib/exercises/math/geometry/perimeters/circleCircumference.d.ts.map +1 -1
- package/lib/exercises/math/geometry/perimeters/circleCircumference.js +8 -9
- package/lib/exercises/math/geometry/vectors/alignementViaColinearity.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/alignementViaColinearity.js +9 -5
- package/lib/exercises/math/geometry/vectors/lineFromDirectorVector.js +4 -4
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleBase.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleBase.js +0 -2
- package/lib/exercises/math/probaStat/stats1var/quartiles.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/quartiles.js +6 -7
- package/lib/exercises/math/python/conditionIf.d.ts +1 -1
- package/lib/exercises/math/python/conditionIf.d.ts.map +1 -1
- package/lib/exercises/math/python/conditionIf.js +29 -16
- package/lib/exercises/math/python/forLoop.d.ts.map +1 -1
- package/lib/exercises/math/python/forLoop.js +30 -18
- package/lib/exercises/math/python/inOutCalcul.d.ts.map +1 -1
- package/lib/exercises/math/python/inOutCalcul.js +25 -12
- package/lib/exercises/math/python/pyForLoop1Exercise.d.ts +4 -7
- package/lib/exercises/math/python/pyForLoop1Exercise.d.ts.map +1 -1
- package/lib/exercises/math/python/pyForLoop1Exercise.js +77 -118
- package/lib/exercises/math/python/pyNestedForLoopExercise.d.ts +0 -3
- package/lib/exercises/math/python/pyNestedForLoopExercise.d.ts.map +1 -1
- package/lib/exercises/math/python/pyNestedForLoopExercise.js +50 -51
- package/lib/exercises/math/python/pyWhileLoop1Exercise.d.ts +1 -3
- package/lib/exercises/math/python/pyWhileLoop1Exercise.d.ts.map +1 -1
- package/lib/exercises/math/python/pyWhileLoop1Exercise.js +70 -74
- package/lib/exercises/math/python/pythonFunctionTrinom.d.ts.map +1 -1
- package/lib/exercises/math/python/pythonFunctionTrinom.js +26 -13
- package/lib/exercises/math/python/whileLoop.d.ts.map +1 -1
- package/lib/exercises/math/python/whileLoop.js +30 -18
- package/lib/exercises/math/sequences/arithmetic/arithmeticExplicitFormulaUsage.js +1 -1
- package/lib/exercises/math/sequences/geometric/geometricExplicitFormulaUsage.js +1 -1
- package/lib/index.d.ts +12 -17
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/vector.js +1 -1
- package/lib/math/systems/generalSystem.js +5 -5
- package/package.json +1 -1
|
@@ -9,21 +9,15 @@ const operationsreversed = [
|
|
|
9
9
|
{ name: "-", func: (x, step) => x - step },
|
|
10
10
|
{ name: "/", func: (x, step) => Math.floor(x / step) },
|
|
11
11
|
];
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const opIndex = randint(0, operations.length);
|
|
15
|
-
const op = operations[opIndex];
|
|
16
|
-
const step = randint(1, 10, [0, 1]);
|
|
17
|
-
const iterations = randint(1, 6, [1]);
|
|
18
|
-
let x = initialValue;
|
|
19
|
-
const a = randint(10, 30);
|
|
20
|
-
while (x <= a) {
|
|
21
|
-
x = op.func(x, step);
|
|
22
|
-
}
|
|
12
|
+
const getAnswer = (identifiers) => {
|
|
13
|
+
const { a, initialValue, iterations, opIndex, step, x } = identifiers;
|
|
23
14
|
const answer = x.toString();
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
return answer;
|
|
16
|
+
};
|
|
17
|
+
const getInstruction = (identifiers) => {
|
|
18
|
+
const { a, initialValue, iterations, opIndex, step, x } = identifiers;
|
|
19
|
+
const op = operations[opIndex];
|
|
20
|
+
return `Qu'affichera le programme suivant ?
|
|
27
21
|
\`\`\`
|
|
28
22
|
a = ${a}
|
|
29
23
|
n = ${initialValue}
|
|
@@ -31,13 +25,32 @@ while n <= a:
|
|
|
31
25
|
n = n ${op.name} ${step}
|
|
32
26
|
print(n)
|
|
33
27
|
\`\`\`
|
|
34
|
-
|
|
28
|
+
`;
|
|
29
|
+
};
|
|
30
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
31
|
+
const question = {
|
|
32
|
+
answer: getAnswer(identifiers),
|
|
33
|
+
instruction: getInstruction(identifiers),
|
|
35
34
|
keys: ["a", "equal"],
|
|
36
35
|
answerFormat: "tex",
|
|
37
|
-
identifiers
|
|
36
|
+
identifiers,
|
|
38
37
|
};
|
|
39
38
|
return question;
|
|
40
39
|
};
|
|
40
|
+
const getWhileLoopQuestion = () => {
|
|
41
|
+
const initialValue = randint(0, 13, [0, 1]);
|
|
42
|
+
const opIndex = randint(0, operations.length);
|
|
43
|
+
const op = operations[opIndex];
|
|
44
|
+
const step = randint(1, 10, [0, 1]);
|
|
45
|
+
const iterations = randint(1, 6, [1]);
|
|
46
|
+
let x = initialValue;
|
|
47
|
+
const a = randint(10, 30);
|
|
48
|
+
while (x <= a) {
|
|
49
|
+
x = op.func(x, step);
|
|
50
|
+
}
|
|
51
|
+
const identifiers = { initialValue, step, iterations, opIndex, a, x };
|
|
52
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
53
|
+
};
|
|
41
54
|
const getPropositions = (n, { answer, step, opIndex, x }) => {
|
|
42
55
|
const propositions = [];
|
|
43
56
|
const correctAnswer = answer;
|
|
@@ -63,13 +76,12 @@ const isAnswerValid = (ans, { answer }) => {
|
|
|
63
76
|
export const whileLoop = {
|
|
64
77
|
id: "whileLoop",
|
|
65
78
|
label: "Boucle while $2$",
|
|
66
|
-
levels: ["2nde"],
|
|
67
79
|
isSingleStep: true,
|
|
68
|
-
sections: ["Python"],
|
|
69
80
|
generator: (nb) => getDistinctQuestions(getWhileLoopQuestion, nb),
|
|
70
81
|
qcmTimer: 60,
|
|
71
82
|
freeTimer: 60,
|
|
72
83
|
getPropositions,
|
|
73
84
|
isAnswerValid,
|
|
74
85
|
subject: "Mathématiques",
|
|
86
|
+
getQuestionFromIdentifiers,
|
|
75
87
|
};
|
|
@@ -21,7 +21,7 @@ const getArithmeticExplicitFormulaUsage = () => {
|
|
|
21
21
|
keys: ["u", "underscore", "equal"],
|
|
22
22
|
answerFormat: "tex",
|
|
23
23
|
identifiers: { firstValue, askedRank, reason },
|
|
24
|
-
hint: `
|
|
24
|
+
hint: `Remplace $n$ par $${askedRank}$ dans la formule donnée.`,
|
|
25
25
|
correction: `On remplace $n$ par $${askedRank}$ dans la formule donnée :
|
|
26
26
|
|
|
27
27
|
${alignTex([
|
|
@@ -22,7 +22,7 @@ const getAnswer = (identifiers) => {
|
|
|
22
22
|
};
|
|
23
23
|
const getHint = (identifiers) => {
|
|
24
24
|
const { askedRank } = identifiers;
|
|
25
|
-
return `
|
|
25
|
+
return `Remplace $n$ par $${askedRank}$ dans la formule donnée.`;
|
|
26
26
|
};
|
|
27
27
|
const getCorrection = (identifiers) => {
|
|
28
28
|
const { firstValue, reason, askedRank } = identifiers;
|
package/lib/index.d.ts
CHANGED
|
@@ -1994,18 +1994,15 @@ declare const mathExercises: (Exercise<{
|
|
|
1994
1994
|
degree: number;
|
|
1995
1995
|
leftBoundPiMultiple: number;
|
|
1996
1996
|
}, {}> | Exercise<{
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
b?: number;
|
|
2002
|
-
};
|
|
1997
|
+
initialValue: number;
|
|
1998
|
+
step: number;
|
|
1999
|
+
iterations: number;
|
|
2000
|
+
opIndex: number;
|
|
2003
2001
|
}, {}> | Exercise<{
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
};
|
|
2002
|
+
a: number;
|
|
2003
|
+
b: number;
|
|
2004
|
+
op: string;
|
|
2005
|
+
withInput: boolean;
|
|
2009
2006
|
}, {}> | Exercise<{
|
|
2010
2007
|
a: number;
|
|
2011
2008
|
b: number;
|
|
@@ -2030,14 +2027,12 @@ declare const mathExercises: (Exercise<{
|
|
|
2030
2027
|
}, {}> | Exercise<{
|
|
2031
2028
|
a: number;
|
|
2032
2029
|
b: number;
|
|
2033
|
-
|
|
2030
|
+
opName: string;
|
|
2034
2031
|
condition: string;
|
|
2035
2032
|
}, {}> | Exercise<{
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
p: number;
|
|
2040
|
-
};
|
|
2033
|
+
op: string;
|
|
2034
|
+
n: number;
|
|
2035
|
+
p: number;
|
|
2041
2036
|
}, {}> | Exercise<{
|
|
2042
2037
|
p: number;
|
|
2043
2038
|
n: number;
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,QAAA,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAA+B,CAAC;AACnD,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -56,7 +56,7 @@ export class Vector {
|
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
58
|
toTexWithCoords() {
|
|
59
|
-
return `\\overrightarrow{${this.name}}\\begin{pmatrix}${this.x.toTex()} \\\\[3pt] ${this.y.toTex()} \\end{pmatrix}`;
|
|
59
|
+
return `\\overrightarrow{${this.name}}\\hspace{-2pt}\\begin{pmatrix}${this.x.toTex()} \\\\[3pt] ${this.y.toTex()} \\end{pmatrix}`;
|
|
60
60
|
}
|
|
61
61
|
toCoords() {
|
|
62
62
|
return `\\begin{pmatrix}${this.x.toTex()} \\\\[3pt] ${this.y.toTex()} \\end{pmatrix}`;
|
|
@@ -159,7 +159,7 @@ ${new AddNode(multiply(this.coeffs[1][0], "x"), multiply(this.coeffs[1][1], "y")
|
|
|
159
159
|
: equa2.isolate(varName);
|
|
160
160
|
corr += `
|
|
161
161
|
|
|
162
|
-
On peut isoler $${varName}$ dans la ${isFirstEqua ? "première" : "
|
|
162
|
+
On peut isoler $${varName}$ dans la ${isFirstEqua ? "première" : "seconde"} équation :
|
|
163
163
|
|
|
164
164
|
$$
|
|
165
165
|
${isolated.toTex()}
|
|
@@ -178,7 +178,7 @@ $$`;
|
|
|
178
178
|
const varFinalSimp = varFinal.simplify();
|
|
179
179
|
corr += `
|
|
180
180
|
|
|
181
|
-
On peut alors remplacer $${varName}$ dans la ${isFirstEqua ? "
|
|
181
|
+
On peut alors remplacer $${varName}$ dans la ${isFirstEqua ? "seconde" : "première"} équation, pour en déduire $${isX ? "y" : "x"}$ :
|
|
182
182
|
|
|
183
183
|
${alignTex([[substituted.toTex()], [subSimp.toTex()], [isolated2.toTex()]])}
|
|
184
184
|
|
|
@@ -210,10 +210,10 @@ ${alignTex([[isolated.toTex()], [varFinal.toTex()], [varFinalSimp.toTex()]])}
|
|
|
210
210
|
if (shouldHandleFirst || shouldHandleSecond) {
|
|
211
211
|
corr += `
|
|
212
212
|
|
|
213
|
-
On
|
|
213
|
+
On multiplie la ${shouldHandleFirst
|
|
214
214
|
? `première équation par $${firstEquaMultiple}$`
|
|
215
|
-
: `
|
|
216
|
-
? ` et la
|
|
215
|
+
: `seconde équation par $${secondEquaMultiple}$`} ${shouldHandleFirst && shouldHandleSecond
|
|
216
|
+
? ` et la seconde équation par $${secondEquaMultiple}$`
|
|
217
217
|
: ""} :
|
|
218
218
|
|
|
219
219
|
$$
|