math-exercises 3.0.28 → 3.0.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.
- package/lib/exercises/math/calcul/fractions/fractionSquare.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionSquare.js +4 -0
- package/lib/exercises/math/calcul/fractions/fractionsProduct.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsProduct.js +4 -0
- package/lib/exercises/math/calcul/fractions/fractionsSubstraction.d.ts +11 -0
- package/lib/exercises/math/calcul/fractions/fractionsSubstraction.d.ts.map +1 -0
- package/lib/exercises/math/calcul/fractions/fractionsSubstraction.js +106 -0
- package/lib/exercises/math/calcul/fractions/index.d.ts +1 -0
- package/lib/exercises/math/calcul/fractions/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/index.js +1 -0
- package/lib/exercises/math/calcul/proportionality/proportionalityTable.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/proportionalityTable.js +23 -7
- package/lib/exercises/math/calcul/proportionality/rectangleSideAfterReduction.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/rectangleSideAfterReduction.js +4 -0
- package/lib/exercises/math/calcul/sign/signFromAx.d.ts.map +1 -1
- package/lib/exercises/math/calcul/sign/signFromAx.js +4 -0
- package/lib/exercises/math/calculLitteral/distributivity/index.d.ts +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/index.js +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/simpleDistri.d.ts +9 -0
- package/lib/exercises/math/calculLitteral/distributivity/simpleDistri.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/distributivity/simpleDistri.js +116 -0
- package/lib/exercises/math/calculLitteral/simplifying/reduceExpression.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/simplifying/reduceExpression.js +5 -1
- package/lib/exercises/math/calculLitteral/simplifying/valuateExpression.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/simplifying/valuateExpression.js +4 -0
- package/lib/exercises/math/dataRepresentations/functionGraphReading.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/functionGraphReading.js +4 -0
- package/lib/exercises/math/dataRepresentations/pieChartReading.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/pieChartReading.js +4 -0
- package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.js +4 -0
- package/lib/exercises/math/geometry/lines/linesRelativePositions.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/linesRelativePositions.js +4 -0
- package/lib/exercises/math/geometry/thales/thales.d.ts +9 -9
- package/lib/exercises/math/geometry/thales/thales.d.ts.map +1 -1
- package/lib/exercises/math/geometry/thales/thales.js +153 -88
- package/lib/exercises/math/geometry/thales/thalesCalcul.js +2 -2
- package/lib/exercises/math/percent/findRightCalculForPriceEvolution.d.ts +10 -0
- package/lib/exercises/math/percent/findRightCalculForPriceEvolution.d.ts.map +1 -0
- package/lib/exercises/math/percent/findRightCalculForPriceEvolution.js +117 -0
- package/lib/exercises/math/percent/index.d.ts +1 -1
- package/lib/exercises/math/percent/index.d.ts.map +1 -1
- package/lib/exercises/math/percent/index.js +1 -1
- package/lib/exercises/math/powers/powersOfTenToDecimal.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersOfTenToDecimal.js +4 -0
- package/lib/exercises/math/powers/powersProduct.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersProduct.js +10 -14
- package/lib/exercises/math/probaStat/stats1var/choseReasoningForIndicator.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/choseReasoningForIndicator.js +4 -0
- package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.js +4 -0
- package/lib/index.d.ts +19 -18
- package/lib/index.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/lengthNode.d.ts +2 -1
- package/lib/tree/nodes/geometry/lengthNode.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/lengthNode.js +7 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fractionSquare.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionSquare.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"fractionSquare.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionSquare.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAiGF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAkBhD,CAAC"}
|
|
@@ -74,6 +74,9 @@ const getFractionSquareQuestion = (ops) => {
|
|
|
74
74
|
num: rational.num,
|
|
75
75
|
denum: rational.denum,
|
|
76
76
|
};
|
|
77
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
78
|
+
};
|
|
79
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
77
80
|
const question = {
|
|
78
81
|
answer: getAnswer(identifiers),
|
|
79
82
|
instruction: getInstruction(identifiers),
|
|
@@ -101,4 +104,5 @@ export const fractionSquare = {
|
|
|
101
104
|
getCorrection,
|
|
102
105
|
getAnswer,
|
|
103
106
|
hasHintAndCorrection: true,
|
|
107
|
+
getQuestionFromIdentifiers,
|
|
104
108
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fractionsProduct.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsProduct.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"fractionsProduct.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsProduct.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAiBrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAiIF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAqB3D,CAAC"}
|
|
@@ -62,6 +62,9 @@ const getFractionsProduct = (opts) => {
|
|
|
62
62
|
rationalNum: [rational.num, rational.denum],
|
|
63
63
|
rationalDenum: [rational2.num, rational2.denum],
|
|
64
64
|
};
|
|
65
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
66
|
+
};
|
|
67
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
65
68
|
const question = {
|
|
66
69
|
instruction: getInstruction(identifiers, opts),
|
|
67
70
|
startStatement: getStartStatement(identifiers, opts),
|
|
@@ -120,4 +123,5 @@ export const fractionsProduct = {
|
|
|
120
123
|
getAnswer,
|
|
121
124
|
getHint,
|
|
122
125
|
getCorrection,
|
|
126
|
+
getQuestionFromIdentifiers,
|
|
123
127
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
frac1: number[];
|
|
4
|
+
frac2: number[];
|
|
5
|
+
};
|
|
6
|
+
type Options = {
|
|
7
|
+
allowNonIrreductible?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const fractionsSubstraction: Exercise<Identifiers, Options>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=fractionsSubstraction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fractionsSubstraction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsSubstraction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AA8GF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkBhE,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, GeneratorOptionType, GeneratorOptionTarget, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { RationalConstructor, } from "../../../../math/numbers/rationals/rational.js";
|
|
4
|
+
import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
5
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
6
|
+
import { rationalParser } from "../../../../tree/parsers/rationalParser.js";
|
|
7
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
8
|
+
const options = [
|
|
9
|
+
{
|
|
10
|
+
id: "allowNonIrreductible",
|
|
11
|
+
label: "Autoriser les fractions non réduites",
|
|
12
|
+
type: GeneratorOptionType.checkbox,
|
|
13
|
+
target: GeneratorOptionTarget.vea,
|
|
14
|
+
},
|
|
15
|
+
];
|
|
16
|
+
const getStatementNode = (identifiers) => {
|
|
17
|
+
const { frac1, frac2 } = identifiers;
|
|
18
|
+
return substract(frac(frac1[0], frac1[1]), frac(frac2[0], frac2[1]));
|
|
19
|
+
};
|
|
20
|
+
const getPropositions = (n, { answer, frac1, frac2 }) => {
|
|
21
|
+
const propositions = [];
|
|
22
|
+
addValidProp(propositions, answer);
|
|
23
|
+
tryToAddWrongProp(propositions, frac(frac1[0] - frac2[0], frac1[1] - frac2[1], {
|
|
24
|
+
allowDivideByZero: true,
|
|
25
|
+
}).toTex());
|
|
26
|
+
while (propositions.length < n) {
|
|
27
|
+
tryToAddWrongProp(propositions, RationalConstructor.randomIrreductible().toTex());
|
|
28
|
+
}
|
|
29
|
+
return shuffleProps(propositions, n);
|
|
30
|
+
};
|
|
31
|
+
const getAnswer = (identifiers) => {
|
|
32
|
+
return getStatementNode(identifiers).simplify().toTex();
|
|
33
|
+
};
|
|
34
|
+
const getInstruction = (identifiers, opts) => {
|
|
35
|
+
return `Calculer ${opts?.allowNonIrreductible
|
|
36
|
+
? ""
|
|
37
|
+
: "et donner le résultat sous la forme la plus simplifiée possible"} :
|
|
38
|
+
|
|
39
|
+
$$
|
|
40
|
+
${getStatementNode(identifiers).toTex()}
|
|
41
|
+
$$`;
|
|
42
|
+
};
|
|
43
|
+
// const getHint: GetHint<Identifiers> = (identifiers) => {};
|
|
44
|
+
// const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
|
|
45
|
+
const getKeys = (identifiers) => {
|
|
46
|
+
return [];
|
|
47
|
+
};
|
|
48
|
+
const isAnswerValid = (ans, { answer }, opts) => {
|
|
49
|
+
const allow = opts?.allowNonIrreductible;
|
|
50
|
+
try {
|
|
51
|
+
if (allow) {
|
|
52
|
+
const parsed = rationalParser(ans);
|
|
53
|
+
if (!parsed)
|
|
54
|
+
return false;
|
|
55
|
+
return parsed.simplify().toTex() === answer;
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
return ans === answer;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
return handleVEAError(err);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
const getFractionsSubstractionQuestion = (opts) => {
|
|
66
|
+
const ratio1 = RationalConstructor.randomIrreductible();
|
|
67
|
+
let ratio2;
|
|
68
|
+
do {
|
|
69
|
+
ratio2 = RationalConstructor.randomIrreductible(12);
|
|
70
|
+
} while (ratio2.value >= ratio1.value);
|
|
71
|
+
const identifiers = {
|
|
72
|
+
frac1: [ratio1.num, ratio1.denum],
|
|
73
|
+
frac2: [ratio2.num, ratio2.denum],
|
|
74
|
+
};
|
|
75
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
76
|
+
};
|
|
77
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
78
|
+
const question = {
|
|
79
|
+
answer: getAnswer(identifiers),
|
|
80
|
+
instruction: getInstruction(identifiers, opts),
|
|
81
|
+
keys: getKeys(identifiers),
|
|
82
|
+
answerFormat: "tex",
|
|
83
|
+
identifiers,
|
|
84
|
+
// hint: getHint(identifiers),
|
|
85
|
+
// correction: getCorrection(identifiers),
|
|
86
|
+
};
|
|
87
|
+
return question;
|
|
88
|
+
};
|
|
89
|
+
export const fractionsSubstraction = {
|
|
90
|
+
id: "fractionsSubstraction",
|
|
91
|
+
connector: "=",
|
|
92
|
+
label: "Soustraction de fractions",
|
|
93
|
+
isSingleStep: true,
|
|
94
|
+
generator: (nb, opts) => getDistinctQuestions(() => getFractionsSubstractionQuestion(opts), nb),
|
|
95
|
+
qcmTimer: 60,
|
|
96
|
+
freeTimer: 60,
|
|
97
|
+
getPropositions,
|
|
98
|
+
isAnswerValid,
|
|
99
|
+
subject: "Mathématiques",
|
|
100
|
+
getInstruction,
|
|
101
|
+
// getHint,
|
|
102
|
+
// getCorrection,
|
|
103
|
+
getAnswer,
|
|
104
|
+
options,
|
|
105
|
+
getQuestionFromIdentifiers,
|
|
106
|
+
};
|
|
@@ -12,4 +12,5 @@ export * from "./fractionsSumsMultiplesDenominators.js";
|
|
|
12
12
|
export * from "./fractionsSumsPrimeDenominators.js";
|
|
13
13
|
export * from "./fractionsOperations.js";
|
|
14
14
|
export * from "./fractionSquare.js";
|
|
15
|
+
export * from "./fractionsSubstraction.js";
|
|
15
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proportionalityTable.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/proportionality/proportionalityTable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"proportionalityTable.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/proportionality/proportionalityTable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;CACrB,CAAC;AA0FF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAgBtD,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise
|
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { IntegerConstructor } from "../../../../math/numbers/integer/integer.js";
|
|
4
4
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
5
|
+
import { round } from "../../../../math/utils/round.js";
|
|
5
6
|
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
6
7
|
import { dollarize } from "../../../../utils/latex/dollarize.js";
|
|
7
8
|
import { mdTable } from "../../../../utils/markdown/mdTable.js";
|
|
@@ -15,37 +16,50 @@ ${mdTable([
|
|
|
15
16
|
|
|
16
17
|
Déterminer le nombre manquant.`;
|
|
17
18
|
};
|
|
19
|
+
const getAnswer = (identifiers) => {
|
|
20
|
+
const { randQuation, x1, x2, x3, x4 } = identifiers;
|
|
21
|
+
const table = [x1, x2, x3, x4].map(Number);
|
|
22
|
+
switch (randQuation) {
|
|
23
|
+
case 0:
|
|
24
|
+
return round((table[1] * table[2]) / table[3], 0).frenchify();
|
|
25
|
+
case 1:
|
|
26
|
+
return round((table[0] * table[3]) / table[2], 0).frenchify();
|
|
27
|
+
case 2:
|
|
28
|
+
return round((table[3] * table[0]) / table[1], 0).frenchify();
|
|
29
|
+
case 3:
|
|
30
|
+
default:
|
|
31
|
+
return round((table[2] * table[1]) / table[0], 0).frenchify();
|
|
32
|
+
}
|
|
33
|
+
};
|
|
18
34
|
const getProportionalityTable = () => {
|
|
19
35
|
const fact = randint(2, 10);
|
|
20
36
|
let [x1, x2] = IntegerConstructor.randomDifferents(1, 100 / fact, 2);
|
|
21
37
|
let [x3, x4] = [x1 * fact, x2 * fact];
|
|
22
|
-
let answer = "";
|
|
23
38
|
const randQuation = randint(0, 4);
|
|
24
39
|
switch (randQuation) {
|
|
25
40
|
case 0:
|
|
26
|
-
answer = x1 + "";
|
|
27
41
|
x1 = "?";
|
|
28
42
|
break;
|
|
29
43
|
case 1:
|
|
30
|
-
answer = +x2 + "";
|
|
31
44
|
x2 = "?";
|
|
32
45
|
break;
|
|
33
46
|
case 2:
|
|
34
|
-
answer = x3 + "";
|
|
35
47
|
x3 = "?";
|
|
36
48
|
break;
|
|
37
49
|
case 3:
|
|
38
|
-
answer = x4 + "";
|
|
39
50
|
x4 = "?";
|
|
40
51
|
break;
|
|
41
52
|
}
|
|
42
53
|
const identifiers = { x1, x2, x3, x4, randQuation };
|
|
54
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
55
|
+
};
|
|
56
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
43
57
|
const question = {
|
|
44
58
|
instruction: getInstruction(identifiers),
|
|
45
|
-
answer:
|
|
59
|
+
answer: getAnswer(identifiers),
|
|
46
60
|
keys: [],
|
|
47
61
|
answerFormat: "tex",
|
|
48
|
-
identifiers
|
|
62
|
+
identifiers,
|
|
49
63
|
style: {
|
|
50
64
|
tableHasNoHeader: true,
|
|
51
65
|
},
|
|
@@ -77,4 +91,6 @@ export const proportionalityTable = {
|
|
|
77
91
|
isAnswerValid,
|
|
78
92
|
subject: "Mathématiques",
|
|
79
93
|
getInstruction,
|
|
94
|
+
getQuestionFromIdentifiers,
|
|
95
|
+
getAnswer,
|
|
80
96
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rectangleSideAfterReduction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/proportionality/rectangleSideAfterReduction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"rectangleSideAfterReduction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/proportionality/rectangleSideAfterReduction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;CAGnB,CAAC;AAoPF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAoB7D,CAAC"}
|
|
@@ -169,6 +169,9 @@ const getRectangleSideAfterReductionQuestion = (ops) => {
|
|
|
169
169
|
const identifiers = {
|
|
170
170
|
lengths: [a, b, c, d],
|
|
171
171
|
};
|
|
172
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
173
|
+
};
|
|
174
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
172
175
|
const question = {
|
|
173
176
|
answer: getAnswer(identifiers),
|
|
174
177
|
instruction: getInstruction(identifiers),
|
|
@@ -195,4 +198,5 @@ export const rectangleSideAfterReduction = {
|
|
|
195
198
|
// getHint,
|
|
196
199
|
// getCorrection,
|
|
197
200
|
getAnswer,
|
|
201
|
+
getQuestionFromIdentifiers,
|
|
198
202
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signFromAx.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/sign/signFromAx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"signFromAx.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/sign/signFromAx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AA6GF,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,WAAW,CAkB5C,CAAC"}
|
|
@@ -80,6 +80,9 @@ const getSignFromAxQuestion = (ops) => {
|
|
|
80
80
|
[1, 0.45],
|
|
81
81
|
]),
|
|
82
82
|
};
|
|
83
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
84
|
+
};
|
|
85
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
83
86
|
const question = {
|
|
84
87
|
answer: getAnswer(identifiers),
|
|
85
88
|
instruction: getInstruction(identifiers),
|
|
@@ -107,4 +110,5 @@ export const signFromAx = {
|
|
|
107
110
|
hasHintAndCorrection: true,
|
|
108
111
|
getAnswer,
|
|
109
112
|
answerType: "QCU",
|
|
113
|
+
getQuestionFromIdentifiers,
|
|
110
114
|
};
|
|
@@ -2,7 +2,7 @@ export * from "./allIdentities.js";
|
|
|
2
2
|
export * from "./doubleDistributivity.js";
|
|
3
3
|
export { firstIdentity } from "./firstIdentity.js";
|
|
4
4
|
export { secondIdentity } from "./secondIdentity.js";
|
|
5
|
-
export * from "./
|
|
5
|
+
export * from "./simpleDistri.js";
|
|
6
6
|
export { thirdIdentity } from "./thirdIdentity.js";
|
|
7
7
|
export * from "./doubleDistributivityWithCoeff.js";
|
|
8
8
|
export * from "./canonicalFormDevelopment.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,oCAAoC,CAAC;AACnD,cAAc,gCAAgC,CAAC"}
|
|
@@ -2,7 +2,7 @@ export * from "./allIdentities.js";
|
|
|
2
2
|
export * from "./doubleDistributivity.js";
|
|
3
3
|
export { firstIdentity } from "./firstIdentity.js";
|
|
4
4
|
export { secondIdentity } from "./secondIdentity.js";
|
|
5
|
-
export * from "./
|
|
5
|
+
export * from "./simpleDistri.js";
|
|
6
6
|
export { thirdIdentity } from "./thirdIdentity.js";
|
|
7
7
|
export * from "./doubleDistributivityWithCoeff.js";
|
|
8
8
|
export * from "./canonicalFormDevelopment.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simpleDistri.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/simpleDistri.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAarC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AA+GF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAoBtD,CAAC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { Affine, AffineConstructor } from "../../../../math/polynomials/affine.js";
|
|
4
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
5
|
+
import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
|
|
6
|
+
import { AddNode } from "../../../../tree/nodes/operators/addNode.js";
|
|
7
|
+
import { MultiplyNode } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
8
|
+
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
9
|
+
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
10
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
11
|
+
import { polynomialParser } from "../../../../tree/parsers/polynomialParser.js";
|
|
12
|
+
const buildStatement = (identifiers) => {
|
|
13
|
+
const { a, b, coeff } = identifiers;
|
|
14
|
+
const affine = new Affine(a, b);
|
|
15
|
+
const statementTree = new MultiplyNode(new NumberNode(coeff), affine.toTree());
|
|
16
|
+
return statementTree;
|
|
17
|
+
};
|
|
18
|
+
const getInstruction = (identifiers) => {
|
|
19
|
+
const statementTex = buildStatement(identifiers).toTex();
|
|
20
|
+
return `Développer et réduire :
|
|
21
|
+
|
|
22
|
+
$$
|
|
23
|
+
${statementTex}
|
|
24
|
+
$$`;
|
|
25
|
+
};
|
|
26
|
+
const getAnswer = (identifiers) => {
|
|
27
|
+
const { a, b, coeff } = identifiers;
|
|
28
|
+
const affine = new Affine(a, b);
|
|
29
|
+
return affine.times(coeff).toTree().toTex();
|
|
30
|
+
};
|
|
31
|
+
const getHint = (identifiers) => {
|
|
32
|
+
return `Multiplie chaque terme dans la parenthèse par $${identifiers.coeff}$.`;
|
|
33
|
+
};
|
|
34
|
+
const getCorrection = (identifiers) => {
|
|
35
|
+
const { a, b, coeff } = identifiers;
|
|
36
|
+
const statement = buildStatement(identifiers);
|
|
37
|
+
const affine = new Affine(a, b);
|
|
38
|
+
const answer = getAnswer(identifiers);
|
|
39
|
+
return `${alignTex([
|
|
40
|
+
[
|
|
41
|
+
statement.toTex(),
|
|
42
|
+
"=",
|
|
43
|
+
new AddNode(new MultiplyNode(new NumberNode(coeff), new MultiplyNode(new NumberNode(affine.a), "x".toTree()), { forceTimesSign: true }), new MultiplyNode(new NumberNode(coeff), new NumberNode(affine.b))).toTex(),
|
|
44
|
+
],
|
|
45
|
+
["", "=", answer],
|
|
46
|
+
])}`;
|
|
47
|
+
};
|
|
48
|
+
const getSimpleDistributivityQuestion = () => {
|
|
49
|
+
const affine = AffineConstructor.random(undefined, {
|
|
50
|
+
excludes: [0],
|
|
51
|
+
});
|
|
52
|
+
const coeff = randint(-10, 11, [-1, 0, 1]);
|
|
53
|
+
const identifiers = { a: affine.a, b: affine.b, coeff: coeff };
|
|
54
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
55
|
+
};
|
|
56
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
57
|
+
const question = {
|
|
58
|
+
instruction: getInstruction(identifiers),
|
|
59
|
+
startStatement: buildStatement(identifiers).toTex(),
|
|
60
|
+
answer: getAnswer(identifiers),
|
|
61
|
+
keys: ["x"],
|
|
62
|
+
answerFormat: "tex",
|
|
63
|
+
identifiers,
|
|
64
|
+
hint: getHint(identifiers),
|
|
65
|
+
correction: getCorrection(identifiers),
|
|
66
|
+
};
|
|
67
|
+
return question;
|
|
68
|
+
};
|
|
69
|
+
const getPropositions = (n, { answer, a, b, coeff }) => {
|
|
70
|
+
const propositions = [];
|
|
71
|
+
addValidProp(propositions, answer);
|
|
72
|
+
const affine = new Affine(a, b);
|
|
73
|
+
tryToAddWrongProp(propositions, new Affine(coeff * a, b).toTree().toTex());
|
|
74
|
+
tryToAddWrongProp(propositions, new Affine(a, coeff * b).toTree().toTex());
|
|
75
|
+
tryToAddWrongProp(propositions, affine.times(-coeff).toTree().toTex());
|
|
76
|
+
while (propositions.length < n) {
|
|
77
|
+
const wrongAnswer = AffineConstructor.random(undefined, {
|
|
78
|
+
excludes: [0],
|
|
79
|
+
}).toTree();
|
|
80
|
+
tryToAddWrongProp(propositions, wrongAnswer.toTex());
|
|
81
|
+
}
|
|
82
|
+
return shuffle(propositions);
|
|
83
|
+
};
|
|
84
|
+
const isAnswerValid = (ans, { answer, a, b, coeff }) => {
|
|
85
|
+
try {
|
|
86
|
+
const parsed = polynomialParser(ans);
|
|
87
|
+
if (!parsed)
|
|
88
|
+
return false;
|
|
89
|
+
return (parsed
|
|
90
|
+
.simplify({ towardsDistribute: true, forbidFactorize: true })
|
|
91
|
+
.toTex() === answer);
|
|
92
|
+
}
|
|
93
|
+
catch (err) {
|
|
94
|
+
return handleVEAError(err);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
export const simpleDistributivity = {
|
|
98
|
+
id: "simpleDistri",
|
|
99
|
+
connector: "=",
|
|
100
|
+
label: "Distributivité simple",
|
|
101
|
+
levels: ["3ème", "2nde", "CAP", "2ndPro", "1reTech"],
|
|
102
|
+
sections: ["Calcul littéral"],
|
|
103
|
+
isSingleStep: false,
|
|
104
|
+
generator: (nb) => getDistinctQuestions(getSimpleDistributivityQuestion, nb),
|
|
105
|
+
qcmTimer: 60,
|
|
106
|
+
freeTimer: 60,
|
|
107
|
+
getPropositions,
|
|
108
|
+
isAnswerValid,
|
|
109
|
+
subject: "Mathématiques",
|
|
110
|
+
hasHintAndCorrection: true,
|
|
111
|
+
getAnswer,
|
|
112
|
+
getCorrection,
|
|
113
|
+
getHint,
|
|
114
|
+
getInstruction,
|
|
115
|
+
getQuestionFromIdentifiers,
|
|
116
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reduceExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/simplifying/reduceExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"reduceExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/simplifying/reduceExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAiBrC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;IAOjB,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;IAGnB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAqNF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAiBlD,CAAC"}
|
|
@@ -140,11 +140,14 @@ const getReduceExpression = () => {
|
|
|
140
140
|
variable,
|
|
141
141
|
order,
|
|
142
142
|
};
|
|
143
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
144
|
+
};
|
|
145
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
143
146
|
const question = {
|
|
144
147
|
instruction: getInstruction(identifiers),
|
|
145
148
|
startStatement: getStartStatement(identifiers),
|
|
146
149
|
answer: getAnswer(identifiers),
|
|
147
|
-
keys: [variable],
|
|
150
|
+
keys: [identifiers.variable],
|
|
148
151
|
answerFormat: "tex",
|
|
149
152
|
identifiers,
|
|
150
153
|
};
|
|
@@ -204,4 +207,5 @@ export const reduceExpression = {
|
|
|
204
207
|
rebuildIdentifiers,
|
|
205
208
|
getAnswer,
|
|
206
209
|
getInstruction,
|
|
210
|
+
getQuestionFromIdentifiers,
|
|
207
211
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"valuateExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/simplifying/valuateExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"valuateExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/simplifying/valuateExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAcrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAgHF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAkBnD,CAAC"}
|
|
@@ -71,6 +71,9 @@ const getValuateExpressionQuestion = (ops) => {
|
|
|
71
71
|
b,
|
|
72
72
|
monomFirst,
|
|
73
73
|
};
|
|
74
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
75
|
+
};
|
|
76
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
74
77
|
const question = {
|
|
75
78
|
answer: getAnswer(identifiers),
|
|
76
79
|
instruction: getInstruction(identifiers),
|
|
@@ -98,4 +101,5 @@ export const valuateExpression = {
|
|
|
98
101
|
getAnswer,
|
|
99
102
|
answerType: "QCU",
|
|
100
103
|
hasHintAndCorrection: true,
|
|
104
|
+
getQuestionFromIdentifiers,
|
|
101
105
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functionGraphReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/functionGraphReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"functionGraphReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/functionGraphReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAgIF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAkBtD,CAAC;;AAEF,UAAU;AACV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsGE"}
|
|
@@ -109,6 +109,9 @@ const getFunctionGraphReadingQuestion = (opts) => {
|
|
|
109
109
|
xValue = randPoint[0];
|
|
110
110
|
}
|
|
111
111
|
const identifiers = { a, b, yValue, isAskingX, xValue };
|
|
112
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
113
|
+
};
|
|
114
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
112
115
|
const question = {
|
|
113
116
|
answer: getAnswer(identifiers),
|
|
114
117
|
instruction: getInstruction(identifiers),
|
|
@@ -137,6 +140,7 @@ export const functionGraphReading = {
|
|
|
137
140
|
getAnswer,
|
|
138
141
|
getGGBOptions,
|
|
139
142
|
hasGeogebra: true,
|
|
143
|
+
getQuestionFromIdentifiers,
|
|
140
144
|
};
|
|
141
145
|
/***SVG */
|
|
142
146
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pieChartReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/pieChartReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"pieChartReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/pieChartReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAuBrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAuLF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAkBjD,CAAC"}
|
|
@@ -138,6 +138,9 @@ const getPieChartReadingQuestion = (opts) => {
|
|
|
138
138
|
labels,
|
|
139
139
|
points,
|
|
140
140
|
};
|
|
141
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
142
|
+
};
|
|
143
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
141
144
|
const question = {
|
|
142
145
|
answer: getAnswer(identifiers),
|
|
143
146
|
instruction: getInstruction(identifiers),
|
|
@@ -166,4 +169,5 @@ export const pieChartReading = {
|
|
|
166
169
|
getAnswer,
|
|
167
170
|
getGGBOptions,
|
|
168
171
|
hasGeogebra: true,
|
|
172
|
+
getQuestionFromIdentifiers,
|
|
169
173
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pythagoreOrThales.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidian/pythagoreOrThales.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"pythagoreOrThales.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidian/pythagoreOrThales.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAkBtC,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IAEzB,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IACtC,OAAO,EAAE,MAAM,EAAE,CAAC;CAQnB,CAAC;AAoNF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAsBnD,CAAC"}
|
|
@@ -162,6 +162,9 @@ const getPythagoreOrThalesQuestion = (opts) => {
|
|
|
162
162
|
isAskingLength,
|
|
163
163
|
isSegmentHeight,
|
|
164
164
|
};
|
|
165
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
166
|
+
};
|
|
167
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
165
168
|
const question = {
|
|
166
169
|
answer: getAnswer(identifiers),
|
|
167
170
|
instruction: getInstruction(identifiers),
|
|
@@ -194,6 +197,7 @@ export const pythagoreOrThales = {
|
|
|
194
197
|
pdfOptions: {
|
|
195
198
|
shouldSpreadPropositions: true,
|
|
196
199
|
},
|
|
200
|
+
getQuestionFromIdentifiers,
|
|
197
201
|
};
|
|
198
202
|
const getSubTriangle = ({ triangle, insidePointsNames, ratio, isPapillon, }) => {
|
|
199
203
|
const [A, B, C] = triangle.points;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linesRelativePositions.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/lines/linesRelativePositions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"linesRelativePositions.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/lines/linesRelativePositions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAE/D,WAAW,EAAE,MAAM,CAAC;CAKrB,CAAC;AAoJF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAoBxD,CAAC"}
|
|
@@ -107,6 +107,9 @@ const getLinesRelativePositionsQuestion = (opts) => {
|
|
|
107
107
|
const lines = [d1, d2, d3, d4, d5];
|
|
108
108
|
const coupleAsked = randint(0, 4);
|
|
109
109
|
const identifiers = { lines, coupleAsked };
|
|
110
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
111
|
+
};
|
|
112
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
110
113
|
const question = {
|
|
111
114
|
answer: getAnswer(identifiers),
|
|
112
115
|
instruction: getInstruction(identifiers),
|
|
@@ -137,4 +140,5 @@ export const linesRelativePositions = {
|
|
|
137
140
|
hasGeogebra: true,
|
|
138
141
|
maxAllowedQuestions: 4,
|
|
139
142
|
answerType: "QCU",
|
|
143
|
+
getQuestionFromIdentifiers,
|
|
140
144
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { TriangleIdentifiers } from "../../../../math/geometry/triangle.js";
|
|
2
3
|
type Identifiers = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
yB: number;
|
|
8
|
-
xC: number;
|
|
9
|
-
yC: number;
|
|
10
|
-
factor: number;
|
|
4
|
+
ratio: number;
|
|
5
|
+
triangleIdentifiers: TriangleIdentifiers;
|
|
6
|
+
insidePointsNames: string[];
|
|
7
|
+
isPapillon: boolean;
|
|
11
8
|
};
|
|
12
|
-
|
|
9
|
+
type Options = {
|
|
10
|
+
configurationType: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const thales: Exercise<Identifiers, Options>;
|
|
13
13
|
export {};
|
|
14
14
|
//# sourceMappingURL=thales.d.ts.map
|