math-exercises 2.2.12 → 2.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/exercises/exercise.d.ts +2 -1
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.js +1 -1
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.js +1 -1
- package/lib/exercises/math/calcul/ordering/framing.d.ts +9 -0
- package/lib/exercises/math/calcul/ordering/framing.d.ts.map +1 -1
- package/lib/exercises/math/calcul/ordering/framing.js +142 -192
- package/lib/exercises/math/calcul/ordering/index.d.ts +1 -0
- package/lib/exercises/math/calcul/ordering/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/ordering/index.js +1 -1
- package/lib/exercises/math/functions/basics/imageFunction.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/imageFunction.js +4 -3
- package/lib/exercises/math/percent/htToTTC.js +1 -1
- package/lib/exercises/math/percent/ttcToHT.js +1 -1
- package/lib/index.d.ts +5 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/types/keyProps.d.ts +1 -2
- package/lib/types/keyProps.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { KeyId } from "../types/keyIds";
|
|
2
|
+
import { KeyProps } from "../types/keyProps";
|
|
2
3
|
export declare const addValidProp: (props: Proposition[], statement: string, format?: "tex" | "raw") => void;
|
|
3
4
|
export declare const addWrongProp: (props: Proposition[], statement: string, format?: "tex" | "raw") => void;
|
|
4
5
|
export declare const tryToAddWrongProp: (props: Proposition[], statement: string, format?: "tex" | "raw") => void;
|
|
@@ -18,7 +19,7 @@ export interface Question<TIdentifiers = {}> {
|
|
|
18
19
|
answer?: string;
|
|
19
20
|
answerFormat?: "tex" | "raw";
|
|
20
21
|
ggbAnswer?: string[];
|
|
21
|
-
keys?: KeyId[];
|
|
22
|
+
keys?: (KeyId | KeyProps)[];
|
|
22
23
|
commands?: string[];
|
|
23
24
|
coords?: number[];
|
|
24
25
|
options?: {
|
|
@@ -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;
|
|
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;AACF,MAAM,WAAW,QAAQ,CAAC,YAAY,GAAG,EAAE;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;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AAgB,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"}
|
|
@@ -7,7 +7,7 @@ const decimal_1 = require("../../../../math/numbers/decimals/decimal");
|
|
|
7
7
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
8
8
|
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
9
9
|
const getMultiplyDecimalByNegativeTensQuestion = () => {
|
|
10
|
-
const dec = decimal_1.DecimalConstructor.random(
|
|
10
|
+
const dec = decimal_1.DecimalConstructor.random(1, 200, (0, randint_1.randint)(1, 5));
|
|
11
11
|
const pow = -(0, randint_1.randint)(1, 4);
|
|
12
12
|
const factor = Math.pow(10, pow);
|
|
13
13
|
const answer = dec.multiplyByPowerOfTen(pow).toTree().toTex();
|
|
@@ -9,7 +9,7 @@ const divideNode_1 = require("../../../../tree/nodes/operators/divideNode");
|
|
|
9
9
|
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
10
10
|
const coinFlip_1 = require("../../../../utils/coinFlip");
|
|
11
11
|
const getMultiplyDecimalByTensQuestion = () => {
|
|
12
|
-
const dec = decimal_1.DecimalConstructor.random(
|
|
12
|
+
const dec = decimal_1.DecimalConstructor.random(1, 200, (0, randint_1.randint)(1, 5));
|
|
13
13
|
const pow = (0, randint_1.randint)(1, 4);
|
|
14
14
|
const factor = Math.pow(10, pow);
|
|
15
15
|
const isDivide = (0, coinFlip_1.coinFlip)();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framing.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/ordering/framing.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"framing.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/ordering/framing.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAmBlC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,GAAG,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAyJF,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,WAAW,CAazC,CAAC"}
|
|
@@ -1,193 +1,143 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
//
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
//
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
//
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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
|
-
// };
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.framing = 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 sqrtNode_1 = require("../../../../tree/nodes/functions/sqrtNode");
|
|
9
|
+
const nodeConstructor_1 = require("../../../../tree/nodes/nodeConstructor");
|
|
10
|
+
const piNode_1 = require("../../../../tree/nodes/numbers/piNode");
|
|
11
|
+
const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
12
|
+
const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
|
|
13
|
+
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
14
|
+
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
15
|
+
const coinFlip_1 = require("../../../../utils/coinFlip");
|
|
16
|
+
const random_1 = require("../../../../utils/random");
|
|
17
|
+
//fraction: 1/3, 2/3, 1/6, 5/6, x/7
|
|
18
|
+
//décimal
|
|
19
|
+
const getFramingQuestion = () => {
|
|
20
|
+
const type = (0, randint_1.randint)(1, 5);
|
|
21
|
+
let nb;
|
|
22
|
+
const pow = -(0, randint_1.randint)(1, 4);
|
|
23
|
+
let a;
|
|
24
|
+
let b;
|
|
25
|
+
let ev;
|
|
26
|
+
let dec;
|
|
27
|
+
switch (type) {
|
|
28
|
+
case 1:
|
|
29
|
+
//CL(pi)
|
|
30
|
+
nb = new addNode_1.AddNode(new multiplyNode_1.MultiplyNode((0, random_1.random)([(0, randint_1.randint)(-3, 0), (0, randint_1.randint)(1, 4), 10, -10]).toTree(), piNode_1.PiNode), (0, randint_1.randint)(-10, 10).toTree());
|
|
31
|
+
ev = nb.evaluate({});
|
|
32
|
+
dec = new decimal_1.Decimal(ev);
|
|
33
|
+
a = dec.toLowerBound(pow).toTree();
|
|
34
|
+
b = dec.toUpperBound(pow).toTree();
|
|
35
|
+
break;
|
|
36
|
+
case 2:
|
|
37
|
+
//CL(sqrt(2))
|
|
38
|
+
nb = new addNode_1.AddNode(new multiplyNode_1.MultiplyNode((0, random_1.random)([(0, randint_1.randint)(-3, 0), (0, randint_1.randint)(1, 4), 10, -10]).toTree(), new sqrtNode_1.SqrtNode((2).toTree())), (0, randint_1.randint)(-10, 10).toTree());
|
|
39
|
+
ev = nb.evaluate({});
|
|
40
|
+
dec = new decimal_1.Decimal(ev);
|
|
41
|
+
a = dec.toLowerBound(pow).toTree();
|
|
42
|
+
b = dec.toUpperBound(pow).toTree();
|
|
43
|
+
break;
|
|
44
|
+
case 3:
|
|
45
|
+
//fraction
|
|
46
|
+
nb = new addNode_1.AddNode(new multiplyNode_1.MultiplyNode((0, random_1.random)([(0, randint_1.randint)(-2, 0), (0, randint_1.randint)(1, 3), 10, -10]).toTree(), (0, random_1.random)([
|
|
47
|
+
new fractionNode_1.FractionNode((1).toTree(), (3).toTree()),
|
|
48
|
+
new fractionNode_1.FractionNode((2).toTree(), (3).toTree()),
|
|
49
|
+
]), { forceTimesSign: true }), (0, randint_1.randint)(-10, 10).toTree());
|
|
50
|
+
ev = nb.evaluate({});
|
|
51
|
+
dec = new decimal_1.Decimal(ev);
|
|
52
|
+
a = dec.toLowerBound(pow).toTree();
|
|
53
|
+
b = dec.toUpperBound(pow).toTree();
|
|
54
|
+
break;
|
|
55
|
+
case 4:
|
|
56
|
+
default:
|
|
57
|
+
dec = decimal_1.DecimalConstructor.random(-200, 200, (0, randint_1.randint)(-pow, -pow + 3));
|
|
58
|
+
nb = dec.toTree();
|
|
59
|
+
a = dec.toLowerBound(pow).toTree();
|
|
60
|
+
b = dec.toUpperBound(pow).toTree();
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
const answer = `${a.toTex()}<${nb.toTex()}<${b.toTex()}`;
|
|
64
|
+
const question = {
|
|
65
|
+
answer,
|
|
66
|
+
instruction: `Encadrer à $${new powerNode_1.PowerNode((10).toTree(), pow.toTree()).toTex()}$ près le nombre suivant :
|
|
67
|
+
|
|
68
|
+
$$
|
|
69
|
+
${nb.toTex()}
|
|
70
|
+
$$
|
|
71
|
+
|
|
72
|
+
Donner une réponse sous la forme $a<${nb.toTex()}<b$.
|
|
73
|
+
|
|
74
|
+
${type === 2
|
|
75
|
+
? "On rappelle que $\\sqrt 2 \\approx 1,41421$."
|
|
76
|
+
: type === 1
|
|
77
|
+
? "On rappelle que $\\pi \\approx 3, 14159$."
|
|
78
|
+
: ""}`,
|
|
79
|
+
keys: [
|
|
80
|
+
"pi",
|
|
81
|
+
"inf",
|
|
82
|
+
"sup",
|
|
83
|
+
{
|
|
84
|
+
id: "custom",
|
|
85
|
+
label: nb.toTex(),
|
|
86
|
+
labelType: "tex",
|
|
87
|
+
mathfieldInstructions: {
|
|
88
|
+
method: "write",
|
|
89
|
+
content: nb.toTex(),
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
answerFormat: "tex",
|
|
94
|
+
identifiers: {
|
|
95
|
+
type,
|
|
96
|
+
nbIds: nb.toIdentifiers(),
|
|
97
|
+
nbValue: nb.evaluate({}),
|
|
98
|
+
pow,
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
return question;
|
|
102
|
+
};
|
|
103
|
+
const getPropositions = (n, { answer, nbIds, nbValue, pow }) => {
|
|
104
|
+
const propositions = [];
|
|
105
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
106
|
+
const dec = new decimal_1.Decimal(nbValue);
|
|
107
|
+
const node = nodeConstructor_1.NodeConstructor.fromIdentifiers(nbIds);
|
|
108
|
+
console.log(nbValue, pow);
|
|
109
|
+
while (propositions.length < n) {
|
|
110
|
+
const fakePower = -(0, randint_1.randint)(1, 4, [pow]);
|
|
111
|
+
const fakeDec = new decimal_1.Decimal(dec.value * (0, randint_1.randint)(-3, 3, [0, 1]));
|
|
112
|
+
(0, coinFlip_1.coinFlip)()
|
|
113
|
+
? (0, exercise_1.tryToAddWrongProp)(propositions, `${dec.toLowerBound(fakePower).toTree().toTex()}<${node.toTex()}<${dec
|
|
114
|
+
.toUpperBound(fakePower)
|
|
115
|
+
.toTree()
|
|
116
|
+
.toTex()}`)
|
|
117
|
+
: (0, exercise_1.tryToAddWrongProp)(propositions, `${fakeDec
|
|
118
|
+
.toLowerBound(pow)
|
|
119
|
+
.toTree()
|
|
120
|
+
.toTex()}<${node.toTex()}<${fakeDec
|
|
121
|
+
.toUpperBound(pow)
|
|
122
|
+
.toTree()
|
|
123
|
+
.toTex()}`);
|
|
124
|
+
}
|
|
125
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
126
|
+
};
|
|
127
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
128
|
+
return ans === answer;
|
|
129
|
+
};
|
|
130
|
+
exports.framing = {
|
|
131
|
+
id: "framing",
|
|
132
|
+
connector: "=",
|
|
133
|
+
label: "Encadrer un nombre réel à $10^{-n}$",
|
|
134
|
+
levels: [],
|
|
135
|
+
isSingleStep: true,
|
|
136
|
+
sections: [],
|
|
137
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getFramingQuestion, nb),
|
|
138
|
+
qcmTimer: 60,
|
|
139
|
+
freeTimer: 60,
|
|
140
|
+
getPropositions,
|
|
141
|
+
isAnswerValid,
|
|
142
|
+
subject: "Mathématiques",
|
|
143
|
+
};
|
|
@@ -1 +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"}
|
|
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;AAClC,cAAc,WAAW,CAAC"}
|
|
@@ -16,4 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./integerOrdering"), exports);
|
|
18
18
|
__exportStar(require("./decimalOrdering"), exports);
|
|
19
|
-
|
|
19
|
+
__exportStar(require("./framing"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imageFunction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/imageFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAOlC,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;
|
|
1
|
+
{"version":3,"file":"imageFunction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/imageFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAOlC,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;AAsDF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAa/C,CAAC"}
|
|
@@ -16,9 +16,10 @@ const getImageFunction = () => {
|
|
|
16
16
|
(0, randint_1.randint)(-4, 5, [0]),
|
|
17
17
|
]);
|
|
18
18
|
const xValue = (0, randint_1.randint)(-9, 10);
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const flip = (0, coinFlip_1.coinFlip)();
|
|
20
|
+
const statement = `Soit $f(x) = ${(rand ? polynome1 : polynome2)
|
|
21
|
+
.toTree()
|
|
22
|
+
.toTex()}. Calculer ${flip ? `l'image de $${xValue}$ par $f$.` : `$f(${xValue})$.`}`;
|
|
22
23
|
const answer = rand
|
|
23
24
|
? polynome1.calculate(xValue) + ""
|
|
24
25
|
: polynome2.calculate(xValue) + "";
|
|
@@ -14,7 +14,7 @@ const getHtToTtcQuestion = () => {
|
|
|
14
14
|
const answer = (0, round_1.round)(ht * (1 + TVA / 100), 2).frenchify();
|
|
15
15
|
const question = {
|
|
16
16
|
answer,
|
|
17
|
-
instruction: `Un
|
|
17
|
+
instruction: `Un objet coûte $${ht.frenchify()}€$ en HT. Quel est son prix TTC, sachant que la TVA est de $${TVA.frenchify()}\\%$ ? (arrondir au centième)`,
|
|
18
18
|
keys: [],
|
|
19
19
|
answerFormat: "tex",
|
|
20
20
|
identifiers: { TVA, ht },
|
|
@@ -14,7 +14,7 @@ const getTtcToHtQuestion = () => {
|
|
|
14
14
|
const answer = (0, round_1.round)(TTC / (1 + TVA / 100), 2).frenchify();
|
|
15
15
|
const question = {
|
|
16
16
|
answer,
|
|
17
|
-
instruction: `Un
|
|
17
|
+
instruction: `Un objet coûte $${TTC.frenchify()}€$ en TTC. Quel est son prix HT, sachant que la TVA est de $${TVA.frenchify()}\\%$ ? (arrondir au centième)`,
|
|
18
18
|
keys: [],
|
|
19
19
|
answerFormat: "tex",
|
|
20
20
|
identifiers: { TTC, TVA },
|
package/lib/index.d.ts
CHANGED
|
@@ -187,6 +187,11 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
|
|
|
187
187
|
type: number;
|
|
188
188
|
a: number;
|
|
189
189
|
b: number;
|
|
190
|
+
}> | import("./exercises/exercise").Exercise<{
|
|
191
|
+
type: number;
|
|
192
|
+
nbIds: any;
|
|
193
|
+
nbValue: number;
|
|
194
|
+
pow: number;
|
|
190
195
|
}> | import("./exercises/exercise").Exercise<{
|
|
191
196
|
dec: number;
|
|
192
197
|
pow: number;
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,OAAO,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEgD,CAAC;AACnD,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC"}
|
package/lib/types/keyProps.d.ts
CHANGED
|
@@ -4,10 +4,9 @@ export type KeyProps = {
|
|
|
4
4
|
label: string;
|
|
5
5
|
labelType: "raw" | "tex" | "svg";
|
|
6
6
|
mathfieldInstructions?: MathfieldInstructions;
|
|
7
|
-
onClick?: () => void;
|
|
8
7
|
};
|
|
9
8
|
export interface MathfieldInstructions {
|
|
10
9
|
method: "write" | "cmd" | "keystroke" | "typedText";
|
|
11
|
-
content: string
|
|
10
|
+
content: string;
|
|
12
11
|
}
|
|
13
12
|
//# sourceMappingURL=keyProps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyProps.d.ts","sourceRoot":"","sources":["../../src/types/keyProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,KAAK,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;IACjC,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"keyProps.d.ts","sourceRoot":"","sources":["../../src/types/keyProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,KAAK,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;IACjC,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;CAC/C,CAAC;AACF,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,OAAO,GAAG,KAAK,GAAG,WAAW,GAAG,WAAW,CAAC;IACpD,OAAO,EAAE,MAAM,CAAC;CACjB"}
|