math-exercises 2.2.33 → 2.2.35
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/README.md +6 -62
- package/lib/exercises/math/calcul/proportionality/proportionalityTable.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/proportionalityTable.js +18 -8
- package/lib/exercises/math/calcul/proportionality/proportionalityTableCoefficient.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/proportionalityTableCoefficient.js +18 -10
- package/lib/exercises/math/functions/affines/affineAdjustment.d.ts +2 -0
- package/lib/exercises/math/functions/affines/affineAdjustment.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineAdjustment.js +16 -8
- package/lib/exercises/math/functions/affines/affineAdjustmentComplete.d.ts +2 -0
- package/lib/exercises/math/functions/affines/affineAdjustmentComplete.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineAdjustmentComplete.js +7 -6
- package/lib/exercises/math/functions/affines/affineAdjustmentRsquared.d.ts +2 -0
- package/lib/exercises/math/functions/affines/affineAdjustmentRsquared.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineAdjustmentRsquared.js +7 -6
- package/lib/exercises/math/functions/basics/inverseImageFunctionTable.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/inverseImageFunctionTable.js +19 -7
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.js +3 -1
- package/lib/exercises/math/geometry/vectors/vectorNormCalculation.js +2 -2
- package/lib/exercises/math/percent/globalPercent.d.ts.map +1 -1
- package/lib/exercises/math/percent/globalPercent.js +3 -4
- package/lib/exercises/math/percent/isTableProportional.d.ts +4 -1
- package/lib/exercises/math/percent/isTableProportional.d.ts.map +1 -1
- package/lib/exercises/math/percent/isTableProportional.js +13 -9
- package/lib/exercises/math/percent/populationEffectifFromSubPopulation.d.ts.map +1 -1
- package/lib/exercises/math/percent/populationEffectifFromSubPopulation.js +9 -3
- package/lib/exercises/math/percent/reciprocalPercentage.d.ts.map +1 -1
- package/lib/exercises/math/percent/reciprocalPercentage.js +3 -4
- package/lib/exercises/math/probaStat/probaFromTableNoContext.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaFromTableNoContext.js +35 -18
- package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaFromTableWithContext.js +26 -18
- package/lib/exercises/math/probaStat/stats1var/averageWithTable.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/averageWithTable.js +17 -9
- package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.js +81 -38
- package/lib/exercises/math/probaStat/stats1var/median.d.ts +1 -0
- package/lib/exercises/math/probaStat/stats1var/median.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/median.js +16 -8
- package/lib/exercises/math/probaStat/stats1var/quartiles.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/quartiles.js +16 -24
- package/lib/exercises/math/probaStat/stats2var/averagePoint.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats2var/averagePoint.js +18 -10
- package/lib/exercises/math/spaceGeometry/vectors/spaceVectorNormCalculation.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/vectors/spaceVectorNormCalculation.js +42 -29
- package/lib/index.d.ts +11 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/utils/latex/dollarize.d.ts +2 -0
- package/lib/utils/latex/dollarize.d.ts.map +1 -0
- package/lib/utils/latex/dollarize.js +7 -0
- package/lib/utils/markdown/mdCode.d.ts +2 -0
- package/lib/utils/markdown/mdCode.d.ts.map +1 -0
- package/lib/utils/markdown/mdCode.js +9 -0
- package/lib/utils/markdown/mdTable.d.ts +2 -0
- package/lib/utils/markdown/mdTable.d.ts.map +1 -0
- package/lib/utils/markdown/mdTable.js +17 -0
- package/package.json +1 -1
|
@@ -9,40 +9,49 @@ const sqrtNode_1 = require("../../../../tree/nodes/functions/sqrtNode");
|
|
|
9
9
|
const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
10
10
|
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
11
11
|
const alignTex_1 = require("../../../../utils/latex/alignTex");
|
|
12
|
+
const getHint = (identifiers) => {
|
|
13
|
+
return "La norme d'un vecteur de l'espace est la racine carrée de la somme des carrés de ses coordonnées.";
|
|
14
|
+
};
|
|
15
|
+
const getCorrection = ({ x, y, z }) => {
|
|
16
|
+
const answer = getAnswer({ x, y, z });
|
|
17
|
+
return `La norme d'un vecteur de l'espace est la racine carrée de la somme des carrés de ses coordonnées. Ici, on a donc :
|
|
18
|
+
|
|
19
|
+
${(0, alignTex_1.alignTex)([
|
|
20
|
+
[
|
|
21
|
+
"\\lVert \\overrightarrow u \\rVert",
|
|
22
|
+
"=",
|
|
23
|
+
new sqrtNode_1.SqrtNode(new addNode_1.AddNode(new powerNode_1.SquareNode(x.toTree()), new addNode_1.AddNode(new powerNode_1.SquareNode(y.toTree()), new powerNode_1.SquareNode(z.toTree())))).toTex(),
|
|
24
|
+
],
|
|
25
|
+
["", "=", new sqrtNode_1.SqrtNode((x ** 2 + y ** 2 + z ** 2).toTree()).toTex()],
|
|
26
|
+
])}
|
|
27
|
+
|
|
28
|
+
Donc $\\lVert \\overrightarrow u \\rVert = ${answer}$.
|
|
29
|
+
`;
|
|
30
|
+
};
|
|
31
|
+
const getAnswer = (identifiers) => {
|
|
32
|
+
const u = new spaceVector_1.SpaceVector("u", identifiers.x.toTree(), identifiers.y.toTree(), identifiers.z.toTree());
|
|
33
|
+
const correctAnswer = u.getNorm();
|
|
34
|
+
return correctAnswer.simplify().toTex();
|
|
35
|
+
};
|
|
36
|
+
const getInstruction = (identifiers) => {
|
|
37
|
+
const u = new spaceVector_1.SpaceVector("u", identifiers.x.toTree(), identifiers.y.toTree(), identifiers.z.toTree());
|
|
38
|
+
return `Cacluler la norme du vecteur $${u.toTexWithCoords()}$`;
|
|
39
|
+
};
|
|
12
40
|
const getSpaceVectorNormCalculationQuestion = () => {
|
|
13
41
|
const u = spaceVector_1.SpaceVectorConstructor.random("u", false);
|
|
14
|
-
const
|
|
15
|
-
|
|
42
|
+
const identifiers = {
|
|
43
|
+
x: u.x.evaluate({}),
|
|
44
|
+
y: u.y.evaluate({}),
|
|
45
|
+
z: u.z.evaluate({}),
|
|
46
|
+
};
|
|
16
47
|
const question = {
|
|
17
|
-
answer,
|
|
18
|
-
instruction:
|
|
48
|
+
answer: getAnswer(identifiers),
|
|
49
|
+
instruction: getInstruction(identifiers),
|
|
19
50
|
keys: [],
|
|
20
51
|
answerFormat: "tex",
|
|
21
|
-
identifiers
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
z: u.z.evaluate({}),
|
|
25
|
-
},
|
|
26
|
-
hint: "La norme d'un vecteur de l'espace est la racine carrée de la somme des carrés de ses coordonnées.",
|
|
27
|
-
correction: `La norme d'un vecteur de l'espace est la racine carrée de la somme des carrés de ses coordonnées. Ici, on a donc :
|
|
28
|
-
|
|
29
|
-
${(0, alignTex_1.alignTex)([
|
|
30
|
-
[
|
|
31
|
-
"\\lVert \\overrightarrow u \\rVert",
|
|
32
|
-
"=",
|
|
33
|
-
new sqrtNode_1.SqrtNode(new addNode_1.AddNode(new powerNode_1.SquareNode(u.x), new addNode_1.AddNode(new powerNode_1.SquareNode(u.y), new powerNode_1.SquareNode(u.z)))).toTex(),
|
|
34
|
-
],
|
|
35
|
-
[
|
|
36
|
-
"",
|
|
37
|
-
"=",
|
|
38
|
-
new sqrtNode_1.SqrtNode((u.x.evaluate({}) ** 2 +
|
|
39
|
-
u.y.evaluate({}) ** 2 +
|
|
40
|
-
u.z.evaluate({}) ** 2).toTree()).toTex(),
|
|
41
|
-
],
|
|
42
|
-
])}
|
|
43
|
-
|
|
44
|
-
Donc $\\lVert \\overrightarrow u \\rVert = ${answer}$.
|
|
45
|
-
`,
|
|
52
|
+
identifiers,
|
|
53
|
+
hint: getHint(identifiers),
|
|
54
|
+
correction: getCorrection(identifiers),
|
|
46
55
|
};
|
|
47
56
|
return question;
|
|
48
57
|
};
|
|
@@ -76,4 +85,8 @@ exports.spaceVectorNormCalculation = {
|
|
|
76
85
|
isAnswerValid,
|
|
77
86
|
subject: "Mathématiques",
|
|
78
87
|
hasHintAndCorrection: true,
|
|
88
|
+
getHint,
|
|
89
|
+
getCorrection,
|
|
90
|
+
getAnswer,
|
|
91
|
+
getInstruction,
|
|
79
92
|
};
|
package/lib/index.d.ts
CHANGED
|
@@ -564,14 +564,20 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
|
|
|
564
564
|
G2x: number;
|
|
565
565
|
G2y: number;
|
|
566
566
|
G1y: number;
|
|
567
|
+
xValues: number[];
|
|
568
|
+
yValues: number[];
|
|
567
569
|
}> | import("./exercises/exercise").Exercise<{
|
|
568
570
|
rSquared: number;
|
|
571
|
+
xValues: number[];
|
|
572
|
+
yValues: number[];
|
|
569
573
|
}> | import("./exercises/exercise").Exercise<{
|
|
570
574
|
G1x: number;
|
|
571
575
|
G2x: number;
|
|
572
576
|
G2y: number;
|
|
573
577
|
G1y: number;
|
|
574
578
|
rSquared: number;
|
|
579
|
+
xValues: number[];
|
|
580
|
+
yValues: number[];
|
|
575
581
|
}> | import("./exercises/exercise").Exercise<{
|
|
576
582
|
trinomial: number[];
|
|
577
583
|
leftbound: number;
|
|
@@ -1087,7 +1093,10 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
|
|
|
1087
1093
|
}> | import("./exercises/exercise").Exercise<{
|
|
1088
1094
|
total: number;
|
|
1089
1095
|
lefties: number;
|
|
1090
|
-
}> | import("./exercises/exercise").Exercise<{
|
|
1096
|
+
}> | import("./exercises/exercise").Exercise<{
|
|
1097
|
+
xValues: number[];
|
|
1098
|
+
yValues: number[];
|
|
1099
|
+
}> | import("./exercises/exercise").Exercise<{
|
|
1091
1100
|
evolution: number;
|
|
1092
1101
|
}> | import("./exercises/exercise").Exercise<{
|
|
1093
1102
|
TVA: number;
|
|
@@ -1198,6 +1207,7 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
|
|
|
1198
1207
|
rand: number;
|
|
1199
1208
|
}> | import("./exercises/exercise").Exercise<{
|
|
1200
1209
|
randomValues: number[];
|
|
1210
|
+
randomEffectives: number[];
|
|
1201
1211
|
}> | import("./exercises/exercise").Exercise<{
|
|
1202
1212
|
sortedValues: number[];
|
|
1203
1213
|
}> | import("./exercises/exercise").Exercise<{
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,yBAAyB,CAAC;AAEjC,QAAA,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,yBAAyB,CAAC;AAEjC,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA+B,CAAC;AACnD,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dollarize.d.ts","sourceRoot":"","sources":["../../../src/utils/latex/dollarize.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,SAAU,MAAM,GAAG,MAAM,WAE9C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mdCode.d.ts","sourceRoot":"","sources":["../../../src/utils/markdown/mdCode.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,QAAS,MAAM,WAIjC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mdTable.d.ts","sourceRoot":"","sources":["../../../src/utils/markdown/mdTable.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,OAAO,SAAU,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,EAAE,WASlD,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mdTable = void 0;
|
|
4
|
+
const rowBuilder = (row) => {
|
|
5
|
+
return "|" + row.join("|") + "|";
|
|
6
|
+
};
|
|
7
|
+
const mdTable = (rows) => {
|
|
8
|
+
const width = rows[0].length;
|
|
9
|
+
return `
|
|
10
|
+
<!-- table -->
|
|
11
|
+
${rowBuilder(rows[0])}
|
|
12
|
+
${rowBuilder(new Array(width).fill("-"))}
|
|
13
|
+
${rows.slice(1).map(rowBuilder).join("\n")}
|
|
14
|
+
<!-- !table -->
|
|
15
|
+
`;
|
|
16
|
+
};
|
|
17
|
+
exports.mdTable = mdTable;
|