math-exercises 2.2.10 → 2.2.11
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/index.d.ts +3 -0
- package/lib/exercises/math/calcul/decimals/index.d.ts.map +1 -0
- package/lib/exercises/math/calcul/decimals/index.js +18 -0
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.d.ts +8 -0
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.d.ts.map +1 -0
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.js +53 -0
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.d.ts +9 -0
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.d.ts.map +1 -0
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.js +63 -0
- package/lib/exercises/math/calcul/index.d.ts +2 -0
- package/lib/exercises/math/calcul/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/index.js +2 -0
- package/lib/exercises/math/calcul/operations/index.d.ts +2 -0
- package/lib/exercises/math/calcul/operations/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/operations/index.js +2 -0
- package/lib/exercises/math/calcul/operations/operationsPriorities.d.ts +1 -1
- package/lib/exercises/math/calcul/operations/operationsPriorities.d.ts.map +1 -1
- package/lib/exercises/math/calcul/operations/operationsPriorities.js +20 -5
- package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesis.d.ts +8 -0
- package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesis.d.ts.map +1 -0
- package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesis.js +111 -0
- package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesisNoRelatives.d.ts +8 -0
- package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesisNoRelatives.d.ts.map +1 -0
- package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesisNoRelatives.js +127 -0
- package/lib/exercises/math/calcul/operations/operationsPrioritiesWithoutRelative.d.ts.map +1 -1
- package/lib/exercises/math/calcul/operations/operationsPrioritiesWithoutRelative.js +18 -1
- package/lib/exercises/math/calcul/ordering/decimalOrdering.d.ts +9 -0
- package/lib/exercises/math/calcul/ordering/decimalOrdering.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/decimalOrdering.js +77 -0
- package/lib/exercises/math/calcul/ordering/framing.d.ts +10 -0
- package/lib/exercises/math/calcul/ordering/framing.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/framing.js +143 -0
- package/lib/exercises/math/calcul/ordering/index.d.ts +4 -0
- package/lib/exercises/math/calcul/ordering/index.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/index.js +19 -0
- package/lib/exercises/math/calcul/ordering/integerOrdering.d.ts +8 -0
- package/lib/exercises/math/calcul/ordering/integerOrdering.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/integerOrdering.js +61 -0
- package/lib/exercises/math/derivation/derivative/powerFunctionDerivative.js +1 -1
- package/lib/exercises/math/functions/affines/leadingCoeffAndOriginOrdinate.js +1 -1
- package/lib/exercises/math/functions/basics/graphicInequation.js +6 -6
- package/lib/exercises/math/functions/basics/twoFunctionsInequation.js +6 -6
- package/lib/exercises/math/percent/htToTTC.d.ts +8 -0
- package/lib/exercises/math/percent/htToTTC.d.ts.map +1 -0
- package/lib/exercises/math/percent/htToTTC.js +50 -0
- package/lib/exercises/math/percent/index.d.ts +2 -0
- package/lib/exercises/math/percent/index.d.ts.map +1 -1
- package/lib/exercises/math/percent/index.js +2 -0
- package/lib/exercises/math/percent/ttcToHT.d.ts +8 -0
- package/lib/exercises/math/percent/ttcToHT.d.ts.map +1 -0
- package/lib/exercises/math/percent/ttcToHT.js +50 -0
- package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.js +2 -11
- package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.js +1 -1
- package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.js +1 -1
- package/lib/exercises/pc/motion/typeOfAcceleration.js +1 -1
- package/lib/exercises/pc/motion/typeOfMovement.js +1 -1
- package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.js +1 -1
- package/lib/index.d.ts +32 -1
- package/lib/index.d.ts.map +1 -1
- 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 +18 -0
- package/lib/math/sets/intervals/intervals.d.ts.map +1 -1
- package/lib/math/sets/intervals/intervals.js +2 -2
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +0 -5
- package/lib/tree/nodes/inequations/inequationSolutionNode.js +1 -1
- package/lib/tree/nodes/node.d.ts +2 -0
- package/lib/tree/nodes/node.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +9 -6
- package/lib/tree/nodes/sets/intervalNode.js +1 -1
- package/lib/tree/nodes/sets/unionIntervalNode.js +1 -1
- package/lib/types/keyProps.d.ts +13 -0
- package/lib/types/keyProps.d.ts.map +1 -0
- package/lib/types/keyProps.js +2 -0
- 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
|
+
{"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"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
};
|
|
@@ -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;AAClC,cAAc,WAAW,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
|
+
__exportStar(require("./framing"), exports);
|
|
@@ -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
|
|
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
|
|
80
|
-
: `S
|
|
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
|
|
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
|
|
132
|
-
(0, exercise_1.tryToAddWrongProp)(propositions, `S
|
|
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
|
|
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
|
|
114
|
-
: `S
|
|
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
|
|
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
|
|
156
|
-
(0, exercise_1.tryToAddWrongProp)(propositions, `S
|
|
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
|
|
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 @@
|
|
|
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
|
+
};
|
|
@@ -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 @@
|
|
|
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;
|
|
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"}
|
|
@@ -8,15 +8,6 @@ const exercise_1 = require("../../../exercise");
|
|
|
8
8
|
const getDistinctQuestions_1 = require("../../../utils/getDistinctQuestions");
|
|
9
9
|
const getAnswer = (rand, x1, x2, x3, x4) => {
|
|
10
10
|
const x = x1 + x2 + x3 + x4;
|
|
11
|
-
const total = x1 + x2 + x3 + x4;
|
|
12
|
-
const totalA = x1 + x3;
|
|
13
|
-
const totalB = x2 + x4;
|
|
14
|
-
const totalC = x1 + x2;
|
|
15
|
-
const totalD = x3 + x4;
|
|
16
|
-
const A_C = x1;
|
|
17
|
-
const A_D = x3;
|
|
18
|
-
const B_C = x2;
|
|
19
|
-
const B_D = x4;
|
|
20
11
|
let freqString;
|
|
21
12
|
let frequence;
|
|
22
13
|
let answer;
|
|
@@ -112,8 +103,8 @@ const getPropositions = (n, { answer, rand, x1, x2, x3, x4 }) => {
|
|
|
112
103
|
const propositions = [];
|
|
113
104
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
114
105
|
while (propositions.length < n) {
|
|
115
|
-
const
|
|
116
|
-
const { answer: answerTree } = getAnswer(
|
|
106
|
+
const fakeRand = (0, randint_1.randint)(0, 12);
|
|
107
|
+
const { answer: answerTree } = getAnswer(fakeRand, x1, x2, x3, x4);
|
|
117
108
|
(0, exercise_1.tryToAddWrongProp)(propositions, answerTree.toTex());
|
|
118
109
|
}
|
|
119
110
|
return (0, shuffle_1.shuffle)(propositions);
|