math-exercises 2.2.31 → 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.
@@ -42,7 +42,7 @@ const getBinomialsTrinomialsProposedSolutionsQuestion = () => {
42
42
  const answer = answertype ? "Oui" : "Non";
43
43
  const question = {
44
44
  answer: answer,
45
- 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()}$ ?`,
46
46
  keys: [],
47
47
  answerFormat: "raw",
48
48
  identifiers: {
@@ -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;AAQlC,KAAK,WAAW,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AA2B5C,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAY/C,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
- return (0, arrayHasSameElement_1.arrayHasSameElements)((0, deleteObjectNamesFromAnswer_1.deleteObjectNamesFromAnswer)(ans), ggbAnswer);
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;AA6FF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAkB9D,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 ["euro"];
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,CAgBrE,CAAC"}
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"}
@@ -119,4 +119,5 @@ exports.populationEffectifFromSubPopulation = {
119
119
  subject: "Mathématiques",
120
120
  getHint,
121
121
  getCorrection,
122
+ hasHintAndCorrection: true,
122
123
  };
@@ -82,7 +82,7 @@ const generateType6Exercise = () => {
82
82
  a=int(input("Entrez un nombre"))
83
83
  for i in range(1,${nbIteration + 1}):
84
84
  b=b*a
85
- print(a)
85
+ print(b)
86
86
  \`\`\`
87
87
  `;
88
88
  return { instruction, exoVariable };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "math-exercises",
3
- "version": "2.2.31",
3
+ "version": "2.2.32",
4
4
  "description": "Math exercises generator for middle school and high school",
5
5
  "main": "lib/index.js",
6
6
  "files": [