math-exercises 2.2.10 → 2.2.12

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.
Files changed (79) hide show
  1. package/lib/exercises/exercise.d.ts.map +1 -1
  2. package/lib/exercises/math/calcul/decimals/index.d.ts +3 -0
  3. package/lib/exercises/math/calcul/decimals/index.d.ts.map +1 -0
  4. package/lib/exercises/math/calcul/decimals/index.js +18 -0
  5. package/lib/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.d.ts +8 -0
  6. package/lib/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.d.ts.map +1 -0
  7. package/lib/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.js +53 -0
  8. package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.d.ts +9 -0
  9. package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.d.ts.map +1 -0
  10. package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.js +63 -0
  11. package/lib/exercises/math/calcul/index.d.ts +2 -0
  12. package/lib/exercises/math/calcul/index.d.ts.map +1 -1
  13. package/lib/exercises/math/calcul/index.js +2 -0
  14. package/lib/exercises/math/calcul/operations/index.d.ts +2 -0
  15. package/lib/exercises/math/calcul/operations/index.d.ts.map +1 -1
  16. package/lib/exercises/math/calcul/operations/index.js +2 -0
  17. package/lib/exercises/math/calcul/operations/operationsPriorities.d.ts +1 -1
  18. package/lib/exercises/math/calcul/operations/operationsPriorities.d.ts.map +1 -1
  19. package/lib/exercises/math/calcul/operations/operationsPriorities.js +20 -5
  20. package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesis.d.ts +8 -0
  21. package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesis.d.ts.map +1 -0
  22. package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesis.js +111 -0
  23. package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesisNoRelatives.d.ts +8 -0
  24. package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesisNoRelatives.d.ts.map +1 -0
  25. package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesisNoRelatives.js +127 -0
  26. package/lib/exercises/math/calcul/operations/operationsPrioritiesWithoutRelative.d.ts.map +1 -1
  27. package/lib/exercises/math/calcul/operations/operationsPrioritiesWithoutRelative.js +18 -1
  28. package/lib/exercises/math/calcul/ordering/decimalOrdering.d.ts +9 -0
  29. package/lib/exercises/math/calcul/ordering/decimalOrdering.d.ts.map +1 -0
  30. package/lib/exercises/math/calcul/ordering/decimalOrdering.js +77 -0
  31. package/lib/exercises/math/calcul/ordering/framing.d.ts +1 -0
  32. package/lib/exercises/math/calcul/ordering/framing.d.ts.map +1 -0
  33. package/lib/exercises/math/calcul/ordering/framing.js +193 -0
  34. package/lib/exercises/math/calcul/ordering/index.d.ts +3 -0
  35. package/lib/exercises/math/calcul/ordering/index.d.ts.map +1 -0
  36. package/lib/exercises/math/calcul/ordering/index.js +19 -0
  37. package/lib/exercises/math/calcul/ordering/integerOrdering.d.ts +8 -0
  38. package/lib/exercises/math/calcul/ordering/integerOrdering.d.ts.map +1 -0
  39. package/lib/exercises/math/calcul/ordering/integerOrdering.js +61 -0
  40. package/lib/exercises/math/derivation/derivative/powerFunctionDerivative.js +1 -1
  41. package/lib/exercises/math/functions/affines/leadingCoeffAndOriginOrdinate.js +1 -1
  42. package/lib/exercises/math/functions/basics/graphicInequation.js +6 -6
  43. package/lib/exercises/math/functions/basics/twoFunctionsInequation.js +6 -6
  44. package/lib/exercises/math/percent/htToTTC.d.ts +8 -0
  45. package/lib/exercises/math/percent/htToTTC.d.ts.map +1 -0
  46. package/lib/exercises/math/percent/htToTTC.js +50 -0
  47. package/lib/exercises/math/percent/index.d.ts +2 -0
  48. package/lib/exercises/math/percent/index.d.ts.map +1 -1
  49. package/lib/exercises/math/percent/index.js +2 -0
  50. package/lib/exercises/math/percent/ttcToHT.d.ts +8 -0
  51. package/lib/exercises/math/percent/ttcToHT.d.ts.map +1 -0
  52. package/lib/exercises/math/percent/ttcToHT.js +50 -0
  53. package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.d.ts.map +1 -1
  54. package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.js +2 -11
  55. package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.js +1 -1
  56. package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.js +1 -1
  57. package/lib/exercises/pc/motion/typeOfAcceleration.js +1 -1
  58. package/lib/exercises/pc/motion/typeOfMovement.js +1 -1
  59. package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.js +1 -1
  60. package/lib/index.d.ts +27 -1
  61. package/lib/index.d.ts.map +1 -1
  62. package/lib/math/numbers/decimals/decimal.d.ts +2 -0
  63. package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
  64. package/lib/math/numbers/decimals/decimal.js +18 -0
  65. package/lib/math/sets/intervals/intervals.d.ts.map +1 -1
  66. package/lib/math/sets/intervals/intervals.js +2 -2
  67. package/lib/playground.d.ts.map +1 -1
  68. package/lib/playground.js +0 -5
  69. package/lib/tree/nodes/inequations/inequationSolutionNode.js +1 -1
  70. package/lib/tree/nodes/node.d.ts +2 -0
  71. package/lib/tree/nodes/node.d.ts.map +1 -1
  72. package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
  73. package/lib/tree/nodes/operators/addNode.js +9 -6
  74. package/lib/tree/nodes/sets/intervalNode.js +1 -1
  75. package/lib/tree/nodes/sets/unionIntervalNode.js +1 -1
  76. package/lib/types/keyProps.d.ts +13 -0
  77. package/lib/types/keyProps.d.ts.map +1 -0
  78. package/lib/types/keyProps.js +2 -0
  79. package/package.json +1 -1
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.decimalOrdering = void 0;
4
+ const exercise_1 = require("../../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const randfloat_1 = require("../../../../math/utils/random/randfloat");
7
+ const randint_1 = require("../../../../math/utils/random/randint");
8
+ const coinFlip_1 = require("../../../../utils/coinFlip");
9
+ const getDecimalOrderingQuestion = () => {
10
+ const type = (0, randint_1.randint)(1, 5);
11
+ let a = 0;
12
+ let b = 0;
13
+ while (b == a) {
14
+ switch (type) {
15
+ case 1:
16
+ //+-x vs +-x.y
17
+ a = (0, randint_1.randint)(-100, 100);
18
+ b = (0, randfloat_1.randfloat)(Math.floor(a), Math.floor(a) + 1, (0, randint_1.randint)(1, 3));
19
+ break;
20
+ case 2:
21
+ //+-x.y vs +-x.y
22
+ a = (0, randfloat_1.randfloat)(-100, 100, 1);
23
+ b = (0, randfloat_1.randfloat)(Math.floor(a), Math.floor(a) + 1, 1);
24
+ break;
25
+ case 3:
26
+ //+-x.yy vs +-x.yy
27
+ a = (0, randfloat_1.randfloat)(-100, 100, 2);
28
+ b = (0, randfloat_1.randfloat)(Math.floor(a), Math.floor(a) + 1, 2);
29
+ break;
30
+ case 4:
31
+ default:
32
+ //+-x.yy vs +-x ou +-x.y
33
+ a = (0, randfloat_1.randfloat)(-100, 100, 2);
34
+ b = (0, coinFlip_1.coinFlip)()
35
+ ? Math.floor(a)
36
+ : (0, randfloat_1.randfloat)(Math.floor(a), Math.floor(a) + 1, 1);
37
+ break;
38
+ }
39
+ }
40
+ const answer = a < b ? "<" : a === b ? "=" : ">";
41
+ const question = {
42
+ answer,
43
+ instruction: `Compléter par le bon symbole :
44
+
45
+ $$${a.frenchify()}\\ ...... \\ ${b.frenchify()}$$`,
46
+ keys: [],
47
+ answerFormat: "tex",
48
+ identifiers: { type, a, b },
49
+ };
50
+ return question;
51
+ };
52
+ const getPropositions = (n, { answer }) => {
53
+ const propositions = [];
54
+ (0, exercise_1.addValidProp)(propositions, answer);
55
+ (0, exercise_1.tryToAddWrongProp)(propositions, "<");
56
+ (0, exercise_1.tryToAddWrongProp)(propositions, ">");
57
+ (0, exercise_1.tryToAddWrongProp)(propositions, "=");
58
+ return (0, exercise_1.shuffleProps)(propositions, n);
59
+ };
60
+ const isAnswerValid = (ans, { answer }) => {
61
+ return ans === answer;
62
+ };
63
+ exports.decimalOrdering = {
64
+ id: "decimalOrdering",
65
+ connector: "\\iff",
66
+ label: "Comparer des nombres décimaux",
67
+ levels: [],
68
+ isSingleStep: true,
69
+ sections: [],
70
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getDecimalOrderingQuestion, nb),
71
+ qcmTimer: 60,
72
+ freeTimer: 60,
73
+ getPropositions,
74
+ isAnswerValid,
75
+ subject: "Mathématiques",
76
+ answerType: "QCU",
77
+ };
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=framing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"framing.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/ordering/framing.ts"],"names":[],"mappings":""}
@@ -0,0 +1,193 @@
1
+ "use strict";
2
+ // import {
3
+ // Exercise,
4
+ // Proposition,
5
+ // QCMGenerator,
6
+ // Question,
7
+ // QuestionGenerator,
8
+ // VEA,
9
+ // GGBVEA,
10
+ // addValidProp,
11
+ // shuffleProps,
12
+ // tryToAddWrongProp,
13
+ // } from "../../../../exercises/exercise";
14
+ // import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions";
15
+ // import {
16
+ // Decimal,
17
+ // DecimalConstructor,
18
+ // } from "../../../../math/numbers/decimals/decimal";
19
+ // import { randint } from "../../../../math/utils/random/randint";
20
+ // import { AlgebraicNode } from "../../../../tree/nodes/algebraicNode";
21
+ // import { MultiEqualNode } from "../../../../tree/nodes/equations/multiEqualNode";
22
+ // import { SqrtNode } from "../../../../tree/nodes/functions/sqrtNode";
23
+ // import { NodeConstructor } from "../../../../tree/nodes/nodeConstructor";
24
+ // import { PiNode } from "../../../../tree/nodes/numbers/piNode";
25
+ // import { AddNode } from "../../../../tree/nodes/operators/addNode";
26
+ // import { FractionNode } from "../../../../tree/nodes/operators/fractionNode";
27
+ // import { MultiplyNode } from "../../../../tree/nodes/operators/multiplyNode";
28
+ // import { PowerNode } from "../../../../tree/nodes/operators/powerNode";
29
+ // import { coinFlip } from "../../../../utils/coinFlip";
30
+ // import { random } from "../../../../utils/random";
31
+ // type Identifiers = {
32
+ // type: number;
33
+ // nbIds: any;
34
+ // nbValue: number;
35
+ // pow: number;
36
+ // };
37
+ // //fraction: 1/3, 2/3, 1/6, 5/6, x/7
38
+ // //décimal
39
+ // const getFramingQuestion: QuestionGenerator<Identifiers> = () => {
40
+ // const type = randint(1, 5);
41
+ // let nb: AlgebraicNode;
42
+ // const pow = -randint(1, 4);
43
+ // let a: AlgebraicNode;
44
+ // let b: AlgebraicNode;
45
+ // let ev: number;
46
+ // let dec: Decimal;
47
+ // switch (type) {
48
+ // case 1:
49
+ // //CL(pi)
50
+ // nb = new AddNode(
51
+ // new MultiplyNode(
52
+ // random([randint(-3, 0), randint(1, 4), 10, -10]).toTree(),
53
+ // PiNode,
54
+ // ),
55
+ // randint(-10, 10).toTree(),
56
+ // );
57
+ // ev = nb.evaluate({});
58
+ // dec = new Decimal(ev);
59
+ // a = dec.toLowerBound(pow).toTree();
60
+ // b = dec.toUpperBound(pow).toTree();
61
+ // break;
62
+ // case 2:
63
+ // //CL(sqrt(2))
64
+ // nb = new AddNode(
65
+ // new MultiplyNode(
66
+ // random([randint(-3, 0), randint(1, 4), 10, -10]).toTree(),
67
+ // new SqrtNode((2).toTree()),
68
+ // ),
69
+ // randint(-10, 10).toTree(),
70
+ // );
71
+ // ev = nb.evaluate({});
72
+ // dec = new Decimal(ev);
73
+ // a = dec.toLowerBound(pow).toTree();
74
+ // b = dec.toUpperBound(pow).toTree();
75
+ // break;
76
+ // case 3:
77
+ // //fraction
78
+ // nb = new AddNode(
79
+ // new MultiplyNode(
80
+ // random([randint(-2, 0), randint(1, 3), 10, -10]).toTree(),
81
+ // random([
82
+ // new FractionNode((1).toTree(), (3).toTree()),
83
+ // new FractionNode((2).toTree(), (3).toTree()),
84
+ // ]),
85
+ // { forceTimesSign: true },
86
+ // ),
87
+ // randint(-10, 10).toTree(),
88
+ // );
89
+ // ev = nb.evaluate({});
90
+ // dec = new Decimal(ev);
91
+ // a = dec.toLowerBound(pow).toTree();
92
+ // b = dec.toUpperBound(pow).toTree();
93
+ // break;
94
+ // case 4:
95
+ // default:
96
+ // dec = DecimalConstructor.random(-200, 200, randint(-pow, -pow + 3));
97
+ // nb = dec.toTree();
98
+ // a = dec.toLowerBound(pow).toTree();
99
+ // b = dec.toUpperBound(pow).toTree();
100
+ // break;
101
+ // }
102
+ // const answer = `${a.toTex()}<${nb.toTex()}<${b.toTex()}`;
103
+ // const question: Question<Identifiers> = {
104
+ // answer,
105
+ // instruction: `Encadrer à $${new PowerNode(
106
+ // (10).toTree(),
107
+ // pow.toTree(),
108
+ // ).toTex()}$ près le nombre suivant :
109
+ // $$
110
+ // ${nb.toTex()}
111
+ // $$
112
+ // Donner une réponse sous la forme $a<${nb.toTex()}<b$.
113
+ // ${
114
+ // type === 2
115
+ // ? "On rappelle que $\\sqrt 2 \\approx 1,41421$."
116
+ // : type === 1
117
+ // ? "On rappelle que $\\pi \\approx 3, 14159$."
118
+ // : ""
119
+ // }`,
120
+ // keys: [
121
+ // "pi",
122
+ // "inf",
123
+ // "sup",
124
+ // {
125
+ // id: "custom",
126
+ // label: nb.toTex(),
127
+ // labelType: "tex",
128
+ // mathfieldInstructions: {
129
+ // method: "write",
130
+ // content: nb.toTex(),
131
+ // },
132
+ // },
133
+ // ],
134
+ // answerFormat: "tex",
135
+ // identifiers: {
136
+ // type,
137
+ // nbIds: nb.toIdentifiers(),
138
+ // nbValue: nb.evaluate({}),
139
+ // pow,
140
+ // },
141
+ // };
142
+ // return question;
143
+ // };
144
+ // const getPropositions: QCMGenerator<Identifiers> = (
145
+ // n,
146
+ // { answer, nbIds, nbValue, pow },
147
+ // ) => {
148
+ // const propositions: Proposition[] = [];
149
+ // addValidProp(propositions, answer);
150
+ // const dec = new Decimal(nbValue);
151
+ // const node = NodeConstructor.fromIdentifiers(nbIds);
152
+ // console.log(nbValue, pow);
153
+ // while (propositions.length < n) {
154
+ // const fakePower = -randint(1, 4, [pow]);
155
+ // const fakeDec = new Decimal(dec.value * randint(-3, 3, [0, 1]));
156
+ // coinFlip()
157
+ // ? tryToAddWrongProp(
158
+ // propositions,
159
+ // `${dec.toLowerBound(fakePower).toTree().toTex()}<${node.toTex()}<${dec
160
+ // .toUpperBound(fakePower)
161
+ // .toTree()
162
+ // .toTex()}`,
163
+ // )
164
+ // : tryToAddWrongProp(
165
+ // propositions,
166
+ // `${fakeDec
167
+ // .toLowerBound(pow)
168
+ // .toTree()
169
+ // .toTex()}<${node.toTex()}<${fakeDec
170
+ // .toUpperBound(pow)
171
+ // .toTree()
172
+ // .toTex()}`,
173
+ // );
174
+ // }
175
+ // return shuffleProps(propositions, n);
176
+ // };
177
+ // const isAnswerValid: VEA<Identifiers> = (ans, { answer }) => {
178
+ // return ans === answer;
179
+ // };
180
+ // export const framing: Exercise<Identifiers> = {
181
+ // id: "framing",
182
+ // connector: "=",
183
+ // label: "Encadrer un nombre réel à $10^{-n}$",
184
+ // levels: [],
185
+ // isSingleStep: true,
186
+ // sections: [],
187
+ // generator: (nb: number) => getDistinctQuestions(getFramingQuestion, nb),
188
+ // qcmTimer: 60,
189
+ // freeTimer: 60,
190
+ // getPropositions,
191
+ // isAnswerValid,
192
+ // subject: "Mathématiques",
193
+ // };
@@ -0,0 +1,3 @@
1
+ export * from "./integerOrdering";
2
+ export * from "./decimalOrdering";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/ordering/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,19 @@
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("./integerOrdering"), exports);
18
+ __exportStar(require("./decimalOrdering"), exports);
19
+ // export * from "./framing";
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ a: number;
4
+ b: number;
5
+ };
6
+ export declare const integerOrdering: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=integerOrdering.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integerOrdering.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/ordering/integerOrdering.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA0CF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAejD,CAAC"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.integerOrdering = 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 coinFlip_1 = require("../../../../utils/coinFlip");
8
+ const probaFlip_1 = require("../../../../utils/probaFlip");
9
+ const getIntegerOrderingQuestion = () => {
10
+ let a;
11
+ let b;
12
+ if ((0, probaFlip_1.probaFlip)(0.66)) {
13
+ a = (0, randint_1.randint)(-20, 0);
14
+ b = (0, randint_1.randint)(-20, 0, [a]);
15
+ }
16
+ else {
17
+ if ((0, coinFlip_1.coinFlip)()) {
18
+ a = (0, randint_1.randint)(-20, 0);
19
+ b = (0, randint_1.randint)(0, 20, [a]);
20
+ }
21
+ else {
22
+ a = (0, randint_1.randint)(0, 20);
23
+ b = (0, randint_1.randint)(0, 20, [a]);
24
+ }
25
+ }
26
+ const answer = a < b ? "<" : ">";
27
+ const question = {
28
+ answer,
29
+ instruction: `Compléter par le bon symbole : $${a}\\ ...... \\ ${b}$`,
30
+ keys: [],
31
+ answerFormat: "tex",
32
+ identifiers: { a, b },
33
+ };
34
+ return question;
35
+ };
36
+ const getPropositions = (n, { answer }) => {
37
+ const propositions = [];
38
+ (0, exercise_1.addValidProp)(propositions, answer);
39
+ (0, exercise_1.tryToAddWrongProp)(propositions, "<");
40
+ (0, exercise_1.tryToAddWrongProp)(propositions, ">");
41
+ (0, exercise_1.tryToAddWrongProp)(propositions, "=");
42
+ return (0, exercise_1.shuffleProps)(propositions, n);
43
+ };
44
+ const isAnswerValid = (ans, { answer }) => {
45
+ return ans === answer;
46
+ };
47
+ exports.integerOrdering = {
48
+ id: "integerOrdering",
49
+ connector: "\\iff",
50
+ label: "Comparer des nombres entiers relatifs",
51
+ levels: [],
52
+ isSingleStep: true,
53
+ sections: [],
54
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getIntegerOrderingQuestion, nb),
55
+ qcmTimer: 60,
56
+ freeTimer: 60,
57
+ getPropositions,
58
+ isAnswerValid,
59
+ answerType: "QCU",
60
+ subject: "Mathématiques",
61
+ };
@@ -58,7 +58,7 @@ const isAnswerValid = (ans, { a, power }) => {
58
58
  exports.powerFunctionDerivative = {
59
59
  id: "powerFunctionDerivative",
60
60
  connector: "=",
61
- label: "Dérivée d'une fonction puissance",
61
+ label: "Dérivée d'une fonction monôme",
62
62
  levels: ["1reESM", "1reSpé", "1reTech", "MathComp"],
63
63
  sections: ["Dérivation"],
64
64
  isSingleStep: false,
@@ -38,7 +38,7 @@ const generateExercise = () => {
38
38
  const flip = (0, coinFlip_1.coinFlip)();
39
39
  const f = affine_1.AffineConstructor.random();
40
40
  const instruction = `Soit la fonction affine $f(x)=${f.toTex()}$. ${flip
41
- ? `Déterminer la valeur du coefficient directeur`
41
+ ? `Déterminer la valeur du coefficient directeur.`
42
42
  : `Déterminer la valeur de l'ordonnée à l'origine.`}`;
43
43
  return {
44
44
  instruction,
@@ -76,8 +76,8 @@ const getGraphicInequationQuestion = () => {
76
76
  const yMax = Math.max(...splinePoints.map((point) => point[1]));
77
77
  const intervalsNodes = intervals.map((i) => new intervalNode_1.IntervalNode(new numberNode_1.NumberNode(i.a), new numberNode_1.NumberNode(i.b), i.closure));
78
78
  const answer = intervalsNodes.length === 1
79
- ? `S=\\ ${intervalsNodes[0].toTex()}`
80
- : `S=\\ ${new unionIntervalNode_1.UnionIntervalNode(intervalsNodes).toTex()}`;
79
+ ? `S=${intervalsNodes[0].toTex()}`
80
+ : `S=${new unionIntervalNode_1.UnionIntervalNode(intervalsNodes).toTex()}`;
81
81
  const commands = [
82
82
  `S =Spline(${splinePoints
83
83
  .map((point) => `(${point[0]},${point[1]})`)
@@ -123,20 +123,20 @@ const getPropositions = (n, { answer, intervals, splinePoints, yValue }) => {
123
123
  (0, exercise_1.tryToAddWrongProp)(propositions, `S=\\varnothing`);
124
124
  if (intervals.length === 1) {
125
125
  const interval = new intervalNode_1.IntervalNode(intervals[0].a.toTree(), intervals[0].b.toTree(), intervals[0].closure);
126
- (0, exercise_1.tryToAddWrongProp)(propositions, `S=\\ ${interval.toRandomDifferentClosure().toTex()}`);
126
+ (0, exercise_1.tryToAddWrongProp)(propositions, `S=${interval.toRandomDifferentClosure().toTex()}`);
127
127
  }
128
128
  else if (intervals.length === 2) {
129
129
  const rightIntervals = intervals.map((i) => new intervalNode_1.IntervalNode(i.a.toTree(), i.b.toTree(), i.closure));
130
130
  const fakeIntervals = intervals.map((i) => new intervalNode_1.IntervalNode(i.a.toTree(), i.b.toTree(), i.closure));
131
- (0, exercise_1.tryToAddWrongProp)(propositions, `S=\\ ${rightIntervals[(0, coinFlip_1.coinFlip)() ? 0 : 1].toTex()}`);
132
- (0, exercise_1.tryToAddWrongProp)(propositions, `S=\\ ${new unionIntervalNode_1.UnionIntervalNode(fakeIntervals.map((i) => i.toRandomDifferentClosure())).toTex()}`);
131
+ (0, exercise_1.tryToAddWrongProp)(propositions, `S=${rightIntervals[(0, coinFlip_1.coinFlip)() ? 0 : 1].toTex()}`);
132
+ (0, exercise_1.tryToAddWrongProp)(propositions, `S=${new unionIntervalNode_1.UnionIntervalNode(fakeIntervals.map((i) => i.toRandomDifferentClosure())).toTex()}`);
133
133
  }
134
134
  while (propositions.length < n) {
135
135
  let a = (0, randint_1.randint)(splinePoints[0][0], splinePoints[splinePoints.length - 1][0] + 1);
136
136
  let b = (0, randint_1.randint)(splinePoints[0][0], splinePoints[splinePoints.length - 1][0] + 1, [a]);
137
137
  if (a > b)
138
138
  [a, b] = [b, a];
139
- (0, exercise_1.tryToAddWrongProp)(propositions, `S=\\ ${new intervalNode_1.IntervalNode(new numberNode_1.NumberNode(a), new numberNode_1.NumberNode(b), closure_1.ClosureType.FF).toTex()}`);
139
+ (0, exercise_1.tryToAddWrongProp)(propositions, `S=${new intervalNode_1.IntervalNode(new numberNode_1.NumberNode(a), new numberNode_1.NumberNode(b), closure_1.ClosureType.FF).toTex()}`);
140
140
  }
141
141
  return (0, exercise_1.shuffleProps)(propositions, n);
142
142
  };
@@ -110,8 +110,8 @@ const getTwoFunctionsInequationQuestion = () => {
110
110
  });
111
111
  const intervalsNodes = intervals.map((i) => new intervalNode_1.IntervalNode(new numberNode_1.NumberNode(i.a), new numberNode_1.NumberNode(i.b), i.closure));
112
112
  const answer = intervalsNodes.length === 1
113
- ? `S=\\ ${intervalsNodes[0].toTex()}`
114
- : `S=\\ ${new unionIntervalNode_1.UnionIntervalNode(intervalsNodes).toTex()}`;
113
+ ? `S=${intervalsNodes[0].toTex()}`
114
+ : `S=${new unionIntervalNode_1.UnionIntervalNode(intervalsNodes).toTex()}`;
115
115
  const question = {
116
116
  answer,
117
117
  instruction: `Déterminer graphiquement les solutions de l'inéquation $f(x) ${ineq.symbol} g(x)$ où $f$ et $g$ sont les fonctions représentées ci-dessous.`,
@@ -147,13 +147,13 @@ const getPropositions = (n, { answer, intervals, fSplinePoints, ineqSymbol }) =>
147
147
  (0, exercise_1.tryToAddWrongProp)(propositions, `S=\\varnothing`);
148
148
  if (intervals.length === 1) {
149
149
  const interval = new intervalNode_1.IntervalNode(intervals[0].a.toTree(), intervals[0].b.toTree(), intervals[0].closure);
150
- (0, exercise_1.tryToAddWrongProp)(propositions, `S=\\ ${interval.toRandomDifferentClosure().toTex()}`);
150
+ (0, exercise_1.tryToAddWrongProp)(propositions, `S=${interval.toRandomDifferentClosure().toTex()}`);
151
151
  }
152
152
  else {
153
153
  const rightIntervals = intervals.map((i) => new intervalNode_1.IntervalNode(i.a.toTree(), i.b.toTree(), i.closure));
154
154
  const fakeIntervals = intervals.map((i) => new intervalNode_1.IntervalNode(i.a.toTree(), i.b.toTree(), i.closure));
155
- (0, exercise_1.tryToAddWrongProp)(propositions, `S=\\ ${rightIntervals[(0, coinFlip_1.coinFlip)() ? 0 : 1].toTex()}`);
156
- (0, exercise_1.tryToAddWrongProp)(propositions, `S=\\ ${new unionIntervalNode_1.UnionIntervalNode(fakeIntervals.map((i) => i.toRandomDifferentClosure())).toTex()}`);
155
+ (0, exercise_1.tryToAddWrongProp)(propositions, `S=${rightIntervals[(0, coinFlip_1.coinFlip)() ? 0 : 1].toTex()}`);
156
+ (0, exercise_1.tryToAddWrongProp)(propositions, `S=${new unionIntervalNode_1.UnionIntervalNode(fakeIntervals.map((i) => i.toRandomDifferentClosure())).toTex()}`);
157
157
  }
158
158
  while (propositions.length < n) {
159
159
  const isStrict = ineqSymbol === "<" || ineqSymbol === ">";
@@ -161,7 +161,7 @@ const getPropositions = (n, { answer, intervals, fSplinePoints, ineqSymbol }) =>
161
161
  const x2 = (0, randint_1.randint)(x1 + 1, x1 + 5);
162
162
  const x3 = (0, randint_1.randint)(x2 + 3, x2 + 6);
163
163
  const x4 = (0, randint_1.randint)(x3 + 1, x3 + 3);
164
- (0, exercise_1.tryToAddWrongProp)(propositions, `S=\\ ${new unionIntervalNode_1.UnionIntervalNode([
164
+ (0, exercise_1.tryToAddWrongProp)(propositions, `S=${new unionIntervalNode_1.UnionIntervalNode([
165
165
  new intervalNode_1.IntervalNode(x1.toTree(), x2.toTree(), isStrict ? closure_1.ClosureType.FO : closure_1.ClosureType.FF),
166
166
  new intervalNode_1.IntervalNode(x3.toTree(), x4.toTree(), isStrict ? closure_1.ClosureType.OF : closure_1.ClosureType.FF),
167
167
  ]).toTex()}`);
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../exercises/exercise";
2
+ type Identifiers = {
3
+ TVA: number;
4
+ ht: number;
5
+ };
6
+ export declare const htToTTC: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=htToTTC.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"htToTTC.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/htToTTC.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAgCF,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,WAAW,CAazC,CAAC"}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.htToTTC = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
6
+ const randfloat_1 = require("../../../math/utils/random/randfloat");
7
+ const randint_1 = require("../../../math/utils/random/randint");
8
+ const round_1 = require("../../../math/utils/round");
9
+ const coinFlip_1 = require("../../../utils/coinFlip");
10
+ const random_1 = require("../../../utils/random");
11
+ const getHtToTtcQuestion = () => {
12
+ const TVA = (0, random_1.random)([20, 5.5]);
13
+ const ht = (0, coinFlip_1.coinFlip)() ? (0, randint_1.randint)(50, 1000) : (0, randfloat_1.randfloat)(20, 200, 2);
14
+ const answer = (0, round_1.round)(ht * (1 + TVA / 100), 2).frenchify();
15
+ const question = {
16
+ answer,
17
+ instruction: `Un object coûte $${ht.frenchify()}€$ en HT. Quel est son prix TTC, sachant que la TVA est de $${TVA.frenchify()}\\%$ ? (arrondir au centième)`,
18
+ keys: [],
19
+ answerFormat: "tex",
20
+ identifiers: { TVA, ht },
21
+ };
22
+ return question;
23
+ };
24
+ const getPropositions = (n, { answer, TVA, ht }) => {
25
+ const propositions = [];
26
+ (0, exercise_1.addValidProp)(propositions, answer);
27
+ (0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)((ht * TVA) / 100, 2).frenchify());
28
+ (0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)(ht + TVA / 100, 2).frenchify());
29
+ while (propositions.length < n) {
30
+ (0, exercise_1.tryToAddWrongProp)(propositions, (0, randfloat_1.randfloat)(50, 400, 2).frenchify());
31
+ }
32
+ return (0, exercise_1.shuffleProps)(propositions, n);
33
+ };
34
+ const isAnswerValid = (ans, { answer }) => {
35
+ return ans === answer;
36
+ };
37
+ exports.htToTTC = {
38
+ id: "htToTTC",
39
+ connector: "=",
40
+ label: "Passer d'un prix HT à un prix TTC",
41
+ levels: [],
42
+ isSingleStep: true,
43
+ sections: [],
44
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getHtToTtcQuestion, nb),
45
+ qcmTimer: 60,
46
+ freeTimer: 60,
47
+ getPropositions,
48
+ isAnswerValid,
49
+ subject: "Mathématiques",
50
+ };
@@ -8,4 +8,6 @@ export * from "./valuePercent";
8
8
  export * from "./findProportion";
9
9
  export * from "./isTableProportional";
10
10
  export * from "./cmToEvolution";
11
+ export * from "./htToTTC";
12
+ export * from "./ttcToHT";
11
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/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;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/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;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
@@ -24,3 +24,5 @@ __exportStar(require("./valuePercent"), exports);
24
24
  __exportStar(require("./findProportion"), exports);
25
25
  __exportStar(require("./isTableProportional"), exports);
26
26
  __exportStar(require("./cmToEvolution"), exports);
27
+ __exportStar(require("./htToTTC"), exports);
28
+ __exportStar(require("./ttcToHT"), exports);
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../exercises/exercise";
2
+ type Identifiers = {
3
+ TTC: number;
4
+ TVA: number;
5
+ };
6
+ export declare const ttcToHT: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=ttcToHT.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ttcToHT.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/ttcToHT.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAuCF,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,WAAW,CAazC,CAAC"}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ttcToHT = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
6
+ const randfloat_1 = require("../../../math/utils/random/randfloat");
7
+ const randint_1 = require("../../../math/utils/random/randint");
8
+ const round_1 = require("../../../math/utils/round");
9
+ const coinFlip_1 = require("../../../utils/coinFlip");
10
+ const random_1 = require("../../../utils/random");
11
+ const getTtcToHtQuestion = () => {
12
+ const TVA = (0, random_1.random)([20, 5.5]);
13
+ const TTC = (0, coinFlip_1.coinFlip)() ? (0, randint_1.randint)(50, 1000) : (0, randfloat_1.randfloat)(20, 200, 2);
14
+ const answer = (0, round_1.round)(TTC / (1 + TVA / 100), 2).frenchify();
15
+ const question = {
16
+ answer,
17
+ instruction: `Un object coûte $${TTC.frenchify()}€$ en TTC. Quel est son prix HT, sachant que la TVA est de $${TVA.frenchify()}\\%$ ? (arrondir au centième)`,
18
+ keys: [],
19
+ answerFormat: "tex",
20
+ identifiers: { TTC, TVA },
21
+ };
22
+ return question;
23
+ };
24
+ const getPropositions = (n, { answer, TTC, TVA }) => {
25
+ const propositions = [];
26
+ (0, exercise_1.addValidProp)(propositions, answer);
27
+ (0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)(TTC * (1 + TVA / 100), 2).frenchify());
28
+ (0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)(TTC - (1 + TVA / 100) * TTC, 2).frenchify());
29
+ while (propositions.length < n) {
30
+ (0, exercise_1.tryToAddWrongProp)(propositions, (0, randfloat_1.randfloat)(50, 400, 2).frenchify());
31
+ }
32
+ return (0, exercise_1.shuffleProps)(propositions, n);
33
+ };
34
+ const isAnswerValid = (ans, { answer }) => {
35
+ return ans === answer;
36
+ };
37
+ exports.ttcToHT = {
38
+ id: "ttcToHT",
39
+ connector: "=",
40
+ label: "Passer d'un prix TTC à un prix HT",
41
+ levels: [],
42
+ isSingleStep: true,
43
+ sections: [],
44
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getTtcToHtQuestion, nb),
45
+ qcmTimer: 60,
46
+ freeTimer: 60,
47
+ getPropositions,
48
+ isAnswerValid,
49
+ subject: "Mathématiques",
50
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"marginalAndConditionalFrequency.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,QAAQ,EAQT,MAAM,mBAAmB,CAAC;AAG3B,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AA2IF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAcjE,CAAC"}
1
+ {"version":3,"file":"marginalAndConditionalFrequency.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,QAAQ,EAQT,MAAM,mBAAmB,CAAC;AAG3B,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAkIF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAcjE,CAAC"}