math-exercises 3.0.123 → 3.0.124

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.
@@ -1,6 +1,6 @@
1
1
  import { Exercise } from "../../../../exercises/exercise.js";
2
2
  type Identifiers = {
3
- phrase: number;
3
+ situationIndex: number;
4
4
  initial: number;
5
5
  growth: number;
6
6
  };
@@ -1 +1 @@
1
- {"version":3,"file":"affineFromExercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/affineFromExercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAuHF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAiBpD,CAAC"}
1
+ {"version":3,"file":"affineFromExercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/affineFromExercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAoNF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAiBpD,CAAC"}
@@ -6,6 +6,114 @@ import { add } from "../../../../tree/nodes/operators/addNode.js";
6
6
  import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
7
7
  import { VariableNode } from "../../../../tree/nodes/variables/variableNode.js";
8
8
  import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
9
+ const situations = [
10
+ {
11
+ instruction: (initial, growth) => `On suppose qu'une plante, d'une hauteur initiale de
12
+ $${initial.frenchify()}\\ \\textrm{cm}$, croît chaque jour de $${growth.frenchify()}\\ \\textrm{cm}$.
13
+ Quelle est sa hauteur (en $\\textrm{cm}$) après $x$ jours ?`,
14
+ hint: `Quel calcul permet de trouver la hauteur de la plante au bout de $10$ jours ?
15
+
16
+ Inspire toi de ce calcul pour déterminer la hauteur de la plante au bout de $x$ jours.`,
17
+ correction: (initial, growth, answer) => `Chaque jour, la plante gagne $${growth.frenchify()}\\ \\textrm{cm}$. Au bout de $x$ jours, la plante a donc gagné $x\\times ${growth.frenchify()}\\ \\textrm{cm}$.
18
+
19
+ La hauteur initiale de la plante est de $${initial}\\ \\textrm{cm}$.
20
+
21
+ Au bout de $x$ jours, la plante a donc une hauteur de :
22
+
23
+ $$
24
+ ${answer}\\ \\textrm{cm}
25
+ $$`,
26
+ randInitial: () => randint(2, 20),
27
+ randGrowth: () => randfloat(0, 4, 2, [0]),
28
+ },
29
+ {
30
+ instruction: (initial, growth) => `Une compagnie de taxis propose un tarif qui inclut un
31
+ montant fixe de $${initial.frenchify()}\\ €$ et un montant variable de $${growth.frenchify()}\\ €$
32
+ par kilomètre parcouru.
33
+ Quel est le prix payé (en $€$) pour $x \\ \\textrm{km}$ parcourus ?`,
34
+ hint: `Quel calcul permet de trouver le prix payé pour $10$ kilomètres parcourus ?
35
+
36
+ Inspire toi de ce calcul pour déterminer le prix payé pour $x$ kilomètres parcourus.
37
+ `,
38
+ correction: (initial, growth, answer) => `Pour chaque kilomètre parcouru, le prix augmente de $${growth.frenchify()}\\ €$. Au bout de $x$ kilomètres, le prix augmente donc de $x\\times ${growth.frenchify()}\\ \\ €$.
39
+
40
+ Le montant fixe initial du trajet est de $${initial}\\ €$.
41
+
42
+ Pour $x$ kilomètres parcourus, le prix du trajet est donc de :
43
+
44
+ $$
45
+ ${answer}\\ €
46
+ $$`,
47
+ randInitial: () => randint(2, 20),
48
+ randGrowth: () => randfloat(0, 4, 2, [0]),
49
+ },
50
+ {
51
+ instruction: (initial, growth) => `Pour l’électricité de sa maison, Jimmy paye
52
+ un abonnement fixe de $${initial.frenchify()}\\ €$
53
+ puis il paye $${growth.frenchify()}\\ €$ par kWh consommé.
54
+ Quelle sera la facture (en $€$) pour $x \\ \\textrm{kWh}$ consommés ?`,
55
+ hint: `Quel calcul permet de trouver la facture pour $10$ kWh consommés ?
56
+
57
+ Inspire toi de ce calcul pour déterminer la facture pour $x$ kWh consommés.
58
+ `,
59
+ correction: (initial, growth, answer) => `Pour chaque kWh consommé, le prix augmente de $${growth.frenchify()}\\ €$.
60
+ Au bout de $x$ kWh, le prix augmente donc de $x\\times ${growth.frenchify()}\\ \\ €$.
61
+
62
+ Le montant de l'abonnement fixe est de $${initial}\\ €$.
63
+
64
+ Pour $x$ kWh consommés, la facture sera donc de :
65
+
66
+ $$
67
+ ${answer}\\ €
68
+ $$`,
69
+ randInitial: () => randint(10, 20),
70
+ randGrowth: () => randfloat(0, 0.5, 2, [0]),
71
+ },
72
+ {
73
+ instruction: (initial, growth) => `Dany décide de partir au Sud de la France.
74
+ Il part de Valenciennes où il fait $${initial.frenchify()}$°C.
75
+ La température augmente de $${growth.frenchify()}$°C à chaque centaine de km vers le Sud.
76
+ Quelle sera la température (en °C) pour $x$ centaines de km parcourus vers le Sud ?`,
77
+ hint: `Quel calcul permet de trouver la température pour $2$ centaines de km parcourus ?
78
+
79
+ Inspire toi de ce calcul pour déterminer la température pour $x$ centaines de km parcourus.
80
+ `,
81
+ correction: (initial, growth, answer) => `Pour chaque centaine de km parcourue, la température augmente de $${growth.frenchify()}$ °C.
82
+ Au bout de $x$ centaines de km, la température augmente donc de $x\\times ${growth.frenchify()}$ °C.
83
+
84
+ Au départ, la température est de $${initial}$ °C.
85
+
86
+ Pour $x$ centaines de km parcourus, la température sera donc de :
87
+
88
+ $$
89
+ ${answer}\\ \\textrm{°C}
90
+ $$`,
91
+ randInitial: () => randint(0, 10),
92
+ randGrowth: () => randfloat(0.5, 1, 2),
93
+ },
94
+ {
95
+ instruction: (initial, growth) => `Emma est salariée. Son salaire net était
96
+ de $${initial.frenchify()}\\ €$ à son entrée dans l'entreprise,
97
+ et augmente de $${growth.frenchify()}$ € tous les ans.
98
+ Quel sera son salaire net (en €) quand elle aura $x$ années d'ancienneté ?`,
99
+ hint: `Quel calcul permet de trouver son salaire net pour $10$ années d'ancienneté ?
100
+
101
+ Inspire toi de ce calcul pour déterminer son salaire net pour $x$ années d'ancienneté.
102
+ `,
103
+ correction: (initial, growth, answer) => `Chaque année, son salaire net augmente de $${growth.frenchify()}$ €.
104
+ Au bout de $x$ années, son salaire net aura augmenté de $x\\times ${growth.frenchify()}$ €.
105
+
106
+ Au départ, son salaire net était de $${initial}$ €.
107
+
108
+ Pour $x$ années d'ancienneté, son salaire net sera donc de :
109
+
110
+ $$
111
+ ${answer}\\ \\textrm{€}
112
+ $$`,
113
+ randInitial: () => randint(12, 17) * 100,
114
+ randGrowth: () => randfloat(20, 50, 2),
115
+ },
116
+ ];
9
117
  const getPropositions = (n, { answer, ...identifiers }) => {
10
118
  const propositions = [];
11
119
  const { initial, growth } = identifiers;
@@ -20,54 +128,20 @@ const getAnswer = (identifiers) => {
20
128
  return add(multiply(identifiers.growth, new VariableNode("x")), identifiers.initial).toTex();
21
129
  };
22
130
  const getInstruction = (identifiers) => {
23
- const { phrase, initial, growth } = identifiers;
24
- switch (phrase) {
25
- case 0:
26
- return `On suppose qu'une plante, d'une hauteur initiale de
27
- $${initial}\\ \\textrm{cm}$, croît chaque jour de $${growth.frenchify()}\\ \\textrm{cm}$.
28
- Quelle est sa hauteur (en $\\textrm{cm}$) après $x$ jours ?`;
29
- case 1:
30
- default:
31
- return `Une compagnie de taxis propose un tarif qui inclut un
32
- montant fixe de $${initial}\\ €$ et un montant variable de $${growth.frenchify()}\\ €$
33
- par kilomètre parcouru.
34
- Quel est le prix payé (en $€$) pour $x \\ \\textrm{km}$ parcourus ?`;
35
- }
131
+ const { situationIndex, initial, growth } = identifiers;
132
+ const situation = situations[situationIndex];
133
+ return situation.instruction(initial, growth);
36
134
  };
37
135
  const getHint = (identifiers) => {
38
- const { phrase } = identifiers;
39
- if (phrase === 0) {
40
- return `Quel calcul permet de trouver la hauteur de la plante au bout de $10$ jours ?
41
-
42
- Inspire toi de ce calcul pour déterminer la hauteur de la plante au bout de $x$ jours.`;
43
- }
44
- return `Quel calcul permet de trouver le prix payé pour $10$ kilomètres parcourus ?
45
-
46
- Inspire toi de ce calcul pour déterminer le prix payé pour $x$ kilomètres parcourus.
47
- `;
136
+ const { situationIndex } = identifiers;
137
+ const situation = situations[situationIndex];
138
+ return situation.hint;
48
139
  };
49
140
  const getCorrection = (identifiers) => {
50
- const { growth, initial, phrase } = identifiers;
51
- if (phrase === 0) {
52
- return `Chaque jour, la plante gagne $${growth.frenchify()}\\ \\textrm{cm}$. Au bout de $x$ jours, la plante a donc gagné $x\\times ${growth.frenchify()}\\ \\textrm{cm}$.
53
-
54
- La hauteur initiale de la plante est de $${initial}\\ \\textrm{cm}$.
55
-
56
- Au bout de $x$ jours, la plante a donc une hauteur de :
57
-
58
- $$
59
- ${getAnswer(identifiers)}\\ \\textrm{cm}
60
- $$`;
61
- }
62
- return `Pour chaque kilomètre parcouru, le prix augmente de $${growth.frenchify()}\\ €$. Au bout de $x$ kilomètres, le prix augmente donc de $x\\times ${growth.frenchify()}\\ \\ €$.
63
-
64
- Le montant fixe initial du trajet est de $${initial}\\ €$.
65
-
66
- Pour $x$ kilomètres parcourus, le prix du trajet est donc de :
67
-
68
- $$
69
- ${getAnswer(identifiers)}\\ €
70
- $$`;
141
+ const { situationIndex, initial, growth } = identifiers;
142
+ const situation = situations[situationIndex];
143
+ const answer = getAnswer(identifiers);
144
+ return situation.correction(initial, growth, answer);
71
145
  };
72
146
  const isAnswerValid = (ans, { answer }) => {
73
147
  return parseAlgebraic(ans)
@@ -75,10 +149,11 @@ const isAnswerValid = (ans, { answer }) => {
75
149
  .equals(parseAlgebraic(answer).simplify());
76
150
  };
77
151
  const getAffineFromExerciseQuestion = () => {
78
- const phrase = randint(0, 2);
79
- const initial = randint(2, 20);
80
- const growth = randfloat(0, 4, 2, [0]);
81
- const identifiers = { phrase, initial, growth };
152
+ const situationIndex = randint(0, situations.length);
153
+ const situation = situations[situationIndex];
154
+ const initial = situation.randInitial();
155
+ const growth = situation.randGrowth();
156
+ const identifiers = { situationIndex, initial, growth };
82
157
  return getQuestionFromIdentifiers(identifiers);
83
158
  };
84
159
  const getQuestionFromIdentifiers = (identifiers) => {
@@ -7,9 +7,10 @@ type ColorProps = {
7
7
  type FunctionProps = {
8
8
  fName: string;
9
9
  colorProps: ColorProps;
10
+ nodeIds: NodeIdentifiers;
11
+ isAnswer: boolean;
10
12
  };
11
13
  type Identifiers = {
12
- arrNodeIds: NodeIdentifiers[];
13
14
  arrFProps: FunctionProps[];
14
15
  isLinear: boolean;
15
16
  };
@@ -1 +1 @@
1
- {"version":3,"file":"recognizeAffineGraph.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/recognizeAffineGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAQrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAc7C,KAAK,UAAU,GAAG;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAmBF,KAAK,aAAa,GAAG;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AA+IF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAgBtD,CAAC"}
1
+ {"version":3,"file":"recognizeAffineGraph.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/recognizeAffineGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAc7C,KAAK,UAAU,GAAG;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAmBF,KAAK,aAAa,GAAG;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,EAAE,eAAe,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAgKF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAgBtD,CAAC"}
@@ -19,10 +19,6 @@ const DISPLAY_PROPS = {
19
19
  yMax: +5,
20
20
  };
21
21
  const arrColorProps = [
22
- {
23
- strFrench: "rouge",
24
- hashRgb: red,
25
- },
26
22
  {
27
23
  strFrench: "bleu",
28
24
  hashRgb: blueDark,
@@ -31,6 +27,10 @@ const arrColorProps = [
31
27
  strFrench: "orange",
32
28
  hashRgb: orange,
33
29
  },
30
+ {
31
+ strFrench: "rouge",
32
+ hashRgb: red,
33
+ },
34
34
  ];
35
35
  const arrFName = ["f", "g", "h"];
36
36
  const getInstruction = (identifiers) => {
@@ -41,7 +41,7 @@ const getInstruction = (identifiers) => {
41
41
  Quelle fonction est ${isLinear ? "linéaire" : "affine"} ?`;
42
42
  };
43
43
  const getGGBOptions = (identifiers) => {
44
- const { arrNodeIds, arrFProps } = identifiers;
44
+ const { arrFProps } = identifiers;
45
45
  function createFunctionCommands(nodeIds, fName, color) {
46
46
  const nodeF = NodeConstructor.fromIdentifiers(nodeIds);
47
47
  const expr = nodeF.toMathString();
@@ -52,7 +52,7 @@ const getGGBOptions = (identifiers) => {
52
52
  `SetColor(${fName}, "${color}")`,
53
53
  ];
54
54
  }
55
- const commands = arrNodeIds.flatMap((_, i) => createFunctionCommands(arrNodeIds[i], arrFProps[i].fName, arrFProps[i].colorProps.hashRgb));
55
+ const commands = arrFProps.flatMap((fProps) => createFunctionCommands(fProps.nodeIds, fProps.fName, fProps.colorProps.hashRgb));
56
56
  const ggb = new GeogebraConstructor({
57
57
  commands,
58
58
  });
@@ -66,35 +66,52 @@ const getHint = () => {
66
66
  };
67
67
  const getCorrection = (identifiers) => {
68
68
  const { isLinear, arrFProps } = identifiers;
69
- const strFName = arrFProps[0].fName;
70
- const strColor = arrFProps[0].colorProps.strFrench;
69
+ const fPropsAnswer = arrFProps.find((fProps) => fProps.isAnswer);
70
+ const strFName = fPropsAnswer.fName;
71
+ const strColor = fPropsAnswer.colorProps.strFrench;
71
72
  return `Une fonction ${isLinear ? "linéaire" : "affine"} est représentée par une droite ${isLinear ? "passant par l'origine" : ""}.
72
73
  La seule droite ici est la courbe en ${strColor}.
73
74
  La fonction ${isLinear ? "linéaire" : "affine"} est donc $${strFName}$.`;
74
75
  };
75
76
  const getAnswer = (identifiers) => {
76
77
  const { arrFProps } = identifiers;
77
- return arrFProps[0].fName;
78
+ const fPropsAnswer = arrFProps.find((fProps) => fProps.isAnswer);
79
+ return fPropsAnswer.fName;
78
80
  };
79
81
  const getRecognizeAffineGraphQuestion = () => {
80
82
  const isLinear = coinFlip();
81
83
  const { xMin, xMax, yMin, yMax } = DISPLAY_PROPS;
82
- const arrNodeIds = [
83
- AffineConstructor.random({ min: -10, max: 10 }, { min: isLinear ? 0 : -10, max: isLinear ? 0 : 10 }, "x").toTree(),
84
- add(multiply(randint(-0.5, 0.5, [0]), exp("x")), randint(-5, 5)),
85
- (() => {
86
- const rootsPool = [...Array(xMax - xMin).keys()].map((i) => i + xMin);
87
- const roots = randomMany(rootsPool, 2).toSorted((i1, i2) => i1 - i2);
88
- const ySummit = randint(yMin, yMax, [0]);
89
- return TrinomConstructor.fromRootsAndSummitY(roots, ySummit).toTree();
90
- })(),
91
- ].map((node) => node.toIdentifiers());
92
- const arrFNameShuffled = shuffle(arrFName);
93
- const arrColorPropsShuffled = shuffle(arrColorProps);
94
- const arrFProps = arrFNameShuffled.map((_, i) => {
95
- return { fName: arrFName[i], colorProps: arrColorPropsShuffled[i] };
84
+ const arrItem = [
85
+ {
86
+ node: AffineConstructor.random({ min: -10, max: 10 }, { min: isLinear ? 0 : -10, max: isLinear ? 0 : 10 }, "x").toTree(),
87
+ isAnswer: true,
88
+ },
89
+ {
90
+ node: add(multiply(randint(-0.5, 0.5, [0]), exp("x")), randint(-5, 5)),
91
+ isAnswer: false,
92
+ },
93
+ {
94
+ node: (() => {
95
+ const rootsPool = [...Array(xMax - xMin).keys()].map((i) => i + xMin);
96
+ const roots = randomMany(rootsPool, 2).toSorted((i1, i2) => i1 - i2);
97
+ const ySummit = randint(yMin, yMax, [0]);
98
+ return TrinomConstructor.fromRootsAndSummitY(roots, ySummit).toTree();
99
+ })(),
100
+ isAnswer: false,
101
+ },
102
+ ];
103
+ const arrFProps = shuffle(arrItem).map((item, i) => {
104
+ return {
105
+ fName: arrFName[i],
106
+ colorProps: arrColorProps[i],
107
+ nodeIds: item.node.toIdentifiers(),
108
+ isAnswer: item.isAnswer,
109
+ };
96
110
  });
97
- const identifiers = { arrNodeIds, arrFProps, isLinear };
111
+ const identifiers = {
112
+ arrFProps,
113
+ isLinear,
114
+ };
98
115
  return getQuestionFromIdentifiers(identifiers);
99
116
  };
100
117
  const getQuestionFromIdentifiers = (identifiers) => {
@@ -1 +1 @@
1
- {"version":3,"file":"powerEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/powerEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAoBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAoJF,KAAK,OAAO,GAAG;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAUF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkBxD,CAAC"}
1
+ {"version":3,"file":"powerEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/powerEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAoBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAmJF,KAAK,OAAO,GAAG;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAUF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkBxD,CAAC"}
@@ -90,7 +90,6 @@ const isAnswerValid = (ans, { answer }) => {
90
90
  const parsed = parseAlgebraic(ans);
91
91
  const value = parsed.evaluate();
92
92
  const answerValue = parseAlgebraic(answer).evaluate();
93
- console.log(value, answerValue);
94
93
  if (Math.abs(value - answerValue) < 0.01)
95
94
  return true;
96
95
  return parsed.simplify().toTex() === answer;
@@ -1 +1 @@
1
- {"version":3,"file":"vectorLinearCombination.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/vectorLinearCombination.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,YAAY,CAAC;IAChB,CAAC,EAAE,YAAY,CAAC;CACjB,CAAC;AAEF,KAAK,YAAY,GAAG;IAClB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAsNF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAczD,CAAC"}
1
+ {"version":3,"file":"vectorLinearCombination.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/vectorLinearCombination.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,YAAY,CAAC;IAChB,CAAC,EAAE,YAAY,CAAC;CACjB,CAAC;AAEF,KAAK,YAAY,GAAG;IAClB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAqNF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAczD,CAAC"}
@@ -154,7 +154,6 @@ const isAnswerValid = (ans, { answer, ...identifiers }) => {
154
154
  if (!isBinomialCoefficientNode(parsed))
155
155
  return false;
156
156
  const vec = new Vector("u", parsed.leftChild, parsed.rightChild);
157
- console.log(solVector.toCoords(), vec.toCoords());
158
157
  return solVector.simplify().toCoords() === vec.toCoords();
159
158
  }
160
159
  else {
package/lib/index.d.ts CHANGED
@@ -842,7 +842,7 @@ declare const mathExercises: (Exercise<{
842
842
  yA: number;
843
843
  yB: number;
844
844
  }, object, string | number | boolean | string[] | number[] | boolean[]> | Exercise<{
845
- phrase: number;
845
+ situationIndex: number;
846
846
  initial: number;
847
847
  growth: number;
848
848
  }, object, string | number | boolean | string[] | number[] | boolean[]> | Exercise<{
@@ -850,13 +850,14 @@ declare const mathExercises: (Exercise<{
850
850
  pointIdsB: import("./math/geometry/point.js").PointIdentifiers;
851
851
  funcName: string;
852
852
  }, object, string | number | boolean | string[] | number[] | boolean[]> | Exercise<{
853
- arrNodeIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers[];
854
853
  arrFProps: {
855
854
  fName: string;
856
855
  colorProps: {
857
856
  strFrench: string;
858
857
  hashRgb: string;
859
858
  };
859
+ nodeIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
860
+ isAnswer: boolean;
860
861
  }[];
861
862
  isLinear: boolean;
862
863
  }, object, string | number | boolean | string[] | number[] | boolean[]> | Exercise<{
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAE3D,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0EAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "math-exercises",
3
3
  "type": "module",
4
- "version": "3.0.123",
4
+ "version": "3.0.124",
5
5
  "description": "Math exercises generator for middle school and high school",
6
6
  "main": "lib/index.js",
7
7
  "files": [