math-exercises 2.1.15 → 2.1.17
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 +3 -1
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/paritySumsAndProducts.js +1 -1
- package/lib/exercises/math/calcul/proportionality/index.d.ts +1 -0
- package/lib/exercises/math/calcul/proportionality/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/index.js +1 -0
- package/lib/exercises/math/calcul/proportionality/proportionalityTableCoefficient.d.ts +8 -0
- package/lib/exercises/math/calcul/proportionality/proportionalityTableCoefficient.d.ts.map +1 -0
- package/lib/exercises/math/calcul/proportionality/proportionalityTableCoefficient.js +55 -0
- package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType3Exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType3Exercise.js +4 -0
- 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/equaDiff/equaDiffGeneralForme.d.ts.map +1 -1
- package/lib/exercises/math/equaDiff/equaDiffGeneralForme.js +8 -1
- package/lib/exercises/math/functions/affines/affineAdjustmentComplete.js +1 -1
- package/lib/exercises/math/functions/affines/affineMeanValue.d.ts +9 -0
- package/lib/exercises/math/functions/affines/affineMeanValue.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/affineMeanValue.js +77 -0
- package/lib/exercises/math/functions/affines/index.d.ts +1 -0
- package/lib/exercises/math/functions/affines/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/index.js +1 -0
- package/lib/exercises/math/functions/index.d.ts +1 -0
- package/lib/exercises/math/functions/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/index.js +1 -0
- package/lib/exercises/math/functions/integral/index.d.ts +10 -0
- package/lib/exercises/math/functions/integral/index.d.ts.map +1 -0
- package/lib/exercises/math/functions/integral/index.js +25 -0
- package/lib/exercises/math/functions/integral/integralAffines.d.ts +9 -0
- package/lib/exercises/math/functions/integral/integralAffines.d.ts.map +1 -0
- package/lib/exercises/math/functions/integral/integralAffines.js +72 -0
- package/lib/exercises/math/functions/integral/integralDerivatedUCosU.d.ts +10 -0
- package/lib/exercises/math/functions/integral/integralDerivatedUCosU.d.ts.map +1 -0
- package/lib/exercises/math/functions/integral/integralDerivatedUCosU.js +81 -0
- package/lib/exercises/math/functions/integral/integralDerivatedUSinU.d.ts +10 -0
- package/lib/exercises/math/functions/integral/integralDerivatedUSinU.d.ts.map +1 -0
- package/lib/exercises/math/functions/integral/integralDerivatedUSinU.js +86 -0
- package/lib/exercises/math/functions/integral/integralExpAxPlusB.d.ts +10 -0
- package/lib/exercises/math/functions/integral/integralExpAxPlusB.d.ts.map +1 -0
- package/lib/exercises/math/functions/integral/integralExpAxPlusB.js +83 -0
- package/lib/exercises/math/functions/integral/integralExpU.d.ts +10 -0
- package/lib/exercises/math/functions/integral/integralExpU.d.ts.map +1 -0
- package/lib/exercises/math/functions/integral/integralExpU.js +95 -0
- package/lib/exercises/math/functions/integral/integralFractions.d.ts +10 -0
- package/lib/exercises/math/functions/integral/integralFractions.d.ts.map +1 -0
- package/lib/exercises/math/functions/integral/integralFractions.js +109 -0
- package/lib/exercises/math/functions/integral/integralKCosinus.d.ts +9 -0
- package/lib/exercises/math/functions/integral/integralKCosinus.d.ts.map +1 -0
- package/lib/exercises/math/functions/integral/integralKCosinus.js +83 -0
- package/lib/exercises/math/functions/integral/integralKSinus.d.ts +9 -0
- package/lib/exercises/math/functions/integral/integralKSinus.d.ts.map +1 -0
- package/lib/exercises/math/functions/integral/integralKSinus.js +83 -0
- package/lib/exercises/math/functions/integral/integralTrinomials.d.ts +9 -0
- package/lib/exercises/math/functions/integral/integralTrinomials.d.ts.map +1 -0
- package/lib/exercises/math/functions/integral/integralTrinomials.js +78 -0
- package/lib/exercises/math/functions/logarithm/log10PowerSimplifying.d.ts.map +1 -1
- package/lib/exercises/math/functions/logarithm/log10PowerSimplifying.js +12 -0
- 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/index.d.ts +1 -0
- package/lib/exercises/math/functions/trinoms/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/index.js +1 -0
- package/lib/exercises/math/functions/trinoms/trinomialMeanValue.d.ts +9 -0
- package/lib/exercises/math/functions/trinoms/trinomialMeanValue.d.ts.map +1 -0
- package/lib/exercises/math/functions/trinoms/trinomialMeanValue.js +77 -0
- package/lib/exercises/math/functions/trinoms/variationsFromAlgebricForm.js +1 -1
- 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/equalCaracteristicFromGraph.js +1 -1
- package/lib/exercises/math/geometry/vectors/paralellismViaColinearity.js +1 -1
- package/lib/exercises/math/geometry/vectors/parallelogramViaEqualVectors.js +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProductViaCoords.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProductViaCoords.js +2 -0
- package/lib/exercises/math/matrices/matrixGeneralTerm.js +1 -1
- package/lib/exercises/math/percent/index.d.ts +1 -0
- package/lib/exercises/math/percent/index.d.ts.map +1 -1
- package/lib/exercises/math/percent/index.js +1 -0
- package/lib/exercises/math/percent/isTableProportional.d.ts +5 -0
- package/lib/exercises/math/percent/isTableProportional.d.ts.map +1 -0
- package/lib/exercises/math/percent/isTableProportional.js +73 -0
- package/lib/exercises/math/probaStat/calculateProbaOfBinomialDistribution.d.ts +13 -0
- package/lib/exercises/math/probaStat/calculateProbaOfBinomialDistribution.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/calculateProbaOfBinomialDistribution.js +85 -0
- package/lib/exercises/math/probaStat/expectedValueOfBinomialProba.d.ts +9 -0
- package/lib/exercises/math/probaStat/expectedValueOfBinomialProba.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/expectedValueOfBinomialProba.js +77 -0
- package/lib/exercises/math/probaStat/independancy.js +1 -1
- package/lib/exercises/math/probaStat/index.d.ts +3 -0
- package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/index.js +3 -0
- package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.js +1 -1
- package/lib/exercises/math/probaStat/varianceOfBinomialProba.d.ts +9 -0
- package/lib/exercises/math/probaStat/varianceOfBinomialProba.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/varianceOfBinomialProba.js +74 -0
- package/lib/exercises/math/python/pyWhileLoop1Exercise.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/math/trigonometry/arcValue.d.ts +9 -0
- package/lib/exercises/math/trigonometry/arcValue.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/arcValue.js +78 -0
- package/lib/exercises/math/trigonometry/calculateCosSinAndTan.d.ts +7 -0
- package/lib/exercises/math/trigonometry/calculateCosSinAndTan.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/calculateCosSinAndTan.js +71 -0
- package/lib/exercises/math/trigonometry/index.d.ts +2 -0
- package/lib/exercises/math/trigonometry/index.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/index.js +2 -0
- package/lib/exercises/math/trigonometry/trigonometrySideCalcul.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/trigonometrySideCalcul.js +70 -0
- package/lib/exercises/pc/chemicalElements/atomicStructureOfNucleus.js +1 -1
- package/lib/exercises/pc/chemicalElements/findAtomicStructureElement.d.ts.map +1 -1
- package/lib/exercises/pc/chemicalElements/findAtomicStructureElement.js +12 -0
- package/lib/exercises/pc/chemicalElements/identifyRightElectronicConfiguration.js +1 -1
- package/lib/exercises/pc/chemicalReactions/calculateSynthesisEfficiency.d.ts.map +1 -1
- package/lib/exercises/pc/chemicalReactions/calculateSynthesisEfficiency.js +12 -5
- package/lib/exercises/pc/chemicalReactions/identifyLimitingReagent.js +1 -1
- package/lib/exercises/pc/chemicalReactions/identifyStoichiometricMixture.js +1 -1
- package/lib/exercises/pc/forces/forceWork.d.ts.map +1 -1
- package/lib/exercises/pc/pH.d.ts.map +1 -1
- package/lib/exercises/pc/pH.js +7 -0
- package/lib/exercises/pc/sound/frequencyComparison.js +1 -1
- package/lib/exercises/pc/waves/periodicWaveCelerity.d.ts.map +1 -1
- package/lib/exercises/pc/waves/periodicWaveCelerity.js +13 -2
- package/lib/exercises/pc/weight/weightOnTheMoon.d.ts.map +1 -1
- package/lib/exercises/pc/weight/weightOnTheMoon.js +17 -0
- package/lib/index.d.ts +74 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/math/polynomials/trinom.d.ts.map +1 -1
- package/lib/math/trigonometry/remarkableValue.d.ts.map +1 -1
- package/lib/math/trigonometry/remarkableValue.js +1 -0
- package/lib/math/trigonometry/remarkableValues.d.ts +1 -0
- package/lib/math/trigonometry/remarkableValues.d.ts.map +1 -1
- package/lib/math/trigonometry/remarkableValues.js +30 -29
- package/lib/math/utils/combinatorics/combination.d.ts +2 -0
- package/lib/math/utils/combinatorics/combination.d.ts.map +1 -0
- package/lib/math/utils/combinatorics/combination.js +8 -0
- package/lib/tree/nodes/algebraicNode.d.ts +1 -0
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/arcSinNode.d.ts +19 -0
- package/lib/tree/nodes/functions/arcSinNode.d.ts.map +1 -0
- package/lib/tree/nodes/functions/arcSinNode.js +59 -0
- package/lib/tree/nodes/functions/arccosNode.d.ts +19 -0
- package/lib/tree/nodes/functions/arccosNode.d.ts.map +1 -0
- package/lib/tree/nodes/functions/arccosNode.js +60 -0
- package/lib/tree/nodes/functions/arctanNode.d.ts +19 -0
- package/lib/tree/nodes/functions/arctanNode.d.ts.map +1 -0
- package/lib/tree/nodes/functions/arctanNode.js +60 -0
- package/lib/tree/nodes/functions/cosNode.d.ts +3 -3
- package/lib/tree/nodes/functions/cosNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/cosNode.js +14 -15
- package/lib/tree/nodes/functions/expNode.d.ts +1 -1
- package/lib/tree/nodes/functions/expNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/expNode.js +11 -1
- package/lib/tree/nodes/functions/functionNode.d.ts +8 -4
- package/lib/tree/nodes/functions/functionNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/functionNode.js +8 -4
- package/lib/tree/nodes/functions/integralNode.d.ts +12 -0
- package/lib/tree/nodes/functions/integralNode.d.ts.map +1 -0
- package/lib/tree/nodes/functions/integralNode.js +16 -0
- package/lib/tree/nodes/functions/sinNode.d.ts +2 -2
- package/lib/tree/nodes/functions/sinNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sinNode.js +13 -14
- package/lib/tree/nodes/functions/tanNode.d.ts +19 -0
- package/lib/tree/nodes/functions/tanNode.d.ts.map +1 -0
- package/lib/tree/nodes/functions/tanNode.js +64 -0
- package/lib/tree/nodes/geometry/degree.d.ts +20 -0
- package/lib/tree/nodes/geometry/degree.d.ts.map +1 -0
- package/lib/tree/nodes/geometry/degree.js +48 -0
- package/lib/tree/nodes/operators/operatorNode.d.ts +2 -1
- package/lib/tree/nodes/operators/operatorNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/operatorNode.js +1 -0
- package/package.json +1 -1
|
@@ -9,4 +9,7 @@ export * from "./independancy";
|
|
|
9
9
|
export * from "./issuesCountingForCards";
|
|
10
10
|
export * from "./probaFromTableNoContext";
|
|
11
11
|
export * from "./probaFromTableWithContext";
|
|
12
|
+
export * from "./expectedValueOfBinomialProba";
|
|
13
|
+
export * from "./varianceOfBinomialProba";
|
|
14
|
+
export * from "./calculateProbaOfBinomialDistribution";
|
|
12
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wCAAwC,CAAC"}
|
|
@@ -25,3 +25,6 @@ __exportStar(require("./independancy"), exports);
|
|
|
25
25
|
__exportStar(require("./issuesCountingForCards"), exports);
|
|
26
26
|
__exportStar(require("./probaFromTableNoContext"), exports);
|
|
27
27
|
__exportStar(require("./probaFromTableWithContext"), exports);
|
|
28
|
+
__exportStar(require("./expectedValueOfBinomialProba"), exports);
|
|
29
|
+
__exportStar(require("./varianceOfBinomialProba"), exports);
|
|
30
|
+
__exportStar(require("./calculateProbaOfBinomialDistribution"), exports);
|
|
@@ -97,7 +97,7 @@ exports.fineAdjustementExercise = {
|
|
|
97
97
|
levels: ["TermSpé"],
|
|
98
98
|
isSingleStep: true,
|
|
99
99
|
hasGeogebra: true,
|
|
100
|
-
answerType: "
|
|
100
|
+
answerType: "QCU",
|
|
101
101
|
sections: ["Statistiques"],
|
|
102
102
|
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getFineAdjustementExerciseQuestion, nb),
|
|
103
103
|
qcmTimer: 60,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"varianceOfBinomialProba.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/varianceOfBinomialProba.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA0EF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAazD,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.varianceOfBinomialProba = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const rational_1 = require("../../../math/numbers/rationals/rational");
|
|
7
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
|
+
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
9
|
+
const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
|
|
10
|
+
const powerNode_1 = require("../../../tree/nodes/operators/powerNode");
|
|
11
|
+
const substractNode_1 = require("../../../tree/nodes/operators/substractNode");
|
|
12
|
+
const nbOneNode = new numberNode_1.NumberNode(1);
|
|
13
|
+
const getVarianceOfBinomialProbaQuestion = () => {
|
|
14
|
+
const nX = (0, randint_1.randint)(1, 9);
|
|
15
|
+
const b = (0, randint_1.randint)(2, 11);
|
|
16
|
+
const a = (0, randint_1.randint)(1, b);
|
|
17
|
+
const p = new rational_1.Rational(a, b);
|
|
18
|
+
const correctAns = getCorrectAnswer(nX, p);
|
|
19
|
+
const question = {
|
|
20
|
+
answer: correctAns.toTex(),
|
|
21
|
+
instruction: `Soit $X$ une variable aléatoire qui suit une loi binomiale de paramètres $n=${nX}$ et $p=${p
|
|
22
|
+
.toTree()
|
|
23
|
+
.simplify()
|
|
24
|
+
.toTex()}$. Calculez la variance de $X$.`,
|
|
25
|
+
keys: [],
|
|
26
|
+
answerFormat: "tex",
|
|
27
|
+
identifiers: { nX, a, b },
|
|
28
|
+
};
|
|
29
|
+
return question;
|
|
30
|
+
};
|
|
31
|
+
const getPropositions = (n, { answer, nX, a, b }) => {
|
|
32
|
+
const propositions = [];
|
|
33
|
+
const p = new rational_1.Rational(a, b);
|
|
34
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
35
|
+
generatePropositions(nX, p).forEach((value) => (0, exercise_1.tryToAddWrongProp)(propositions, value));
|
|
36
|
+
let random;
|
|
37
|
+
while (propositions.length < n) {
|
|
38
|
+
random = rational_1.RationalConstructor.randomIrreductible(10).toTree();
|
|
39
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, random.toTex());
|
|
40
|
+
}
|
|
41
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
42
|
+
};
|
|
43
|
+
const isAnswerValid = (ans, { nX, a, b }) => {
|
|
44
|
+
const p = new rational_1.Rational(a, b);
|
|
45
|
+
const correctAns = getCorrectAnswer(nX, p);
|
|
46
|
+
return correctAns
|
|
47
|
+
.toAllValidTexs({ allowFractionToDecimal: true })
|
|
48
|
+
.includes(ans);
|
|
49
|
+
};
|
|
50
|
+
const generatePropositions = (n, p) => {
|
|
51
|
+
const pTree = p.toTree().simplify();
|
|
52
|
+
const nNode = new numberNode_1.NumberNode(n);
|
|
53
|
+
const firstProposition = new multiplyNode_1.MultiplyNode(nNode, pTree).simplify();
|
|
54
|
+
const secondProposition = new multiplyNode_1.MultiplyNode(nNode, new powerNode_1.PowerNode(pTree, new numberNode_1.NumberNode(2)).simplify()).simplify();
|
|
55
|
+
return [firstProposition.toTex(), secondProposition.toTex()];
|
|
56
|
+
};
|
|
57
|
+
const getCorrectAnswer = (n, p) => {
|
|
58
|
+
const pTree = p.toTree().simplify();
|
|
59
|
+
const oneMinusP = new substractNode_1.SubstractNode(nbOneNode, pTree);
|
|
60
|
+
return new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(n), new multiplyNode_1.MultiplyNode(pTree, oneMinusP).simplify()).simplify();
|
|
61
|
+
};
|
|
62
|
+
exports.varianceOfBinomialProba = {
|
|
63
|
+
id: "varianceOfBinomialProba",
|
|
64
|
+
label: "Calcul de la variance d'une loi binomiale",
|
|
65
|
+
levels: ["TermTech"],
|
|
66
|
+
isSingleStep: true,
|
|
67
|
+
sections: ["Probabilités"],
|
|
68
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getVarianceOfBinomialProbaQuestion, nb),
|
|
69
|
+
qcmTimer: 60,
|
|
70
|
+
freeTimer: 60,
|
|
71
|
+
getPropositions,
|
|
72
|
+
isAnswerValid,
|
|
73
|
+
subject: "Mathématiques",
|
|
74
|
+
};
|
|
@@ -89,7 +89,7 @@ const generateType16Instruction = (a, b, op) => {
|
|
|
89
89
|
const generateType17Instruction = (a, b, op) => {
|
|
90
90
|
const instruction = `Qu’affichera le programme suivant, si l'utilisateur entre ${a} ?
|
|
91
91
|
\`\`\`
|
|
92
|
-
a=input("Entrez un
|
|
92
|
+
a=input("Entrez un entier naturel non nul.")
|
|
93
93
|
a=int(a)
|
|
94
94
|
n=1
|
|
95
95
|
while n<=a:
|
|
@@ -47,7 +47,7 @@ exports.genericSequenceVariations = {
|
|
|
47
47
|
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getGenericSequenceVariationsQuestion, nb),
|
|
48
48
|
qcmTimer: 60,
|
|
49
49
|
freeTimer: 60,
|
|
50
|
-
answerType: "
|
|
50
|
+
answerType: "QCU",
|
|
51
51
|
getPropositions,
|
|
52
52
|
subject: "Mathématiques",
|
|
53
53
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
trigFunction: string;
|
|
4
|
+
trigValue: number;
|
|
5
|
+
angleInDegrees: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const arcValue: Exercise<Identifiers>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=arcValue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arcValue.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/arcValue.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAoEF,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAY1C,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.arcValue = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
|
+
const round_1 = require("../../../math/utils/round");
|
|
8
|
+
const sinNode_1 = require("../../../tree/nodes/functions/sinNode");
|
|
9
|
+
const cosNode_1 = require("../../../tree/nodes/functions/cosNode");
|
|
10
|
+
const tanNode_1 = require("../../../tree/nodes/functions/tanNode");
|
|
11
|
+
const variableNode_1 = require("../../../tree/nodes/variables/variableNode");
|
|
12
|
+
const getArcValueQuestion = () => {
|
|
13
|
+
const trigFunctions = ["sin", "cos", "tan"];
|
|
14
|
+
const selectedFunction = trigFunctions[(0, randint_1.randint)(0, trigFunctions.length)];
|
|
15
|
+
let trigValue;
|
|
16
|
+
let angleInRadians;
|
|
17
|
+
let angleInDegrees;
|
|
18
|
+
if (selectedFunction === "sin") {
|
|
19
|
+
do {
|
|
20
|
+
trigValue = (0, round_1.round)(Math.random(), 2);
|
|
21
|
+
angleInRadians = Math.asin(trigValue);
|
|
22
|
+
angleInDegrees = (angleInRadians * 180) / Math.PI;
|
|
23
|
+
} while (angleInDegrees < 0);
|
|
24
|
+
}
|
|
25
|
+
else if (selectedFunction === "cos") {
|
|
26
|
+
do {
|
|
27
|
+
trigValue = (0, round_1.round)(Math.random(), 2);
|
|
28
|
+
angleInRadians = Math.acos(trigValue);
|
|
29
|
+
angleInDegrees = (angleInRadians * 180) / Math.PI;
|
|
30
|
+
} while (angleInDegrees < 0);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
do {
|
|
34
|
+
trigValue = (0, round_1.round)(Math.random() * 2 - 1, 2);
|
|
35
|
+
angleInRadians = Math.atan(trigValue);
|
|
36
|
+
angleInDegrees = (angleInRadians * 180) / Math.PI;
|
|
37
|
+
} while (angleInDegrees < 0);
|
|
38
|
+
}
|
|
39
|
+
const trigNode = selectedFunction === "sin"
|
|
40
|
+
? new sinNode_1.SinNode(new variableNode_1.VariableNode("\\theta"))
|
|
41
|
+
: selectedFunction === "cos"
|
|
42
|
+
? new cosNode_1.CosNode(new variableNode_1.VariableNode("\\theta"))
|
|
43
|
+
: new tanNode_1.TanNode(new variableNode_1.VariableNode("\\theta"));
|
|
44
|
+
const instruction = `Quelle est la valeur en degrés de l'angle $\\theta$ si $${trigNode.toTex()} = ${trigValue.frenchify()}$ ? Arrondir à l'unité.`;
|
|
45
|
+
const answer = (0, round_1.round)(angleInDegrees, 0).toTree().toTex();
|
|
46
|
+
const question = {
|
|
47
|
+
answer: answer,
|
|
48
|
+
instruction: instruction,
|
|
49
|
+
keys: [],
|
|
50
|
+
answerFormat: "tex",
|
|
51
|
+
identifiers: { trigFunction: selectedFunction, trigValue, angleInDegrees },
|
|
52
|
+
};
|
|
53
|
+
return question;
|
|
54
|
+
};
|
|
55
|
+
const getPropositions = (n, { answer, angleInDegrees, trigFunction, trigValue }) => {
|
|
56
|
+
const propositions = [];
|
|
57
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
58
|
+
while (propositions.length < n) {
|
|
59
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, randint_1.randint)(0, 180).toTree().toTex());
|
|
60
|
+
}
|
|
61
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
62
|
+
};
|
|
63
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
64
|
+
return ans === answer;
|
|
65
|
+
};
|
|
66
|
+
exports.arcValue = {
|
|
67
|
+
id: "arcValue",
|
|
68
|
+
label: "Calculer l'angle en degrés donné une valeur trigonométrique",
|
|
69
|
+
levels: ["1reSpé"],
|
|
70
|
+
isSingleStep: true,
|
|
71
|
+
sections: ["Trigonométrie"],
|
|
72
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getArcValueQuestion, nb),
|
|
73
|
+
qcmTimer: 60,
|
|
74
|
+
freeTimer: 60,
|
|
75
|
+
getPropositions,
|
|
76
|
+
isAnswerValid,
|
|
77
|
+
subject: "Mathématiques",
|
|
78
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calculateCosSinAndTan.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/calculateCosSinAndTan.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA0DF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAavD,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.calculateCosSinAndTan = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const randfloat_1 = require("../../../math/utils/random/randfloat");
|
|
7
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
|
+
const cosNode_1 = require("../../../tree/nodes/functions/cosNode");
|
|
9
|
+
const sinNode_1 = require("../../../tree/nodes/functions/sinNode");
|
|
10
|
+
const tanNode_1 = require("../../../tree/nodes/functions/tanNode");
|
|
11
|
+
const degree_1 = require("../../../tree/nodes/geometry/degree");
|
|
12
|
+
const random_1 = require("../../../utils/random");
|
|
13
|
+
const trigo = ["sin", "tan", "cos"];
|
|
14
|
+
const getCalculateCosSinAndTanQuestion = () => {
|
|
15
|
+
const trigoFunct = (0, random_1.random)(trigo);
|
|
16
|
+
const degree = (0, randint_1.randint)(1, 360);
|
|
17
|
+
const question = {
|
|
18
|
+
answer: getCorrectAnswer(degree, trigoFunct),
|
|
19
|
+
instruction: `Calculer $${trigoFunct}(${new degree_1.DegreeNode(degree).toTex()})$, arrondir le resultat au dixième.`,
|
|
20
|
+
keys: [],
|
|
21
|
+
answerFormat: "tex",
|
|
22
|
+
identifiers: { degree },
|
|
23
|
+
};
|
|
24
|
+
return question;
|
|
25
|
+
};
|
|
26
|
+
const getPropositions = (n, { answer, degree }) => {
|
|
27
|
+
const propositions = [];
|
|
28
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
29
|
+
const correctAns = Math.cos(degree);
|
|
30
|
+
let random;
|
|
31
|
+
while (propositions.length < n) {
|
|
32
|
+
random = (+(correctAns + (0, randfloat_1.randfloat)(-0.5, 0.6)).toFixed(2)).toTree();
|
|
33
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, random.toTex());
|
|
34
|
+
}
|
|
35
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
36
|
+
};
|
|
37
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
38
|
+
return ans === answer;
|
|
39
|
+
};
|
|
40
|
+
const getCorrectAnswer = (degree, trigoFunct) => {
|
|
41
|
+
let ans;
|
|
42
|
+
switch (trigoFunct) {
|
|
43
|
+
case "cos":
|
|
44
|
+
const cos = new cosNode_1.CosNode(degree.toTree());
|
|
45
|
+
ans = +cos.evaluate({}).toFixed(2);
|
|
46
|
+
return ans.toTree().toTex();
|
|
47
|
+
case "sin":
|
|
48
|
+
const sin = new sinNode_1.SinNode(degree.toTree());
|
|
49
|
+
ans = +sin.evaluate({}).toFixed(2);
|
|
50
|
+
return ans.toTree().toTex();
|
|
51
|
+
case "tan":
|
|
52
|
+
const tan = new tanNode_1.TanNode(degree.toTree());
|
|
53
|
+
ans = +tan.evaluate({}).toFixed(2);
|
|
54
|
+
return ans.toTree().toTex();
|
|
55
|
+
default:
|
|
56
|
+
return "";
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
exports.calculateCosSinAndTan = {
|
|
60
|
+
id: "calculateCosSinAndTan",
|
|
61
|
+
label: "Calcul de tan/sin/cos avec des degrés",
|
|
62
|
+
levels: ["3ème"],
|
|
63
|
+
isSingleStep: true,
|
|
64
|
+
sections: ["Trigonométrie"],
|
|
65
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getCalculateCosSinAndTanQuestion, nb),
|
|
66
|
+
qcmTimer: 60,
|
|
67
|
+
freeTimer: 60,
|
|
68
|
+
getPropositions,
|
|
69
|
+
isAnswerValid,
|
|
70
|
+
subject: "Mathématiques",
|
|
71
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC"}
|
|
@@ -20,3 +20,5 @@ __exportStar(require("./trigonometry"), exports);
|
|
|
20
20
|
__exportStar(require("./trigonometryAngleCalcul"), exports);
|
|
21
21
|
__exportStar(require("./trigonometrySideCalcul"), exports);
|
|
22
22
|
__exportStar(require("./associatePoint"), exports);
|
|
23
|
+
__exportStar(require("./arcValue"), exports);
|
|
24
|
+
__exportStar(require("./calculateCosSinAndTan"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigonometrySideCalcul.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/trigonometrySideCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;
|
|
1
|
+
{"version":3,"file":"trigonometrySideCalcul.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/trigonometrySideCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAiNF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAexD,CAAC"}
|
|
@@ -54,6 +54,8 @@ const getTrigonometrySideCalcul = () => {
|
|
|
54
54
|
const question = {
|
|
55
55
|
instruction: `Le triangle $${triangle.getTriangleName()}$ rectangle en $${triangle.getRightAngle()}$ est tel que $${sides[randSide]} = ${(sideLengths[randSide] + "").replace(".", ",")}$ cm et $\\widehat{${angle[randAngle]}} = ${(angleValue[randAngle] + "").replace(".", ",")}^\\circ$. Calculer $${sides[randSideQuestion]}$ à $0,1$ cm près.`,
|
|
56
56
|
answer,
|
|
57
|
+
hint: getHint(sides, angle[randAngle]),
|
|
58
|
+
correction: getCorrection(sides, sideLengths, randSideQuestion, randSide, angle[randAngle], angleValue[randAngle], answer),
|
|
57
59
|
keys: [],
|
|
58
60
|
commands: ggb.commands,
|
|
59
61
|
options: ggb.getOptions(),
|
|
@@ -71,6 +73,74 @@ const getPropositions = (n, { answer }) => {
|
|
|
71
73
|
}
|
|
72
74
|
return (0, shuffle_1.shuffle)(propositions);
|
|
73
75
|
};
|
|
76
|
+
const getHint = (sides, angle) => {
|
|
77
|
+
const hypothenus = sides[2];
|
|
78
|
+
const adjacent = sides.filter((value) => value !== hypothenus &&
|
|
79
|
+
[value.charAt(0), value.charAt(1)].includes(angle))[0];
|
|
80
|
+
const opposite = sides.filter((value) => value !== hypothenus && value !== adjacent[0])[0];
|
|
81
|
+
return `Identifier le côté opposé, le côté adjacent et l'hypoténuse, puis utiliesr la bonne formule de trigonométrie.`;
|
|
82
|
+
};
|
|
83
|
+
const getCorrection = (sides, sideLengths, randSideQuestion, randSide, angle, angleValue, answer) => {
|
|
84
|
+
const hypothenus = { name: sides[2], length: sideLengths[2] };
|
|
85
|
+
const sidesWithLentgh = sides.map((value, index) => {
|
|
86
|
+
return { name: value, length: sideLengths[index] };
|
|
87
|
+
});
|
|
88
|
+
const adjacent = sidesWithLentgh.filter((value) => value.name !== hypothenus.name &&
|
|
89
|
+
[value.name.charAt(0), value.name.charAt(1)].includes(angle))[0];
|
|
90
|
+
const opposite = sidesWithLentgh.filter((value) => value.name !== hypothenus.name && value.name !== adjacent.name)[0];
|
|
91
|
+
const correctEquations = getCorrectEquations({ name: sides[randSideQuestion], length: sideLengths[randSideQuestion] }, { name: sides[randSide], length: sideLengths[randSide] }, hypothenus, { name: angle, value: angleValue }, adjacent, opposite, answer);
|
|
92
|
+
return `On utilise la relation $${correctEquations[0]}$, on a donc :
|
|
93
|
+
$${correctEquations[1]} \\Leftrightarrow ${correctEquations[2]} \\Leftrightarrow ${correctEquations[3]}$ `;
|
|
94
|
+
};
|
|
95
|
+
const getCorrectEquations = (randSideQuestion, randSide, hypothenus, angle, adjacent, opposite, answer) => {
|
|
96
|
+
let result;
|
|
97
|
+
switch (randSideQuestion.name) {
|
|
98
|
+
case adjacent.name:
|
|
99
|
+
result =
|
|
100
|
+
randSide.name === opposite.name
|
|
101
|
+
? [
|
|
102
|
+
`\\tan(\\widehat{${angle.name}})=\\frac{${opposite.name}}{${adjacent.name}}`,
|
|
103
|
+
`\\tan(\\widehat{${angle.value}})=\\frac{${opposite.length}}{${adjacent.name}}`,
|
|
104
|
+
`\\frac{${opposite.length}}{\\tan(\\widehat{${angle.value}})}=${adjacent.name}`,
|
|
105
|
+
]
|
|
106
|
+
: [
|
|
107
|
+
`\\cos(\\widehat{${angle.name}})=\\frac{${adjacent.name}}{${hypothenus.name}}`,
|
|
108
|
+
`\\cos(\\widehat{${angle.value}})=\\frac{${adjacent.name}}{${hypothenus.length}}`,
|
|
109
|
+
`\\cos(\\widehat{${angle.value}})*${hypothenus.length}=${adjacent.name}`,
|
|
110
|
+
];
|
|
111
|
+
return result.concat(`${answer}=${adjacent.name}`);
|
|
112
|
+
case opposite.name:
|
|
113
|
+
result =
|
|
114
|
+
randSide.name === adjacent.name
|
|
115
|
+
? [
|
|
116
|
+
`\\tan(\\widehat{${angle.name}})=\\frac{${opposite.name}}{${adjacent.name}}`,
|
|
117
|
+
`\\tan(\\widehat{${angle.value}})=\\frac{${opposite.name}}{${adjacent.length}}`,
|
|
118
|
+
`\\tan(\\widehat{${angle.value}})*${adjacent.length}=${opposite.name}`,
|
|
119
|
+
]
|
|
120
|
+
: [
|
|
121
|
+
`\\sin(\\widehat{${angle.name}})=\\frac{${opposite.name}}{${hypothenus.name}}`,
|
|
122
|
+
`\\sin(\\widehat{${angle.value}})=\\frac{${opposite.name}}{${hypothenus.length}}`,
|
|
123
|
+
`\\sin(\\widehat{${angle.value}})*${hypothenus.length}=${opposite.name}`,
|
|
124
|
+
];
|
|
125
|
+
return result.concat(`${answer}=${opposite.name}`);
|
|
126
|
+
case hypothenus.name:
|
|
127
|
+
result =
|
|
128
|
+
randSide.name === adjacent.name
|
|
129
|
+
? [
|
|
130
|
+
`\\cos(\\widehat{${angle.name}})=\\frac{${adjacent.name}}{${hypothenus.name}}`,
|
|
131
|
+
`\\cos(\\widehat{${angle.value}})=\\frac{${adjacent.length}}{${hypothenus.name}}`,
|
|
132
|
+
`\\frac{${adjacent.length}}{\\cos(${angle.value})}=${hypothenus.name}`,
|
|
133
|
+
]
|
|
134
|
+
: [
|
|
135
|
+
`\\sin(\\widehat{${angle.name}})=\\frac{${opposite.name}}{${hypothenus.name}}`,
|
|
136
|
+
`\\sin(\\widehat{${angle.value}})=\\frac{${opposite.length}}{${hypothenus.name}}`,
|
|
137
|
+
`\\frac{${opposite.length}}{\\sin(${angle.value})}=${hypothenus.name}`,
|
|
138
|
+
];
|
|
139
|
+
return result.concat(`${answer}=${hypothenus.name}`);
|
|
140
|
+
default:
|
|
141
|
+
return [];
|
|
142
|
+
}
|
|
143
|
+
};
|
|
74
144
|
const isAnswerValid = (ans, { answer }) => {
|
|
75
145
|
const answerTree = new numberNode_1.NumberNode(Number(answer.replace(",", ".")));
|
|
76
146
|
const texs = answerTree.toAllValidTexs();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findAtomicStructureElement.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/chemicalElements/findAtomicStructureElement.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAKtE,KAAK,sBAAsB,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;AAQhE,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,WAAW,CAAC;IACxB,aAAa,EAAE,sBAAsB,CAAC;CACvC,CAAC;
|
|
1
|
+
{"version":3,"file":"findAtomicStructureElement.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/chemicalElements/findAtomicStructureElement.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAKtE,KAAK,sBAAsB,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;AAQhE,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,WAAW,CAAC;IACxB,aAAa,EAAE,sBAAsB,CAAC;CACvC,CAAC;AAoFF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAa5D,CAAC"}
|
|
@@ -27,6 +27,8 @@ const getFindAtomicStructureElementQuestion = () => {
|
|
|
27
27
|
const question = {
|
|
28
28
|
answer: `${answer}`,
|
|
29
29
|
instruction,
|
|
30
|
+
hint: getHint(elementToFind),
|
|
31
|
+
correction: getCorrection(elementToFind, protonsNumber, neutronsNumber),
|
|
30
32
|
keys: [],
|
|
31
33
|
answerFormat: "tex",
|
|
32
34
|
identifiers: { atomSymbol: atom.symbole, elementToFind },
|
|
@@ -53,6 +55,16 @@ const getPropositions = (n, { answer, atomSymbol, elementToFind }) => {
|
|
|
53
55
|
const isAnswerValid = (ans, { answer }) => {
|
|
54
56
|
return ans === answer;
|
|
55
57
|
};
|
|
58
|
+
const getHint = (elementToFind) => {
|
|
59
|
+
return elementToFind === "proton"
|
|
60
|
+
? `Pour déterminer le nombre de protons d'un atome, vous pouvez utiliser l'écriture conventionnelle du noyau atomique.`
|
|
61
|
+
: `On rapelle que : Nombre de neutrons $= A - Z$.`;
|
|
62
|
+
};
|
|
63
|
+
const getCorrection = (elementToFind, protonNb, neutronNb) => {
|
|
64
|
+
return elementToFind === "proton"
|
|
65
|
+
? `Le nombre de proton est égal à : $${protonNb}$`
|
|
66
|
+
: `Le nombre de neutron est égal à : $A - Z=${neutronNb}$`;
|
|
67
|
+
};
|
|
56
68
|
exports.findAtomicStructureElement = {
|
|
57
69
|
id: "findAtomicStructureElement",
|
|
58
70
|
label: "Trouver le nombre de protons, neutrons ou électrons d'un atome",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calculateSynthesisEfficiency.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/chemicalReactions/calculateSynthesisEfficiency.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAKlC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;
|
|
1
|
+
{"version":3,"file":"calculateSynthesisEfficiency.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/chemicalReactions/calculateSynthesisEfficiency.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAKlC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AA6EF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAa9D,CAAC"}
|
|
@@ -9,11 +9,18 @@ const getCalculateSynthesisEfficiencyQuestion = () => {
|
|
|
9
9
|
const maxQuantity = (0, randfloat_1.randfloat)(0.2, 0.6, 2);
|
|
10
10
|
const productQuantity = (0, randfloat_1.randfloat)(maxQuantity / 2, maxQuantity * 0.9, 2);
|
|
11
11
|
const efficiency = (0, round_1.round)(productQuantity / maxQuantity, 2);
|
|
12
|
+
const instruction = `Lors d'une synthèse chimique, $${(0, round_1.roundSignificant)(maxQuantity, 2)}\\ \\text{mol}$ de produit est attendu au maximum, et il se forme au final $${(0, round_1.roundSignificant)(productQuantity, 2)}\\ \\text{mol}$ de produit.
|
|
13
|
+
Calculer le rendement.`;
|
|
14
|
+
const hint = "Le rendement est calculé en utilisant la formule : $R = \\frac{n_{produit}}{n_{max}}$, où $n_{produit}$ est la quantité de produit obtenue et $n_{max}$ est la quantité maximale attendue.";
|
|
15
|
+
const correction = `Pour calculer le rendement :
|
|
16
|
+
\n1. La quantité maximale de produit attendue est $${(0, round_1.roundSignificant)(maxQuantity, 2)}\\ \\text{mol}$.
|
|
17
|
+
\n2. La quantité de produit effectivement obtenue est $${(0, round_1.roundSignificant)(productQuantity, 2)}\\ \\text{mol}$.
|
|
18
|
+
\n3. Le rendement est donné par $R = \\frac{n_{produit}}{n_{max}} = \\frac{${(0, round_1.roundSignificant)(productQuantity, 2)}}{${(0, round_1.roundSignificant)(maxQuantity, 2)}} = ${(0, round_1.roundSignificant)(efficiency, 2)}$.`;
|
|
12
19
|
const question = {
|
|
13
20
|
answer: `${(0, round_1.roundSignificant)(efficiency, 2)}`,
|
|
14
|
-
instruction
|
|
15
|
-
|
|
16
|
-
|
|
21
|
+
instruction,
|
|
22
|
+
hint,
|
|
23
|
+
correction,
|
|
17
24
|
keys: [],
|
|
18
25
|
answerFormat: "tex",
|
|
19
26
|
identifiers: { maxQuantity, productQuantity },
|
|
@@ -25,10 +32,10 @@ const getPropositions = (n, { answer, maxQuantity, productQuantity }) => {
|
|
|
25
32
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
26
33
|
const wrongDivision = maxQuantity / productQuantity;
|
|
27
34
|
const multiplied = maxQuantity * productQuantity;
|
|
28
|
-
const
|
|
35
|
+
const subtracted = maxQuantity - productQuantity;
|
|
29
36
|
(0, exercise_1.tryToAddWrongProp)(propositions, `${(0, round_1.roundSignificant)(wrongDivision, 2)}`);
|
|
30
37
|
(0, exercise_1.tryToAddWrongProp)(propositions, `${(0, round_1.roundSignificant)(multiplied, 2)}`);
|
|
31
|
-
(0, exercise_1.tryToAddWrongProp)(propositions, `${(0, round_1.roundSignificant)(
|
|
38
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, `${(0, round_1.roundSignificant)(subtracted, 2)}`);
|
|
32
39
|
while (propositions.length < n) {
|
|
33
40
|
(0, exercise_1.tryToAddWrongProp)(propositions, `${(0, round_1.roundSignificant)((0, randfloat_1.randfloat)(0, 5), 2)}`);
|
|
34
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forceWork.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/forces/forceWork.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"forceWork.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/forces/forceWork.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAoDF,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,WAAW,CAa3C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pH.d.ts","sourceRoot":"","sources":["../../../src/exercises/pc/pH.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;
|
|
1
|
+
{"version":3,"file":"pH.d.ts","sourceRoot":"","sources":["../../../src/exercises/pc/pH.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAkDF,eAAO,MAAM,EAAE,EAAE,QAAQ,CAAC,WAAW,CAapC,CAAC"}
|
package/lib/exercises/pc/pH.js
CHANGED
|
@@ -13,10 +13,17 @@ const getpH = () => {
|
|
|
13
13
|
const concentrationHydrogene = randomNumber * 10 ** -randomTenPower;
|
|
14
14
|
const instruction = `Calculer le pH d'une solution ayant une concentration en ions hydrogène ($H^+$) de $${randomNumber} \\times 10^{-${randomTenPower}}$ mol/L.`;
|
|
15
15
|
const answer = (0, frenchify_1.frenchify)((0, round_1.round)(-Math.log10(concentrationHydrogene), 1));
|
|
16
|
+
const hint = "Utilisez la formule du pH : $\\text{pH} = -\\log[H^+]$.";
|
|
17
|
+
const correction = `Pour calculer le pH, on utilise la formule $\\text{pH} = -\\log[H^+]$ :
|
|
18
|
+
\n1. La concentration en ions hydrogène est $${randomNumber} \\times 10^{-${randomTenPower}}$ mol/L.
|
|
19
|
+
\n2. En appliquant la formule, on obtient $\\text{pH} = -\\log(${randomNumber} \\times 10^{-${randomTenPower}})$.
|
|
20
|
+
\n3. Le résultat est $${answer}$.`;
|
|
16
21
|
const question = {
|
|
17
22
|
instruction,
|
|
18
23
|
startStatement: `pH`,
|
|
19
24
|
answer,
|
|
25
|
+
hint,
|
|
26
|
+
correction,
|
|
20
27
|
keys: ["log"],
|
|
21
28
|
answerFormat: "tex",
|
|
22
29
|
identifiers: { randomNumber, randomTenPower },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"periodicWaveCelerity.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/waves/periodicWaveCelerity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;
|
|
1
|
+
{"version":3,"file":"periodicWaveCelerity.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/waves/periodicWaveCelerity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAoGF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CActD,CAAC"}
|