math-exercises 2.2.6 → 2.2.7
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/addAndSub.js +1 -1
- package/lib/exercises/math/calcul/addAndSubWithoutRelatives.js +1 -1
- package/lib/exercises/math/calcul/digitDecimalRank.d.ts.map +1 -1
- package/lib/exercises/math/calcul/digitDecimalRank.js +2 -3
- package/lib/exercises/math/calcul/digitDecimalRankNumber.d.ts.map +1 -1
- package/lib/exercises/math/calcul/digitDecimalRankNumber.js +2 -3
- package/lib/exercises/math/calcul/digitRank.d.ts.map +1 -1
- package/lib/exercises/math/calcul/digitRank.js +2 -3
- package/lib/exercises/math/calcul/digitRankNumber.d.ts.map +1 -1
- package/lib/exercises/math/calcul/digitRankNumber.js +2 -3
- package/lib/exercises/math/calcul/mentalCaluls/index.d.ts +2 -0
- package/lib/exercises/math/calcul/mentalCaluls/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/mentalCaluls/index.js +2 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSub.js +1 -1
- package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSubNoRelative.d.ts +7 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSubNoRelative.d.ts.map +1 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSubNoRelative.js +71 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplications.d.ts.map +1 -1
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplications.js +25 -17
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationsNoRelative.d.ts +7 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationsNoRelative.d.ts.map +1 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationsNoRelative.js +93 -0
- package/lib/exercises/math/calcul/operations/expressionNature.d.ts +1 -0
- package/lib/exercises/math/calcul/operations/expressionNature.d.ts.map +1 -0
- package/lib/exercises/math/calcul/operations/expressionNature.js +81 -0
- package/lib/exercises/math/functions/trinoms/solveSecondDegreeEquationByFactorisation.js +1 -1
- package/lib/exercises/math/functions/trinoms/solveSecondDegreeEquationFromCano.js +1 -1
- package/lib/exercises/math/geometry/cartesian/placeAPoint.d.ts +4 -1
- package/lib/exercises/math/geometry/cartesian/placeAPoint.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/placeAPoint.js +1 -1
- package/lib/exercises/math/percent/averageEvolutionRate.d.ts.map +1 -1
- package/lib/exercises/math/percent/averageEvolutionRate.js +16 -0
- package/lib/exercises/math/percent/cmToEvolution.d.ts +7 -0
- package/lib/exercises/math/percent/cmToEvolution.d.ts.map +1 -0
- package/lib/exercises/math/percent/cmToEvolution.js +70 -0
- package/lib/exercises/math/percent/evolutionToCM.d.ts +0 -1
- package/lib/exercises/math/percent/evolutionToCM.d.ts.map +1 -1
- package/lib/exercises/math/percent/evolutionToCM.js +20 -24
- package/lib/exercises/math/percent/findProportion.d.ts.map +1 -1
- package/lib/exercises/math/percent/findProportion.js +15 -0
- package/lib/exercises/math/percent/globalPercent.d.ts.map +1 -1
- package/lib/exercises/math/percent/globalPercent.js +14 -0
- package/lib/exercises/math/percent/index.d.ts +1 -0
- package/lib/exercises/math/percent/index.d.ts.map +1 -1
- package/lib/exercises/math/percent/index.js +1 -0
- package/lib/exercises/math/percent/isTableProportional.d.ts.map +1 -1
- package/lib/exercises/math/percent/isTableProportional.js +35 -33
- package/lib/exercises/math/percent/percentToDecimal.d.ts.map +1 -1
- package/lib/exercises/math/percent/percentToDecimal.js +14 -0
- package/lib/exercises/math/percent/reciprocalPercentage.d.ts.map +1 -1
- package/lib/exercises/math/percent/reciprocalPercentage.js +18 -0
- package/lib/exercises/math/percent/valuePercent.d.ts.map +1 -1
- package/lib/exercises/math/percent/valuePercent.js +7 -0
- package/lib/exercises/math/powers/powersProduct.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersProduct.js +22 -0
- package/lib/exercises/math/probaStat/expectedValueOfBinomialProba.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/expectedValueOfBinomialProba.js +14 -2
- package/lib/exercises/math/probaStat/varianceOfBinomialProba.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/varianceOfBinomialProba.js +21 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticExplicitFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticExplicitFormulaUsage.js +15 -0
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormula.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormula.js +17 -0
- package/lib/exercises/math/sequences/geometric/geometricExplicitFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricExplicitFormulaUsage.js +13 -0
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormula.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormula.js +15 -0
- package/lib/exercises/math/spaceGeometry/vectors/spaceVectorCoordinatesFromPoints.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/vectors/spaceVectorCoordinatesFromPoints.js +15 -0
- package/lib/exercises/math/spaceGeometry/vectors/spaceVectorNormCalculation.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/vectors/spaceVectorNormCalculation.js +26 -1
- package/lib/exercises/math/suites/sequenceEvaluation.js +1 -1
- package/lib/exercises/math/suites/sequencePlot.d.ts.map +1 -1
- package/lib/exercises/math/suites/sequencePlot.js +10 -3
- package/lib/index.d.ts +43 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -0
- package/lib/math/geometry/spaceVector.d.ts +1 -0
- package/lib/math/geometry/spaceVector.d.ts.map +1 -1
- package/lib/math/geometry/spaceVector.js +3 -0
- package/lib/math/polynomials/trinom.js +2 -2
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +2 -14
- package/lib/server.d.ts +1 -0
- package/lib/server.d.ts.map +1 -1
- package/lib/server.js +4 -1
- package/lib/utils/numberPrototype/toSeparatedThousands.d.ts +2 -0
- package/lib/utils/numberPrototype/toSeparatedThousands.d.ts.map +1 -0
- package/lib/utils/numberPrototype/toSeparatedThousands.js +12 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arithmeticFindExplicitFormula.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormula.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;
|
|
1
|
+
{"version":3,"file":"arithmeticFindExplicitFormula.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormula.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAsEF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAe/D,CAAC"}
|
|
@@ -20,6 +20,22 @@ const getArithmeticFindExplicitFormula = () => {
|
|
|
20
20
|
keys: ["un", "equal", "n"],
|
|
21
21
|
answerFormat: "tex",
|
|
22
22
|
identifiers: { firstValue, reason },
|
|
23
|
+
hint: `Utilise la formule générale d'une suite arithmétique :
|
|
24
|
+
|
|
25
|
+
$u_n = u_0 + n \\times r $,
|
|
26
|
+
|
|
27
|
+
où $u_0$ est le premier terme et $r$ la raison.`,
|
|
28
|
+
correction: `La formule générale d'une suite arithmétique est :
|
|
29
|
+
|
|
30
|
+
$u_n = u_0 + n \\times r $,
|
|
31
|
+
|
|
32
|
+
où $u_0$ est le premier terme et $r$ la raison.
|
|
33
|
+
|
|
34
|
+
Ici, puisque $u_0 = ${firstValue}$ et $r = ${reason}$, on a :
|
|
35
|
+
|
|
36
|
+
$${answer}$
|
|
37
|
+
|
|
38
|
+
`,
|
|
23
39
|
};
|
|
24
40
|
return question;
|
|
25
41
|
};
|
|
@@ -56,4 +72,5 @@ exports.arithmeticFindExplicitFormula = {
|
|
|
56
72
|
getPropositions,
|
|
57
73
|
isAnswerValid,
|
|
58
74
|
subject: "Mathématiques",
|
|
75
|
+
hasHintAndCorrection: true,
|
|
59
76
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometricExplicitFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/geometric/geometricExplicitFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"geometricExplicitFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/geometric/geometricExplicitFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA8DF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAe/D,CAAC"}
|
|
@@ -8,6 +8,7 @@ const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
|
|
|
8
8
|
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
9
9
|
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
10
10
|
const variableNode_1 = require("../../../../tree/nodes/variables/variableNode");
|
|
11
|
+
const alignTex_1 = require("../../../../utils/alignTex");
|
|
11
12
|
const shuffle_1 = require("../../../../utils/shuffle");
|
|
12
13
|
const getGeometricExplicitFormulaUsage = () => {
|
|
13
14
|
const askedRank = (0, randint_1.randint)(0, 10);
|
|
@@ -23,6 +24,17 @@ const getGeometricExplicitFormulaUsage = () => {
|
|
|
23
24
|
keys: ["u", "underscore", "equal"],
|
|
24
25
|
answerFormat: "tex",
|
|
25
26
|
identifiers: { firstValue, reason, askedRank },
|
|
27
|
+
hint: `Il suffit de remplacer $n$ par $${askedRank}$ dans la formule donnée.`,
|
|
28
|
+
correction: `On remplace $n$ par $${askedRank}$ dans la formule donnée :
|
|
29
|
+
|
|
30
|
+
${(0, alignTex_1.alignTex)([
|
|
31
|
+
[
|
|
32
|
+
`u_{${askedRank}}`,
|
|
33
|
+
"=",
|
|
34
|
+
new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(firstValue), new powerNode_1.PowerNode(new numberNode_1.NumberNode(reason), askedRank.toTree())).toTex(),
|
|
35
|
+
],
|
|
36
|
+
["", "=", answer],
|
|
37
|
+
])}`,
|
|
26
38
|
};
|
|
27
39
|
return question;
|
|
28
40
|
};
|
|
@@ -54,4 +66,5 @@ exports.geometricExplicitFormulaUsage = {
|
|
|
54
66
|
getPropositions,
|
|
55
67
|
isAnswerValid,
|
|
56
68
|
subject: "Mathématiques",
|
|
69
|
+
hasHintAndCorrection: true,
|
|
57
70
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometricFindExplicitFormula.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/geometric/geometricFindExplicitFormula.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;
|
|
1
|
+
{"version":3,"file":"geometricFindExplicitFormula.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/geometric/geometricFindExplicitFormula.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAiFF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAe9D,CAAC"}
|
|
@@ -22,6 +22,20 @@ const getGeometricFindExplicitFormula = () => {
|
|
|
22
22
|
keys: ["un", "equal", "n"],
|
|
23
23
|
answerFormat: "tex",
|
|
24
24
|
identifiers: { reason, firstValue },
|
|
25
|
+
hint: `Utilise la formule générale d'une suite géométrique :
|
|
26
|
+
|
|
27
|
+
$u_n = u_0 \\times r^n $,
|
|
28
|
+
|
|
29
|
+
où $u_0$ est le premier terme et $r$ la raison.`,
|
|
30
|
+
correction: `La formule générale d'une suite géométrique est :
|
|
31
|
+
|
|
32
|
+
$u_n = u_0 \\times r^n $,
|
|
33
|
+
|
|
34
|
+
où $u_0$ est le premier terme et $r$ la raison.
|
|
35
|
+
|
|
36
|
+
Ici, puisque $u_0 = ${firstValue}$ et $r = ${reason}$, on a :
|
|
37
|
+
|
|
38
|
+
$${answer}$`,
|
|
25
39
|
};
|
|
26
40
|
return question;
|
|
27
41
|
};
|
|
@@ -58,4 +72,5 @@ exports.geometricFindExplicitFormula = {
|
|
|
58
72
|
getPropositions,
|
|
59
73
|
isAnswerValid,
|
|
60
74
|
subject: "Mathématiques",
|
|
75
|
+
hasHintAndCorrection: true,
|
|
61
76
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spaceVectorCoordinatesFromPoints.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/vectors/spaceVectorCoordinatesFromPoints.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"spaceVectorCoordinatesFromPoints.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/vectors/spaceVectorCoordinatesFromPoints.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG,EAAE,CAAC;AAmEtB,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CAgBlE,CAAC"}
|
|
@@ -5,6 +5,8 @@ const exercise_1 = require("../../../../exercises/exercise");
|
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
6
|
const spacePoint_1 = require("../../../../math/geometry/spacePoint");
|
|
7
7
|
const spaceVector_1 = require("../../../../math/geometry/spaceVector");
|
|
8
|
+
const substractNode_1 = require("../../../../tree/nodes/operators/substractNode");
|
|
9
|
+
const alignTex_1 = require("../../../../utils/alignTex");
|
|
8
10
|
const getSpaceVectorCoordinatesFromPointsQuestion = () => {
|
|
9
11
|
const points = spacePoint_1.SpacePointConstructor.randomDifferent(["A", "B"]);
|
|
10
12
|
const vector = spaceVector_1.SpaceVectorConstructor.fromPoints(points[0], points[1]);
|
|
@@ -22,6 +24,18 @@ const getSpaceVectorCoordinatesFromPointsQuestion = () => {
|
|
|
22
24
|
by: points[1].y.evaluate({}),
|
|
23
25
|
bz: points[1].z.evaluate({}),
|
|
24
26
|
},
|
|
27
|
+
hint: `Soient deux points $M(x_M;y_M;z_M)$ et $N(x_N;y_N;z_N)$, alors le vecteur $\\overrightarrow{MN}$ a pour coordonnées :
|
|
28
|
+
|
|
29
|
+
$\\overrightarrow{MN} \\begin{pmatrix} x_N - x_M \\\\ y_N - y_M \\\\ z_N - z_M \\end{pmatrix}$`,
|
|
30
|
+
correction: `Les coordonnées du vecteur $\\overrightarrow{AB}$ sont :
|
|
31
|
+
|
|
32
|
+
${(0, alignTex_1.alignTex)([
|
|
33
|
+
[
|
|
34
|
+
`\\begin{pmatrix} ${new substractNode_1.SubstractNode(points[1].x, points[0].x).toTex()} \\\\ ${new substractNode_1.SubstractNode(points[1].y, points[0].y).toTex()} \\\\ ${new substractNode_1.SubstractNode(points[1].z, points[0].z).toTex()} \\end{pmatrix}`,
|
|
35
|
+
"=",
|
|
36
|
+
vector.toCoordsTex(),
|
|
37
|
+
],
|
|
38
|
+
])}`,
|
|
25
39
|
};
|
|
26
40
|
return question;
|
|
27
41
|
};
|
|
@@ -49,4 +63,5 @@ exports.spaceVectorCoordinatesFromPoints = {
|
|
|
49
63
|
getPropositions,
|
|
50
64
|
isAnswerValid,
|
|
51
65
|
subject: "Mathématiques",
|
|
66
|
+
hasHintAndCorrection: true,
|
|
52
67
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spaceVectorNormCalculation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/vectors/spaceVectorNormCalculation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"spaceVectorNormCalculation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/vectors/spaceVectorNormCalculation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAwEF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAc5D,CAAC"}
|
|
@@ -6,11 +6,15 @@ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQ
|
|
|
6
6
|
const spaceVector_1 = require("../../../../math/geometry/spaceVector");
|
|
7
7
|
const real_1 = require("../../../../math/numbers/reals/real");
|
|
8
8
|
const sqrtNode_1 = require("../../../../tree/nodes/functions/sqrtNode");
|
|
9
|
+
const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
10
|
+
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
11
|
+
const alignTex_1 = require("../../../../utils/alignTex");
|
|
9
12
|
const getSpaceVectorNormCalculationQuestion = () => {
|
|
10
13
|
const u = spaceVector_1.SpaceVectorConstructor.random("u", false);
|
|
11
14
|
const correctAnswer = u.getNorm();
|
|
15
|
+
const answer = correctAnswer.simplify().toTex();
|
|
12
16
|
const question = {
|
|
13
|
-
answer
|
|
17
|
+
answer,
|
|
14
18
|
instruction: `Cacluler la norme du vecteur $${u.toTexWithCoords()}$`,
|
|
15
19
|
keys: [],
|
|
16
20
|
answerFormat: "tex",
|
|
@@ -19,6 +23,26 @@ const getSpaceVectorNormCalculationQuestion = () => {
|
|
|
19
23
|
y: u.y.evaluate({}),
|
|
20
24
|
z: u.z.evaluate({}),
|
|
21
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
|
+
`,
|
|
22
46
|
};
|
|
23
47
|
return question;
|
|
24
48
|
};
|
|
@@ -51,4 +75,5 @@ exports.spaceVectorNormCalculation = {
|
|
|
51
75
|
getPropositions,
|
|
52
76
|
isAnswerValid,
|
|
53
77
|
subject: "Mathématiques",
|
|
78
|
+
hasHintAndCorrection: true,
|
|
54
79
|
};
|
|
@@ -130,7 +130,7 @@ const isAnswerValid = (ans, { affine, termeid, termeAdd, termeMult }) => {
|
|
|
130
130
|
};
|
|
131
131
|
exports.sequenceEvaluation = {
|
|
132
132
|
id: "sequenceEvaluation",
|
|
133
|
-
label: "
|
|
133
|
+
label: "Exprimer $u_{f(n)}$ en connaissant $u_n$",
|
|
134
134
|
levels: ["1reSpé"],
|
|
135
135
|
isSingleStep: true,
|
|
136
136
|
sections: ["Suites"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequencePlot.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/suites/sequencePlot.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;
|
|
1
|
+
{"version":3,"file":"sequencePlot.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/suites/sequencePlot.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AA2FF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAe9C,CAAC"}
|
|
@@ -16,11 +16,11 @@ const getSequencePlotQuestion = () => {
|
|
|
16
16
|
for (let n = 0; n <= nMax; n++) {
|
|
17
17
|
let u_n;
|
|
18
18
|
if (isArithmetic) {
|
|
19
|
-
const noise = (0, randfloat_1.randfloat)(-
|
|
19
|
+
const noise = (0, randfloat_1.randfloat)(-2, 2, 1);
|
|
20
20
|
u_n = a * n + b + noise;
|
|
21
21
|
}
|
|
22
22
|
else {
|
|
23
|
-
const noise = (0, randfloat_1.randfloat)(-
|
|
23
|
+
const noise = (0, randfloat_1.randfloat)(-2, 2, 1);
|
|
24
24
|
u_n = b * Math.pow(a, n) + noise;
|
|
25
25
|
}
|
|
26
26
|
points.push([n, Math.round(u_n)]);
|
|
@@ -41,8 +41,9 @@ const getSequencePlotQuestion = () => {
|
|
|
41
41
|
isXAxesNatural: true,
|
|
42
42
|
isGridSimple: true,
|
|
43
43
|
});
|
|
44
|
+
const answer = u_nValue.toString();
|
|
44
45
|
const question = {
|
|
45
|
-
answer
|
|
46
|
+
answer,
|
|
46
47
|
instruction: `Ci-dessous est tracé un nuage de points représentant les valeurs d'une suite $(u_n)$. Quelle est la valeur de $u_{${nValue}}$ ?`,
|
|
47
48
|
commands: ggb.commands,
|
|
48
49
|
options: ggb.getOptions(),
|
|
@@ -55,6 +56,11 @@ const getSequencePlotQuestion = () => {
|
|
|
55
56
|
keys: [],
|
|
56
57
|
answerFormat: "raw",
|
|
57
58
|
identifiers: { nValue, points, isArithmetic },
|
|
59
|
+
hint: `$u_{${nValue}}$ est l'ordonnée du point d'absicsse $${nValue}$ dans le nuage de points.`,
|
|
60
|
+
correction: `$u_{${nValue}}$ est l'ordonnée du point d'absicsse $${nValue}$ dans le nuage de points.
|
|
61
|
+
|
|
62
|
+
On lit donc : $u_{${nValue}}=${answer}$.
|
|
63
|
+
`,
|
|
58
64
|
};
|
|
59
65
|
return question;
|
|
60
66
|
};
|
|
@@ -84,4 +90,5 @@ exports.sequencePlot = {
|
|
|
84
90
|
getPropositions,
|
|
85
91
|
isAnswerValid,
|
|
86
92
|
subject: "Mathématiques",
|
|
93
|
+
hasHintAndCorrection: true,
|
|
87
94
|
};
|
package/lib/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ declare global {
|
|
|
7
7
|
}
|
|
8
8
|
interface String {
|
|
9
9
|
toTree: () => AlgebraicNode;
|
|
10
|
+
unfrenchify: () => number;
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
13
|
/**
|
|
@@ -105,6 +106,10 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
|
|
|
105
106
|
rand: number;
|
|
106
107
|
a: number;
|
|
107
108
|
b: number;
|
|
109
|
+
}> | import("./exercises/exercise").Exercise<{
|
|
110
|
+
numbers: number[];
|
|
111
|
+
}> | import("./exercises/exercise").Exercise<{
|
|
112
|
+
numbers: number[];
|
|
108
113
|
}> | import("./exercises/exercise").Exercise<{
|
|
109
114
|
type: number;
|
|
110
115
|
a: number;
|
|
@@ -594,6 +599,38 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
|
|
|
594
599
|
ineqSymbol: import("./math/inequations/inequation").InegalitySymbols;
|
|
595
600
|
intervals: {
|
|
596
601
|
a: number;
|
|
602
|
+
/**
|
|
603
|
+
* TODO
|
|
604
|
+
* Décimal : permettre facilement -0.xxx
|
|
605
|
+
* Tree shaking export
|
|
606
|
+
*
|
|
607
|
+
* VEA:
|
|
608
|
+
* -> -3x est bien transofmré en -3*x, x*(-3) mais pas en -x*3
|
|
609
|
+
* ->> faire le meme delire que pour les power mais pour les opposite ?
|
|
610
|
+
* c'est à dire créer toutes les permuts en déplacant le moins qquepart
|
|
611
|
+
* -> faire des nodes pour les Ensembles de nombre
|
|
612
|
+
*
|
|
613
|
+
* !-> choses pour lesquelles la v1 ne marchera pas :
|
|
614
|
+
* !-- fractions non réduites
|
|
615
|
+
* !-- nbs décimaux avec des 0
|
|
616
|
+
* !-- nb quelconque de moins, genre -3*-4 ou -x/-y
|
|
617
|
+
* !-> pour ces choses là il faut obligatoirement parser la rpéonse élève ?
|
|
618
|
+
*
|
|
619
|
+
* Passer les sqrtNode en tree-iable
|
|
620
|
+
*
|
|
621
|
+
*
|
|
622
|
+
*
|
|
623
|
+
* !!!à fix :
|
|
624
|
+
* ! fraction réductible
|
|
625
|
+
* ! 0,20 au lieu de 0,2
|
|
626
|
+
* ! moins partout dans fraction
|
|
627
|
+
* !puissances négatives vers inverse fraction
|
|
628
|
+
* ! simplification du ln
|
|
629
|
+
* ! meileure gestion des [] : le clavier devriat pouvoir produire des left/right ;
|
|
630
|
+
* !aussi en tapant [ puis diviser, le crochet passe en numérateur
|
|
631
|
+
* ! espace tous les 3 chiffres dans un nb (le clavier doit le fournir aussi!)
|
|
632
|
+
|
|
633
|
+
*/
|
|
597
634
|
b: number;
|
|
598
635
|
closure: import("./tree/nodes/sets/closure").ClosureType;
|
|
599
636
|
}[];
|
|
@@ -800,7 +837,10 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
|
|
|
800
837
|
}> | import("./exercises/exercise").Exercise<{
|
|
801
838
|
correctA: number;
|
|
802
839
|
correctB: number;
|
|
803
|
-
}> | import("./exercises/exercise").Exercise<{
|
|
840
|
+
}> | import("./exercises/exercise").Exercise<{
|
|
841
|
+
x: number;
|
|
842
|
+
y: number;
|
|
843
|
+
}> | import("./exercises/exercise").Exercise<{
|
|
804
844
|
coin: boolean;
|
|
805
845
|
radius: number;
|
|
806
846
|
diametre: number;
|
|
@@ -999,7 +1039,6 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
|
|
|
999
1039
|
rate: number;
|
|
1000
1040
|
nbMois: number;
|
|
1001
1041
|
}> | import("./exercises/exercise").Exercise<{
|
|
1002
|
-
isFromEvolutionToCM: boolean;
|
|
1003
1042
|
evolution: number;
|
|
1004
1043
|
}> | import("./exercises/exercise").Exercise<{
|
|
1005
1044
|
evolutions: string[];
|
|
@@ -1016,6 +1055,8 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
|
|
|
1016
1055
|
total: number;
|
|
1017
1056
|
lefties: number;
|
|
1018
1057
|
}> | import("./exercises/exercise").Exercise<{}> | import("./exercises/exercise").Exercise<{
|
|
1058
|
+
evolution: number;
|
|
1059
|
+
}> | import("./exercises/exercise").Exercise<{
|
|
1019
1060
|
int: number;
|
|
1020
1061
|
power: number;
|
|
1021
1062
|
}> | 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":"AAUA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAI3D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,EAAE,MAAM,aAAa,CAAC;QAC5B,SAAS,EAAE,MAAM,MAAM,CAAC;QACxB,YAAY,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,aAAa,CAAC;KACpD;IACD,UAAU,MAAM;QACd,MAAM,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
|
package/lib/index.js
CHANGED
|
@@ -31,6 +31,9 @@ const PCExercises = __importStar(require("./exercises/pc"));
|
|
|
31
31
|
const infiniteNode_1 = require("./tree/nodes/numbers/infiniteNode");
|
|
32
32
|
const toScientific_1 = require("./utils/numberPrototype/toScientific");
|
|
33
33
|
const variableNode_1 = require("./tree/nodes/variables/variableNode");
|
|
34
|
+
String.prototype.unfrenchify = function () {
|
|
35
|
+
return Number(this.valueOf().replace(",", "."));
|
|
36
|
+
};
|
|
34
37
|
String.prototype.toTree = function () {
|
|
35
38
|
return new variableNode_1.VariableNode(this.valueOf());
|
|
36
39
|
};
|
|
@@ -14,6 +14,7 @@ export declare class SpaceVector {
|
|
|
14
14
|
z: AlgebraicNode;
|
|
15
15
|
constructor(name: string, x: AlgebraicNode, y: AlgebraicNode, z: AlgebraicNode);
|
|
16
16
|
toTex(): string;
|
|
17
|
+
toCoordsTex(): string;
|
|
17
18
|
toInlineCoordsTex(): string;
|
|
18
19
|
toTexWithCoords(): string;
|
|
19
20
|
isColinear(v: SpaceVector): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spaceVector.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/spaceVector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,OAAO,EAAE,IAAI,EAAY,MAAM,uBAAuB,CAAC;AAQvD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,8BAAsB,sBAAsB;IAC1C,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,WAAW;IAQnE,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,UAAO,GAAG,WAAW;IAY1D,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,SAAS,UAAO,GAAG,WAAW,EAAE;CAW1E;AAED,qBAAa,WAAW;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,CAAC,EAAE,aAAa,CAAC;IACjB,CAAC,EAAE,aAAa,CAAC;IACjB,CAAC,EAAE,aAAa,CAAC;gBAEf,IAAI,EAAE,MAAM,EACZ,CAAC,EAAE,aAAa,EAChB,CAAC,EAAE,aAAa,EAChB,CAAC,EAAE,aAAa;IASlB,KAAK,IAAI,MAAM;IAIf,iBAAiB,IAAI,MAAM;IAK3B,eAAe,IAAI,MAAM;IAMzB,UAAU,CAAC,CAAC,EAAE,WAAW,GAAG,OAAO;IAGnC,WAAW,CAAC,CAAC,EAAE,WAAW,GAAG,aAAa;IAI1C,KAAK,CAAC,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,MAAM;IAQrC,aAAa,CAAC,CAAC,EAAE,WAAW,GAAG,IAAI;IAInC,GAAG,CAAC,CAAC,EAAE,WAAW,GAAG,WAAW;IAShC,OAAO,IAAI,aAAa;IAYxB,WAAW,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,MAAM;IAQjD,MAAM,CAAC,CAAC,EAAE,WAAW;CAGtB"}
|
|
1
|
+
{"version":3,"file":"spaceVector.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/spaceVector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,OAAO,EAAE,IAAI,EAAY,MAAM,uBAAuB,CAAC;AAQvD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,8BAAsB,sBAAsB;IAC1C,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,WAAW;IAQnE,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,UAAO,GAAG,WAAW;IAY1D,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,SAAS,UAAO,GAAG,WAAW,EAAE;CAW1E;AAED,qBAAa,WAAW;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,CAAC,EAAE,aAAa,CAAC;IACjB,CAAC,EAAE,aAAa,CAAC;IACjB,CAAC,EAAE,aAAa,CAAC;gBAEf,IAAI,EAAE,MAAM,EACZ,CAAC,EAAE,aAAa,EAChB,CAAC,EAAE,aAAa,EAChB,CAAC,EAAE,aAAa;IASlB,KAAK,IAAI,MAAM;IAIf,WAAW,IAAI,MAAM;IAGrB,iBAAiB,IAAI,MAAM;IAK3B,eAAe,IAAI,MAAM;IAMzB,UAAU,CAAC,CAAC,EAAE,WAAW,GAAG,OAAO;IAGnC,WAAW,CAAC,CAAC,EAAE,WAAW,GAAG,aAAa;IAI1C,KAAK,CAAC,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,MAAM;IAQrC,aAAa,CAAC,CAAC,EAAE,WAAW,GAAG,IAAI;IAInC,GAAG,CAAC,CAAC,EAAE,WAAW,GAAG,WAAW;IAShC,OAAO,IAAI,aAAa;IAYxB,WAAW,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,MAAM;IAQjD,MAAM,CAAC,CAAC,EAAE,WAAW;CAGtB"}
|
|
@@ -47,6 +47,9 @@ class SpaceVector {
|
|
|
47
47
|
toTex() {
|
|
48
48
|
return `\\overrightarrow{${this.name}}`;
|
|
49
49
|
}
|
|
50
|
+
toCoordsTex() {
|
|
51
|
+
return `\\begin{pmatrix}${this.x.toTex()} \\\\ ${this.y.toTex()} \\\\ ${this.z.toTex()} \\end{pmatrix}`;
|
|
52
|
+
}
|
|
50
53
|
toInlineCoordsTex() {
|
|
51
54
|
return `\\left(${this.x.simplify().toTex()};${this.y
|
|
52
55
|
.simplify()
|
|
@@ -179,14 +179,14 @@ class Trinom extends polynomial_1.Polynomial {
|
|
|
179
179
|
const alpha = this.getAlpha();
|
|
180
180
|
let square;
|
|
181
181
|
if (alpha !== 0) {
|
|
182
|
-
square = new powerNode_1.SquareNode(new addNode_1.AddNode(new variableNode_1.VariableNode(this.variable), new oppositeNode_1.OppositeNode(this.getAlphaNode())));
|
|
182
|
+
square = new powerNode_1.SquareNode(new addNode_1.AddNode(new variableNode_1.VariableNode(this.variable), new oppositeNode_1.OppositeNode(this.getAlphaNode()).simplify()));
|
|
183
183
|
}
|
|
184
184
|
else {
|
|
185
185
|
square = new powerNode_1.SquareNode(new variableNode_1.VariableNode(this.variable));
|
|
186
186
|
}
|
|
187
187
|
const beta = this.getBeta();
|
|
188
188
|
return beta !== 0
|
|
189
|
-
? new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(this.a), square),
|
|
189
|
+
? new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(this.a), square), this.getBetaNode())
|
|
190
190
|
: new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(this.a), square);
|
|
191
191
|
}
|
|
192
192
|
getSommet() {
|
package/lib/playground.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../src/playground.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../src/playground.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,UAAU,YAEtB,CAAC"}
|
package/lib/playground.js
CHANGED
|
@@ -1,20 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.playground = void 0;
|
|
4
|
-
const
|
|
5
|
-
const randTupleInt_1 = require("./math/utils/random/randTupleInt");
|
|
6
|
-
const addNode_1 = require("./tree/nodes/operators/addNode");
|
|
7
|
-
const multiplyNode_1 = require("./tree/nodes/operators/multiplyNode");
|
|
8
|
-
const random_1 = require("./utils/random");
|
|
9
|
-
const shuffle_1 = require("./utils/shuffle");
|
|
4
|
+
const toSeparatedThousands_1 = require("./utils/numberPrototype/toSeparatedThousands");
|
|
10
5
|
const playground = () => {
|
|
11
|
-
|
|
12
|
-
const permut = [
|
|
13
|
-
(0, shuffle_1.shuffle)([affines[0], affines[1]]),
|
|
14
|
-
(0, shuffle_1.shuffle)([affines[0], affines[2]]),
|
|
15
|
-
];
|
|
16
|
-
const operation = (0, random_1.random)(["add", "substract"]);
|
|
17
|
-
const statementTree = new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(permut[0][0].toTree(), permut[0][1].toTree()), new multiplyNode_1.MultiplyNode(permut[1][0].toTree(), permut[1][1].toTree()));
|
|
18
|
-
console.log((0, randTupleInt_1.distinctRandTupleInt)(3, 2, { from: 1, to: 10 }));
|
|
6
|
+
console.log((0, toSeparatedThousands_1.toSeperatedThousands)("12345,6789"));
|
|
19
7
|
};
|
|
20
8
|
exports.playground = playground;
|
package/lib/server.d.ts
CHANGED
package/lib/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAuC3D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,EAAE,MAAM,aAAa,CAAC;QAC5B,SAAS,EAAE,MAAM,MAAM,CAAC;QACxB,YAAY,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,aAAa,CAAC;KACpD;IACD,UAAU,MAAM;QACd,MAAM,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAuC3D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,EAAE,MAAM,aAAa,CAAC;QAC5B,SAAS,EAAE,MAAM,MAAM,CAAC;QACxB,YAAY,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,aAAa,CAAC;KACpD;IACD,UAAU,MAAM;QACd,MAAM,EAAE,MAAM,aAAa,CAAC;QAC5B,WAAW,EAAE,MAAM,MAAM,CAAC;KAC3B;CACF"}
|
package/lib/server.js
CHANGED
|
@@ -45,6 +45,9 @@ const allExercises = [...mathExercises, ...pcExercises];
|
|
|
45
45
|
String.prototype.toTree = function () {
|
|
46
46
|
return new variableNode_1.VariableNode(this.valueOf());
|
|
47
47
|
};
|
|
48
|
+
String.prototype.unfrenchify = function () {
|
|
49
|
+
return Number(this.valueOf().replace(",", "."));
|
|
50
|
+
};
|
|
48
51
|
Number.prototype.toTree = function () {
|
|
49
52
|
const value = this.valueOf();
|
|
50
53
|
if (value === Infinity)
|
|
@@ -65,7 +68,7 @@ const runServer = () => {
|
|
|
65
68
|
app.use((0, cors_1.default)());
|
|
66
69
|
console.log("math exos", mathExercises.length);
|
|
67
70
|
console.log("math hints", mathExercises.filter((exo) => exo.hasHintAndCorrection).length);
|
|
68
|
-
console.log("pc exos", pcExercises.length);
|
|
71
|
+
console.log("pc exos", `${pcExercises.length}`);
|
|
69
72
|
(0, playground_1.playground)();
|
|
70
73
|
app.get("/", (req, res) => {
|
|
71
74
|
res.json(allExercises);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toSeparatedThousands.d.ts","sourceRoot":"","sources":["../../../src/utils/numberPrototype/toSeparatedThousands.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,MAAO,MAAM,WAQ7C,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toSeperatedThousands = void 0;
|
|
4
|
+
const toSeperatedThousands = (t) => {
|
|
5
|
+
const n = t.unfrenchify();
|
|
6
|
+
if (isNaN(n))
|
|
7
|
+
throw Error("NaN passed to toSeperatedThousands");
|
|
8
|
+
const [intPart, fracPart] = t.split(",");
|
|
9
|
+
return (intPart.replace(/\B(?=(\d{3})+(?!\d))/g, "\\ ") +
|
|
10
|
+
(fracPart !== undefined ? "," + fracPart : ""));
|
|
11
|
+
};
|
|
12
|
+
exports.toSeperatedThousands = toSeperatedThousands;
|