math-exercises 2.1.26-beta.5 → 2.1.26-beta.6

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 +1 @@
1
- {"version":3,"file":"calibrationCurveOfSolution.d.ts","sourceRoot":"","sources":["../../../src/exercises/pc/calibrationCurveOfSolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAWlC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAyEF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAa5D,CAAC"}
1
+ {"version":3,"file":"calibrationCurveOfSolution.d.ts","sourceRoot":"","sources":["../../../src/exercises/pc/calibrationCurveOfSolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAWlC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAuFF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAa5D,CAAC"}
@@ -16,8 +16,8 @@ const getCalibrationCurveOfSolutionQuestion = () => {
16
16
  const maxY = 10 * exo.epsilon * exo.l + 5;
17
17
  const question = {
18
18
  ggbAnswer: [
19
- `(1,${exo.epsilon * exo.l})`,
20
- `(2,${2 * exo.epsilon * exo.l})`,
19
+ `(5, ${5 * exo.epsilon * exo.l})`,
20
+ `(10, ${10 * exo.epsilon * exo.l})`,
21
21
  `Line(A, B)`,
22
22
  ],
23
23
  instruction: exo.instruction,
@@ -27,16 +27,13 @@ const getCalibrationCurveOfSolutionQuestion = () => {
27
27
  isXAxesNatural: true,
28
28
  isAxesRatioFixed: false,
29
29
  enableShiftDragZoom: true,
30
- axisLabels: ["$\\tiny{[Xi]}$", "$\\tiny{A}$"],
30
+ axisLabels: ["$\\tiny{[Xi](C)}$", "$\\tiny{A}$"],
31
31
  customToolBar: (0, toolBarConstructor_1.toolBarConstructor)({
32
32
  join: true,
33
- point: true,
34
33
  }),
35
34
  },
36
- hint: `Utiliser la formule $a=c\\cdot l\\cdot ε$.`,
37
- correction: `1 - Choisir deux coordonnées $x_1$ et $x_2$. \n \\
38
- 2 - Calculer $a_1 = x_1\\cdot l \\cdotε$ et $a_2 = x_2\\cdot l \\cdotε$. \n \\
39
- 3 - Tracer la droite qui passe par les deux points $(x_1,a_1)$ et $(x_2,a_2)$.`,
35
+ hint: exo.hint,
36
+ correction: exo.correction,
40
37
  identifiers: {
41
38
  epsilon: exo.epsilon,
42
39
  l: exo.l,
@@ -47,9 +44,10 @@ const getCalibrationCurveOfSolutionQuestion = () => {
47
44
  const isGGBAnswerValid = (ans, { ggbAnswer, epsilon, l }) => {
48
45
  if ((0, arrayEqual_1.arrayEqual)(ans, ggbAnswer))
49
46
  return true;
47
+ console.log(ans);
50
48
  const points = ans
51
49
  .filter((command) => (0, isGGBPoint_1.isGGBPoint)(command))
52
- .map((value) => (0, getPointFromGGB_1.getPointFromGGB)(value, ""));
50
+ .map((value) => (0, getPointFromGGB_1.getPointFromGGB)(value, "", false));
53
51
  return (points.length !== 0 &&
54
52
  points.every((value) => value.getXnumber() * epsilon * l === value.getYnumber()));
55
53
  };
@@ -58,14 +56,28 @@ const generateExercise = () => {
58
56
  const epsilon = (0, randint_1.randint)(1, 3);
59
57
  const l = (0, randint_1.randint)(1, 3);
60
58
  const instruction = `Dans un laboratoire, vous avez effectué l'étalonnage d'une solution ${(0, requiresApostropheBefore_1.requiresApostropheBefore)(molecule.name) ? "d'" : "de "}${molecule.name}. \n
61
- Vous disposez du coefficient d'extinction molaire $ε$ de $${epsilon}$ $\\text{L}\/(\\text{mol}\\cdot \\text{cm})$ et de la longueur de la cuve $l$ de $${l}$ $\\text{cm}$. \n
59
+ Vous disposez du coefficient d'extinction molaire $ε$ de $${epsilon}$ $\\text{L}\\cdot\\text{mol}^{-1}\\cdot\\text{cm}^{-1}$ et de la longueur de la cuve $l$ de $${l}$ $\\text{cm}$. \n
62
60
  Tracer la courbe d'étalonnage de cette solution.`;
63
61
  return {
64
62
  instruction,
63
+ hint: getHint(),
64
+ correction: getCorrection(),
65
65
  epsilon,
66
66
  l,
67
67
  };
68
68
  };
69
+ const getCorrection = () => {
70
+ return `1 - Choisir deux coordonnées $x_1$ et $x_2$. \n \\
71
+ 2 - Calculer $A_1 = x_1\\cdot l \\cdotε$ et $A_2 = x_2\\cdot l \\cdotε$. \n \\
72
+ 3 - Tracer la droite qui passe par les deux points $(x_1,A_1)$ et $(x_2,A_2)$.`;
73
+ };
74
+ const getHint = () => {
75
+ return `Utiliser la formule $A=C\\cdot \\ell\\cdot ε$, où :\n
76
+ - $A$ est l'absorbance (une grandeur sans unité)\n
77
+ - $ε$ est le coefficient d'extinction molaire (ou coefficient d'absorption molaire) en $\\text{L}\\cdot\\text{mol}^{-1}\\cdot\\text{cm}^{-1}$\n
78
+ - $C$ est la concentration de la solution en $\\text{mol}\\cdot\\text{L}^{-1}$\n
79
+ - $\\ell$ est la longueur du chemin optique en centimètres $(\\text{cm})$`;
80
+ };
69
81
  exports.calibrationCurveOfSolution = {
70
82
  id: "calibrationCurveOfSolution",
71
83
  label: "Tracer une courbe d'étalonnage",
@@ -1 +1 @@
1
- {"version":3,"file":"beerLambertRandomValue.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/dosage/beerLambertRandomValue.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAwMF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,CAahE,CAAC"}
1
+ {"version":3,"file":"beerLambertRandomValue.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/dosage/beerLambertRandomValue.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAmNF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,CAahE,CAAC"}
@@ -13,15 +13,19 @@ const randint_1 = require("../../../math/utils/random/randint");
13
13
  const getBeerLambertRandomValueQuestion = () => {
14
14
  const molecule = (0, random_1.random)(molecule_1.molecules);
15
15
  const concentration = (0, round_1.round)((0, randfloat_1.randfloat)(0.01, 0.1), 2); // Concentration in mol/L
16
- const molarAbsorptivity = (0, round_1.round)((0, randfloat_1.randfloat)(10, 100), 1); // Molar absorptivity in L/(mol·cm)
16
+ const molarAbsorptivity = (0, round_1.round)((0, randfloat_1.randfloat)(10, 100), 1); // Molar absorptivity in L·mol^-1·cm^-1
17
17
  const pathLength = (0, round_1.round)((0, randfloat_1.randfloat)(1, 5), 1); // Path length in cm
18
18
  const absorbance = (0, round_1.round)(concentration * molarAbsorptivity * pathLength, 2); // Absorbance
19
19
  const variables = [
20
- { name: "concentration", value: concentration, unit: "\\text{mol/L}" },
20
+ {
21
+ name: "concentration",
22
+ value: concentration,
23
+ unit: "\\text{mol} \\cdot \\text{L}^{-1}",
24
+ },
21
25
  {
22
26
  name: "molarAbsorptivity",
23
27
  value: molarAbsorptivity,
24
- unit: "\\text{L/(mol.cm)}",
28
+ unit: "\\text{L} \\cdot \\text{mol}^{-1} \\cdot \\text{cm}^{-1}",
25
29
  },
26
30
  { name: "pathLength", value: pathLength, unit: "\\text{cm}" },
27
31
  { name: "absorbance", value: absorbance, unit: "" },
@@ -39,50 +43,55 @@ const getBeerLambertRandomValueQuestion = () => {
39
43
  : "- Absorbance"} : ${v.name === "concentration"
40
44
  ? "$C$"
41
45
  : v.name === "molarAbsorptivity"
42
- ? "$ε$"
46
+ ? "$\\varepsilon$"
43
47
  : v.name === "pathLength"
44
48
  ? "$\\ell$"
45
49
  : "$A$"} = $${(0, frenchify_1.frenchify)(v.value)}\\ ${v.unit}$`)
46
50
  .join(",\n");
47
- const instruction = `Vous êtes en train de réaliser l'étalonnage d'une solution ${(0, requiresApostropheBefore_1.requiresApostropheBefore)(molecule.name) ? "d'" : "de "}${molecule.name} en utilisant une solution étalon. Vous avez mesuré les données suivantes :\n
51
+ const instruction = `Vous êtes en train de réaliser l'étalonnage d'une solution ${(0, requiresApostropheBefore_1.requiresApostropheBefore)(molecule.name.toLowerCase()) ? "d'" : "de "}${molecule.name.toLowerCase()} en utilisant une solution étalon. Vous avez mesuré les données suivantes :\n
48
52
  - ${knownVariablesText}.
49
53
  \n
50
54
  À partir de ces données, déterminez ${targetVariable.name === "concentration"
51
- ? "la concentration en $\\text{mol/L}$"
55
+ ? "la concentration en $\\text{mol} \\cdot \\text{L}^{-1}$"
52
56
  : targetVariable.name === "molarAbsorptivity"
53
- ? "le coefficient d'absorption molaire en $\\text{L}/(\\text{mol}\\cdot\\text{cm})$"
57
+ ? "le coefficient d'absorption molaire en $\\text{L} \\cdot \\text{mol}^{-1} \\cdot \\text{cm}^{-1}$"
54
58
  : targetVariable.name === "pathLength"
55
59
  ? "la longueur du trajet optique en $\\text{cm}$"
56
60
  : "l'absorbance"} de cette solution.`;
57
- const hint = `Rappelez-vous la loi de Beer-Lambert : $A = ε \\cdot C \\cdot \\ell$.
58
- Réorganisez cette formule pour isoler la variable à trouver.`;
61
+ const hint = `Rappelez-vous la loi de Beer-Lambert : $A = \\varepsilon \\cdot C \\cdot \\ell$. Voici les éléments de cette formule :
62
+ - $A$ : l'absorbance
63
+ - $\\varepsilon$ : le coefficient d'absorption molaire en $\\text{L} \\cdot \\text{mol}^{-1} \\cdot \\text{cm}^{-1}$
64
+ - $C$ : la concentration en $\\text{mol} \\cdot \\text{L}^{-1}$
65
+ - $\\ell$ : la longueur du trajet optique en $\\text{cm}$
66
+
67
+ Réorganisez cette formule pour isoler la variable à trouver.`;
59
68
  const correction = `La loi de Beer-Lambert est donnée par :
60
- $$A = ε \\cdot \\ell \\cdot C$$
69
+ $$A = \\varepsilon \\cdot \\ell \\cdot C$$
61
70
 
62
- Pour résoudre le problème, nous devons réorganiser la formule pour isoler la variable inconnue. En utilisant les valeurs fournies pour $ε$, $C$, et $\\ell$, nous pouvons résoudre pour la variable manquante.
71
+ Pour résoudre le problème, nous devons réorganiser la formule pour isoler la variable inconnue. En utilisant les valeurs fournies pour $\\varepsilon$, $C$, et $\\ell$, nous pouvons résoudre pour trouver la variable manquante.
63
72
 
64
- Si $A$ est l'absorbance, $ε$ est le coefficient d'absorption molaire, $C$ est la concentration et $\\ell$ est la longueur du trajet optique, alors:
73
+ Si $A$ est l'absorbance, $\\varepsilon$ est le coefficient d'absorption molaire, $C$ est la concentration et $\\ell$ est la longueur du trajet optique, alors:
65
74
 
66
75
  ${targetVariable.name === "concentration"
67
- ? "$$C = \\frac{A}{ε \\cdot \\ell}$$"
76
+ ? "$$C = \\frac{A}{\\varepsilon \\cdot \\ell}$$"
68
77
  : ""}
69
78
  ${targetVariable.name === "molarAbsorptivity"
70
- ? "$$ε = \\frac{A}{C \\cdot \\ell}$$"
79
+ ? "$$\\varepsilon = \\frac{A}{C \\cdot \\ell}$$"
71
80
  : ""}
72
81
  ${targetVariable.name === "pathLength"
73
- ? "$$\\ell = \\frac{A}{ε \\cdot C}$$"
82
+ ? "$$\\ell = \\frac{A}{\\varepsilon \\cdot C}$$"
74
83
  : ""}
75
84
  ${targetVariable.name === "absorbance"
76
- ? "$$A = ε \\cdot C \\cdot \\ell$$"
85
+ ? "$$A = \\varepsilon \\cdot C \\cdot \\ell$$"
77
86
  : ""}
78
87
 
79
88
  En appliquant les valeurs:
80
89
 
81
90
  ${targetVariable.name === "concentration"
82
- ? `$$C = \\frac{${(0, frenchify_1.frenchify)(absorbance)}}{${(0, frenchify_1.frenchify)(molarAbsorptivity)} \\cdot ${(0, frenchify_1.frenchify)(pathLength)}} = ${(0, frenchify_1.frenchify)((0, round_1.round)(absorbance / (molarAbsorptivity * pathLength), 2))}\\ \\text{mol/L}$$`
91
+ ? `$$C = \\frac{${(0, frenchify_1.frenchify)(absorbance)}}{${(0, frenchify_1.frenchify)(molarAbsorptivity)} \\cdot ${(0, frenchify_1.frenchify)(pathLength)}} = ${(0, frenchify_1.frenchify)((0, round_1.round)(absorbance / (molarAbsorptivity * pathLength), 2))}\\ \\text{mol} \\cdot \\text{L}^{-1}$$`
83
92
  : ""}
84
93
  ${targetVariable.name === "molarAbsorptivity"
85
- ? `$$ε = \\frac{${(0, frenchify_1.frenchify)(absorbance)}}{${(0, frenchify_1.frenchify)(concentration)} \\cdot ${(0, frenchify_1.frenchify)(pathLength)}} = ${(0, frenchify_1.frenchify)((0, round_1.round)(absorbance / (concentration * pathLength), 1))}\\ \\text{L}/(\\text{mol} \\cdot \\text{cm})$$`
94
+ ? `$$\\varepsilon = \\frac{${(0, frenchify_1.frenchify)(absorbance)}}{${(0, frenchify_1.frenchify)(concentration)} \\cdot ${(0, frenchify_1.frenchify)(pathLength)}} = ${(0, frenchify_1.frenchify)((0, round_1.round)(absorbance / (concentration * pathLength), 1))}\\ \\text{L} \\cdot \\text{mol}^{-1} \\cdot \\text{cm}^{-1}$$`
86
95
  : ""}
87
96
  ${targetVariable.name === "pathLength"
88
97
  ? `$$\\ell = \\frac{${(0, frenchify_1.frenchify)(absorbance)}}{${(0, frenchify_1.frenchify)(molarAbsorptivity)} \\cdot ${(0, frenchify_1.frenchify)(concentration)}} = ${(0, frenchify_1.frenchify)((0, round_1.round)(absorbance / (molarAbsorptivity * concentration), 1))}\\ \\text{cm}$$`
@@ -98,7 +107,7 @@ const getBeerLambertRandomValueQuestion = () => {
98
107
  keys: [],
99
108
  answerFormat: "tex",
100
109
  identifiers: {
101
- moleculeName: molecule.name,
110
+ moleculeName: molecule.name.toLowerCase(),
102
111
  concentration,
103
112
  molarAbsorptivity,
104
113
  pathLength,
@@ -122,11 +131,15 @@ const getPropositions = (n, { answer, concentration, molarAbsorptivity, pathLeng
122
131
  };
123
132
  const isAnswerValid = (ans, { answer, randomIndex, concentration, molarAbsorptivity, pathLength, absorbance, }) => {
124
133
  const variables = [
125
- { name: "concentration", value: concentration, unit: "\\text{mol/L}" },
134
+ {
135
+ name: "concentration",
136
+ value: concentration,
137
+ unit: "\\text{mol} \\cdot \\text{L}^{-1}",
138
+ },
126
139
  {
127
140
  name: "molarAbsorptivity",
128
141
  value: molarAbsorptivity,
129
- unit: "\\text{L}/(\\text{mol} \\cdot \\text{cm})",
142
+ unit: "\\text{L} \\cdot \\text{mol}^{-1} \\cdot \\text{cm}^{-1}",
130
143
  },
131
144
  { name: "pathLength", value: pathLength, unit: "\\text{cm}" },
132
145
  { name: "absorbance", value: absorbance, unit: "" },
@@ -1 +1 @@
1
- {"version":3,"file":"spectralEnergy.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/spectral/spectralEnergy.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAKnD,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,OAAO,EAAE,CAAC;IACvB,WAAW,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;IACzC,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAiJF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAaxD,CAAC"}
1
+ {"version":3,"file":"spectralEnergy.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/spectral/spectralEnergy.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAKnD,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,OAAO,EAAE,CAAC;IACvB,WAAW,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;IACzC,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAwJF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAaxD,CAAC"}
@@ -47,12 +47,14 @@ const getSpectralEnergyQuestion = () => {
47
47
  ![](${images[(0, randint_1.randint)(0, images.length)]})
48
48
 
49
49
  En utilisant ces données, calculez l'énergie de transition en joules pour la lumière ${targetColor} émise par l'échantillon.`;
50
- const hint = `La relation entre l'énergie et la longueur d'onde est : $E = \\frac{hc}{\\lambda}$. \n Rappel des constantes :
51
-
52
- - Constante de Planck : $h = ${h.toSignificant(2).toTex()}$
53
- - Vitesse de la lumière : $c = ${c.toSignificant(2).toTex()}$`;
50
+ const hint = `La relation entre l'énergie et la longueur d'onde est : $E = \\frac{hc}{\\lambda}$. \n
51
+ Rappel des constantes :
52
+ - Constante de Planck : $h = ${h.toSignificant(2).toTex()}$
53
+ - Vitesse de la lumière : $c = ${c.toSignificant(2).toTex()}$`;
54
54
  const correction = `La relation entre l'énergie et la longueur d'onde est donnée par :
55
- $E = \\frac{hc}{\\lambda}$. \n En utilisant les valeurs fournies pour $h$, $c$, et $\\lambda_{${targetColor}}$ (en mètres), vous pouvez résoudre pour l'énergie :
55
+ $E = \\frac{hc}{\\lambda}$.
56
+
57
+ \n En utilisant les valeurs fournies pour $h$, $c$, et $\\lambda_{${targetColor}}$ (en mètres), vous pouvez résoudre pour l'énergie : \n
56
58
  $E_{${targetColor}} = \\dfrac{${h.toTex({ scientific: 2 })} \\times ${c.toTex({
57
59
  scientific: 2,
58
60
  })}}{${targetColor === "bleue"
@@ -61,7 +63,12 @@ const getSpectralEnergyQuestion = () => {
61
63
  })
62
64
  : targetColor === "rouge"
63
65
  ? wavelengthRed.toTex({ scientific: 2 })
64
- : wavelengthGreen.toTex({ scientific: 2 })}} = ${targetEnergy.toTex()}\\ J$.`;
66
+ : wavelengthGreen.toTex({ scientific: 2 })}} = ${targetEnergy.toTex()}\\ J$. \n
67
+
68
+ Rappel des constantes :
69
+
70
+ - Constante de Planck : $h = ${h.toSignificant(2).toTex()}$
71
+ - Vitesse de la lumière : $c = ${c.toSignificant(2).toTex()}$`;
65
72
  const question = {
66
73
  answer: targetEnergy.toTex(),
67
74
  instruction,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "math-exercises",
3
- "version": "2.1.26-beta.5",
3
+ "version": "2.1.26-beta.6",
4
4
  "description": "Math exercises generator for middle school and high school",
5
5
  "main": "lib/index.js",
6
6
  "files": [