math-exercises 2.0.37 → 2.0.39
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/conversion/hoursToDecimal.d.ts +8 -0
- package/lib/exercises/conversion/hoursToDecimal.d.ts.map +1 -0
- package/lib/exercises/conversion/hoursToDecimal.js +72 -0
- package/lib/exercises/conversion/index.d.ts +1 -0
- package/lib/exercises/conversion/index.d.ts.map +1 -1
- package/lib/exercises/conversion/index.js +1 -0
- package/lib/exercises/derivation/derivative/thirdDegreeFunctionVariation.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/thirdDegreeFunctionVariation.js +1 -0
- package/lib/exercises/derivation/derivativeNumberReading.d.ts.map +1 -1
- package/lib/exercises/derivation/derivativeNumberReading.js +1 -0
- package/lib/exercises/exercise.d.ts +1 -0
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/functions/affines/affineExpressionReading.d.ts.map +1 -1
- package/lib/exercises/functions/affines/affineExpressionReading.js +1 -0
- package/lib/exercises/functions/affines/interceptReading.d.ts.map +1 -1
- package/lib/exercises/functions/affines/interceptReading.js +1 -0
- package/lib/exercises/functions/affines/leadingCoefficient.d.ts.map +1 -1
- package/lib/exercises/functions/affines/leadingCoefficient.js +1 -0
- package/lib/exercises/functions/basics/graphicEquation.d.ts.map +1 -1
- package/lib/exercises/functions/basics/graphicEquation.js +1 -0
- package/lib/exercises/functions/basics/graphicInequation.d.ts.map +1 -1
- package/lib/exercises/functions/basics/graphicInequation.js +1 -0
- package/lib/exercises/functions/basics/imageFunctionGeogebra.d.ts.map +1 -1
- package/lib/exercises/functions/basics/imageFunctionGeogebra.js +1 -0
- package/lib/exercises/functions/basics/inverseImageFunctionGeogebra.d.ts.map +1 -1
- package/lib/exercises/functions/basics/inverseImageFunctionGeogebra.js +1 -0
- package/lib/exercises/functions/index.d.ts +1 -0
- package/lib/exercises/functions/index.d.ts.map +1 -1
- package/lib/exercises/functions/index.js +1 -0
- package/lib/exercises/functions/parity/index.d.ts +3 -0
- package/lib/exercises/functions/parity/index.d.ts.map +1 -0
- package/lib/exercises/functions/parity/index.js +18 -0
- package/lib/exercises/functions/parity/parityFromAlgebra.d.ts +8 -0
- package/lib/exercises/functions/parity/parityFromAlgebra.d.ts.map +1 -0
- package/lib/exercises/functions/parity/parityFromAlgebra.js +117 -0
- package/lib/exercises/functions/parity/parityFromGraph.d.ts +8 -0
- package/lib/exercises/functions/parity/parityFromGraph.d.ts.map +1 -0
- package/lib/exercises/functions/parity/parityFromGraph.js +128 -0
- package/lib/exercises/functions/trinoms/rootsReading.d.ts.map +1 -1
- package/lib/exercises/functions/trinoms/rootsReading.js +1 -0
- package/lib/exercises/functions/trinoms/summitReading.d.ts.map +1 -1
- package/lib/exercises/functions/trinoms/summitReading.js +1 -0
- package/lib/exercises/geometry/areas/rightTriangleArea.d.ts.map +1 -1
- package/lib/exercises/geometry/areas/rightTriangleArea.js +1 -0
- package/lib/exercises/geometry/areas/triangleArea.d.ts.map +1 -1
- package/lib/exercises/geometry/areas/triangleArea.js +1 -0
- package/lib/exercises/geometry/pythagore/pythagore.d.ts.map +1 -1
- package/lib/exercises/geometry/pythagore/pythagore.js +1 -0
- package/lib/exercises/geometry/pythagore/pythagoreCalcul.d.ts.map +1 -1
- package/lib/exercises/geometry/pythagore/pythagoreCalcul.js +1 -0
- package/lib/exercises/geometry/thales/thales.d.ts.map +1 -1
- package/lib/exercises/geometry/thales/thales.js +1 -0
- package/lib/exercises/geometry/thales/thalesCalcul.d.ts.map +1 -1
- package/lib/exercises/geometry/thales/thalesCalcul.js +1 -0
- package/lib/exercises/geometry/vectors/coordinatesReading.d.ts.map +1 -1
- package/lib/exercises/geometry/vectors/coordinatesReading.js +1 -0
- package/lib/exercises/geometry/vectors/equalCaracteristicFromGraph.d.ts.map +1 -1
- package/lib/exercises/geometry/vectors/equalCaracteristicFromGraph.js +1 -0
- package/lib/exercises/limits/limitReading.d.ts.map +1 -1
- package/lib/exercises/limits/limitReading.js +1 -0
- package/lib/exercises/percent/index.d.ts +2 -0
- package/lib/exercises/percent/index.d.ts.map +1 -1
- package/lib/exercises/percent/index.js +2 -0
- package/lib/exercises/percent/percentToDecimal.d.ts +8 -0
- package/lib/exercises/percent/percentToDecimal.d.ts.map +1 -0
- package/lib/exercises/percent/percentToDecimal.js +69 -0
- package/lib/exercises/percent/valuePercent.d.ts +8 -0
- package/lib/exercises/percent/valuePercent.d.ts.map +1 -0
- package/lib/exercises/percent/valuePercent.js +45 -0
- package/lib/exercises/probaStat/probabilityTree.d.ts.map +1 -1
- package/lib/exercises/probaStat/probabilityTree.js +1 -0
- package/lib/exercises/sequences/arithmetic/arithmeticFirstTermsSum.d.ts +10 -0
- package/lib/exercises/sequences/arithmetic/arithmeticFirstTermsSum.d.ts.map +1 -0
- package/lib/exercises/sequences/arithmetic/arithmeticFirstTermsSum.js +50 -0
- package/lib/exercises/sequences/arithmetic/index.d.ts +1 -0
- package/lib/exercises/sequences/arithmetic/index.d.ts.map +1 -1
- package/lib/exercises/sequences/arithmetic/index.js +1 -0
- package/lib/exercises/sequences/arithmetic/recognizeArithmeticFromGraph.d.ts.map +1 -1
- package/lib/exercises/sequences/arithmetic/recognizeArithmeticFromGraph.js +1 -0
- package/lib/exercises/sequences/arithmetic/recognizeReasonFromGraph.d.ts.map +1 -1
- package/lib/exercises/sequences/arithmetic/recognizeReasonFromGraph.js +1 -0
- package/lib/exercises/trigonometry/trigonometry.d.ts.map +1 -1
- package/lib/exercises/trigonometry/trigonometry.js +1 -0
- package/lib/exercises/trigonometry/trigonometryAngleCalcul.d.ts.map +1 -1
- package/lib/exercises/trigonometry/trigonometryAngleCalcul.js +1 -0
- package/lib/exercises/trigonometry/trigonometrySideCalcul.d.ts.map +1 -1
- package/lib/exercises/trigonometry/trigonometrySideCalcul.js +1 -0
- package/lib/index.d.ts +103 -81
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -0
- package/lib/math/numbers/decimals/decimal.d.ts +2 -0
- package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
- package/lib/math/numbers/decimals/decimal.js +4 -0
- package/lib/math/polynomials/polynomial.d.ts.map +1 -1
- package/lib/math/polynomials/polynomial.js +11 -0
- package/lib/math/polynomials/rationalFrac.d.ts.map +1 -1
- package/lib/math/polynomials/rationalFrac.js +13 -0
- package/lib/server.d.ts +1 -0
- package/lib/server.d.ts.map +1 -1
- package/lib/server.js +5 -0
- package/lib/types/keyIds.d.ts +1 -1
- package/lib/types/keyIds.d.ts.map +1 -1
- package/lib/utils/probaLawFlip.d.ts +5 -0
- package/lib/utils/probaLawFlip.d.ts.map +1 -1
- package/lib/utils/probaLawFlip.js +6 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pythagore.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/pythagore/pythagore.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAWlC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AA+DF,eAAO,MAAM,SAAS,EAAE,YAAY,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"pythagore.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/pythagore/pythagore.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAWlC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AA+DF,eAAO,MAAM,SAAS,EAAE,YAAY,CAAC,WAAW,CAa/C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pythagoreCalcul.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/pythagore/pythagoreCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAalC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAkGF,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"pythagoreCalcul.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/pythagore/pythagoreCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAalC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAkGF,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,WAAW,CAarD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thales.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/thales/thales.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AA0IF,eAAO,MAAM,MAAM,EAAE,YAAY,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"thales.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/thales/thales.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AA0IF,eAAO,MAAM,MAAM,EAAE,YAAY,CAAC,WAAW,CAa5C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thalesCalcul.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/thales/thalesCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAmLF,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"thalesCalcul.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/thales/thalesCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAmLF,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,WAAW,CAalD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coordinatesReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/vectors/coordinatesReading.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAqEF,eAAO,MAAM,kBAAkB,EAAE,YAAY,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"coordinatesReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/vectors/coordinatesReading.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAqEF,eAAO,MAAM,kBAAkB,EAAE,YAAY,CAAC,WAAW,CAcxD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equalCaracteristicFromGraph.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/vectors/equalCaracteristicFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC;CACrB,CAAC;AAwLF,eAAO,MAAM,2BAA2B,EAAE,YAAY,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"equalCaracteristicFromGraph.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/vectors/equalCaracteristicFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC;CACrB,CAAC;AAwLF,eAAO,MAAM,2BAA2B,EAAE,YAAY,CAAC,WAAW,CAcjE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limitReading.d.ts","sourceRoot":"","sources":["../../../src/exercises/limits/limitReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAyBlC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvB,CAAC;AAyGF,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"limitReading.d.ts","sourceRoot":"","sources":["../../../src/exercises/limits/limitReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAyBlC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvB,CAAC;AAyGF,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,WAAW,CAalD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/percent/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/percent/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC"}
|
|
@@ -19,3 +19,5 @@ __exportStar(require("./averageEvolutionRate"), exports);
|
|
|
19
19
|
__exportStar(require("./evolutionToCM"), exports);
|
|
20
20
|
__exportStar(require("./globalPercent"), exports);
|
|
21
21
|
__exportStar(require("./reciprocalPercentage"), exports);
|
|
22
|
+
__exportStar(require("./percentToDecimal"), exports);
|
|
23
|
+
__exportStar(require("./valuePercent"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"percentToDecimal.d.ts","sourceRoot":"","sources":["../../../src/exercises/percent/percentToDecimal.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAiEF,eAAO,MAAM,gBAAgB,EAAE,YAAY,CAAC,WAAW,CAatD,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.percentToDecimal = void 0;
|
|
4
|
+
const exercise_1 = require("../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const decimal_1 = require("../../math/numbers/decimals/decimal");
|
|
7
|
+
const randint_1 = require("../../math/utils/random/randint");
|
|
8
|
+
const coinFlip_1 = require("../../utils/coinFlip");
|
|
9
|
+
const getPercentToDecimalQuestion = () => {
|
|
10
|
+
const isPercentToDecimal = (0, coinFlip_1.coinFlip)();
|
|
11
|
+
const nb = decimal_1.DecimalConstructor.random(0, 2);
|
|
12
|
+
const tex = nb.toTree().toTex();
|
|
13
|
+
const percentTex = nb.toPercentNode().toTex();
|
|
14
|
+
const instru = isPercentToDecimal ? percentTex : tex;
|
|
15
|
+
const answer = isPercentToDecimal ? tex : percentTex;
|
|
16
|
+
const question = {
|
|
17
|
+
answer,
|
|
18
|
+
instruction: `Ecrire le nombre suivant ${isPercentToDecimal
|
|
19
|
+
? "sous forme de nombre décimal"
|
|
20
|
+
: "sous forme de pourcentage"} : $${instru}$`,
|
|
21
|
+
keys: ["percent"],
|
|
22
|
+
answerFormat: "tex",
|
|
23
|
+
identifiers: { isPercentToDecimal, nb: nb.value },
|
|
24
|
+
};
|
|
25
|
+
return question;
|
|
26
|
+
};
|
|
27
|
+
const getPropositions = (n, { answer, isPercentToDecimal, nb }) => {
|
|
28
|
+
const propositions = [];
|
|
29
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
30
|
+
const dec = new decimal_1.Decimal(nb);
|
|
31
|
+
while (propositions.length < n) {
|
|
32
|
+
if (isPercentToDecimal) {
|
|
33
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, dec
|
|
34
|
+
.multiplyByPowerOfTen((0, randint_1.randint)(-4, 4, [0, 1]))
|
|
35
|
+
.toTree()
|
|
36
|
+
.toTex());
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, dec
|
|
40
|
+
.multiplyByPowerOfTen((0, randint_1.randint)(-4, 4, [0, 1]))
|
|
41
|
+
.toPercentNode()
|
|
42
|
+
.toTex());
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
46
|
+
};
|
|
47
|
+
const isAnswerValid = (ans, { answer, isPercentToDecimal, nb }) => {
|
|
48
|
+
const dec = new decimal_1.Decimal(nb);
|
|
49
|
+
if (isPercentToDecimal) {
|
|
50
|
+
return ans === answer;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
const texs = dec.toPercentNode().toAllValidTexs();
|
|
54
|
+
return texs.includes(ans);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
exports.percentToDecimal = {
|
|
58
|
+
id: "percentToDecimal",
|
|
59
|
+
connector: "=",
|
|
60
|
+
label: "Ecrire un pourcentage sous forme décimal et vice-versa",
|
|
61
|
+
levels: ["2nde", "2ndPro", "1reESM", "1rePro"],
|
|
62
|
+
isSingleStep: true,
|
|
63
|
+
sections: ["Pourcentages"],
|
|
64
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getPercentToDecimalQuestion, nb),
|
|
65
|
+
qcmTimer: 60,
|
|
66
|
+
freeTimer: 60,
|
|
67
|
+
getPropositions,
|
|
68
|
+
isAnswerValid,
|
|
69
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"valuePercent.d.ts","sourceRoot":"","sources":["../../../src/exercises/percent/valuePercent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAmCF,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,WAAW,CAYlD,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.valuePercent = void 0;
|
|
4
|
+
const exercise_1 = require("../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const decimal_1 = require("../../math/numbers/decimals/decimal");
|
|
7
|
+
const randint_1 = require("../../math/utils/random/randint");
|
|
8
|
+
const round_1 = require("../../math/utils/round");
|
|
9
|
+
const getValuePercentQuestion = () => {
|
|
10
|
+
const percent = (0, randint_1.randint)(1, 100);
|
|
11
|
+
const nb = (0, randint_1.randint)(1, 100);
|
|
12
|
+
const ans = (0, round_1.round)((percent * nb) / 100, 2).frenchify();
|
|
13
|
+
const question = {
|
|
14
|
+
answer: ans + "",
|
|
15
|
+
instruction: `Calculer $${percent}\\%$ de $${nb}$.`,
|
|
16
|
+
keys: [],
|
|
17
|
+
answerFormat: "tex",
|
|
18
|
+
identifiers: { percent, nb },
|
|
19
|
+
};
|
|
20
|
+
return question;
|
|
21
|
+
};
|
|
22
|
+
const getPropositions = (n, { answer, percent, nb }) => {
|
|
23
|
+
const propositions = [];
|
|
24
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
25
|
+
while (propositions.length < n) {
|
|
26
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, decimal_1.DecimalConstructor.random(0, 100).toTree().toTex());
|
|
27
|
+
}
|
|
28
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
29
|
+
};
|
|
30
|
+
const isAnswerValid = (ans, { answer, percent, nb }) => {
|
|
31
|
+
return ans === answer;
|
|
32
|
+
};
|
|
33
|
+
exports.valuePercent = {
|
|
34
|
+
id: "valuePercent",
|
|
35
|
+
connector: "=",
|
|
36
|
+
label: "Calculer un pourcentage",
|
|
37
|
+
levels: ["3ème", "2ndPro", "2nde", "1reESM", "1rePro"],
|
|
38
|
+
isSingleStep: true,
|
|
39
|
+
sections: ["Pourcentages"],
|
|
40
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getValuePercentQuestion, nb),
|
|
41
|
+
qcmTimer: 60,
|
|
42
|
+
freeTimer: 60,
|
|
43
|
+
getPropositions,
|
|
44
|
+
isAnswerValid,
|
|
45
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"probabilityTree.d.ts","sourceRoot":"","sources":["../../../src/exercises/probaStat/probabilityTree.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,YAAY,EAQb,MAAM,aAAa,CAAC;AAGrB,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AA8IF,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"probabilityTree.d.ts","sourceRoot":"","sources":["../../../src/exercises/probaStat/probabilityTree.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,YAAY,EAQb,MAAM,aAAa,CAAC;AAGrB,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AA8IF,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,WAAW,CAqBrD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MathExercise } from "../../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
firstRank: number;
|
|
4
|
+
firstValue: number;
|
|
5
|
+
reason: number;
|
|
6
|
+
nbTerms: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const arithmeticFirstTermsSum: MathExercise<Identifiers>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=arithmeticFirstTermsSum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arithmeticFirstTermsSum.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/arithmetic/arithmeticFirstTermsSum.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAKlC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAsCF,eAAO,MAAM,uBAAuB,EAAE,YAAY,CAAC,WAAW,CAa7D,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.arithmeticFirstTermsSum = 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 random_1 = require("../../../utils/random");
|
|
8
|
+
const getArithmeticFirstTermsSumQuestion = () => {
|
|
9
|
+
const firstRank = (0, random_1.random)([0, 1]);
|
|
10
|
+
const firstValue = (0, randint_1.randint)(-9, 10);
|
|
11
|
+
const reason = (0, randint_1.randint)(-5, 5, [0]);
|
|
12
|
+
const nbTerms = (0, randint_1.randint)(4, 9);
|
|
13
|
+
const lastRank = firstRank + nbTerms - 1;
|
|
14
|
+
const answer = (lastRank - firstRank + 1) *
|
|
15
|
+
(firstRank === 0 ? firstValue : firstValue - reason) +
|
|
16
|
+
(reason * (lastRank * (lastRank + 1))) / 2;
|
|
17
|
+
const answerTex = answer + "";
|
|
18
|
+
const question = {
|
|
19
|
+
answer: answerTex,
|
|
20
|
+
instruction: `Soit $u$ une suite arithmétique de premier terme $u_${firstRank} = ${firstValue}$ et de raison $${reason}$. Calculer la somme des $${nbTerms}$ premiers termes de $u$.`,
|
|
21
|
+
keys: [],
|
|
22
|
+
answerFormat: "tex",
|
|
23
|
+
identifiers: { firstRank, firstValue, reason, nbTerms },
|
|
24
|
+
};
|
|
25
|
+
return question;
|
|
26
|
+
};
|
|
27
|
+
const getPropositions = (n, { answer }) => {
|
|
28
|
+
const propositions = [];
|
|
29
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
30
|
+
while (propositions.length < n) {
|
|
31
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, randint_1.randint)(-100, 100) + "");
|
|
32
|
+
}
|
|
33
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
34
|
+
};
|
|
35
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
36
|
+
return ans === answer;
|
|
37
|
+
};
|
|
38
|
+
exports.arithmeticFirstTermsSum = {
|
|
39
|
+
id: "arithmeticFirstTermsSum",
|
|
40
|
+
connector: "=",
|
|
41
|
+
label: "Calculer la somme des premiers termes d'une suite arithmétique",
|
|
42
|
+
levels: ["1rePro", "1reESM", "1reTech", "1reSpé"],
|
|
43
|
+
isSingleStep: true,
|
|
44
|
+
sections: ["Suites"],
|
|
45
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getArithmeticFirstTermsSumQuestion, nb),
|
|
46
|
+
qcmTimer: 60,
|
|
47
|
+
freeTimer: 60,
|
|
48
|
+
getPropositions,
|
|
49
|
+
isAnswerValid,
|
|
50
|
+
};
|
|
@@ -9,4 +9,5 @@ export * from "./recognizeArithmeticFromFirstTerms";
|
|
|
9
9
|
export * from "./recognizeReasonFromFirstTerms";
|
|
10
10
|
export * from "./recognizeReasonFromGraph";
|
|
11
11
|
export * from "./recognizeArithmeticFromGraph";
|
|
12
|
+
export * from "./arithmeticFirstTermsSum";
|
|
12
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/arithmetic/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oCAAoC,CAAC;AACnD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,qCAAqC,CAAC;AACpD,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/arithmetic/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oCAAoC,CAAC;AACnD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,qCAAqC,CAAC;AACpD,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC"}
|
|
@@ -25,3 +25,4 @@ __exportStar(require("./recognizeArithmeticFromFirstTerms"), exports);
|
|
|
25
25
|
__exportStar(require("./recognizeReasonFromFirstTerms"), exports);
|
|
26
26
|
__exportStar(require("./recognizeReasonFromGraph"), exports);
|
|
27
27
|
__exportStar(require("./recognizeArithmeticFromGraph"), exports);
|
|
28
|
+
__exportStar(require("./arithmeticFirstTermsSum"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recognizeArithmeticFromGraph.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/arithmetic/recognizeArithmeticFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AA4EF,eAAO,MAAM,4BAA4B,EAAE,YAAY,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"recognizeArithmeticFromGraph.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/arithmetic/recognizeArithmeticFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AA4EF,eAAO,MAAM,4BAA4B,EAAE,YAAY,CAAC,WAAW,CAclE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recognizeReasonFromGraph.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/arithmetic/recognizeReasonFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAgDF,eAAO,MAAM,wBAAwB,EAAE,YAAY,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"recognizeReasonFromGraph.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/arithmetic/recognizeReasonFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAgDF,eAAO,MAAM,wBAAwB,EAAE,YAAY,CAAC,WAAW,CAc9D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigonometry.d.ts","sourceRoot":"","sources":["../../../src/exercises/trigonometry/trigonometry.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAWlC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAqHF,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"trigonometry.d.ts","sourceRoot":"","sources":["../../../src/exercises/trigonometry/trigonometry.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAWlC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAqHF,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,WAAW,CAclD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigonometryAngleCalcul.d.ts","sourceRoot":"","sources":["../../../src/exercises/trigonometry/trigonometryAngleCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AA8EF,eAAO,MAAM,uBAAuB,EAAE,YAAY,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"trigonometryAngleCalcul.d.ts","sourceRoot":"","sources":["../../../src/exercises/trigonometry/trigonometryAngleCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AA8EF,eAAO,MAAM,uBAAuB,EAAE,YAAY,CAAC,WAAW,CAc7D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigonometrySideCalcul.d.ts","sourceRoot":"","sources":["../../../src/exercises/trigonometry/trigonometrySideCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,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;AA4FF,eAAO,MAAM,sBAAsB,EAAE,YAAY,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"trigonometrySideCalcul.d.ts","sourceRoot":"","sources":["../../../src/exercises/trigonometry/trigonometrySideCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,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;AA4FF,eAAO,MAAM,sBAAsB,EAAE,YAAY,CAAC,WAAW,CAc5D,CAAC"}
|