math-exercises 2.2.1 → 2.2.3

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.
@@ -44,7 +44,7 @@ const isGGBAnswerValid = (ans, { ggbAnswer }) => {
44
44
  exports.digitDecimalRank = {
45
45
  id: "digitDecimalRank",
46
46
  connector: "=",
47
- label: "",
47
+ label: "Déterminer le rang d'un chiffre dans une partie décimale",
48
48
  levels: [],
49
49
  isSingleStep: true,
50
50
  sections: [],
@@ -1 +1 @@
1
- {"version":3,"file":"drawAlineInGGB.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/drawAlineInGGB.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAIT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAyDF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAahD,CAAC"}
1
+ {"version":3,"file":"drawAlineInGGB.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/drawAlineInGGB.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAIT,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAwDF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAahD,CAAC"}
@@ -8,6 +8,7 @@ const toolBarConstructor_1 = require("../../../../exercises/utils/geogebra/toolB
8
8
  const point_1 = require("../../../../math/geometry/point");
9
9
  const affine_1 = require("../../../../math/polynomials/affine");
10
10
  const arrayEqual_1 = require("../../../../utils/arrayEqual");
11
+ const deleteObjectNamesFromAnswer_1 = require("../../../../geogebra/deleteObjectNamesFromAnswer");
11
12
  const getDrawAlineInGgbQuestion = () => {
12
13
  const f = affine_1.AffineConstructor.random({ min: -3, max: 3 });
13
14
  const yA = f.b;
@@ -33,8 +34,7 @@ const getDrawAlineInGgbQuestion = () => {
33
34
  return question;
34
35
  };
35
36
  const isGGBAnswerValid = (ans, { ggbAnswer, correctA, correctB }) => {
36
- const studentAnswer = ans.map((s) => s.split("=")[1]);
37
- console.log(studentAnswer);
37
+ const studentAnswer = (0, deleteObjectNamesFromAnswer_1.deleteObjectNamesFromAnswer)(ans);
38
38
  if ((0, arrayEqual_1.arrayEqual)(studentAnswer, ggbAnswer))
39
39
  return true;
40
40
  if (studentAnswer.length !== 3)
@@ -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;AAMlC,KAAK,WAAW,GAAG,EAAE,CAAC;AAkCtB,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;AAOlC,KAAK,WAAW,GAAG,EAAE,CAAC;AA+BtB,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAY/C,CAAC"}
@@ -5,6 +5,7 @@ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQ
5
5
  const toolBarConstructor_1 = require("../../../../exercises/utils/geogebra/toolBarConstructor");
6
6
  const point_1 = require("../../../../math/geometry/point");
7
7
  const arrayHasSameElement_1 = require("../../../../utils/arrayHasSameElement");
8
+ const deleteObjectNamesFromAnswer_1 = require("../../../../geogebra/deleteObjectNamesFromAnswer");
8
9
  const getPlaceAPointQuestion = () => {
9
10
  const point = point_1.PointConstructor.random("A");
10
11
  const xMax = point.getXnumber() + 2;
@@ -28,7 +29,7 @@ const getPlaceAPointQuestion = () => {
28
29
  return question;
29
30
  };
30
31
  const isGGBAnswerValid = (ans, { ggbAnswer }) => {
31
- return (0, arrayHasSameElement_1.arrayHasSameElements)(ans.map((s) => s.split("=")[1]), ggbAnswer);
32
+ return (0, arrayHasSameElement_1.arrayHasSameElements)((0, deleteObjectNamesFromAnswer_1.deleteObjectNamesFromAnswer)(ans), ggbAnswer);
32
33
  };
33
34
  exports.testGGBAnswer = {
34
35
  id: "placeAPoint",
@@ -10,7 +10,7 @@ const getDrawAVectorInGgbQuestion = () => {
10
10
  const y = x === 0 ? (0, randint_1.randint)(-3, 3, [0]) : (0, randint_1.randint)(-3, 3);
11
11
  const vector = new vector_1.Vector("u", x.toTree(), y.toTree());
12
12
  const question = {
13
- ggbAnswer: [`Vector((-2, -2), (${-2 + x}, ${-2 + y}))`],
13
+ ggbAnswer: [`Vector[(-2, -2), (${-2 + x}, ${-2 + y})]`],
14
14
  instruction: `Tracer le vecteur $${vector.toTex()}${vector.toInlineCoordsTex()}$`,
15
15
  keys: [],
16
16
  studentGgbOptions: {
@@ -0,0 +1,2 @@
1
+ export declare const deleteObjectNamesFromAnswer: (answers: string[]) => string[];
2
+ //# sourceMappingURL=deleteObjectNamesFromAnswer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deleteObjectNamesFromAnswer.d.ts","sourceRoot":"","sources":["../../src/geogebra/deleteObjectNamesFromAnswer.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,YAAa,MAAM,EAAE,aAE5D,CAAC"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deleteObjectNamesFromAnswer = void 0;
4
+ const deleteObjectNamesFromAnswer = (answers) => {
5
+ return answers.map((s) => s.replace(/^[^=]*=\s*/, ""));
6
+ };
7
+ exports.deleteObjectNamesFromAnswer = deleteObjectNamesFromAnswer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "math-exercises",
3
- "version": "2.2.1",
3
+ "version": "2.2.3",
4
4
  "description": "Math exercises generator for middle school and high school",
5
5
  "main": "lib/index.js",
6
6
  "files": [