math-exercises 2.2.30 → 2.2.32
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/equation/binomialsTrinomialsProposedSolutions.d.ts +4 -1
- package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.js +8 -7
- package/lib/exercises/math/geometry/cartesian/placeAPoint.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/placeAPoint.js +7 -4
- package/lib/exercises/math/percent/findStartValueAfterEvolution.d.ts.map +1 -1
- package/lib/exercises/math/percent/findStartValueAfterEvolution.js +5 -5
- package/lib/exercises/math/percent/populationEffectifFromSubPopulation.d.ts.map +1 -1
- package/lib/exercises/math/percent/populationEffectifFromSubPopulation.js +1 -0
- package/lib/exercises/math/python/pyForLoop1Exercise.js +1 -1
- package/lib/index.d.ts +4 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equationSolutionNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equationSolutionNode.js +1 -0
- package/package.json +1 -1
package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
-
type Identifiers = {
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
solutionNodeIds: any;
|
|
4
|
+
equationNodeIds: any;
|
|
5
|
+
};
|
|
3
6
|
export declare const binomialsTrinomialsProposedSolutions: Exercise<Identifiers>;
|
|
4
7
|
export {};
|
|
5
8
|
//# sourceMappingURL=binomialsTrinomialsProposedSolutions.d.ts.map
|
package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binomialsTrinomialsProposedSolutions.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"binomialsTrinomialsProposedSolutions.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,GAAG,CAAC;IACrB,eAAe,EAAE,GAAG,CAAC;CACtB,CAAC;AA0EF,eAAO,MAAM,oCAAoC,EAAE,QAAQ,CAAC,WAAW,CActE,CAAC"}
|
|
@@ -35,19 +35,20 @@ const getBinomialsTrinomialsProposedSolutionsQuestion = () => {
|
|
|
35
35
|
? new equalNode_1.EqualNode(trinomial.toTree(), constante.toTree())
|
|
36
36
|
: new equalNode_1.EqualNode(binomial1.toTree(), binomial2.toTree());
|
|
37
37
|
const ans = degree
|
|
38
|
-
? root.toTree()
|
|
39
|
-
: new fractionNode_1.FractionNode(new substractNode_1.SubstractNode(binomial2.b.toTree(), binomial1.b.toTree()), new substractNode_1.SubstractNode(binomial1.a.toTree(), binomial2.a.toTree()))
|
|
40
|
-
.simplify()
|
|
41
|
-
.toTex();
|
|
38
|
+
? root.toTree()
|
|
39
|
+
: new fractionNode_1.FractionNode(new substractNode_1.SubstractNode(binomial2.b.toTree(), binomial1.b.toTree()), new substractNode_1.SubstractNode(binomial1.a.toTree(), binomial2.a.toTree())).simplify();
|
|
42
40
|
const answertype = (0, coinFlip_1.coinFlip)();
|
|
43
|
-
const solution = answertype ? ans : (0, randint_1.randint)(-10, 10);
|
|
41
|
+
const solution = answertype ? ans : (0, randint_1.randint)(-10, 10).toTree();
|
|
44
42
|
const answer = answertype ? "Oui" : "Non";
|
|
45
43
|
const question = {
|
|
46
44
|
answer: answer,
|
|
47
|
-
instruction: `Le nombre $${solution}$ est-il une solution de l'équation $${equation.toTex()}$ ?`,
|
|
45
|
+
instruction: `Le nombre $${solution.toTex()}$ est-il une solution de l'équation $${equation.toTex()}$ ?`,
|
|
48
46
|
keys: [],
|
|
49
47
|
answerFormat: "raw",
|
|
50
|
-
identifiers: {
|
|
48
|
+
identifiers: {
|
|
49
|
+
equationNodeIds: equation.toIdentifiers(),
|
|
50
|
+
solutionNodeIds: solution.toIdentifiers(),
|
|
51
|
+
},
|
|
51
52
|
};
|
|
52
53
|
return question;
|
|
53
54
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"placeAPoint.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/placeAPoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAIT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"placeAPoint.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/placeAPoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAIT,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AA+B5C,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAY/C,CAAC"}
|
|
@@ -4,9 +4,8 @@ exports.testGGBAnswer = void 0;
|
|
|
4
4
|
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
5
5
|
const toolBarConstructor_1 = require("../../../../exercises/utils/geogebra/toolBarConstructor");
|
|
6
6
|
const point_1 = require("../../../../math/geometry/point");
|
|
7
|
-
const arrayHasSameElement_1 = require("../../../../utils/arrays/arrayHasSameElement");
|
|
8
|
-
const deleteObjectNamesFromAnswer_1 = require("../../../../geogebra/deleteObjectNamesFromAnswer");
|
|
9
7
|
const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor");
|
|
8
|
+
const parseGGBPoints_1 = require("../../../../geogebra/parsers/parseGGBPoints");
|
|
10
9
|
const getPlaceAPointQuestion = () => {
|
|
11
10
|
const point = point_1.PointConstructor.random("A");
|
|
12
11
|
const studentGGB = new geogebraConstructor_1.GeogebraConstructor({
|
|
@@ -26,8 +25,12 @@ const getPlaceAPointQuestion = () => {
|
|
|
26
25
|
};
|
|
27
26
|
return question;
|
|
28
27
|
};
|
|
29
|
-
const isGGBAnswerValid = (ans, { ggbAnswer }) => {
|
|
30
|
-
|
|
28
|
+
const isGGBAnswerValid = (ans, { ggbAnswer, x, y }) => {
|
|
29
|
+
const points = (0, parseGGBPoints_1.parseGGBPoints)(ans);
|
|
30
|
+
if (points.length !== 1)
|
|
31
|
+
return false;
|
|
32
|
+
const [xAns, yAns] = points[0].replace("(", "").replace(")", "").split(",");
|
|
33
|
+
return Math.abs(Number(xAns) - x) < 0.5 && Math.abs(Number(yAns) - y) < 0.5;
|
|
31
34
|
};
|
|
32
35
|
exports.testGGBAnswer = {
|
|
33
36
|
id: "placeAPoint",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findStartValueAfterEvolution.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/findStartValueAfterEvolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;
|
|
1
|
+
{"version":3,"file":"findStartValueAfterEvolution.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/findStartValueAfterEvolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AA0FF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAkB9D,CAAC"}
|
|
@@ -11,16 +11,16 @@ const getPropositions = (n, { answer, percentRate, vf }) => {
|
|
|
11
11
|
const propositions = [];
|
|
12
12
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
13
13
|
const invCm = 1 - percentRate / 100;
|
|
14
|
-
(0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)(vf * invCm, 2).frenchify()
|
|
14
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)(vf * invCm, 2).frenchify());
|
|
15
15
|
while (propositions.length < n) {
|
|
16
|
-
(0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)((0, randfloat_1.randfloat)(1, 100, 2), 2).frenchify()
|
|
16
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)((0, randfloat_1.randfloat)(1, 100, 2), 2).frenchify());
|
|
17
17
|
}
|
|
18
18
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
19
19
|
};
|
|
20
20
|
const getAnswer = (identifiers) => {
|
|
21
21
|
const cm = 1 + identifiers.percentRate / 100;
|
|
22
22
|
const vd = (0, round_1.round)(identifiers.vf / cm, 2);
|
|
23
|
-
return vd.frenchify()
|
|
23
|
+
return vd.frenchify();
|
|
24
24
|
};
|
|
25
25
|
const getInstruction = (identifiers) => {
|
|
26
26
|
const evolution = identifiers.percentRate < 0 ? "baisse" : "hausse";
|
|
@@ -58,10 +58,10 @@ ${(0, alignTex_1.alignTex)([
|
|
|
58
58
|
`;
|
|
59
59
|
};
|
|
60
60
|
const getKeys = (identifiers) => {
|
|
61
|
-
return [
|
|
61
|
+
return [];
|
|
62
62
|
};
|
|
63
63
|
const isAnswerValid = (ans, { answer }) => {
|
|
64
|
-
return (0, euroParser_1.euroParser)(ans) === answer;
|
|
64
|
+
return (0, euroParser_1.euroParser)(ans) === answer + "€";
|
|
65
65
|
};
|
|
66
66
|
const getFindStartValueAfterEvolutionQuestion = () => {
|
|
67
67
|
const vf = (0, randfloat_1.randfloat)(1, 100, 2);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"populationEffectifFromSubPopulation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/populationEffectifFromSubPopulation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AA6IF,eAAO,MAAM,mCAAmC,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"populationEffectifFromSubPopulation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/populationEffectifFromSubPopulation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AA6IF,eAAO,MAAM,mCAAmC,EAAE,QAAQ,CAAC,WAAW,CAiBrE,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -248,7 +248,10 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
|
|
|
248
248
|
randAdd?: number | undefined;
|
|
249
249
|
op2?: string | undefined;
|
|
250
250
|
};
|
|
251
|
-
}> | import("./exercises/exercise").Exercise<{
|
|
251
|
+
}> | import("./exercises/exercise").Exercise<{
|
|
252
|
+
solutionNodeIds: any;
|
|
253
|
+
equationNodeIds: any;
|
|
254
|
+
}> | import("./exercises/exercise").Exercise<{
|
|
252
255
|
a: number;
|
|
253
256
|
b: number;
|
|
254
257
|
}> | 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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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equationSolutionNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/equations/equationSolutionNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,KAAK,2BAA2B,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,WAAW,CAAA;CAAE,CAAC;AAC7E,qBAAa,oBAAqB,YAAW,IAAI;IAC/C,IAAI,EAAE,QAAQ,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,eAAe,CAAC;IAC9B,IAAI,CAAC,EAAE,WAAW,CAAC;gBAEjB,YAAY,EAAE,eAAe,EAC7B,MAAM,CAAC,EAAE,2BAA2B;IActC,aAAa;;;;;;;;;IAMb,cAAc;IAId,SAAS;
|
|
1
|
+
{"version":3,"file":"equationSolutionNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/equations/equationSolutionNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,KAAK,2BAA2B,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,WAAW,CAAA;CAAE,CAAC;AAC7E,qBAAa,oBAAqB,YAAW,IAAI;IAC/C,IAAI,EAAE,QAAQ,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,eAAe,CAAC;IAC9B,IAAI,CAAC,EAAE,WAAW,CAAC;gBAEjB,YAAY,EAAE,eAAe,EAC7B,MAAM,CAAC,EAAE,2BAA2B;IActC,aAAa;;;;;;;;;IAMb,cAAc;IAId,SAAS;IAkBT,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW;IAQpC,YAAY;IAGZ,QAAQ;IAGR,KAAK;CAGN"}
|
|
@@ -34,6 +34,7 @@ class EquationSolutionNode {
|
|
|
34
34
|
else {
|
|
35
35
|
const solTex = this.solutionsSet.elements.map((e) => e.toTex());
|
|
36
36
|
res.push(solTex.map((e) => `${this.variable}=${e}`).join("\\text{ ou }"));
|
|
37
|
+
res.push(solTex.map((e) => `${this.variable}=${e}`).join(";"));
|
|
37
38
|
if (this.opts?.allowRawRightChildAsSolution) {
|
|
38
39
|
res.push(solTex.join(";"));
|
|
39
40
|
res.push(solTex.join("\\text{ ou }"));
|