math-exercises 2.2.29 → 2.2.30

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.
@@ -74,6 +74,8 @@ export type GetGGBAnswer<TIdentifiers> = (args: TIdentifiers) => string[];
74
74
  export type GetGGBOptions<TIdentifiers> = (args: TIdentifiers) => GeogebraOptions;
75
75
  export type GetStudentGGBOptions<TIdentifiers> = (args: TIdentifiers) => GeogebraOptions;
76
76
  export type RebuildIdentifiers<TIdentifiers> = (oldIdentifiers: any) => TIdentifiers;
77
+ export type GetQuestionFromIdentifiers<TIdentifiers> = (identifiers: TIdentifiers) => Question<TIdentifiers>;
78
+ export type QuestionHotFix<TIdentifiers> = (q: Question<TIdentifiers>) => Question<TIdentifiers>;
77
79
  export interface Exercise<TIdentifiers = {}> {
78
80
  id: string;
79
81
  isSingleStep: boolean;
@@ -105,6 +107,8 @@ export interface Exercise<TIdentifiers = {}> {
105
107
  getGGBOptions?: GetGGBOptions<TIdentifiers>;
106
108
  getStudentGGBOptions?: GetStudentGGBOptions<TIdentifiers>;
107
109
  rebuildIdentifiers?: RebuildIdentifiers<TIdentifiers>;
110
+ getQuestionFromIdentifiers?: GetQuestionFromIdentifiers<TIdentifiers>;
111
+ hotFix?: QuestionHotFix<TIdentifiers>;
108
112
  }
109
113
  export type MathLevel = "6ème" | "5ème" | "4ème" | "3ème" | "2nde" | "1reTech" | "1reESM" | "1reSpé" | "TermSpé" | "TermTech" | "MathExp" | "MathComp" | "CAP" | "2ndPro" | "1rePro" | "TermPro";
110
114
  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é" | "Python" | "Puissances" | "Python" | "Racines carrées" | "Second degré" | "Statistiques" | "Suites" | "Systèmes" | "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;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAIhD,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;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;C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,kBAAkB,GAClB,kBAAkB,GAClB,QAAQ,GACR,YAAY,GACZ,QAAQ,GACR,iBAAiB,GACjB,cAAc,GACd,cAAc,GACd,QAAQ,GACR,UAAU,GACV,uBAAuB,GACvB,oBAAoB,GACpB,eAAe,GACf,gBAAgB,GAChB,UAAU,CAAC;AAEf,MAAM,MAAM,SAAS,GACjB,mBAAmB,GACnB,sBAAsB,GACtB,QAAQ,GACR,kBAAkB,GAClB,WAAW,GACX,SAAS,GACT,cAAc,GACd,+CAA+C,GAC/C,OAAO,GACP,KAAK,GACL,wBAAwB,GACxB,SAAS,GACT,KAAK,GACL,aAAa,GACb,4BAA4B,GAC5B,oBAAoB,GACpB,WAAW,GACX,iBAAiB,GACjB,SAAS,CAAC"}
1
+ {"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAIhD,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;AAEF,MAAM,MAAM,mBAAmB,GAAG;IA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,GACN,MAAM,GACN,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,UAAU,GACV,SAAS,GACT,UAAU,GACV,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,MAAM,WAAW,GACnB,OAAO,GACP,cAAc,GACd,iBAAiB,GACjB,SAAS,GACT,8BAA8B,GAC9B,aAAa,GACb,YAAY,GACZ,SAAS,GACT,0BAA0B,GAC1B,WAAW,GACX,2BAA2B,GAC3B,eAAe,GACf,eAAe,GACf,kBAAkB,GAClB,WAAW,GACX,mBAAmB,GACnB,wBAAwB,GACxB,WAAW,GACX,uBAAuB,GACvB,uBAAuB,GACvB,aAAa,GACb,aAAa,GACb,SAAS,GACT,qBAAqB,GACrB,oBAAoB,GACpB,UAAU,GACV,mBAAmB,GACnB,YAAY,GACZ,cAAc,GACd,YAAY,GACZ,cAAc,GACd,kBAAkB,GAClB,kBAAkB,GAClB,QAAQ,GACR,YAAY,GACZ,QAAQ,GACR,iBAAiB,GACjB,cAAc,GACd,cAAc,GACd,QAAQ,GACR,UAAU,GACV,uBAAuB,GACvB,oBAAoB,GACpB,eAAe,GACf,gBAAgB,GAChB,UAAU,CAAC;AAEf,MAAM,MAAM,SAAS,GACjB,mBAAmB,GACnB,sBAAsB,GACtB,QAAQ,GACR,kBAAkB,GAClB,WAAW,GACX,SAAS,GACT,cAAc,GACd,+CAA+C,GAC/C,OAAO,GACP,KAAK,GACL,wBAAwB,GACxB,SAAS,GACT,KAAK,GACL,aAAa,GACb,4BAA4B,GAC5B,oBAAoB,GACpB,WAAW,GACX,iBAAiB,GACjB,SAAS,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"vectorNormCalculation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/vectorNormCalculation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA+CF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAavD,CAAC"}
1
+ {"version":3,"file":"vectorNormCalculation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/vectorNormCalculation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,0BAA0B,CAAC;AAWlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAoFF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAgBvD,CAAC"}
@@ -8,17 +8,56 @@ const real_1 = require("../../../../math/numbers/reals/real");
8
8
  const sqrtNode_1 = require("../../../../tree/nodes/functions/sqrtNode");
9
9
  const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
10
10
  const addNode_1 = require("../../../../tree/nodes/operators/addNode");
11
+ const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
12
+ const alignTex_1 = require("../../../../utils/latex/alignTex");
13
+ const getAnswer = (identifiers) => {
14
+ const u = new vector_1.Vector("u", identifiers.x.toTree(), identifiers.y.toTree());
15
+ const correctAnswer = u.getNorm();
16
+ return correctAnswer.simplify().toTex();
17
+ };
18
+ const getHint = (identifiers) => {
19
+ return `La norme d'un vecteur est la racine carrée de la somme des carrés de ses coordonnées. En d'autres termes, la norme du vecteur $$\\overrightarrow{u}\\begin{pmatrix}x\\\\y\\end{pmatrix}$$ est :
20
+
21
+ $$
22
+ \\lVert \\overrightarrow u \\rVert = \\sqrt{x^2+y^2}
23
+ $$
24
+ `;
25
+ };
26
+ const getCorrection = (identifiers) => {
27
+ const x = identifiers.x.toTree();
28
+ const y = identifiers.y.toTree();
29
+ const answer = getAnswer(identifiers);
30
+ return `La norme d'un vecteur est la racine carrée de la somme des carrés de ses coordonnées. Ici, on a donc :
31
+
32
+ ${(0, alignTex_1.alignTex)([
33
+ [
34
+ "\\lVert \\overrightarrow u \\rVert",
35
+ "=",
36
+ new sqrtNode_1.SqrtNode(new addNode_1.AddNode(new powerNode_1.SquareNode(x), new powerNode_1.SquareNode(y))).toTex(),
37
+ ],
38
+ [
39
+ "",
40
+ "=",
41
+ new sqrtNode_1.SqrtNode((x.evaluate({}) ** 2 + y.evaluate({}) ** 2).toTree()).toTex(),
42
+ ],
43
+ ])}
44
+
45
+ Donc $\\lVert \\overrightarrow u \\rVert = ${answer}$.
46
+ `;
47
+ };
11
48
  const getVectorNormCalculationQuestion = () => {
12
49
  const u = vector_1.VectorConstructor.random("u", false);
13
- const x = u.x.simplify().value;
14
- const y = u.y.simplify().value;
15
- const correctAnswer = u.getNorm();
50
+ const x = u.x.evaluate({});
51
+ const y = u.y.evaluate({});
52
+ const identifiers = { x, y };
16
53
  const question = {
17
- answer: correctAnswer.simplify().toTex(),
54
+ answer: getAnswer(identifiers),
18
55
  instruction: `Cacluler la norme du vecteur $${u.toTexWithCoords()}$`,
19
56
  keys: [],
20
57
  answerFormat: "tex",
21
- identifiers: { x, y },
58
+ identifiers,
59
+ hint: getHint(identifiers),
60
+ correction: getCorrection(identifiers),
22
61
  };
23
62
  return question;
24
63
  };
@@ -59,4 +98,7 @@ exports.vectorNormCalculation = {
59
98
  getPropositions,
60
99
  isAnswerValid,
61
100
  subject: "Mathématiques",
101
+ hasHintAndCorrection: true,
102
+ getHint,
103
+ getCorrection,
62
104
  };
@@ -1 +1 @@
1
- {"version":3,"file":"evolutionRateFromValues.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/evolutionRateFromValues.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAsEF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAczD,CAAC"}
1
+ {"version":3,"file":"evolutionRateFromValues.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/evolutionRateFromValues.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAiGF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAiBzD,CAAC"}
@@ -9,6 +9,7 @@ const round_1 = require("../../../math/utils/round");
9
9
  const percentParser_1 = require("../../../tree/parsers/percentParser");
10
10
  const coinFlip_1 = require("../../../utils/alea/coinFlip");
11
11
  const doWhile_1 = require("../../../utils/doWhile");
12
+ const alignTex_1 = require("../../../utils/latex/alignTex");
12
13
  const getPropositions = (n, { answer, vd, vf }) => {
13
14
  const propositions = [];
14
15
  (0, exercise_1.addValidProp)(propositions, answer);
@@ -29,8 +30,35 @@ const getAnswer = (identifiers) => {
29
30
  const getInstruction = (identifiers) => {
30
31
  return `Un prix passe de $${identifiers.vd.frenchify()}€$ à $${identifiers.vf.frenchify()}€$. Quel est le taux d'évolution du prix, en pourcentage ? Arrondir au centième de pourcentage.`;
31
32
  };
32
- // const getHint: GetHint<Identifiers> = (identifiers) => {};
33
- // const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
33
+ const getHint = (identifiers) => {
34
+ return `Si une valeur passe d'une valeur de départ $V_d$ à une valeur d'arrivée $V_a$, alors le taux d'évolution $t$ en pourcentage est donné par la formule :
35
+
36
+ $$
37
+ t = \\frac{V_a-V_d}{V_d}\\times 100
38
+ $$`;
39
+ };
40
+ const getCorrection = (identifiers) => {
41
+ const answer = getAnswer(identifiers);
42
+ return `Si une valeur passe d'une valeur de départ $V_d$ à une valeur d'arrivée $V_a$, alors le taux d'évolution $t$ en pourcentage est donné par la formule :
43
+
44
+ $$
45
+ t = \\frac{V_a-V_d}{V_d}\\times 100
46
+ $$
47
+
48
+ Ici, on a $V_d = ${identifiers.vd.frenchify()}$ et $V_a = ${identifiers.vf.frenchify()}$.
49
+
50
+ Donc, le taux d'évolution est :
51
+
52
+ ${(0, alignTex_1.alignTex)([
53
+ [
54
+ "t",
55
+ "=",
56
+ `\\frac{${identifiers.vf.frenchify()}-${identifiers.vd.frenchify()}}{${identifiers.vd.frenchify()}}\\times 100`,
57
+ ],
58
+ ["", "\\approx", answer],
59
+ ])}
60
+ `;
61
+ };
34
62
  const getKeys = (identifiers) => {
35
63
  return ["percent"];
36
64
  };
@@ -50,8 +78,8 @@ const getEvolutionRateFromValuesQuestion = () => {
50
78
  keys: getKeys(identifiers),
51
79
  answerFormat: "tex",
52
80
  identifiers,
53
- // hint: getHint(identifiers),
54
- // correction: getCorrection(identifiers),
81
+ hint: getHint(identifiers),
82
+ correction: getCorrection(identifiers),
55
83
  };
56
84
  return question;
57
85
  };
@@ -68,4 +96,7 @@ exports.evolutionRateFromValues = {
68
96
  isAnswerValid,
69
97
  subject: "Mathématiques",
70
98
  getAnswer,
99
+ hasHintAndCorrection: true,
100
+ getCorrection,
101
+ getHint,
71
102
  };
@@ -1 +1 @@
1
- {"version":3,"file":"findStartValueAfterEvolution.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/findStartValueAfterEvolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AA6DF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAe9D,CAAC"}
1
+ {"version":3,"file":"findStartValueAfterEvolution.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/findStartValueAfterEvolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AA6FF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAkB9D,CAAC"}
@@ -6,6 +6,7 @@ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQues
6
6
  const randfloat_1 = require("../../../math/utils/random/randfloat");
7
7
  const round_1 = require("../../../math/utils/round");
8
8
  const euroParser_1 = require("../../../tree/parsers/euroParser");
9
+ const alignTex_1 = require("../../../utils/latex/alignTex");
9
10
  const getPropositions = (n, { answer, percentRate, vf }) => {
10
11
  const propositions = [];
11
12
  (0, exercise_1.addValidProp)(propositions, answer);
@@ -25,8 +26,37 @@ const getInstruction = (identifiers) => {
25
26
  const evolution = identifiers.percentRate < 0 ? "baisse" : "hausse";
26
27
  return `Après une ${evolution} de $${identifiers.percentRate.frenchify()}\\%$, le prix d'un objet est de $${identifiers.vf.frenchify()}€$. Quel était son prix initial ? Arrondir au centième.`;
27
28
  };
28
- // const getHint: GetHint<Identifiers> = (identifiers) => {};
29
- // const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
29
+ const getHint = (identifiers) => {
30
+ return `Transforme le taux d'évolution en coefficient multiplicateur. Puis, divise le prix final par ce coefficient multiplicateur.`;
31
+ };
32
+ const getCorrection = (identifiers) => {
33
+ const evolution = identifiers.percentRate < 0 ? "baisse" : "hausse";
34
+ const answer = getAnswer(identifiers);
35
+ const cm = (0, round_1.round)(1 + identifiers.percentRate / 100, 4);
36
+ return `Le coefficient multiplicateur associé à une ${evolution} de $${identifiers.percentRate.frenchify()}\\%$ est :
37
+
38
+
39
+ ${(0, alignTex_1.alignTex)([
40
+ ["CM", "=", "1+\\frac{t}{100}"],
41
+ ["", "=", `1+\\frac{${identifiers.percentRate.frenchify()}}{100}`],
42
+ ["", "=", cm.frenchify()],
43
+ ])}
44
+
45
+
46
+ Si on note $V_d$ la valeur de départ et $V_a$ la valeur d'arrivée, alors on sait que :
47
+
48
+ $$
49
+ V_d\\times CM = V_a
50
+ $$
51
+
52
+ Donc, pour trouver $V_d$, il faut diviser $V_a$ par le coefficient multiplicateur :
53
+
54
+ ${(0, alignTex_1.alignTex)([
55
+ ["V_d", "=", `\\frac{${identifiers.vf.frenchify()}}{${cm.frenchify()}}`],
56
+ ["", "\\approx", answer],
57
+ ])}
58
+ `;
59
+ };
30
60
  const getKeys = (identifiers) => {
31
61
  return ["euro"];
32
62
  };
@@ -46,6 +76,8 @@ const getFindStartValueAfterEvolutionQuestion = () => {
46
76
  keys: getKeys(identifiers),
47
77
  answerFormat: "tex",
48
78
  identifiers,
79
+ hint: getHint(identifiers),
80
+ correction: getCorrection(identifiers),
49
81
  };
50
82
  return question;
51
83
  };
@@ -62,4 +94,7 @@ exports.findStartValueAfterEvolution = {
62
94
  isAnswerValid,
63
95
  subject: "Mathématiques",
64
96
  getAnswer,
97
+ getCorrection,
98
+ getHint,
99
+ hasHintAndCorrection: true,
65
100
  };
@@ -1 +1 @@
1
- {"version":3,"file":"populationEffectifFromSubPopulation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/populationEffectifFromSubPopulation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAyGF,eAAO,MAAM,mCAAmC,EAAE,QAAQ,CAAC,WAAW,CAcrE,CAAC"}
1
+ {"version":3,"file":"populationEffectifFromSubPopulation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/populationEffectifFromSubPopulation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AA6IF,eAAO,MAAM,mCAAmC,EAAE,QAAQ,CAAC,WAAW,CAgBrE,CAAC"}
@@ -40,6 +40,28 @@ const getKeys = (identifiers) => {
40
40
  const isAnswerValid = (ans, { answer }) => {
41
41
  return (0, numberParser_1.numberParser)(ans) === answer;
42
42
  };
43
+ const getHint = (identifiers) => {
44
+ const itemType = identifiers.contextType === 2 ? "habitants" : "élèves";
45
+ return `Utilise un produit en croix : si $${identifiers.subPopulationPercent.frenchify()}\\%$ représente $${identifiers.subPopulationEffectif}$ ${itemType}, alors que représente $100\\%$ ?`;
46
+ };
47
+ const getCorrection = (identifiers) => {
48
+ const itemType = identifiers.contextType === 2 ? "habitants" : "élèves";
49
+ const answer = getAnswer(identifiers);
50
+ return `On sait que $${identifiers.subPopulationPercent.frenchify()}\\%$ représente $${identifiers.subPopulationEffectif}$ ${itemType}, et on cherche ce que réprésente $100\\%$ des ${itemType}.
51
+
52
+ Pour cela, on peut faire un produit en croix :
53
+
54
+ |$?$|$100\\%$|
55
+ |-|-|
56
+ |$${identifiers.subPopulationEffectif}$|$${identifiers.subPopulationPercent.frenchify()}\\%$|
57
+
58
+ Pour trouver la valeur manquante, il faut donc faire le calcul suivant :
59
+
60
+ $$
61
+ \\frac{${identifiers.subPopulationEffectif} \\times 100}{${identifiers.subPopulationPercent.frenchify()}} \\approx ${answer}
62
+ $$
63
+ `;
64
+ };
43
65
  const getPopulationEffectifFromSubPopulationQuestion = () => {
44
66
  const contextType = (0, randint_1.randint)(0, 3);
45
67
  let subPopulationEffectif, subPopulationPercent;
@@ -75,6 +97,11 @@ const getPopulationEffectifFromSubPopulationQuestion = () => {
75
97
  keys: getKeys(identifiers),
76
98
  answerFormat: "tex",
77
99
  identifiers,
100
+ hint: getHint(identifiers),
101
+ correction: getCorrection(identifiers),
102
+ style: {
103
+ tableHasNoHeader: true,
104
+ },
78
105
  };
79
106
  return question;
80
107
  };
@@ -90,4 +117,6 @@ exports.populationEffectifFromSubPopulation = {
90
117
  getPropositions,
91
118
  isAnswerValid,
92
119
  subject: "Mathématiques",
120
+ getHint,
121
+ getCorrection,
93
122
  };
@@ -1 +1 @@
1
- {"version":3,"file":"subPopulationEffectifFromPercent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/subPopulationEffectifFromPercent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AA+EF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CAclE,CAAC"}
1
+ {"version":3,"file":"subPopulationEffectifFromPercent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/subPopulationEffectifFromPercent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAqGF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CAiBlE,CAAC"}
@@ -31,6 +31,21 @@ const getInstruction = (identifiers) => {
31
31
  return `Dans une ville de $${identifiers.total}$ habitants, $${identifiers.populationPercent.frenchify()}\\%$ des habitants sont à la retraite. Quel est le nombre de retraités dans cette ville ? ${arrondi}`;
32
32
  }
33
33
  };
34
+ const getHint = (identifiers) => {
35
+ return `Pour calculer $t\\%$ d'un nombre, on le multiplie par $\\frac{t}{100}$.`;
36
+ };
37
+ const getCorrection = (identifiers) => {
38
+ const answer = getAnswer(identifiers);
39
+ return `Pour calculer $t\\%$ d'un nombre, on le multiplie par $\\frac{t}{100}$.
40
+
41
+ Ici, on calcule $${identifiers.populationPercent.frenchify()}\\%$ de $${identifiers.total}$ :
42
+
43
+ $$
44
+ ${identifiers.total}\\times \\frac{${identifiers.populationPercent.frenchify()}}{100} \\approx ${answer}
45
+ $$
46
+
47
+ `;
48
+ };
34
49
  const getKeys = (identifiers) => {
35
50
  return [];
36
51
  };
@@ -66,6 +81,8 @@ const getSubPopulationEffectifFromPercentQuestion = () => {
66
81
  keys: getKeys(identifiers),
67
82
  answerFormat: "tex",
68
83
  identifiers,
84
+ hint: getHint(identifiers),
85
+ correction: getCorrection(identifiers),
69
86
  };
70
87
  return question;
71
88
  };
@@ -82,4 +99,7 @@ exports.subPopulationEffectifFromPercent = {
82
99
  isAnswerValid,
83
100
  subject: "Mathématiques",
84
101
  getAnswer,
102
+ getCorrection,
103
+ getHint,
104
+ hasHintAndCorrection: true,
85
105
  };
@@ -1 +1 @@
1
- {"version":3,"file":"setBelonging.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sets/setBelonging.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AA8EF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAc9C,CAAC"}
1
+ {"version":3,"file":"setBelonging.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sets/setBelonging.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AA6FF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAgB9C,CAAC"}
@@ -8,6 +8,19 @@ const rational_1 = require("../../../math/numbers/rationals/rational");
8
8
  const randint_1 = require("../../../math/utils/random/randint");
9
9
  const random_1 = require("../../../utils/alea/random");
10
10
  const shuffle_1 = require("../../../utils/alea/shuffle");
11
+ const hotFix = (q) => {
12
+ if (q.identifiers.type === 3) {
13
+ return {
14
+ ...q,
15
+ ...getQuestionFromIdentifiers(getIdentifiers(q.identifiers)),
16
+ };
17
+ }
18
+ else
19
+ return q;
20
+ };
21
+ const getInstruction = (identifiers) => {
22
+ return `Donner le plus petit ensemble auquel le nombre $${identifiers.nb}$ appartient.`;
23
+ };
11
24
  const getAnswer = (identifiers) => {
12
25
  const sets = ["N", "Z", "D", "Q", "R"];
13
26
  if (identifiers.type > -1) {
@@ -15,51 +28,54 @@ const getAnswer = (identifiers) => {
15
28
  }
16
29
  return "";
17
30
  };
18
- const getSetBelongingQuestion = () => {
31
+ const getIdentifiers = (prevIdentifiers) => {
19
32
  //N Z D Q R (racine2, pi)
20
33
  //fraction simplifiable en décimal/entier
21
34
  //racine carrée simplifiable en entier / Fraction
22
35
  //
23
- const type = (0, randint_1.randint)(0, 5);
24
- let answer = "";
36
+ const type = prevIdentifiers?.type ?? (0, randint_1.randint)(0, 5);
25
37
  let nb = "";
26
38
  switch (type) {
27
39
  case 0:
28
40
  nb = (0, randint_1.randint)(0, 1000) + "";
29
- answer = "\\mathbb{N}";
30
41
  break;
31
42
  case 1:
32
43
  nb = -(0, randint_1.randint)(0, 1000) + "";
33
- answer = "\\mathbb{Z}";
34
44
  break;
35
45
  case 2:
36
46
  nb = decimal_1.DecimalConstructor.random(-50, 50, (0, randint_1.randint)(1, 4)).toTree().toTex();
37
- answer = "\\mathbb{D}";
38
47
  break;
39
48
  case 3:
40
- nb = rational_1.RationalConstructor.randomIrreductible().toTree().toTex();
41
- answer = "\\mathbb{Q}";
49
+ nb = rational_1.RationalConstructor.randomPureRational().toTree().toTex();
42
50
  break;
43
51
  case 4:
44
52
  nb = (0, random_1.random)(["\\sqrt 2", "\\pi"]);
45
- answer = "\\mathbb{R}";
46
53
  break;
47
54
  }
48
- const question = {
49
- answer,
50
- instruction: `Donner le plus petit ensemble auquel le nombre $${nb}$ appartient.`,
51
- keys: [
52
- "varnothing",
53
- "naturals",
54
- "integers",
55
- "decimals",
56
- "rationals",
57
- "reals",
58
- ],
55
+ return { type, nb };
56
+ };
57
+ const getKeys = (identifiers) => {
58
+ return [
59
+ "varnothing",
60
+ "naturals",
61
+ "integers",
62
+ "decimals",
63
+ "rationals",
64
+ "reals",
65
+ ];
66
+ };
67
+ const getQuestionFromIdentifiers = (identifiers) => {
68
+ return {
69
+ answer: getAnswer(identifiers),
70
+ instruction: getInstruction(identifiers),
71
+ keys: getKeys(identifiers),
59
72
  answerFormat: "tex",
60
- identifiers: { nb, type },
73
+ identifiers,
61
74
  };
62
- return question;
75
+ };
76
+ const getSetBelongingQuestion = () => {
77
+ const identifiers = getIdentifiers();
78
+ return getQuestionFromIdentifiers(identifiers);
63
79
  };
64
80
  const getPropositions = (n, { answer }) => {
65
81
  const propositions = [];
@@ -90,4 +106,6 @@ exports.setBelonging = {
90
106
  isAnswerValid,
91
107
  subject: "Mathématiques",
92
108
  getAnswer,
109
+ getQuestionFromIdentifiers,
110
+ hotFix,
93
111
  };
@@ -1 +1 @@
1
- {"version":3,"file":"degreeToRadians.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/degreeToRadians.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAclC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,GAAG,CAAC;IACnB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAgIF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAgBjD,CAAC"}
1
+ {"version":3,"file":"degreeToRadians.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/degreeToRadians.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AAclC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,GAAG,CAAC;IACnB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAkJF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAiBjD,CAAC"}
@@ -50,10 +50,28 @@ ${nodeConstructor_1.NodeConstructor.fromIdentifiers(radianNodeIds).toTex()}
50
50
  $$
51
51
  `;
52
52
  };
53
- // const getHint : GetHint<Identifiers> = (identifiers)=>{
54
- // }
55
- // const getCorrection : GetCorrection<Identifiers> = (identifiers)=>{
56
- // }
53
+ const getHint = (identifiers) => {
54
+ return `On sait que $\\pi \\ \\text{rad}$ correspond à $180^\\circ$. Il suffit alors de faire un produit en croix.`;
55
+ };
56
+ const getCorrection = (identifiers) => {
57
+ const answer = getAnswer(identifiers);
58
+ const radNode = nodeConstructor_1.NodeConstructor.fromIdentifiers(identifiers.radianNodeIds);
59
+ return `On sait que $\\pi \\ \\text{rad}$ correspond à $180^\\circ$.
60
+
61
+ ${identifiers.isDegreeToRadian
62
+ ? `Pour convertir $${identifiers.degree}^\\circ$ en radians, on fait donc un produit en croix :
63
+
64
+ $$
65
+ \\frac{${identifiers.degree}\\times \\pi}{180} = ${answer}
66
+ $$
67
+ `
68
+ : `Pour convertir $${radNode.toTex()}\\ \\text{rad}$ en degrés, on fait donc un produit en croix :
69
+
70
+ $$
71
+ ${radNode.toTex()}\\times \\frac{180}{\\pi} = ${answer}
72
+ $$
73
+ `}`;
74
+ };
57
75
  const getKeys = (identifiers) => {
58
76
  return ["pi", "degree"];
59
77
  };
@@ -102,8 +120,8 @@ const getDegreeToRadiansQuestion = () => {
102
120
  keys: getKeys(identifiers),
103
121
  answerFormat: "tex",
104
122
  identifiers,
105
- // hint: getHint(identifiers),
106
- // correction: getCorrection(identifiers)
123
+ hint: getHint(identifiers),
124
+ correction: getCorrection(identifiers),
107
125
  };
108
126
  return question;
109
127
  };
@@ -119,7 +137,8 @@ exports.degreeToRadians = {
119
137
  getPropositions,
120
138
  isAnswerValid,
121
139
  subject: "Mathématiques",
122
- // getHint,
123
- // getCorrection,
140
+ getHint,
141
+ getCorrection,
124
142
  getAnswer,
143
+ hasHintAndCorrection: true,
125
144
  };
@@ -10,6 +10,7 @@ export declare abstract class RationalConstructor {
10
10
  static randomSimplifiable(maxGcd?: number): Rational;
11
11
  static randomIrreductible(max?: number): Rational;
12
12
  static randomIrreductibleWithSign(max?: number): Rational;
13
+ static randomPureRational(): Rational;
13
14
  }
14
15
  export declare class Rational implements Nombre {
15
16
  num: number;
@@ -1 +1 @@
1
- {"version":3,"file":"rational.d.ts","sourceRoot":"","sources":["../../../../src/math/numbers/rationals/rational.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AACvE,OAAO,EAAQ,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAIvE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE/C,8BAAsB,mBAAmB;IACvC;;OAEG;IACH,MAAM,CAAC,kBAAkB,CAAC,MAAM,GAAE,MAAW;IAW7C,MAAM,CAAC,kBAAkB,CAAC,GAAG,GAAE,MAAW;IAO1C,MAAM,CAAC,0BAA0B,CAAC,GAAG,GAAE,MAAW;CAQnD;AAED,qBAAa,QAAS,YAAW,MAAM;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,OAAO,CAAC;IACtB,IAAI,EAAE,UAAU,CAAC;gBAEL,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;IAYlD,MAAM,CAAC,CAAC,EAAE,MAAM;IAGhB,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K;IAML,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAkBvB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO;IAgBxC,OAAO,CAAC,cAAc,EAAE,OAAO,GAAG,MAAM;IAIxC,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAgB1B,QAAQ,IAAI,QAAQ;IAIpB,MAAM,CAAC,IAAI,CAAC,EAAE,WAAW;IAgBzB,cAAc;IAId,QAAQ,IAAI,OAAO,GAAG,QAAQ;CAS/B"}
@@ -5,12 +5,14 @@ const coprimesOf_1 = require("../../../math/utils/arithmetic/coprimesOf");
5
5
  const gcd_1 = require("../../../math/utils/arithmetic/gcd");
6
6
  const lcd_1 = require("../../../math/utils/arithmetic/lcd");
7
7
  const randint_1 = require("../../../math/utils/random/randint");
8
+ const round_1 = require("../../../math/utils/round");
8
9
  const oppositeNode_1 = require("../../../tree/nodes/functions/oppositeNode");
9
10
  const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
10
11
  const fractionNode_1 = require("../../../tree/nodes/operators/fractionNode");
11
12
  const coinFlip_1 = require("../../../utils/alea/coinFlip");
12
13
  const random_1 = require("../../../utils/alea/random");
13
14
  const shuffle_1 = require("../../../utils/alea/shuffle");
15
+ const doWhile_1 = require("../../../utils/doWhile");
14
16
  const integer_1 = require("../integer/integer");
15
17
  const nombre_1 = require("../nombre");
16
18
  class RationalConstructor {
@@ -45,6 +47,10 @@ class RationalConstructor {
45
47
  const [num, denum] = (0, shuffle_1.shuffle)([a, b]);
46
48
  return new Rational(sign * num, denum);
47
49
  }
50
+ static randomPureRational() {
51
+ const frac = (0, doWhile_1.doWhile)(() => RationalConstructor.randomIrreductible(20), (x) => (0, round_1.round)(x.value, 10) === x.value);
52
+ return frac;
53
+ }
48
54
  }
49
55
  exports.RationalConstructor = RationalConstructor;
50
56
  class Rational {
@@ -1 +1 @@
1
- {"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../src/playground.ts"],"names":[],"mappings":"AA4BA,eAAO,MAAM,UAAU,YAEtB,CAAC"}
1
+ {"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../src/playground.ts"],"names":[],"mappings":"AA8BA,eAAO,MAAM,UAAU,YAAW,CAAC"}
package/lib/playground.js CHANGED
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.playground = void 0;
4
- const playground = () => {
5
- // console.log(mainTrigoValues.map((e) => e.angle.toTex()));
6
- };
4
+ const playground = () => { };
7
5
  exports.playground = playground;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "math-exercises",
3
- "version": "2.2.29",
3
+ "version": "2.2.30",
4
4
  "description": "Math exercises generator for middle school and high school",
5
5
  "main": "lib/index.js",
6
6
  "files": [