math-exercises 3.0.29 → 3.0.31
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/arithmetics/euclideanDivision.js +2 -2
- 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 -2
- 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/fractionsSumsPrimeDenominators.js +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.js +1 -1
- 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/fractions/periodicWritingToFraction.js +1 -1
- package/lib/exercises/math/calcul/fractions/simplifyFraction.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/simplifyFraction.js +19 -10
- 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/allIdentities.js +3 -3
- package/lib/exercises/math/calculLitteral/distributivity/doubleDistri.d.ts +8 -0
- package/lib/exercises/math/calculLitteral/distributivity/doubleDistri.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/distributivity/doubleDistri.js +155 -0
- package/lib/exercises/math/calculLitteral/distributivity/idRmq1.d.ts +11 -0
- package/lib/exercises/math/calculLitteral/distributivity/idRmq1.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/distributivity/idRmq1.js +147 -0
- package/lib/exercises/math/calculLitteral/distributivity/idRmq2.d.ts +11 -0
- package/lib/exercises/math/calculLitteral/distributivity/idRmq2.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/distributivity/idRmq2.js +150 -0
- package/lib/exercises/math/calculLitteral/distributivity/idRmq3.d.ts +11 -0
- package/lib/exercises/math/calculLitteral/distributivity/idRmq3.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/distributivity/idRmq3.js +143 -0
- package/lib/exercises/math/calculLitteral/distributivity/index.d.ts +5 -5
- package/lib/exercises/math/calculLitteral/distributivity/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/index.js +5 -5
- 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/distributivity/simpleDistriXCoeff.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/simpleDistriXCoeff.js +1 -0
- package/lib/exercises/math/calculLitteral/equation/equa1.d.ts +11 -0
- package/lib/exercises/math/calculLitteral/equation/equa1.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/equation/equa1.js +111 -0
- package/lib/exercises/math/calculLitteral/equation/equa2.d.ts +17 -0
- package/lib/exercises/math/calculLitteral/equation/equa2.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/equation/equa2.js +164 -0
- package/lib/exercises/math/calculLitteral/equation/equa3.d.ts +12 -0
- package/lib/exercises/math/calculLitteral/equation/equa3.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/equation/equa3.js +113 -0
- package/lib/exercises/math/calculLitteral/equation/equa4.d.ts +13 -0
- package/lib/exercises/math/calculLitteral/equation/equa4.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/equation/equa4.js +106 -0
- package/lib/exercises/math/calculLitteral/equation/index.d.ts +4 -4
- package/lib/exercises/math/calculLitteral/equation/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/index.js +4 -4
- 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/derivation/derivative/expDerivativeOne.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/expDerivativeOne.js +0 -6
- package/lib/exercises/math/derivation/derivative/powerFunctionDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/powerFunctionDerivative.js +30 -0
- package/lib/exercises/math/functions/affines/leadingCoefficient.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/leadingCoefficient.js +26 -11
- package/lib/exercises/math/functions/logarithm/logSimplifiying.js +1 -1
- package/lib/exercises/math/geometry/areas/rightTriangleArea.d.ts +1 -1
- package/lib/exercises/math/geometry/areas/rightTriangleArea.d.ts.map +1 -1
- package/lib/exercises/math/geometry/areas/rightTriangleArea.js +1 -1
- package/lib/exercises/math/geometry/areas/triangleArea.d.ts +1 -1
- package/lib/exercises/math/geometry/areas/triangleArea.d.ts.map +1 -1
- package/lib/exercises/math/geometry/areas/triangleArea.js +1 -1
- package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.js +6 -2
- package/lib/exercises/math/geometry/index.d.ts +1 -0
- package/lib/exercises/math/geometry/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/index.js +1 -1
- 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/pythagore/pythagore.d.ts +1 -1
- package/lib/exercises/math/geometry/pythagore/pythagore.d.ts.map +1 -1
- package/lib/exercises/math/geometry/pythagore/pythagore.js +1 -1
- package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts +1 -1
- package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts.map +1 -1
- package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.js +1 -1
- package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.d.ts +4 -4
- package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.d.ts.map +1 -1
- package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.js +4 -4
- package/lib/exercises/math/geometry/thales/thales.d.ts +1 -1
- package/lib/exercises/math/geometry/thales/thales.d.ts.map +1 -1
- package/lib/exercises/math/geometry/thales/thales.js +1 -1
- package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts +1 -1
- package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts.map +1 -1
- package/lib/exercises/math/geometry/thales/thalesCalcul.js +1 -1
- package/lib/exercises/math/geometry/triangles/index.d.ts +1 -1
- package/lib/exercises/math/geometry/triangles/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/triangles/index.js +2 -1
- package/lib/exercises/math/geometry/triangles/triangleNature.d.ts +9 -0
- package/lib/exercises/math/geometry/triangles/triangleNature.d.ts.map +1 -0
- package/lib/exercises/math/geometry/triangles/triangleNature.js +121 -0
- package/lib/exercises/math/geometry/triangles/triangleThirdAngleValue.d.ts +9 -0
- package/lib/exercises/math/geometry/triangles/triangleThirdAngleValue.d.ts.map +1 -0
- package/lib/exercises/math/geometry/triangles/triangleThirdAngleValue.js +134 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaNorms.d.ts +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaNorms.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaNorms.js +1 -1
- 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/percent/percentToDecimal.js +2 -2
- 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/exercises/math/squareRoots/simpifySquareRoot.js +1 -1
- package/lib/exercises/math/squareRoots/squareRootsProducts.js +1 -1
- package/lib/exercises/math/trigonometry/trigonometry.d.ts +1 -1
- package/lib/exercises/math/trigonometry/trigonometry.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/trigonometry.js +1 -1
- package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.d.ts +1 -1
- package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.js +1 -1
- package/lib/exercises/math/trigonometry/trigonometrySideCalcul.d.ts +1 -1
- package/lib/exercises/math/trigonometry/trigonometrySideCalcul.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/trigonometrySideCalcul.js +2 -2
- package/lib/exercises/pc/index.d.ts +4 -4
- package/lib/exercises/pc/index.d.ts.map +1 -1
- package/lib/exercises/pc/index.js +4 -4
- package/lib/index.d.ts +23 -15
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/angle.d.ts +6 -0
- package/lib/math/geometry/angle.d.ts.map +1 -1
- package/lib/math/geometry/angle.js +20 -7
- package/lib/math/geometry/quadrilaterals/parallelogram.d.ts +23 -0
- package/lib/math/geometry/quadrilaterals/parallelogram.d.ts.map +1 -0
- package/lib/math/geometry/quadrilaterals/parallelogram.js +65 -0
- package/lib/math/geometry/quadrilaterals/quadrilateral.d.ts +15 -0
- package/lib/math/geometry/quadrilaterals/quadrilateral.d.ts.map +1 -0
- package/lib/math/geometry/quadrilaterals/quadrilateral.js +38 -0
- package/lib/math/geometry/quadrilaterals/rectangle.d.ts +24 -0
- package/lib/math/geometry/quadrilaterals/rectangle.d.ts.map +1 -0
- package/lib/math/geometry/quadrilaterals/rectangle.js +59 -0
- package/lib/math/geometry/quadrilaterals/rhombus.d.ts +19 -0
- package/lib/math/geometry/quadrilaterals/rhombus.d.ts.map +1 -0
- package/lib/math/geometry/quadrilaterals/rhombus.js +41 -0
- package/lib/math/geometry/quadrilaterals/square.d.ts +22 -0
- package/lib/math/geometry/quadrilaterals/square.d.ts.map +1 -0
- package/lib/math/geometry/quadrilaterals/square.js +38 -0
- package/lib/math/geometry/triangles/equilateralTriangle.d.ts +21 -0
- package/lib/math/geometry/triangles/equilateralTriangle.d.ts.map +1 -0
- package/lib/math/geometry/triangles/equilateralTriangle.js +52 -0
- package/lib/math/geometry/triangles/isoceleTriangle.d.ts +23 -0
- package/lib/math/geometry/triangles/isoceleTriangle.d.ts.map +1 -0
- package/lib/math/geometry/triangles/isoceleTriangle.js +66 -0
- package/lib/math/geometry/triangles/rightTriangle.d.ts +31 -0
- package/lib/math/geometry/triangles/rightTriangle.d.ts.map +1 -0
- package/lib/math/geometry/triangles/rightTriangle.js +108 -0
- package/lib/math/geometry/triangles/triangle.d.ts +68 -0
- package/lib/math/geometry/triangles/triangle.d.ts.map +1 -0
- package/lib/math/geometry/triangles/triangle.js +240 -0
- package/package.json +1 -1
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { equationKeys } from "../../../../exercises/utils/keys/equationKeys.js";
|
|
4
|
+
import { Affine } from "../../../../math/polynomials/affine.js";
|
|
5
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
6
|
+
import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
|
|
7
|
+
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
8
|
+
import { EqualNode } from "../../../../tree/nodes/equations/equalNode.js";
|
|
9
|
+
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
10
|
+
import { AddNode } from "../../../../tree/nodes/operators/addNode.js";
|
|
11
|
+
import { equationVEA } from "../../../../exercises/vea/equationVEA.js";
|
|
12
|
+
const getInstruction = (identifiers) => {
|
|
13
|
+
const { a, b } = identifiers;
|
|
14
|
+
const affine = new Affine(1, a).toTree();
|
|
15
|
+
const tree = new EqualNode(affine, new NumberNode(b));
|
|
16
|
+
const statementTree = tree.toTex();
|
|
17
|
+
return `Résoudre :
|
|
18
|
+
|
|
19
|
+
$$
|
|
20
|
+
${statementTree}
|
|
21
|
+
$$`;
|
|
22
|
+
};
|
|
23
|
+
const getAnswer = (identifiers) => {
|
|
24
|
+
const { a, b } = identifiers;
|
|
25
|
+
const solution = b - a;
|
|
26
|
+
const answer = `x=${solution}`;
|
|
27
|
+
return answer;
|
|
28
|
+
};
|
|
29
|
+
const getHint = (identifiers) => {
|
|
30
|
+
const { a, b } = identifiers;
|
|
31
|
+
return `Il faut isoler $x$ à gauche. Pour cela, effectue l'opération des deux côtés de l'équation qui permet de supprimer le terme $${a < 0 ? "" : "+"}${a}$.`;
|
|
32
|
+
};
|
|
33
|
+
const getCorrection = (identifiers) => {
|
|
34
|
+
const { a, b } = identifiers;
|
|
35
|
+
const affine = new Affine(1, a).toTree();
|
|
36
|
+
const tree = new EqualNode(affine, new NumberNode(b));
|
|
37
|
+
const statementTree = tree.toTex();
|
|
38
|
+
const answer = getAnswer(identifiers);
|
|
39
|
+
return `Pour isoler $x$ à gauche, on effectue l'opération $${a > 0 ? `-${a}` : `+${Math.abs(a)}`}$ des deux côtés de l'équation :
|
|
40
|
+
|
|
41
|
+
${alignTex([
|
|
42
|
+
[
|
|
43
|
+
`${statementTree}`,
|
|
44
|
+
"\\iff",
|
|
45
|
+
new EqualNode(new AddNode(affine, new NumberNode(-a)), new AddNode(b.toTree(), new NumberNode(-a))).toTex(),
|
|
46
|
+
],
|
|
47
|
+
["", "\\iff", answer],
|
|
48
|
+
])}`;
|
|
49
|
+
};
|
|
50
|
+
const getStartStatement = (identifiers) => {
|
|
51
|
+
const { a, b } = identifiers;
|
|
52
|
+
const affine = new Affine(1, a).toTree();
|
|
53
|
+
const tree = new EqualNode(affine, new NumberNode(b));
|
|
54
|
+
const statementTree = tree.toTex();
|
|
55
|
+
return statementTree;
|
|
56
|
+
};
|
|
57
|
+
const getEquationType1ExerciseQuestion = () => {
|
|
58
|
+
const b = randint(-10, 11);
|
|
59
|
+
const a = randint(-10, 11, [0]);
|
|
60
|
+
const identifiers = { a, b };
|
|
61
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
62
|
+
};
|
|
63
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
64
|
+
const question = {
|
|
65
|
+
instruction: getInstruction(identifiers),
|
|
66
|
+
startStatement: getStartStatement(identifiers),
|
|
67
|
+
answer: getAnswer(identifiers),
|
|
68
|
+
keys: equationKeys,
|
|
69
|
+
answerFormat: "tex",
|
|
70
|
+
identifiers,
|
|
71
|
+
hint: getHint(identifiers),
|
|
72
|
+
correction: getCorrection(identifiers),
|
|
73
|
+
};
|
|
74
|
+
return question;
|
|
75
|
+
};
|
|
76
|
+
const getPropositions = (n, { answer, a, b }) => {
|
|
77
|
+
const propositions = [];
|
|
78
|
+
addValidProp(propositions, answer);
|
|
79
|
+
const solution = b - a;
|
|
80
|
+
tryToAddWrongProp(propositions, `x=${b + a}`);
|
|
81
|
+
while (propositions.length < n) {
|
|
82
|
+
const wrongAnswer = solution + randint(-3, 4, [0]);
|
|
83
|
+
tryToAddWrongProp(propositions, `x=${wrongAnswer}`);
|
|
84
|
+
}
|
|
85
|
+
return shuffle(propositions);
|
|
86
|
+
};
|
|
87
|
+
const isAnswerValid = (ans, { a, b }) => {
|
|
88
|
+
const solution = (b - a).toTree().toTex();
|
|
89
|
+
return equationVEA(ans, solution);
|
|
90
|
+
};
|
|
91
|
+
export const equationType1Exercise = {
|
|
92
|
+
id: "equa1",
|
|
93
|
+
connector: "\\iff",
|
|
94
|
+
label: "Résoudre une équation du type $x+a = b$",
|
|
95
|
+
levels: ["4ème", "3ème", "2nde", "CAP", "2ndPro", "1rePro", "1reTech"],
|
|
96
|
+
sections: ["Équations"],
|
|
97
|
+
isSingleStep: true,
|
|
98
|
+
generator: (nb) => getDistinctQuestions(getEquationType1ExerciseQuestion, nb),
|
|
99
|
+
getPropositions,
|
|
100
|
+
qcmTimer: 60,
|
|
101
|
+
freeTimer: 60,
|
|
102
|
+
isAnswerValid,
|
|
103
|
+
subject: "Mathématiques",
|
|
104
|
+
hasHintAndCorrection: true,
|
|
105
|
+
getCorrection,
|
|
106
|
+
getHint,
|
|
107
|
+
getInstruction,
|
|
108
|
+
getAnswer,
|
|
109
|
+
getStartStatement,
|
|
110
|
+
getQuestionFromIdentifiers,
|
|
111
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
|
|
3
|
+
/**
|
|
4
|
+
* type ax=b
|
|
5
|
+
*/
|
|
6
|
+
type Identifiers = {
|
|
7
|
+
a: NodeIdentifiers;
|
|
8
|
+
b: NodeIdentifiers;
|
|
9
|
+
isXRight: boolean;
|
|
10
|
+
aNumberType: string;
|
|
11
|
+
};
|
|
12
|
+
type Options = {
|
|
13
|
+
aNumberType: string[];
|
|
14
|
+
};
|
|
15
|
+
export declare const equationType2Exercise: Exercise<Identifiers, Options>;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=equa2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"equa2.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equa2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAsBrC,OAAO,EAEL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAM7C;;GAEG;AAGH,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,eAAe,CAAC;IACnB,CAAC,EAAE,eAAe,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AA0JF,KAAK,OAAO,GAAG;IACb,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAaF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAuBhE,CAAC"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { equationKeys } from "../../../../exercises/utils/keys/equationKeys.js";
|
|
4
|
+
import { RationalConstructor, } from "../../../../math/numbers/rationals/rational.js";
|
|
5
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
6
|
+
import { EqualNode, equal } from "../../../../tree/nodes/equations/equalNode.js";
|
|
7
|
+
import { VariableNode } from "../../../../tree/nodes/variables/variableNode.js";
|
|
8
|
+
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
9
|
+
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
10
|
+
import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
11
|
+
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
12
|
+
import { random } from "../../../../utils/alea/random.js";
|
|
13
|
+
import { GeneralAffine } from "../../../../math/polynomials/generalAffine.js";
|
|
14
|
+
import { NodeConstructor, reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
15
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
16
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
17
|
+
import { equationVEA } from "../../../../exercises/vea/equationVEA.js";
|
|
18
|
+
const rebuildIdentifiers = (oldIdentifiers) => {
|
|
19
|
+
if (!!oldIdentifiers.aNumberType)
|
|
20
|
+
return oldIdentifiers;
|
|
21
|
+
return {
|
|
22
|
+
a: oldIdentifiers.a.toTree().toIdentifiers(),
|
|
23
|
+
b: oldIdentifiers.b.toTree().toIdentifiers(),
|
|
24
|
+
isXRight: false,
|
|
25
|
+
aNumberType: "Entier",
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
const getInstruction = (identifiers) => {
|
|
29
|
+
return `Résoudre :
|
|
30
|
+
|
|
31
|
+
$$
|
|
32
|
+
${getStatementNode(identifiers).toTex()}
|
|
33
|
+
$$`;
|
|
34
|
+
};
|
|
35
|
+
const getAnswer = (identifiers) => {
|
|
36
|
+
const { a, b, isXRight, aNumberType } = identifiers;
|
|
37
|
+
const aTree = reifyAlgebraic(a);
|
|
38
|
+
const bTree = reifyAlgebraic(b);
|
|
39
|
+
const solution = frac(bTree, aTree).simplify();
|
|
40
|
+
const answer = new EqualNode(new VariableNode("x"), solution).toTex();
|
|
41
|
+
return answer;
|
|
42
|
+
};
|
|
43
|
+
const getHint = (identifiers) => {
|
|
44
|
+
const { a, b, isXRight, aNumberType } = identifiers;
|
|
45
|
+
const aTree = reifyAlgebraic(a);
|
|
46
|
+
const bTree = reifyAlgebraic(b);
|
|
47
|
+
return `Il faut isoler $x$ à ${isXRight ? "droite" : "gauche"}. Pour cela, effectue l'opération des deux côtés de l'équation qui permet de supprimer la multiplication par $${aTree.toTex()}$.`;
|
|
48
|
+
};
|
|
49
|
+
const getCorrection = (identifiers) => {
|
|
50
|
+
const { a, b, isXRight, aNumberType } = identifiers;
|
|
51
|
+
const aTree = reifyAlgebraic(a);
|
|
52
|
+
const bTree = reifyAlgebraic(b);
|
|
53
|
+
const affine = new GeneralAffine(aTree, 0).toTree();
|
|
54
|
+
const equalTree = new EqualNode(affine, bTree);
|
|
55
|
+
const tree = isXRight ? equalTree.reverse() : equalTree;
|
|
56
|
+
const answer = getAnswer(identifiers);
|
|
57
|
+
return `Pour isoler $x$ à ${isXRight ? "droite" : "gauche"}, on divise les deux côtés de l'équation par $${aTree.toTex()}$ :
|
|
58
|
+
|
|
59
|
+
${alignTex([
|
|
60
|
+
[
|
|
61
|
+
`${tree.toTex()}`,
|
|
62
|
+
"\\iff",
|
|
63
|
+
isXRight
|
|
64
|
+
? equal(frac(bTree, aTree), frac(affine, aTree)).toTex()
|
|
65
|
+
: equal(frac(affine, aTree), frac(bTree, aTree)).toTex(),
|
|
66
|
+
],
|
|
67
|
+
["", "\\iff", answer],
|
|
68
|
+
])}
|
|
69
|
+
`;
|
|
70
|
+
};
|
|
71
|
+
const getStatementNode = (identifiers) => {
|
|
72
|
+
const { a, b, isXRight, aNumberType } = identifiers;
|
|
73
|
+
const aTree = reifyAlgebraic(a);
|
|
74
|
+
const bTree = reifyAlgebraic(b);
|
|
75
|
+
const affine = new GeneralAffine(aTree, 0).toTree();
|
|
76
|
+
const equalTree = new EqualNode(affine, bTree);
|
|
77
|
+
const tree = isXRight ? equalTree.reverse() : equalTree;
|
|
78
|
+
return tree;
|
|
79
|
+
};
|
|
80
|
+
const getStartStatement = (identifiers) => {
|
|
81
|
+
return getStatementNode(identifiers).toTex();
|
|
82
|
+
};
|
|
83
|
+
const getEquationType2ExerciseQuestion = (opts) => {
|
|
84
|
+
const types = opts?.aNumberType ?? ["Entier"];
|
|
85
|
+
const b = randint(-10, 11).toTree();
|
|
86
|
+
const type = random(types);
|
|
87
|
+
const a = type === "Entier"
|
|
88
|
+
? randint(-9, 10, [0, 1]).toTree()
|
|
89
|
+
: RationalConstructor.randomIrreductibleWithSign().toTree();
|
|
90
|
+
const isXRight = coinFlip();
|
|
91
|
+
const identifiers = {
|
|
92
|
+
a: a.toIdentifiers(),
|
|
93
|
+
b: b.toIdentifiers(),
|
|
94
|
+
isXRight,
|
|
95
|
+
aNumberType: type,
|
|
96
|
+
};
|
|
97
|
+
return getQuestionFromIdentifiers(identifiers, opts);
|
|
98
|
+
};
|
|
99
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
100
|
+
const question = {
|
|
101
|
+
instruction: getInstruction(identifiers, opts),
|
|
102
|
+
startStatement: getStartStatement(identifiers, opts),
|
|
103
|
+
answer: getAnswer(identifiers, opts),
|
|
104
|
+
keys: equationKeys,
|
|
105
|
+
answerFormat: "tex",
|
|
106
|
+
identifiers,
|
|
107
|
+
hint: getHint(identifiers, opts),
|
|
108
|
+
correction: getCorrection(identifiers, opts),
|
|
109
|
+
};
|
|
110
|
+
return question;
|
|
111
|
+
};
|
|
112
|
+
const getPropositions = (n, { answer, a, b }) => {
|
|
113
|
+
const aNode = NodeConstructor.fromIdentifiers(a);
|
|
114
|
+
const bNode = NodeConstructor.fromIdentifiers(b);
|
|
115
|
+
const propositions = [];
|
|
116
|
+
addValidProp(propositions, answer);
|
|
117
|
+
tryToAddWrongProp(propositions, substract(bNode, aNode).simplify().toTex());
|
|
118
|
+
while (propositions.length < n) {
|
|
119
|
+
const bEv = randint(-7, 8, [0, -bNode.evaluate()]);
|
|
120
|
+
const a = add(aNode, randint(-7, 8, [-aNode.evaluate(), 0]));
|
|
121
|
+
const wrongAnswer = frac(bEv, a).simplify();
|
|
122
|
+
tryToAddWrongProp(propositions, new EqualNode(new VariableNode("x"), wrongAnswer).toTex());
|
|
123
|
+
}
|
|
124
|
+
return shuffle(propositions);
|
|
125
|
+
};
|
|
126
|
+
const isAnswerValid = (ans, { a, b }) => {
|
|
127
|
+
const aNode = NodeConstructor.fromIdentifiers(a);
|
|
128
|
+
const bNode = NodeConstructor.fromIdentifiers(b);
|
|
129
|
+
const solution = frac(bNode, aNode).simplify().toTex();
|
|
130
|
+
return equationVEA(ans, solution);
|
|
131
|
+
};
|
|
132
|
+
const options = [
|
|
133
|
+
{
|
|
134
|
+
id: "aNumberType",
|
|
135
|
+
label: "Type du coefficient $a$",
|
|
136
|
+
target: GeneratorOptionTarget.generation,
|
|
137
|
+
type: GeneratorOptionType.multiselect,
|
|
138
|
+
defaultValue: ["Entier"],
|
|
139
|
+
values: ["Entier", "Rationnel"],
|
|
140
|
+
},
|
|
141
|
+
];
|
|
142
|
+
export const equationType2Exercise = {
|
|
143
|
+
id: "equa2",
|
|
144
|
+
connector: "\\iff",
|
|
145
|
+
label: "Résoudre une équation du type $ax=b$",
|
|
146
|
+
levels: ["4ème", "3ème", "2nde", "CAP", "2ndPro", "1rePro", "1reTech"],
|
|
147
|
+
sections: ["Équations"],
|
|
148
|
+
isSingleStep: true,
|
|
149
|
+
generator: (nb, opts) => getDistinctQuestions(() => getEquationType2ExerciseQuestion(opts), nb),
|
|
150
|
+
qcmTimer: 60,
|
|
151
|
+
freeTimer: 60,
|
|
152
|
+
getPropositions,
|
|
153
|
+
isAnswerValid,
|
|
154
|
+
subject: "Mathématiques",
|
|
155
|
+
hasHintAndCorrection: true,
|
|
156
|
+
options,
|
|
157
|
+
getCorrection,
|
|
158
|
+
getHint,
|
|
159
|
+
getInstruction,
|
|
160
|
+
getAnswer,
|
|
161
|
+
getStartStatement,
|
|
162
|
+
rebuildIdentifiers,
|
|
163
|
+
getQuestionFromIdentifiers,
|
|
164
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
/**
|
|
3
|
+
* type ax+b=c
|
|
4
|
+
*/
|
|
5
|
+
type Identifiers = {
|
|
6
|
+
a: number;
|
|
7
|
+
b: number;
|
|
8
|
+
c: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const equationType3Exercise: Exercise<Identifiers>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=equa3.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"equa3.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equa3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAerC;;GAEG;AACH,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAuGF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAsBvD,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { equationKeys } from "../../../../exercises/utils/keys/equationKeys.js";
|
|
4
|
+
import { Rational } from "../../../../math/numbers/rationals/rational.js";
|
|
5
|
+
import { Affine } from "../../../../math/polynomials/affine.js";
|
|
6
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
7
|
+
import { EqualNode } from "../../../../tree/nodes/equations/equalNode.js";
|
|
8
|
+
import { VariableNode } from "../../../../tree/nodes/variables/variableNode.js";
|
|
9
|
+
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
10
|
+
import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
|
|
11
|
+
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
12
|
+
import { MultiplyNode } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
13
|
+
import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
14
|
+
import { equationVEA } from "../../../../exercises/vea/equationVEA.js";
|
|
15
|
+
const getStatementNode = (identifiers) => {
|
|
16
|
+
const { a, b, c } = identifiers;
|
|
17
|
+
const affine = new Affine(a, b).toTree();
|
|
18
|
+
const statementTree = new EqualNode(affine, new NumberNode(c));
|
|
19
|
+
return statementTree;
|
|
20
|
+
};
|
|
21
|
+
const getInstruction = (identifiers) => {
|
|
22
|
+
return `Résoudre :
|
|
23
|
+
|
|
24
|
+
$$
|
|
25
|
+
${getStatementNode(identifiers).toTex()}
|
|
26
|
+
$$`;
|
|
27
|
+
};
|
|
28
|
+
const getHint = (identifiers) => {
|
|
29
|
+
return "Isolez le terme $x$ dans la partie gauche de l'équation.";
|
|
30
|
+
};
|
|
31
|
+
const getCorrection = (identifiers) => {
|
|
32
|
+
const { a, b, c } = identifiers;
|
|
33
|
+
const statementTex = getStatementNode(identifiers).toTex();
|
|
34
|
+
const answer = getAnswer(identifiers);
|
|
35
|
+
return `Commencer par soustraire $${b}$ des deux côtés de l'équation pour
|
|
36
|
+
l'éliminer du côté gauche. Ensuite, diviser les deux côtés de l'équation par
|
|
37
|
+
$${a}$ pour isoler $x$, ce qui donne :
|
|
38
|
+
|
|
39
|
+
${alignTex([
|
|
40
|
+
[
|
|
41
|
+
statementTex,
|
|
42
|
+
"\\iff",
|
|
43
|
+
new EqualNode(new MultiplyNode(a.toTree(), new VariableNode("x")), (c - b).toTree()).toTex(),
|
|
44
|
+
],
|
|
45
|
+
["", "\\iff", answer],
|
|
46
|
+
])}`;
|
|
47
|
+
};
|
|
48
|
+
const getStartStatement = (identifiers) => {
|
|
49
|
+
return getStatementNode(identifiers).toTex();
|
|
50
|
+
};
|
|
51
|
+
const getAnswer = (identifiers) => {
|
|
52
|
+
const { a, b, c } = identifiers;
|
|
53
|
+
const solution = new Rational(c - b, a).simplify();
|
|
54
|
+
const answerTree = new EqualNode(new VariableNode("x"), solution.toTree());
|
|
55
|
+
const answer = answerTree.toTex();
|
|
56
|
+
return answer;
|
|
57
|
+
};
|
|
58
|
+
const getEquationType3ExerciseQuestion = () => {
|
|
59
|
+
const b = randint(-10, 11, [0]);
|
|
60
|
+
const a = randint(-10, 11, [0, 1]);
|
|
61
|
+
const c = randint(-10, 11);
|
|
62
|
+
const identifiers = { a, b, c };
|
|
63
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
64
|
+
};
|
|
65
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
66
|
+
const question = {
|
|
67
|
+
instruction: getInstruction(identifiers),
|
|
68
|
+
hint: getHint(identifiers),
|
|
69
|
+
correction: getCorrection(identifiers),
|
|
70
|
+
startStatement: getStartStatement(identifiers),
|
|
71
|
+
answer: getAnswer(identifiers),
|
|
72
|
+
keys: equationKeys,
|
|
73
|
+
answerFormat: "tex",
|
|
74
|
+
identifiers,
|
|
75
|
+
};
|
|
76
|
+
return question;
|
|
77
|
+
};
|
|
78
|
+
const getPropositions = (n, { answer, a, b, c }) => {
|
|
79
|
+
const propositions = [];
|
|
80
|
+
addValidProp(propositions, answer);
|
|
81
|
+
while (propositions.length < n) {
|
|
82
|
+
const wrongAnswer = new Rational(c - b + randint(-7, 8, [0, -c + b]), a + randint(-7, 8, [-a, 0])).simplify();
|
|
83
|
+
tryToAddWrongProp(propositions, new EqualNode(new VariableNode("x"), wrongAnswer.toTree()).toTex());
|
|
84
|
+
}
|
|
85
|
+
return shuffle(propositions);
|
|
86
|
+
};
|
|
87
|
+
const isAnswerValid = (ans, { answer, a, b, c }) => {
|
|
88
|
+
const solution = frac(c - b, a)
|
|
89
|
+
.simplify()
|
|
90
|
+
.toTex();
|
|
91
|
+
return equationVEA(ans, solution);
|
|
92
|
+
};
|
|
93
|
+
export const equationType3Exercise = {
|
|
94
|
+
id: "equa3",
|
|
95
|
+
connector: "\\iff",
|
|
96
|
+
label: "Résoudre une équation du type $ax+b=c$",
|
|
97
|
+
levels: ["4ème", "3ème", "2nde", "CAP", "2ndPro", "1rePro", "1reTech"],
|
|
98
|
+
sections: ["Équations"],
|
|
99
|
+
isSingleStep: false,
|
|
100
|
+
generator: (nb) => getDistinctQuestions(getEquationType3ExerciseQuestion, nb),
|
|
101
|
+
qcmTimer: 60,
|
|
102
|
+
freeTimer: 60,
|
|
103
|
+
getPropositions,
|
|
104
|
+
isAnswerValid,
|
|
105
|
+
subject: "Mathématiques",
|
|
106
|
+
hasHintAndCorrection: true,
|
|
107
|
+
getAnswer,
|
|
108
|
+
getInstruction,
|
|
109
|
+
getCorrection,
|
|
110
|
+
getHint,
|
|
111
|
+
getStartStatement,
|
|
112
|
+
getQuestionFromIdentifiers,
|
|
113
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
/**
|
|
3
|
+
* type ax+b=cx+d
|
|
4
|
+
*/
|
|
5
|
+
type Identifiers = {
|
|
6
|
+
a: number;
|
|
7
|
+
b: number;
|
|
8
|
+
c: number;
|
|
9
|
+
d: number;
|
|
10
|
+
};
|
|
11
|
+
export declare const equationType4Exercise: Exercise<Identifiers>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=equa4.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"equa4.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equa4.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAkBrC;;GAEG;AAEH,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAkGF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAoBvD,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { equationKeys } from "../../../../exercises/utils/keys/equationKeys.js";
|
|
4
|
+
import { Rational } from "../../../../math/numbers/rationals/rational.js";
|
|
5
|
+
import { Affine } from "../../../../math/polynomials/affine.js";
|
|
6
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
7
|
+
import { EqualNode, equationResolutionTex, } from "../../../../tree/nodes/equations/equalNode.js";
|
|
8
|
+
import { VariableNode } from "../../../../tree/nodes/variables/variableNode.js";
|
|
9
|
+
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
10
|
+
import { equationVEA } from "../../../../exercises/vea/equationVEA.js";
|
|
11
|
+
import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
12
|
+
const getStatementNode = (identifiers) => {
|
|
13
|
+
const { a, b, c, d } = identifiers;
|
|
14
|
+
const affines = [new Affine(a, b), new Affine(c, d)];
|
|
15
|
+
const statementTree = new EqualNode(affines[0].toTree(), affines[1].toTree());
|
|
16
|
+
return statementTree;
|
|
17
|
+
};
|
|
18
|
+
const getInstruction = (identifiers) => {
|
|
19
|
+
return `Résoudre :
|
|
20
|
+
|
|
21
|
+
$$
|
|
22
|
+
${getStatementNode(identifiers).toTex()}
|
|
23
|
+
$$`;
|
|
24
|
+
};
|
|
25
|
+
const getStartStatement = (identifiers) => {
|
|
26
|
+
return getStatementNode(identifiers).toTex();
|
|
27
|
+
};
|
|
28
|
+
const getAnswer = (identifiers) => {
|
|
29
|
+
const { a, b, c, d } = identifiers;
|
|
30
|
+
const solution = new Rational(d - b, a - c).simplify();
|
|
31
|
+
const answerTree = new EqualNode(new VariableNode("x"), solution.toTree());
|
|
32
|
+
const answer = answerTree.toTex();
|
|
33
|
+
return answer;
|
|
34
|
+
};
|
|
35
|
+
const getEquationType4ExerciseQuestion = () => {
|
|
36
|
+
const a = randint(-10, 11, [0, 1]);
|
|
37
|
+
const b = randint(-10, 11, [0]);
|
|
38
|
+
const c = randint(-10, 11, [0, a]);
|
|
39
|
+
const d = randint(-10, 11, [0]);
|
|
40
|
+
const identifiers = {
|
|
41
|
+
a,
|
|
42
|
+
b,
|
|
43
|
+
c,
|
|
44
|
+
d,
|
|
45
|
+
};
|
|
46
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
47
|
+
};
|
|
48
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
49
|
+
const question = {
|
|
50
|
+
instruction: getInstruction(identifiers),
|
|
51
|
+
startStatement: getStartStatement(identifiers),
|
|
52
|
+
answer: getAnswer(identifiers),
|
|
53
|
+
keys: equationKeys,
|
|
54
|
+
answerFormat: "tex",
|
|
55
|
+
identifiers,
|
|
56
|
+
hint: getHint(identifiers),
|
|
57
|
+
correction: getCorrection(identifiers),
|
|
58
|
+
};
|
|
59
|
+
return question;
|
|
60
|
+
};
|
|
61
|
+
const getHint = (identifiers) => {
|
|
62
|
+
return `Commence par regrouper les termes en $x$ d'un même côté de l'équation. Puis, isole $x$ en effectuant les bonnes opérations.`;
|
|
63
|
+
};
|
|
64
|
+
const getCorrection = (identifiers) => {
|
|
65
|
+
const { a, b, c, d } = identifiers;
|
|
66
|
+
return `On regroupe les nombres d'un côté, et les termes en $x$ de l'autre :
|
|
67
|
+
|
|
68
|
+
$$
|
|
69
|
+
${equationResolutionTex(a.toTree(), b.toTree(), c.toTree(), d.toTree())}
|
|
70
|
+
$$`;
|
|
71
|
+
};
|
|
72
|
+
const getPropositions = (n, { answer, a, b, c, d }) => {
|
|
73
|
+
const propositions = [];
|
|
74
|
+
addValidProp(propositions, answer);
|
|
75
|
+
while (propositions.length < n) {
|
|
76
|
+
const wrongAnswer = new Rational(d - b + randint(-7, 8, [0, -d + b]), a - c + randint(-7, 8, [-a + c, 0])).simplify();
|
|
77
|
+
tryToAddWrongProp(propositions, new EqualNode(new VariableNode("x"), wrongAnswer.toTree()).toTex());
|
|
78
|
+
}
|
|
79
|
+
return shuffle(propositions);
|
|
80
|
+
};
|
|
81
|
+
const isAnswerValid = (ans, { a, b, c, d }) => {
|
|
82
|
+
const solution = frac(d - b, a - c)
|
|
83
|
+
.simplify()
|
|
84
|
+
.toTex();
|
|
85
|
+
return equationVEA(ans, solution);
|
|
86
|
+
};
|
|
87
|
+
export const equationType4Exercise = {
|
|
88
|
+
id: "equa4",
|
|
89
|
+
connector: "\\iff",
|
|
90
|
+
label: "Résoudre une équation du type $ax+b=cx+d$",
|
|
91
|
+
levels: ["4ème", "3ème", "2nde", "CAP", "2ndPro", "1rePro", "1reTech"],
|
|
92
|
+
sections: ["Équations"],
|
|
93
|
+
isSingleStep: false,
|
|
94
|
+
generator: (nb) => getDistinctQuestions(getEquationType4ExerciseQuestion, nb),
|
|
95
|
+
qcmTimer: 60,
|
|
96
|
+
freeTimer: 60,
|
|
97
|
+
getPropositions,
|
|
98
|
+
isAnswerValid,
|
|
99
|
+
subject: "Mathématiques",
|
|
100
|
+
getInstruction,
|
|
101
|
+
getAnswer,
|
|
102
|
+
getQuestionFromIdentifiers,
|
|
103
|
+
getHint,
|
|
104
|
+
getCorrection,
|
|
105
|
+
hasHintAndCorrection: true,
|
|
106
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export * from "./equationSimpleSquare.js";
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./
|
|
2
|
+
export * from "./equa1.js";
|
|
3
|
+
export * from "./equa2.js";
|
|
4
|
+
export * from "./equa3.js";
|
|
5
|
+
export * from "./equa4.js";
|
|
6
6
|
export * from "./fractionEquation.js";
|
|
7
7
|
export * from "./multiplicationEquation.js";
|
|
8
8
|
export * from "./firstDegreeEquation.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iCAAiC,CAAC;AAChD,cAAc,oCAAoC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export * from "./equationSimpleSquare.js";
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./
|
|
2
|
+
export * from "./equa1.js";
|
|
3
|
+
export * from "./equa2.js";
|
|
4
|
+
export * from "./equa3.js";
|
|
5
|
+
export * from "./equa4.js";
|
|
6
6
|
export * from "./fractionEquation.js";
|
|
7
7
|
export * from "./multiplicationEquation.js";
|
|
8
8
|
export * from "./firstDegreeEquation.js";
|
|
@@ -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
|
/**
|