math-exercises 3.0.60 → 3.0.62

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.
@@ -62,13 +62,13 @@ const getCorrection = (identifiers) => {
62
62
  ];
63
63
  return `
64
64
  ${alignTex([
65
- [statementTex, "=", operatorComposition(AddNode, subMultiplications).toTex()],
65
+ ["", statementTex],
66
+ ["=", operatorComposition(AddNode, subMultiplications).toTex()],
66
67
  [
67
- "",
68
68
  "=",
69
69
  operatorComposition(AddNode, subMultiplications.map((e) => e.simplify())).toTex(),
70
70
  ],
71
- ["", "=", answer],
71
+ ["=", answer],
72
72
  ])}
73
73
 
74
74
  `;
@@ -58,7 +58,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
58
58
  const question = {
59
59
  answer: getAnswer(identifiers),
60
60
  instruction: getInstruction(identifiers),
61
- keys: [],
61
+ keys: ["semicolon"],
62
62
  answerFormat: "tex",
63
63
  identifiers,
64
64
  hint: getHint(identifiers),
@@ -58,7 +58,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
58
58
  const question = {
59
59
  answer: getAnswer(identifiers),
60
60
  instruction: getInstruction(identifiers),
61
- keys: [],
61
+ keys: ["semicolon"],
62
62
  answerFormat: "tex",
63
63
  identifiers,
64
64
  hint: getHint(identifiers),
@@ -29,7 +29,7 @@ $$
29
29
  ${equation}
30
30
  $$
31
31
 
32
- Déterminez les coordonnées d'un vecteur directeur de $d$.`;
32
+ Déterminer les coordonnées d'un vecteur directeur de $d$.`;
33
33
  };
34
34
  const getKeys = (identifiers) => {
35
35
  return ["binom", "semicolon"];
@@ -94,18 +94,18 @@ const getPropositions = (n, { answer, xValue, yValue }) => {
94
94
  const wrongAnswer2 = new Vector("v", (xValue + 1).toTree(), (yValue + 1).toTree());
95
95
  const wrongAnswer3 = new Vector("v", yValue.toTree(), xValue.toTree());
96
96
  if (wrongAnswer1.isColinear(vector) === false) {
97
- tryToAddWrongProp(propositions, wrongAnswer1.toInlineCoordsTex());
97
+ tryToAddWrongProp(propositions, wrongAnswer1.toBinomCoords().toTex());
98
98
  }
99
99
  if (wrongAnswer2.isColinear(vector) === false) {
100
- tryToAddWrongProp(propositions, wrongAnswer2.toInlineCoordsTex());
100
+ tryToAddWrongProp(propositions, wrongAnswer2.toBinomCoords().toTex());
101
101
  }
102
102
  if (wrongAnswer3.isColinear(vector) === false) {
103
- tryToAddWrongProp(propositions, wrongAnswer3.toInlineCoordsTex());
103
+ tryToAddWrongProp(propositions, wrongAnswer3.toBinomCoords().toTex());
104
104
  }
105
105
  while (propositions.length < n) {
106
106
  const wrongAnswer = new Vector("v", randint(-5, 5).toTree(), randint(-5, 5).toTree());
107
107
  if (wrongAnswer.isColinear(vector) === false) {
108
- tryToAddWrongProp(propositions, wrongAnswer.toInlineCoordsTex());
108
+ tryToAddWrongProp(propositions, wrongAnswer.toBinomCoords().toTex());
109
109
  }
110
110
  }
111
111
  return shuffleProps(propositions, n);
@@ -1 +1 @@
1
- {"version":3,"file":"directorVectorFromReductEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/lines/directorVectorFromReductEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAY7C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;AAwGF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CAsBlE,CAAC"}
1
+ {"version":3,"file":"directorVectorFromReductEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/lines/directorVectorFromReductEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAY7C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;AA0GF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CAsBlE,CAAC"}
@@ -13,7 +13,9 @@ const getEquationTex = (identifiers) => {
13
13
  const { aIds, bIds } = identifiers;
14
14
  const a = reifyAlgebraic(aIds);
15
15
  const b = reifyAlgebraic(bIds);
16
- return `y=${add(multiply(a, "x"), b).simplify().toTex()}`;
16
+ return `y=${add(multiply(a, "x"), b)
17
+ .simplify({ forbidFactorize: true })
18
+ .toTex()}`;
17
19
  };
18
20
  const getPropositions = (n, { answer }) => {
19
21
  const propositions = [];
@@ -30,7 +30,7 @@ const getAnswer = (identifiers) => {
30
30
  return answer;
31
31
  };
32
32
  const getHint = (identifiers) => {
33
- return `Les points $A$, $B$ est $C$ sont alignés si et seulement si les vecteurs $\\overrightarrow{AB}$ et $\\overrightarrow{AC}$ sont colinéaires.`;
33
+ return `Les points $A$, $B$ et $C$ sont alignés si et seulement si les vecteurs $\\overrightarrow{AB}$ et $\\overrightarrow{AC}$ sont colinéaires.`;
34
34
  };
35
35
  const getCorrection = (identifiers) => {
36
36
  const points = getPoints(identifiers);
@@ -40,7 +40,7 @@ const getCorrection = (identifiers) => {
40
40
  const vec2Simp = vec2.simplify();
41
41
  const det = vec1Simp.determinant(vec2Simp);
42
42
  const isAligned = vec1.isColinear(vec2);
43
- return `Les points $A$, $B$ est $C$ sont alignés si et seulement si les vecteurs $\\overrightarrow{AB}$ et $\\overrightarrow{AC}$ sont colinéaires.
43
+ return `Les points $A$, $B$ et $C$ sont alignés si et seulement si les vecteurs $\\overrightarrow{AB}$ et $\\overrightarrow{AC}$ sont colinéaires.
44
44
 
45
45
  On calcule les coordonnées de ces vecteurs :
46
46
 
@@ -1 +1 @@
1
- {"version":3,"file":"calculatePower.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/calculatePower.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAwHF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAchD,CAAC"}
1
+ {"version":3,"file":"calculatePower.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/calculatePower.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAyHF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAchD,CAAC"}
@@ -49,8 +49,9 @@ $$`;
49
49
  return `On multiplie $${int}$ par lui-même $${power}$ fois :
50
50
 
51
51
  ${alignTex([
52
- [statement, "=", mul.toTex({ forceNoSimplification: true })],
53
- ["", "=", getAnswer(identifiers)],
52
+ ["", statement],
53
+ ["=", mul.toTex({ forceNoSimplification: true })],
54
+ ["=", getAnswer(identifiers)],
54
55
  ])}
55
56
  `;
56
57
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "math-exercises",
3
3
  "type": "module",
4
- "version": "3.0.60",
4
+ "version": "3.0.62",
5
5
  "description": "Math exercises generator for middle school and high school",
6
6
  "main": "lib/index.js",
7
7
  "files": [