math-exercises 2.1.26 → 2.2.0
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.
- package/lib/exercises/exercise.d.ts +27 -4
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/paritySumsAndProducts.js +1 -1
- package/lib/exercises/math/calcul/digitDecimalRank.d.ts +8 -0
- package/lib/exercises/math/calcul/digitDecimalRank.d.ts.map +1 -0
- package/lib/exercises/math/calcul/digitDecimalRank.js +58 -0
- package/lib/exercises/math/calcul/digitRank.d.ts +8 -0
- package/lib/exercises/math/calcul/digitRank.d.ts.map +1 -0
- package/lib/exercises/math/calcul/digitRank.js +58 -0
- package/lib/exercises/math/calcul/index.d.ts +2 -0
- package/lib/exercises/math/calcul/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/index.js +2 -0
- package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.js +1 -1
- package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.js +1 -1
- package/lib/exercises/math/derivation/derivative/convexityQuadrinomials.js +1 -1
- package/lib/exercises/math/derivation/derivative/convexityTrinomials.js +1 -1
- package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.js +1 -1
- package/lib/exercises/math/functions/affines/affineAdjustmentComplete.js +1 -1
- package/lib/exercises/math/functions/affines/affineExpressionReading.js +1 -1
- package/lib/exercises/math/functions/parity/parityFromAlgebra.js +1 -1
- package/lib/exercises/math/functions/parity/parityFromGraph.js +1 -1
- package/lib/exercises/math/functions/trinoms/extremumTypeFromAlgebricForm.js +1 -1
- package/lib/exercises/math/functions/trinoms/variationsFromAlgebricForm.js +1 -1
- package/lib/exercises/math/geometry/cartesian/drawAlineInGGB.d.ts +8 -0
- package/lib/exercises/math/geometry/cartesian/drawAlineInGGB.d.ts.map +1 -0
- package/lib/exercises/math/geometry/cartesian/drawAlineInGGB.js +70 -0
- package/lib/exercises/math/geometry/cartesian/index.d.ts +2 -0
- package/lib/exercises/math/geometry/cartesian/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/index.js +2 -0
- package/lib/exercises/math/geometry/cartesian/placeAPoint.d.ts +5 -0
- package/lib/exercises/math/geometry/cartesian/placeAPoint.d.ts.map +1 -0
- package/lib/exercises/math/geometry/cartesian/placeAPoint.js +46 -0
- package/lib/exercises/math/geometry/convexity/convexityTrinomialsGeo.js +1 -1
- package/lib/exercises/math/geometry/vectors/alignementViaColinearity.js +1 -1
- package/lib/exercises/math/geometry/vectors/colinearity.js +1 -1
- package/lib/exercises/math/geometry/vectors/drawAVectorInGGB.d.ts +8 -0
- package/lib/exercises/math/geometry/vectors/drawAVectorInGGB.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/drawAVectorInGGB.js +71 -0
- package/lib/exercises/math/geometry/vectors/equalCaracteristicFromGraph.js +1 -1
- package/lib/exercises/math/geometry/vectors/index.d.ts +1 -0
- package/lib/exercises/math/geometry/vectors/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/index.js +1 -0
- package/lib/exercises/math/geometry/vectors/paralellismViaColinearity.js +1 -1
- package/lib/exercises/math/geometry/vectors/parallelogramViaEqualVectors.js +1 -1
- package/lib/exercises/math/matrices/matrixGeneralTerm.js +1 -1
- package/lib/exercises/math/percent/isTableProportional.js +1 -1
- package/lib/exercises/math/probaStat/independancy.js +1 -1
- package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.js +1 -1
- package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromFirstTerms.js +1 -1
- package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromGraph.js +1 -1
- package/lib/exercises/math/sequences/genericSequenceVariations.js +1 -1
- package/lib/exercises/pc/calibrationCurveOfSolution.d.ts +8 -0
- package/lib/exercises/pc/calibrationCurveOfSolution.d.ts.map +1 -0
- package/lib/exercises/pc/calibrationCurveOfSolution.js +92 -0
- package/lib/exercises/pc/chemicalElements/atomicStructureOfNucleus.js +1 -1
- package/lib/exercises/pc/chemicalElements/identifyRightElectronicConfiguration.js +1 -1
- package/lib/exercises/pc/chemicalReactions/identifyLimitingReagent.js +1 -1
- package/lib/exercises/pc/chemicalReactions/identifyStoichiometricMixture.js +1 -1
- package/lib/exercises/pc/dosage/beerLambertRandomValue.d.ts +12 -0
- package/lib/exercises/pc/dosage/beerLambertRandomValue.d.ts.map +1 -0
- package/lib/exercises/pc/dosage/beerLambertRandomValue.js +163 -0
- package/lib/exercises/pc/dosage/index.d.ts +2 -0
- package/lib/exercises/pc/dosage/index.d.ts.map +1 -0
- package/lib/exercises/pc/dosage/index.js +17 -0
- package/lib/exercises/pc/index.d.ts +3 -0
- package/lib/exercises/pc/index.d.ts.map +1 -1
- package/lib/exercises/pc/index.js +3 -0
- package/lib/exercises/pc/mole/concentrationReading.js +2 -2
- package/lib/exercises/pc/moleculeNomenclature.js +1 -1
- package/lib/exercises/pc/sound/frequencyComparison.js +1 -1
- package/lib/exercises/pc/spectral/index.d.ts +2 -0
- package/lib/exercises/pc/spectral/index.d.ts.map +1 -0
- package/lib/exercises/pc/spectral/index.js +17 -0
- package/lib/exercises/pc/spectral/spectralEnergy.d.ts +10 -0
- package/lib/exercises/pc/spectral/spectralEnergy.d.ts.map +1 -0
- package/lib/exercises/pc/spectral/spectralEnergy.js +129 -0
- package/lib/exercises/utils/geogebra/getPointFromGGB.d.ts +3 -0
- package/lib/exercises/utils/geogebra/getPointFromGGB.d.ts.map +1 -0
- package/lib/exercises/utils/geogebra/getPointFromGGB.js +15 -0
- package/lib/exercises/utils/geogebra/getVectorFromGGB.d.ts +3 -0
- package/lib/exercises/utils/geogebra/getVectorFromGGB.d.ts.map +1 -0
- package/lib/exercises/utils/geogebra/getVectorFromGGB.js +11 -0
- package/lib/exercises/utils/geogebra/isGGBLine.d.ts +2 -0
- package/lib/exercises/utils/geogebra/isGGBLine.d.ts.map +1 -0
- package/lib/exercises/utils/geogebra/isGGBLine.js +8 -0
- package/lib/exercises/utils/geogebra/isGGBPoint.d.ts +2 -0
- package/lib/exercises/utils/geogebra/isGGBPoint.d.ts.map +1 -0
- package/lib/exercises/utils/geogebra/isGGBPoint.js +8 -0
- package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts +9 -0
- package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts.map +1 -0
- package/lib/exercises/utils/geogebra/toolBarConstructor.js +20 -0
- package/lib/index.d.ts +26 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/math/numbers/decimals/decimal.d.ts +1 -0
- package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
- package/lib/math/numbers/decimals/decimal.js +2 -1
- package/lib/math/numbers/integer/integer.d.ts +1 -0
- package/lib/math/numbers/integer/integer.d.ts.map +1 -1
- package/lib/math/numbers/integer/integer.js +7 -1
- package/lib/pc/constants/quantic.d.ts +9 -0
- package/lib/pc/constants/quantic.d.ts.map +1 -0
- package/lib/pc/constants/quantic.js +14 -0
- package/lib/server.js +24 -10
- package/lib/utils/arrayEqual.d.ts.map +1 -1
- package/lib/utils/arrayHasSameElement.d.ts +2 -0
- package/lib/utils/arrayHasSameElement.d.ts.map +1 -0
- package/lib/utils/arrayHasSameElement.js +8 -0
- package/package.json +1 -1
|
@@ -0,0 +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;AAwJF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAaxD,CAAC"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SpectralEnergyExercise = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const measure_1 = require("../../../pc/measure/measure");
|
|
7
|
+
const randfloat_1 = require("../../../math/utils/random/randfloat");
|
|
8
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
9
|
+
const quantic_1 = require("../../../pc/constants/quantic");
|
|
10
|
+
const wavelengths = {
|
|
11
|
+
bleue: { min: 400, max: 455 },
|
|
12
|
+
verte: { min: 500, max: 560 },
|
|
13
|
+
rouge: { min: 610, max: 660 },
|
|
14
|
+
};
|
|
15
|
+
const h = new measure_1.Measure(quantic_1.planckConstant.value.significantPart, quantic_1.planckConstant.value.exponent);
|
|
16
|
+
const c = new measure_1.Measure(quantic_1.lightSpeed.value.significantPart, quantic_1.lightSpeed.value.exponent);
|
|
17
|
+
const images = [
|
|
18
|
+
`https://heureuxhasarddocsbucket.s3.eu-west-3.amazonaws.com/xpliveV2/activities/quizzes/generator/emissionSpectrum1.png`,
|
|
19
|
+
`https://heureuxhasarddocsbucket.s3.eu-west-3.amazonaws.com/xpliveV2/activities/quizzes/generator/emissionSpectrum2.png`,
|
|
20
|
+
`https://heureuxhasarddocsbucket.s3.eu-west-3.amazonaws.com/xpliveV2/activities/quizzes/generator/emissionSpectrum3.png`,
|
|
21
|
+
`https://heureuxhasarddocsbucket.s3.eu-west-3.amazonaws.com/xpliveV2/activities/quizzes/generator/emissionSpectrum4.png`,
|
|
22
|
+
`https://heureuxhasarddocsbucket.s3.eu-west-3.amazonaws.com/xpliveV2/activities/quizzes/generator/emissionSpectrum5.png`,
|
|
23
|
+
];
|
|
24
|
+
const getSpectralEnergyQuestion = () => {
|
|
25
|
+
const wavelengthBlueNm = (0, randint_1.randint)(wavelengths.bleue.min, wavelengths.bleue.max);
|
|
26
|
+
const wavelengthGreenNm = (0, randint_1.randint)(wavelengths.verte.min, wavelengths.verte.max);
|
|
27
|
+
const wavelengthRedNm = (0, randint_1.randint)(wavelengths.rouge.min, wavelengths.rouge.max);
|
|
28
|
+
const wavelengthBlue = new measure_1.Measure(wavelengthBlueNm, -9);
|
|
29
|
+
const wavelengthGreen = new measure_1.Measure(wavelengthGreenNm, -9);
|
|
30
|
+
const wavelengthRed = new measure_1.Measure(wavelengthRedNm, -9);
|
|
31
|
+
const energies = {
|
|
32
|
+
bleue: h.times(c).divide(wavelengthBlue).toSignificant(2),
|
|
33
|
+
verte: h.times(c).divide(wavelengthGreen).toSignificant(2),
|
|
34
|
+
rouge: h.times(c).divide(wavelengthRed).toSignificant(2),
|
|
35
|
+
};
|
|
36
|
+
const colors = ["bleue", "verte", "rouge"];
|
|
37
|
+
const targetColor = colors[(0, randint_1.randint)(0, colors.length - 1)];
|
|
38
|
+
const targetEnergy = energies[targetColor];
|
|
39
|
+
const instruction = `Vous travaillez dans un laboratoire de spectroscopie et vous êtes en train de réaliser une analyse des transitions électroniques d'un échantillon. \n
|
|
40
|
+
Vous avez utilisé un spectromètre pour mesurer les longueurs d'onde des raies d'émission de la lumière émise par l'échantillon. \n
|
|
41
|
+
Les mesures que vous avez obtenues sont les suivantes :
|
|
42
|
+
|
|
43
|
+
- Longueur d'onde de la lumière bleue : $\\lambda_{bleue} = ${wavelengthBlueNm}\\ nm$,
|
|
44
|
+
- Longueur d'onde de la lumière verte : $\\lambda_{verte} = ${wavelengthGreenNm}\\ nm$,
|
|
45
|
+
- Longueur d'onde de la lumière rouge : $\\lambda_{rouge} = ${wavelengthRedNm}\\ nm$.
|
|
46
|
+
|
|
47
|
+
(0, images.length)]})
|
|
48
|
+
|
|
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
|
|
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
|
+
const correction = `La relation entre l'énergie et la longueur d'onde est donnée par :
|
|
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
|
|
58
|
+
$E_{${targetColor}} = \\dfrac{${h.toTex({ scientific: 2 })} \\times ${c.toTex({
|
|
59
|
+
scientific: 2,
|
|
60
|
+
})}}{${targetColor === "bleue"
|
|
61
|
+
? wavelengthBlue.toTex({
|
|
62
|
+
scientific: 2,
|
|
63
|
+
})
|
|
64
|
+
: targetColor === "rouge"
|
|
65
|
+
? wavelengthRed.toTex({ scientific: 2 })
|
|
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()}$`;
|
|
72
|
+
const question = {
|
|
73
|
+
answer: targetEnergy.toTex(),
|
|
74
|
+
instruction,
|
|
75
|
+
hint,
|
|
76
|
+
correction,
|
|
77
|
+
keys: [],
|
|
78
|
+
answerFormat: "tex",
|
|
79
|
+
identifiers: {
|
|
80
|
+
wavelengths: [wavelengthBlue, wavelengthGreen, wavelengthRed],
|
|
81
|
+
targetColor,
|
|
82
|
+
energy: targetEnergy,
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
return question;
|
|
86
|
+
};
|
|
87
|
+
const getPropositions = (n, { answer, energy }) => {
|
|
88
|
+
const propositions = [];
|
|
89
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
90
|
+
const incorrectValues = [
|
|
91
|
+
new measure_1.Measure((0, randfloat_1.randfloat)(0.1, 10, 2), -19).toSignificant(2),
|
|
92
|
+
energy.times(new measure_1.Measure(1, -8)),
|
|
93
|
+
energy.times(new measure_1.Measure(1, 34)),
|
|
94
|
+
];
|
|
95
|
+
incorrectValues.forEach((value) => {
|
|
96
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, value.toTex());
|
|
97
|
+
});
|
|
98
|
+
while (propositions.length < n) {
|
|
99
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new measure_1.Measure((0, randfloat_1.randfloat)(0.1, 10, 2), -19).toSignificant(2).toTex());
|
|
100
|
+
}
|
|
101
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
102
|
+
};
|
|
103
|
+
const isAnswerValid = (ans, { answer, energy, wavelengths, targetColor }) => {
|
|
104
|
+
const energies = {
|
|
105
|
+
bleue: h.times(c).divide(wavelengths[0]),
|
|
106
|
+
verte: h.times(c).divide(wavelengths[1]),
|
|
107
|
+
rouge: h.times(c).divide(wavelengths[2]),
|
|
108
|
+
};
|
|
109
|
+
const targetEnergy = energies[targetColor];
|
|
110
|
+
const validAnswer1 = targetEnergy.toSignificant(1).toTex();
|
|
111
|
+
const validAnswer2 = targetEnergy.toSignificant(2).toTex();
|
|
112
|
+
const validAnswer3 = targetEnergy.toSignificant(3).toTex();
|
|
113
|
+
let latexs = [];
|
|
114
|
+
latexs.push(validAnswer1, validAnswer2, validAnswer3);
|
|
115
|
+
return latexs.includes(ans);
|
|
116
|
+
};
|
|
117
|
+
exports.SpectralEnergyExercise = {
|
|
118
|
+
id: "spectralEnergy",
|
|
119
|
+
label: "Calculer l'énergie d'une lumière à partir de la longueur d'onde",
|
|
120
|
+
levels: ["TermSpé"],
|
|
121
|
+
isSingleStep: true,
|
|
122
|
+
sections: ["Quantique"],
|
|
123
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getSpectralEnergyQuestion, nb),
|
|
124
|
+
qcmTimer: 60,
|
|
125
|
+
freeTimer: 60,
|
|
126
|
+
getPropositions,
|
|
127
|
+
isAnswerValid,
|
|
128
|
+
subject: "Physique",
|
|
129
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPointFromGGB.d.ts","sourceRoot":"","sources":["../../../../src/exercises/utils/geogebra/getPointFromGGB.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAElD,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,SAAS,GAAE,OAAc,GACxB,KAAK,CASP"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPointFromGGB = void 0;
|
|
4
|
+
const point_1 = require("../../../math/geometry/point");
|
|
5
|
+
function getPointFromGGB(command, name, isInteger = true) {
|
|
6
|
+
const splitted = command.split(",");
|
|
7
|
+
const x = isInteger
|
|
8
|
+
? +(+splitted[0].replace("(", "")).toFixed(0)
|
|
9
|
+
: +splitted[0].replace("(", "");
|
|
10
|
+
const y = isInteger
|
|
11
|
+
? +(+splitted[1].replace(")", "")).toFixed(0)
|
|
12
|
+
: +splitted[1].replace(")", "");
|
|
13
|
+
return new point_1.Point(name, x.toTree(), y.toTree());
|
|
14
|
+
}
|
|
15
|
+
exports.getPointFromGGB = getPointFromGGB;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getVectorFromGGB.d.ts","sourceRoot":"","sources":["../../../../src/exercises/utils/geogebra/getVectorFromGGB.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAKtE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getVectorFromGGB = void 0;
|
|
4
|
+
const vector_1 = require("../../../math/geometry/vector");
|
|
5
|
+
function getVectorFromGGB(command, name) {
|
|
6
|
+
const splitted = command.split(";");
|
|
7
|
+
const x = +splitted[0].replace("(", "");
|
|
8
|
+
const y = +splitted[1].replace(")", "");
|
|
9
|
+
return new vector_1.Vector(name, x.toTree(), y.toTree());
|
|
10
|
+
}
|
|
11
|
+
exports.getVectorFromGGB = getVectorFromGGB;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isGGBLine.d.ts","sourceRoot":"","sources":["../../../../src/exercises/utils/geogebra/isGGBLine.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAGlD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isGGBPoint.d.ts","sourceRoot":"","sources":["../../../../src/exercises/utils/geogebra/isGGBPoint.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAGnD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolBarConstructor.d.ts","sourceRoot":"","sources":["../../../../src/exercises/utils/geogebra/toolBarConstructor.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,YAAa;IAC1C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,WASA,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toolBarConstructor = void 0;
|
|
4
|
+
const toolBarConstructor = (options) => {
|
|
5
|
+
let customToolBar = "0||6";
|
|
6
|
+
if (options.point)
|
|
7
|
+
customToolBar += "||1";
|
|
8
|
+
if (options.join)
|
|
9
|
+
customToolBar += "||2";
|
|
10
|
+
if (options.parallel)
|
|
11
|
+
customToolBar += "||3";
|
|
12
|
+
if (options.orthogonal)
|
|
13
|
+
customToolBar += "||4";
|
|
14
|
+
if (options.intersect)
|
|
15
|
+
customToolBar += "||5";
|
|
16
|
+
if (options.vector)
|
|
17
|
+
customToolBar += "||7";
|
|
18
|
+
return customToolBar;
|
|
19
|
+
};
|
|
20
|
+
exports.toolBarConstructor = toolBarConstructor;
|
package/lib/index.d.ts
CHANGED
|
@@ -128,6 +128,12 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
|
|
|
128
128
|
precisionAsked: number;
|
|
129
129
|
decimal: number;
|
|
130
130
|
precision: number;
|
|
131
|
+
}> | import("./exercises/exercise").Exercise<{
|
|
132
|
+
nb: number;
|
|
133
|
+
rankAsked: number;
|
|
134
|
+
}> | import("./exercises/exercise").Exercise<{
|
|
135
|
+
nb: string;
|
|
136
|
+
rankAsked: number;
|
|
131
137
|
}> | import("./exercises/exercise").Exercise<{
|
|
132
138
|
a: number;
|
|
133
139
|
b: number;
|
|
@@ -782,6 +788,9 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
|
|
|
782
788
|
xValue: number;
|
|
783
789
|
yValue: number;
|
|
784
790
|
}> | import("./exercises/exercise").Exercise<{
|
|
791
|
+
correctA: number;
|
|
792
|
+
correctB: number;
|
|
793
|
+
}> | import("./exercises/exercise").Exercise<{}> | import("./exercises/exercise").Exercise<{
|
|
785
794
|
coin: boolean;
|
|
786
795
|
radius: number;
|
|
787
796
|
diametre: number;
|
|
@@ -889,6 +898,9 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
|
|
|
889
898
|
uY: number;
|
|
890
899
|
aX: number;
|
|
891
900
|
aY: number;
|
|
901
|
+
}> | import("./exercises/exercise").Exercise<{
|
|
902
|
+
x: number;
|
|
903
|
+
y: number;
|
|
892
904
|
}> | import("./exercises/exercise").Exercise<{
|
|
893
905
|
trinom: number[];
|
|
894
906
|
}> | import("./exercises/exercise").Exercise<{
|
|
@@ -1611,6 +1623,20 @@ declare const pcExercises: (import("./exercises/exercise").Exercise<{
|
|
|
1611
1623
|
}> | import("./exercises/exercise").Exercise<{
|
|
1612
1624
|
power: number;
|
|
1613
1625
|
seconds: number;
|
|
1626
|
+
}> | import("./exercises/exercise").Exercise<{
|
|
1627
|
+
epsilon: number;
|
|
1628
|
+
l: number;
|
|
1629
|
+
}> | import("./exercises/exercise").Exercise<{
|
|
1630
|
+
moleculeName: string;
|
|
1631
|
+
concentration: number;
|
|
1632
|
+
molarAbsorptivity: number;
|
|
1633
|
+
pathLength: number;
|
|
1634
|
+
absorbance: number;
|
|
1635
|
+
randomIndex: number;
|
|
1636
|
+
}> | import("./exercises/exercise").Exercise<{
|
|
1637
|
+
wavelengths: import("./pc/measure/measure").Measure[];
|
|
1638
|
+
targetColor: "rouge" | "verte" | "bleue";
|
|
1639
|
+
energy: import("./pc/measure/measure").Measure;
|
|
1614
1640
|
}>)[];
|
|
1615
1641
|
export { mathExercises, pcExercises };
|
|
1616
1642
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,EAAE,MAAM,aAAa,CAAC;QAC5B,SAAS,EAAE,MAAM,MAAM,CAAC;QACxB,YAAY,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,aAAa,CAAC;KACpD;CACF;A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AE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { PercentNode } from "../../../tree/nodes/numbers/percentNode";
|
|
|
3
3
|
import { MultiplyNode } from "../../../tree/nodes/operators/multiplyNode";
|
|
4
4
|
import { Nombre, NumberType } from "../nombre";
|
|
5
5
|
import { Rational } from "../rationals/rational";
|
|
6
|
+
export declare const decimalDigitRanks: string[];
|
|
6
7
|
export declare abstract class DecimalConstructor {
|
|
7
8
|
static randomFracPart(precision: number, leadingZeros?: number): string;
|
|
8
9
|
static random(min: number, max: number, precision?: number): Decimal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decimal.d.ts","sourceRoot":"","sources":["../../../../src/math/numbers/decimals/decimal.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAEvE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,8BAAsB,kBAAkB;IACtC,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,GAAE,MAAU,GAAG,MAAM;IAY1E,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO;IAMpE,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO;IAK/D,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO;CAMrD;AAED,qBAAa,OAAQ,YAAW,MAAM;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM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EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,aAAsB;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;gBACR,KAAK,EAAE,MAAM,GAAG,MAAM;IASlC,MAAM,CAAC,CAAC,EAAE,MAAM;IAIhB;;;;OAIG;IACH,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAIhC,oBAAoB,CAAC,KAAK,EAAE,MAAM;IAkClC,gBAAgB;IA6BhB,oBAAoB,CAAC,QAAQ,CAAC,EAAE,MAAM;IAwCtC,UAAU;IAMV,MAAM;IAIN,aAAa;CAGd"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Decimal = exports.DecimalConstructor = void 0;
|
|
3
|
+
exports.Decimal = exports.DecimalConstructor = exports.decimalDigitRanks = void 0;
|
|
4
4
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
5
5
|
const round_1 = require("../../../math/utils/round");
|
|
6
6
|
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
@@ -9,6 +9,7 @@ const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
|
|
|
9
9
|
const powerNode_1 = require("../../../tree/nodes/operators/powerNode");
|
|
10
10
|
const nombre_1 = require("../nombre");
|
|
11
11
|
const rational_1 = require("../rationals/rational");
|
|
12
|
+
exports.decimalDigitRanks = ["dixièmes", "centièmes", "millièmes"];
|
|
12
13
|
class DecimalConstructor {
|
|
13
14
|
static randomFracPart(precision, leadingZeros = 0) {
|
|
14
15
|
let decimals = "";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { NumberNode } from "../../../tree/nodes/numbers/numberNode";
|
|
2
2
|
import { Nombre, NumberType } from "../nombre";
|
|
3
3
|
import { Rational } from "../rationals/rational";
|
|
4
|
+
export declare const integerDigitRanks: string[];
|
|
4
5
|
export declare abstract class IntegerConstructor {
|
|
5
6
|
static random(nbOfDigits: number, excludes?: number[]): number;
|
|
6
7
|
static randomPrime(max?: number): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integer.d.ts","sourceRoot":"","sources":["../../../../src/math/numbers/integer/integer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAEjE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGjD,8BAAsB,kBAAkB;IACtC,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE;IAGrD,MAAM,CAAC,WAAW,CAAC,GAAG,GAAE,MAAW;IAGnC,MAAM,CAAC,gBAAgB,CACrB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,EAAE,EAAE,MAAM,EACV,QAAQ,CAAC,EAAE,MAAM,EAAE;CAYtB;AAED,qBAAa,OAAQ,YAAW,MAAM;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,UAAU,CAAC;gBAEL,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM;IAMvC,MAAM,CAAC,CAAC,EAAE,MAAM;IAGhB,MAAM;IAIN,KAAK,CAAC,SAAS,EAAE,MAAM;IAkCvB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAc1B,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO;IAYxC,QAAQ;IAGR,GAAG,CAAC,EAAE,EAAE,MAAM;CAYf"}
|
|
1
|
+
{"version":3,"file":"integer.d.ts","sourceRoot":"","sources":["../../../../src/math/numbers/integer/integer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAEjE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGjD,eAAO,MAAM,iBAAiB,UAK7B,CAAC;AACF,8BAAsB,kBAAkB;IACtC,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE;IAGrD,MAAM,CAAC,WAAW,CAAC,GAAG,GAAE,MAAW;IAGnC,MAAM,CAAC,gBAAgB,CACrB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,EAAE,EAAE,MAAM,EACV,QAAQ,CAAC,EAAE,MAAM,EAAE;CAYtB;AAED,qBAAa,OAAQ,YAAW,MAAM;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,UAAU,CAAC;gBAEL,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM;IAMvC,MAAM,CAAC,CAAC,EAAE,MAAM;IAGhB,MAAM;IAIN,KAAK,CAAC,SAAS,EAAE,MAAM;IAkCvB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAc1B,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO;IAYxC,QAAQ;IAGR,GAAG,CAAC,EAAE,EAAE,MAAM;CAYf"}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Integer = exports.IntegerConstructor = void 0;
|
|
3
|
+
exports.Integer = exports.IntegerConstructor = exports.integerDigitRanks = void 0;
|
|
4
4
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
5
5
|
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
6
6
|
const random_1 = require("../../../utils/random");
|
|
7
7
|
const nombre_1 = require("../nombre");
|
|
8
8
|
const rational_1 = require("../rationals/rational");
|
|
9
9
|
const primes_1 = require("./primes");
|
|
10
|
+
exports.integerDigitRanks = [
|
|
11
|
+
"unités",
|
|
12
|
+
"dizaines",
|
|
13
|
+
"centaines",
|
|
14
|
+
"milliers",
|
|
15
|
+
];
|
|
10
16
|
class IntegerConstructor {
|
|
11
17
|
static random(nbOfDigits, excludes) {
|
|
12
18
|
return (0, randint_1.randint)(10 ** (nbOfDigits - 1), 10 ** nbOfDigits, excludes);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Measure } from "../measure/measure";
|
|
2
|
+
type PhysicalConstant = {
|
|
3
|
+
value: Measure;
|
|
4
|
+
unit: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const planckConstant: PhysicalConstant;
|
|
7
|
+
export declare const lightSpeed: PhysicalConstant;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=quantic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quantic.d.ts","sourceRoot":"","sources":["../../../src/pc/constants/quantic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,KAAK,gBAAgB,GAAG;IACtB,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,gBAI5B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,gBAIxB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.lightSpeed = exports.planckConstant = void 0;
|
|
4
|
+
const measure_1 = require("../measure/measure");
|
|
5
|
+
exports.planckConstant = {
|
|
6
|
+
value: new measure_1.Measure(6.626, -34),
|
|
7
|
+
// value: 6.626 * Math.pow(10, -34),
|
|
8
|
+
unit: "\\text{J.s}",
|
|
9
|
+
};
|
|
10
|
+
exports.lightSpeed = {
|
|
11
|
+
value: new measure_1.Measure(3, 8),
|
|
12
|
+
// value: 3 * Math.pow(10, 8),
|
|
13
|
+
unit: "\\text{m.s^(-1)}",
|
|
14
|
+
};
|
package/lib/server.js
CHANGED
|
@@ -35,7 +35,9 @@ const dotenv_1 = __importDefault(require("dotenv"));
|
|
|
35
35
|
const cors_1 = __importDefault(require("cors"));
|
|
36
36
|
const numberNode_1 = require("./tree/nodes/numbers/numberNode");
|
|
37
37
|
const infiniteNode_1 = require("./tree/nodes/numbers/infiniteNode");
|
|
38
|
+
const multiplyNode_1 = require("./tree/nodes/operators/multiplyNode");
|
|
38
39
|
const toScientific_1 = require("./utils/numberPrototype/toScientific");
|
|
40
|
+
const variableNode_1 = require("./tree/nodes/variables/variableNode");
|
|
39
41
|
const jsonParser = body_parser_1.default.json();
|
|
40
42
|
const mathExercises = Object.values(MathExercises);
|
|
41
43
|
const pcExercises = Object.values(PCExercises);
|
|
@@ -60,16 +62,10 @@ const runServer = () => {
|
|
|
60
62
|
app.use((0, cors_1.default)());
|
|
61
63
|
console.log("math exos", mathExercises.length);
|
|
62
64
|
console.log("pc exos", pcExercises.length);
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
// new FractionNode(new MultiplyNode((2).toTree(), PiNode), (3).toTree()),
|
|
68
|
-
// new VariableNode("x"),
|
|
69
|
-
// ),
|
|
70
|
-
// ),
|
|
71
|
-
// ).simplify();
|
|
72
|
-
// console.log(node);
|
|
65
|
+
const node = new multiplyNode_1.MultiplyNode(new variableNode_1.VariableNode("x"), new variableNode_1.VariableNode("x"))
|
|
66
|
+
.simplify()
|
|
67
|
+
.toTex();
|
|
68
|
+
console.log(node);
|
|
73
69
|
app.get("/", (req, res) => {
|
|
74
70
|
res.json(allExercises);
|
|
75
71
|
});
|
|
@@ -130,6 +126,24 @@ const runServer = () => {
|
|
|
130
126
|
result,
|
|
131
127
|
});
|
|
132
128
|
});
|
|
129
|
+
app.post("/ggbvea", jsonParser, (req, res) => {
|
|
130
|
+
const exoId = req.query.exoId;
|
|
131
|
+
const { ggbAns, ggbVeaProps } = req.body;
|
|
132
|
+
const exoIndex = allExercises.findIndex((exo) => exo.id == exoId);
|
|
133
|
+
const exo = allExercises[exoIndex];
|
|
134
|
+
if (!exo) {
|
|
135
|
+
res.send("Exo not found");
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
if (!exo.isGGBAnswerValid) {
|
|
139
|
+
res.send("No GGBVEA implemented");
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
const result = exo.isGGBAnswerValid(ggbAns, ggbVeaProps) ?? false;
|
|
143
|
+
res.json({
|
|
144
|
+
result,
|
|
145
|
+
});
|
|
146
|
+
});
|
|
133
147
|
app.listen("5000", () => {
|
|
134
148
|
console.log(`[server]: Server is running at http://localhost:5000`);
|
|
135
149
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrayEqual.d.ts","sourceRoot":"","sources":["../../src/utils/arrayEqual.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"arrayEqual.d.ts","sourceRoot":"","sources":["../../src/utils/arrayEqual.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,OAAO,CAM3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrayHasSameElement.d.ts","sourceRoot":"","sources":["../../src/utils/arrayHasSameElement.ts"],"names":[],"mappings":"AAAA,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,OAAO,CAKrE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.arrayHasSameElements = void 0;
|
|
4
|
+
function arrayHasSameElements(arr1, arr2) {
|
|
5
|
+
return (arr1.length === arr2.length &&
|
|
6
|
+
arr1.every((element) => arr2.includes(element)));
|
|
7
|
+
}
|
|
8
|
+
exports.arrayHasSameElements = arrayHasSameElements;
|