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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hoursToDecimal.d.ts","sourceRoot":"","sources":["../../../src/exercises/conversion/hoursToDecimal.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAwEF,eAAO,MAAM,cAAc,EAAE,YAAY,CAAC,WAAW,CAapD,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hoursToDecimal = 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 coinFlip_1 = require("../../utils/coinFlip");
|
|
10
|
+
const getHoursToDecimalQuestion = () => {
|
|
11
|
+
const isDecimalToHours = (0, coinFlip_1.coinFlip)();
|
|
12
|
+
const dec = decimal_1.DecimalConstructor.random(0, 3, 2);
|
|
13
|
+
const hours = Math.floor(dec.value);
|
|
14
|
+
const mins = (0, round_1.round)((dec.value - hours) * 100 * 0.6, 0);
|
|
15
|
+
const decTex = dec.toTree().toTex();
|
|
16
|
+
const durationTex = isDecimalToHours
|
|
17
|
+
? decTex + "\\text{h}"
|
|
18
|
+
: `${hours}\\text{h}${mins}\\text{min}`;
|
|
19
|
+
const answer = isDecimalToHours
|
|
20
|
+
? `${hours}\\text{h}${mins}\\text{min}`
|
|
21
|
+
: `${hours},${(0, round_1.round)((mins / 60) * 100, 0)}\\text{h}`;
|
|
22
|
+
const question = {
|
|
23
|
+
answer,
|
|
24
|
+
instruction: `Convertir la durée suivante en ${isDecimalToHours ? "heures et minutes" : "nombre décimal"} : $${durationTex}$ (arrondir ${isDecimalToHours ? "à la minute près" : "au centième près"})`,
|
|
25
|
+
keys: ["hours", "minutes"],
|
|
26
|
+
answerFormat: "tex",
|
|
27
|
+
identifiers: { isDecimalToHours, dec: dec.value },
|
|
28
|
+
};
|
|
29
|
+
return question;
|
|
30
|
+
};
|
|
31
|
+
const getPropositions = (n, { answer, isDecimalToHours, dec }) => {
|
|
32
|
+
const propositions = [];
|
|
33
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
34
|
+
const hours = Math.floor(dec);
|
|
35
|
+
const mins = (0, round_1.round)((dec - hours) * 0.6 * 100, 0);
|
|
36
|
+
if (isDecimalToHours) {
|
|
37
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, `${hours}\\text{h}${(0, round_1.round)((dec - hours) * 100, 0)}\\text{min}`);
|
|
38
|
+
while (propositions.length < n) {
|
|
39
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, `${hours}\\text{h}${(0, randint_1.randint)(1, 100)}\\text{min}`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, `${hours},${mins}\\text{h}`);
|
|
44
|
+
while (propositions.length < n) {
|
|
45
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, decimal_1.DecimalConstructor.random(hours, hours + 1, 2)
|
|
46
|
+
.toTree()
|
|
47
|
+
.toTex() + "\\text{h}");
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
51
|
+
};
|
|
52
|
+
const isAnswerValid = (ans, { answer, isDecimalToHours, dec }) => {
|
|
53
|
+
if (isDecimalToHours)
|
|
54
|
+
return ans === answer;
|
|
55
|
+
// const hours = Math.floor(dec);
|
|
56
|
+
// const mins = round((dec - hours) * 100 * 0.6, 0);
|
|
57
|
+
const texs = [answer, answer.replace("\\text{h}", "")];
|
|
58
|
+
return texs.includes(ans);
|
|
59
|
+
};
|
|
60
|
+
exports.hoursToDecimal = {
|
|
61
|
+
id: "hoursToDecimal",
|
|
62
|
+
connector: "=",
|
|
63
|
+
label: "Convertir une durée en nombre décimal et inversement",
|
|
64
|
+
levels: ["2nde", "2ndPro", "3ème"],
|
|
65
|
+
isSingleStep: true,
|
|
66
|
+
sections: ["Conversions"],
|
|
67
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getHoursToDecimalQuestion, nb),
|
|
68
|
+
qcmTimer: 60,
|
|
69
|
+
freeTimer: 60,
|
|
70
|
+
getPropositions,
|
|
71
|
+
isAnswerValid,
|
|
72
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/conversion/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/conversion/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC"}
|
|
@@ -20,3 +20,4 @@ __exportStar(require("./lengthConversion"), exports);
|
|
|
20
20
|
__exportStar(require("./massConversion"), exports);
|
|
21
21
|
__exportStar(require("./volumeCapacityConversion"), exports);
|
|
22
22
|
__exportStar(require("./volumeConversion"), exports);
|
|
23
|
+
__exportStar(require("./hoursToDecimal"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thirdDegreeFunctionVariation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/thirdDegreeFunctionVariation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAiBlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAwHF,eAAO,MAAM,4BAA4B,EAAE,YAAY,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"thirdDegreeFunctionVariation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/thirdDegreeFunctionVariation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAiBlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAwHF,eAAO,MAAM,4BAA4B,EAAE,YAAY,CAAC,WAAW,CAuBlE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"derivativeNumberReading.d.ts","sourceRoot":"","sources":["../../../src/exercises/derivation/derivativeNumberReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAmBlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,CAAC,EAAE,MAAM,EAAE,CAAC;CACb,CAAC;AA4FF,eAAO,MAAM,uBAAuB,EAAE,YAAY,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"derivativeNumberReading.d.ts","sourceRoot":"","sources":["../../../src/exercises/derivation/derivativeNumberReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAmBlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,CAAC,EAAE,MAAM,EAAE,CAAC;CACb,CAAC;AA4FF,eAAO,MAAM,uBAAuB,EAAE,YAAY,CAAC,WAAW,CAc7D,CAAC"}
|
|
@@ -53,6 +53,7 @@ export interface MathExercise<TIdentifiers = {}> {
|
|
|
53
53
|
answer: string;
|
|
54
54
|
} & TIdentifiers>;
|
|
55
55
|
isAnswerValid?: VEA<TIdentifiers>;
|
|
56
|
+
hasGeogebra?: boolean;
|
|
56
57
|
}
|
|
57
58
|
export type MathLevel = "6ème" | "5ème" | "4ème" | "3ème" | "2nde" | "1reTech" | "1reESM" | "1reSpé" | "TermSpé" | "TermTech" | "MathExp" | "MathComp" | "CAP" | "2ndPro" | "1rePro" | "TermPro";
|
|
58
59
|
export type MathSection = "Aires" | "Arithmétique" | "Calcul littéral" | "Calculs" | "Combinatoire et dénombrement" | "Conversions" | "Dérivation" | "Droites" | "Ensembles et intervalles" | "Équations" | "Équations différentielles" | "Exponentielle" | "Fonction cube" | "Fonction inverse" | "Fonctions" | "Fonctions affines" | "Fonctions de référence" | "Fractions" | "Géométrie cartésienne" | "Géométrie euclidienne" | "Inéquations" | "Intégration" | "Limites" | "Logarithme népérien" | "Logarithme décimal" | "Matrices" | "Nombres complexes" | "Périmètres" | "Pourcentages" | "Primitives" | "Probabilités" | "Produit scalaire" | "Proportionnalité" | "Puissances" | "Racines carrées" | "Second degré" | "Statistiques" | "Suites" | "Théorème de Pythagore" | "Théorème de Thalès" | "Trigonométrie" | "Valeur absolue" | "Vecteurs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAI3C,eAAO,MAAM,YAAY,UAChB,WAAW,EAAE,aACT,MAAM,WACT,KAAK,GAAG,KAAK,SAQtB,CAAC;AACF,eAAO,MAAM,YAAY,UAChB,WAAW,EAAE,aACT,MAAM,WACT,KAAK,GAAG,KAAK,SAQtB,CAAC;AACF,eAAO,MAAM,iBAAiB,UACrB,WAAW,EAAE,aACT,MAAM,WACT,KAAK,GAAG,KAAK,SAUtB,CAAC;AAEF,eAAO,MAAM,YAAY,UAAW,WAAW,EAAE,KAAK,MAAM,kBAE3D,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAElC,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;IACvB,MAAM,EAAE,KAAK,GAAG,KAAK,CAAC;CACvB,CAAC;AACF,MAAM,WAAW,QAAQ,CAAC,YAAY,GAAG,EAAE;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,KAAK,GAAG,KAAK,CAAC;IAC5B,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,E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
|
|
1
|
-
{"version":3,"file":"affineExpressionReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/affines/affineExpressionReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAelC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AA+GF,eAAO,MAAM,uBAAuB,EAAE,YAAY,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"affineExpressionReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/affines/affineExpressionReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAelC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AA+GF,eAAO,MAAM,uBAAuB,EAAE,YAAY,CAAC,WAAW,CAc7D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interceptReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/affines/interceptReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAwDF,eAAO,MAAM,gBAAgB,EAAE,YAAY,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"interceptReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/affines/interceptReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAwDF,eAAO,MAAM,gBAAgB,EAAE,YAAY,CAAC,WAAW,CActD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leadingCoefficient.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/affines/leadingCoefficient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAUlC,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;AAuEF,eAAO,MAAM,kBAAkB,EAAE,YAAY,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"leadingCoefficient.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/affines/leadingCoefficient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAUlC,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;AAuEF,eAAO,MAAM,kBAAkB,EAAE,YAAY,CAAC,WAAW,CAcxD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphicEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/basics/graphicEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAelC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;CAClC,CAAC;AAkGF,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"graphicEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/basics/graphicEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAelC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;CAClC,CAAC;AAkGF,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,WAAW,CAcrD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphicInequation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/basics/graphicInequation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AASlC,OAAO,EAAE,WAAW,EAAgB,MAAM,oCAAoC,CAAC;AAI/E,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,WAAW,CAAA;KAAE,EAAE,CAAC;CAC7D,CAAC;AAiKF,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"graphicInequation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/basics/graphicInequation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AASlC,OAAO,EAAE,WAAW,EAAgB,MAAM,oCAAoC,CAAC;AAI/E,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,WAAW,CAAA;KAAE,EAAE,CAAC;CAC7D,CAAC;AAiKF,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAAC,WAAW,CAcvD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imageFunctionGeogebra.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/basics/imageFunctionGeogebra.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA2EF,eAAO,MAAM,qBAAqB,EAAE,YAAY,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"imageFunctionGeogebra.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/basics/imageFunctionGeogebra.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA2EF,eAAO,MAAM,qBAAqB,EAAE,YAAY,CAAC,WAAW,CAa3D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inverseImageFunctionGeogebra.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/basics/inverseImageFunctionGeogebra.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AA4IF,eAAO,MAAM,4BAA4B,EAAE,YAAY,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"inverseImageFunctionGeogebra.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/basics/inverseImageFunctionGeogebra.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AA4IF,eAAO,MAAM,4BAA4B,EAAE,YAAY,CAAC,WAAW,CAclE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/functions/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/functions/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/parity/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./parityFromAlgebra"), exports);
|
|
18
|
+
__exportStar(require("./parityFromGraph"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parityFromAlgebra.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/parity/parityFromAlgebra.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAoGF,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAAC,WAAW,CAavD,CAAC"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parityFromAlgebra = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const affine_1 = require("../../../math/polynomials/affine");
|
|
7
|
+
const polynomial_1 = require("../../../math/polynomials/polynomial");
|
|
8
|
+
const rationalFrac_1 = require("../../../math/polynomials/rationalFrac");
|
|
9
|
+
const trinom_1 = require("../../../math/polynomials/trinom");
|
|
10
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
11
|
+
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
12
|
+
const doWhile_1 = require("../../../utils/doWhile");
|
|
13
|
+
const probaFlip_1 = require("../../../utils/probaFlip");
|
|
14
|
+
const probaLawFlip_1 = require("../../../utils/probaLawFlip");
|
|
15
|
+
const getParityFromAlgebraQuestion = () => {
|
|
16
|
+
//paires : ax^2 + b , frac ratio trinom/tirnom
|
|
17
|
+
//impaires : linéaires, ax^3, linéaire/trinom
|
|
18
|
+
// ni l'un ni l'autre : affines, trinomes avec ax, x^3 + b
|
|
19
|
+
const type = (0, probaLawFlip_1.probaLawFlip)([
|
|
20
|
+
["even", 0.33],
|
|
21
|
+
["uneven", 0.33],
|
|
22
|
+
["neither", 0.33],
|
|
23
|
+
]);
|
|
24
|
+
let fct;
|
|
25
|
+
let answer = "";
|
|
26
|
+
switch (type) {
|
|
27
|
+
case "even":
|
|
28
|
+
if ((0, coinFlip_1.coinFlip)()) {
|
|
29
|
+
fct = new trinom_1.Trinom((0, randint_1.randint)(-9, 10, [0]), 0, (0, randint_1.randint)(-9, 10))
|
|
30
|
+
.toTree()
|
|
31
|
+
.toTex();
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
let num = new trinom_1.Trinom((0, randint_1.randint)(-9, 10, [0]), 0, (0, randint_1.randint)(-9, 10));
|
|
35
|
+
let denum = (0, doWhile_1.doWhile)(() => new trinom_1.Trinom((0, randint_1.randint)(-9, 10, [0]), 0, (0, randint_1.randint)(-9, 10)), (P) => (num.c === 0 ? P.c !== 0 : P.a / num.a === P.c / num.c));
|
|
36
|
+
fct = new rationalFrac_1.RationalFrac(num, denum).toTree().toTex();
|
|
37
|
+
}
|
|
38
|
+
answer = "Paire";
|
|
39
|
+
break;
|
|
40
|
+
case "uneven":
|
|
41
|
+
if ((0, probaFlip_1.probaFlip)(0.33)) {
|
|
42
|
+
fct = new affine_1.Affine((0, randint_1.randint)(-10, 11, [0]), 0).toTree().toTex();
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
if ((0, coinFlip_1.coinFlip)()) {
|
|
46
|
+
fct = new polynomial_1.Polynomial([0, (0, randint_1.randint)(-10, 11), 0, (0, randint_1.randint)(-10, 11, [0])])
|
|
47
|
+
.toTree()
|
|
48
|
+
.toTex();
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
let num = new affine_1.Affine((0, randint_1.randint)(-9, 10, [0]), 0);
|
|
52
|
+
let denum = new trinom_1.Trinom((0, randint_1.randint)(-9, 10, [0]), 0, (0, randint_1.randint)(-9, 10, [0]));
|
|
53
|
+
fct = new rationalFrac_1.RationalFrac(num, denum).toTree().toTex();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
answer = "Impaire";
|
|
57
|
+
break;
|
|
58
|
+
case "neither":
|
|
59
|
+
if ((0, probaFlip_1.probaFlip)(0.33)) {
|
|
60
|
+
fct = new affine_1.Affine((0, randint_1.randint)(-9, 10, [0]), (0, randint_1.randint)(-9, 10, [0]))
|
|
61
|
+
.toTree()
|
|
62
|
+
.toTex();
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
if ((0, coinFlip_1.coinFlip)()) {
|
|
66
|
+
fct = new trinom_1.Trinom((0, randint_1.randint)(-9, 10, [0]), (0, randint_1.randint)(-9, 10, [0]), (0, randint_1.randint)(-9, 10))
|
|
67
|
+
.toTree()
|
|
68
|
+
.toTex();
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
fct = new polynomial_1.Polynomial([
|
|
72
|
+
(0, randint_1.randint)(-9, 10),
|
|
73
|
+
(0, randint_1.randint)(-9, 10),
|
|
74
|
+
(0, randint_1.randint)(-9, 10, [0]),
|
|
75
|
+
(0, randint_1.randint)(-9, 10, [0]),
|
|
76
|
+
])
|
|
77
|
+
.toTree()
|
|
78
|
+
.toTex();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
answer = "Ni paire, ni impaire";
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
const question = {
|
|
85
|
+
answer,
|
|
86
|
+
instruction: `Soit $f(x) = ${fct}$. La fonction $f$ est-elle paire, impaire, ou ni paire ni impaire ?`,
|
|
87
|
+
keys: [],
|
|
88
|
+
answerFormat: "tex",
|
|
89
|
+
identifiers: { type, fctTex: fct },
|
|
90
|
+
};
|
|
91
|
+
return question;
|
|
92
|
+
};
|
|
93
|
+
const getPropositions = (n, { answer }) => {
|
|
94
|
+
const propositions = [];
|
|
95
|
+
(0, exercise_1.addValidProp)(propositions, answer, "raw");
|
|
96
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "Paire", "raw");
|
|
97
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "Impaire", "raw");
|
|
98
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "Ni paire ni impaire", "raw");
|
|
99
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "On ne peut pas savoir", "raw");
|
|
100
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
101
|
+
};
|
|
102
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
103
|
+
return ans === answer;
|
|
104
|
+
};
|
|
105
|
+
exports.parityFromAlgebra = {
|
|
106
|
+
id: "parityFromAlgebra",
|
|
107
|
+
label: "",
|
|
108
|
+
levels: ["2nde"],
|
|
109
|
+
isSingleStep: true,
|
|
110
|
+
sections: ["Fonctions"],
|
|
111
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getParityFromAlgebraQuestion, nb),
|
|
112
|
+
qcmTimer: 60,
|
|
113
|
+
freeTimer: 60,
|
|
114
|
+
getPropositions,
|
|
115
|
+
isAnswerValid,
|
|
116
|
+
answerType: "QCM",
|
|
117
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parityFromGraph.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/parity/parityFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAclC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA4GF,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,WAAW,CAcrD,CAAC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parityFromGraph = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const colors_1 = require("../../../geogebra/colors");
|
|
7
|
+
const geogebraConstructor_1 = require("../../../geogebra/geogebraConstructor");
|
|
8
|
+
const affine_1 = require("../../../math/polynomials/affine");
|
|
9
|
+
const polynomial_1 = require("../../../math/polynomials/polynomial");
|
|
10
|
+
const rationalFrac_1 = require("../../../math/polynomials/rationalFrac");
|
|
11
|
+
const trinom_1 = require("../../../math/polynomials/trinom");
|
|
12
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
13
|
+
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
14
|
+
const doWhile_1 = require("../../../utils/doWhile");
|
|
15
|
+
const probaFlip_1 = require("../../../utils/probaFlip");
|
|
16
|
+
const probaLawFlip_1 = require("../../../utils/probaLawFlip");
|
|
17
|
+
const getParityFromGraphQuestion = () => {
|
|
18
|
+
//paires : ax^2 + b , frac ratio trinom/tirnom
|
|
19
|
+
//impaires : linéaires, ax^3, linéaire/trinom
|
|
20
|
+
// ni l'un ni l'autre : affines, trinomes avec ax, x^3 + b
|
|
21
|
+
const type = (0, probaLawFlip_1.probaLawFlip)([
|
|
22
|
+
["even", 0.33],
|
|
23
|
+
["uneven", 0.33],
|
|
24
|
+
["neither", 0.33],
|
|
25
|
+
]);
|
|
26
|
+
let fct;
|
|
27
|
+
let answer = "";
|
|
28
|
+
switch (type) {
|
|
29
|
+
case "even":
|
|
30
|
+
if ((0, coinFlip_1.coinFlip)()) {
|
|
31
|
+
fct = new trinom_1.Trinom((0, randint_1.randint)(-9, 10, [0]), 0, (0, randint_1.randint)(-9, 10))
|
|
32
|
+
.toTree()
|
|
33
|
+
.toMathString();
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
let num = new trinom_1.Trinom((0, randint_1.randint)(-9, 10, [0]), 0, (0, randint_1.randint)(-9, 10));
|
|
37
|
+
let denum = (0, doWhile_1.doWhile)(() => new trinom_1.Trinom((0, randint_1.randint)(-9, 10, [0]), 0, (0, randint_1.randint)(-9, 10)), (P) => (num.c === 0 ? P.c !== 0 : P.a / num.a === P.c / num.c));
|
|
38
|
+
fct = new rationalFrac_1.RationalFrac(num, denum).toTree().toMathString();
|
|
39
|
+
}
|
|
40
|
+
answer = "Paire";
|
|
41
|
+
break;
|
|
42
|
+
case "uneven":
|
|
43
|
+
if ((0, probaFlip_1.probaFlip)(0.33)) {
|
|
44
|
+
fct = new affine_1.Affine((0, randint_1.randint)(-10, 11, [0]), 0).toTree().toMathString();
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
if ((0, coinFlip_1.coinFlip)()) {
|
|
48
|
+
fct = new polynomial_1.Polynomial([0, (0, randint_1.randint)(-10, 11), 0, (0, randint_1.randint)(-10, 11, [0])])
|
|
49
|
+
.toTree()
|
|
50
|
+
.toMathString();
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
let num = new affine_1.Affine((0, randint_1.randint)(-9, 10, [0]), 0);
|
|
54
|
+
let denum = new trinom_1.Trinom((0, randint_1.randint)(-9, 10, [0]), 0, (0, randint_1.randint)(-9, 10, [0]));
|
|
55
|
+
fct = new rationalFrac_1.RationalFrac(num, denum).toTree().toMathString();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
answer = "Impaire";
|
|
59
|
+
break;
|
|
60
|
+
case "neither":
|
|
61
|
+
if ((0, probaFlip_1.probaFlip)(0.33)) {
|
|
62
|
+
fct = new affine_1.Affine((0, randint_1.randint)(-9, 10, [0]), (0, randint_1.randint)(-9, 10, [0]))
|
|
63
|
+
.toTree()
|
|
64
|
+
.toMathString();
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
if ((0, coinFlip_1.coinFlip)()) {
|
|
68
|
+
fct = new trinom_1.Trinom((0, randint_1.randint)(-9, 10, [0]), (0, randint_1.randint)(-9, 10, [0]), (0, randint_1.randint)(-9, 10))
|
|
69
|
+
.toTree()
|
|
70
|
+
.toMathString();
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
fct = new polynomial_1.Polynomial([
|
|
74
|
+
(0, randint_1.randint)(-9, 10),
|
|
75
|
+
(0, randint_1.randint)(-9, 10),
|
|
76
|
+
(0, randint_1.randint)(-9, 10, [0]),
|
|
77
|
+
(0, randint_1.randint)(-9, 10, [0]),
|
|
78
|
+
])
|
|
79
|
+
.toTree()
|
|
80
|
+
.toMathString();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
answer = "Ni paire, ni impaire";
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
const commands = [`f(x) = ${fct}`, `SetColor(f, "${(0, colors_1.randomColor)()}")`];
|
|
87
|
+
const ggb = new geogebraConstructor_1.GeogebraConstructor(commands, {
|
|
88
|
+
isGridSimple: true,
|
|
89
|
+
isAxesRatioFixed: false,
|
|
90
|
+
});
|
|
91
|
+
const question = {
|
|
92
|
+
answer,
|
|
93
|
+
instruction: `La fonction $f$ représentée ci-dessous est-elle paire, impaire, ou ni paire ni impaire ?`,
|
|
94
|
+
keys: [],
|
|
95
|
+
options: ggb.getOptions(),
|
|
96
|
+
commands: ggb.commands,
|
|
97
|
+
coords: [-10, 10, -10, 10],
|
|
98
|
+
answerFormat: "tex",
|
|
99
|
+
identifiers: { type, fctCmd: fct },
|
|
100
|
+
};
|
|
101
|
+
return question;
|
|
102
|
+
};
|
|
103
|
+
const getPropositions = (n, { answer }) => {
|
|
104
|
+
const propositions = [];
|
|
105
|
+
(0, exercise_1.addValidProp)(propositions, answer, "raw");
|
|
106
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "Paire", "raw");
|
|
107
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "Impaire", "raw");
|
|
108
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "Ni paire ni impaire", "raw");
|
|
109
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "On ne peut pas savoir", "raw");
|
|
110
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
111
|
+
};
|
|
112
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
113
|
+
return ans === answer;
|
|
114
|
+
};
|
|
115
|
+
exports.parityFromGraph = {
|
|
116
|
+
id: "parityFromGraph",
|
|
117
|
+
label: "",
|
|
118
|
+
levels: ["2nde"],
|
|
119
|
+
isSingleStep: true,
|
|
120
|
+
sections: ["Fonctions"],
|
|
121
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getParityFromGraphQuestion, nb),
|
|
122
|
+
qcmTimer: 60,
|
|
123
|
+
freeTimer: 60,
|
|
124
|
+
getPropositions,
|
|
125
|
+
isAnswerValid,
|
|
126
|
+
answerType: "QCM",
|
|
127
|
+
hasGeogebra: true,
|
|
128
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rootsReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/trinoms/rootsReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAuDF,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"rootsReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/trinoms/rootsReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAuDF,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,WAAW,CAYlD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summitReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/trinoms/summitReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAsDF,eAAO,MAAM,aAAa,EAAE,YAAY,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"summitReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/trinoms/summitReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAsDF,eAAO,MAAM,aAAa,EAAE,YAAY,CAAC,WAAW,CAYnD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rightTriangleArea.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/areas/rightTriangleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AA+EF,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"rightTriangleArea.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/areas/rightTriangleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AA+EF,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAAC,WAAW,CAavD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"triangleArea.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/areas/triangleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG,EAAE,CAAC;AA4GtB,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"triangleArea.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/areas/triangleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG,EAAE,CAAC;AA4GtB,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,WAAW,CAalD,CAAC"}
|