math-exercises 3.0.71 → 3.0.73
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 +3 -1
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/getParityBetweenTwoNumbers.d.ts +9 -0
- package/lib/exercises/math/calcul/arithmetics/getParityBetweenTwoNumbers.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/getParityBetweenTwoNumbers.js +114 -0
- package/lib/exercises/math/calcul/arithmetics/imageOfSquareFunction.d.ts +8 -0
- package/lib/exercises/math/calcul/arithmetics/imageOfSquareFunction.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/imageOfSquareFunction.js +152 -0
- package/lib/exercises/math/calcul/arithmetics/index.d.ts +9 -0
- package/lib/exercises/math/calcul/arithmetics/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/index.js +9 -0
- package/lib/exercises/math/calcul/arithmetics/isInequalityTrue.d.ts +15 -0
- package/lib/exercises/math/calcul/arithmetics/isInequalityTrue.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/isInequalityTrue.js +143 -0
- package/lib/exercises/math/calcul/arithmetics/isPointOnCubicFunction.d.ts +9 -0
- package/lib/exercises/math/calcul/arithmetics/isPointOnCubicFunction.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/isPointOnCubicFunction.js +111 -0
- package/lib/exercises/math/calcul/arithmetics/isPointOnFunction.d.ts +10 -0
- package/lib/exercises/math/calcul/arithmetics/isPointOnFunction.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/isPointOnFunction.js +133 -0
- package/lib/exercises/math/calcul/arithmetics/isPointOnReciprocalFunction.d.ts +9 -0
- package/lib/exercises/math/calcul/arithmetics/isPointOnReciprocalFunction.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/isPointOnReciprocalFunction.js +117 -0
- package/lib/exercises/math/calcul/arithmetics/minNumberInequality.d.ts +13 -0
- package/lib/exercises/math/calcul/arithmetics/minNumberInequality.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/minNumberInequality.js +192 -0
- package/lib/exercises/math/calcul/arithmetics/primeNumberIdentification.d.ts +7 -0
- package/lib/exercises/math/calcul/arithmetics/primeNumberIdentification.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/primeNumberIdentification.js +84 -0
- package/lib/exercises/math/calcul/arithmetics/squareRootCalculation.d.ts +8 -0
- package/lib/exercises/math/calcul/arithmetics/squareRootCalculation.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/squareRootCalculation.js +107 -0
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerSum.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerSum.js +37 -0
- package/lib/exercises/math/calcul/fractions/fractionToPercentToDecimal.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionToPercentToDecimal.js +57 -6
- package/lib/exercises/math/calcul/fractions/fractionsOperations.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsOperations.js +64 -22
- package/lib/exercises/math/calcul/fractions/fractionsSubstraction.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSubstraction.js +143 -4
- package/lib/exercises/math/calcul/fractions/fractionsSum.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSum.js +141 -3
- 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 +3 -3
- package/lib/exercises/math/calcul/fractions/powerNotation.d.ts +9 -0
- package/lib/exercises/math/calcul/fractions/powerNotation.d.ts.map +1 -0
- package/lib/exercises/math/calcul/fractions/powerNotation.js +125 -0
- package/lib/exercises/math/calcul/proportionality/proportionalityTable.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/proportionalityTable.js +29 -5
- package/lib/exercises/math/calcul/sign/absoluteNumber.d.ts +7 -0
- package/lib/exercises/math/calcul/sign/absoluteNumber.d.ts.map +1 -0
- package/lib/exercises/math/calcul/sign/absoluteNumber.js +80 -0
- package/lib/exercises/math/calcul/sign/index.d.ts +1 -0
- package/lib/exercises/math/calcul/sign/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/sign/index.js +1 -0
- package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.js +67 -21
- package/lib/exercises/math/calculLitteral/equation/equa3.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equa3.js +0 -2
- package/lib/exercises/math/calculLitteral/equation/equationWithDistributivity.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationWithDistributivity.js +53 -9
- package/lib/exercises/math/calculLitteral/equation/factorizeEquation.d.ts +9 -0
- package/lib/exercises/math/calculLitteral/equation/factorizeEquation.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/equation/factorizeEquation.js +145 -0
- package/lib/exercises/math/calculLitteral/equation/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/equation/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/index.js +1 -0
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType2.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType2.js +32 -4
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.js +30 -2
- package/lib/exercises/math/calculLitteral/inequations/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/inequations/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/inequations/index.js +1 -0
- package/lib/exercises/math/calculLitteral/inequations/inequationsSign.d.ts +9 -0
- package/lib/exercises/math/calculLitteral/inequations/inequationsSign.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/inequations/inequationsSign.js +75 -0
- package/lib/exercises/math/calculLitteral/inequations/inverseInequality.d.ts +9 -0
- package/lib/exercises/math/calculLitteral/inequations/inverseInequality.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/inequations/inverseInequality.js +120 -0
- package/lib/exercises/math/calculLitteral/simplifying/distributeAndSimplify.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/simplifying/distributeAndSimplify.js +43 -1
- package/lib/exercises/math/curve/index.d.ts +3 -0
- package/lib/exercises/math/curve/index.d.ts.map +1 -0
- package/lib/exercises/math/curve/index.js +2 -0
- package/lib/exercises/math/curve/sqrtCurvePoint.d.ts +8 -0
- package/lib/exercises/math/curve/sqrtCurvePoint.d.ts.map +1 -0
- package/lib/exercises/math/curve/sqrtCurvePoint.js +132 -0
- package/lib/exercises/math/curve/squareCurvePoint.d.ts +8 -0
- package/lib/exercises/math/curve/squareCurvePoint.d.ts.map +1 -0
- package/lib/exercises/math/curve/squareCurvePoint.js +133 -0
- package/lib/exercises/math/functions/absolute/index.d.ts +2 -0
- package/lib/exercises/math/functions/absolute/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/absolute/index.js +2 -0
- package/lib/exercises/math/functions/absolute/removeAbsNotation.d.ts +8 -0
- package/lib/exercises/math/functions/absolute/removeAbsNotation.d.ts.map +1 -0
- package/lib/exercises/math/functions/absolute/removeAbsNotation.js +105 -0
- package/lib/exercises/math/functions/absolute/removeAbsNotationSign.d.ts +8 -0
- package/lib/exercises/math/functions/absolute/removeAbsNotationSign.d.ts.map +1 -0
- package/lib/exercises/math/functions/absolute/removeAbsNotationSign.js +108 -0
- package/lib/exercises/math/functions/affines/affineExpressionReading.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineExpressionReading.js +36 -0
- package/lib/exercises/math/functions/basics/index.d.ts +1 -0
- package/lib/exercises/math/functions/basics/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/index.js +1 -0
- package/lib/exercises/math/functions/basics/valueTableCompletion.d.ts +7 -0
- package/lib/exercises/math/functions/basics/valueTableCompletion.d.ts.map +1 -0
- package/lib/exercises/math/functions/basics/valueTableCompletion.js +78 -0
- package/lib/exercises/math/functions/cube/imageOfCubeFunction.d.ts +8 -0
- package/lib/exercises/math/functions/cube/imageOfCubeFunction.d.ts.map +1 -0
- package/lib/exercises/math/functions/cube/imageOfCubeFunction.js +142 -0
- package/lib/exercises/math/functions/cube/index.d.ts +1 -0
- package/lib/exercises/math/functions/cube/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/cube/index.js +1 -0
- package/lib/exercises/math/functions/square/getImageOfSquareRootFunction.d.ts +8 -0
- package/lib/exercises/math/functions/square/getImageOfSquareRootFunction.d.ts.map +1 -0
- package/lib/exercises/math/functions/square/getImageOfSquareRootFunction.js +128 -0
- package/lib/exercises/math/functions/square/index.d.ts +1 -0
- package/lib/exercises/math/functions/square/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/square/index.js +1 -0
- package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.js +32 -2
- package/lib/exercises/math/index.d.ts +1 -0
- package/lib/exercises/math/index.d.ts.map +1 -1
- package/lib/exercises/math/index.js +1 -0
- package/lib/exercises/math/powers/decimalToScientific.d.ts.map +1 -1
- package/lib/exercises/math/powers/decimalToScientific.js +0 -1
- package/lib/exercises/math/powers/powersMixOperations.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersMixOperations.js +0 -1
- package/lib/exercises/math/probaStat/ballsBasicProbas.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/ballsBasicProbas.js +1 -3
- package/lib/exercises/math/probaStat/stats1var/median.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/median.js +2 -11
- package/lib/exercises/math/probaStat/stats1var/medianList.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/medianList.js +2 -10
- package/lib/exercises/math/probaStat/stats1var/quartilesList.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/quartilesList.js +3 -9
- package/lib/exercises/math/python/index.d.ts +2 -0
- package/lib/exercises/math/python/index.d.ts.map +1 -1
- package/lib/exercises/math/python/index.js +2 -0
- package/lib/exercises/math/python/pyIfElseCondition.d.ts +8 -0
- package/lib/exercises/math/python/pyIfElseCondition.d.ts.map +1 -0
- package/lib/exercises/math/python/pyIfElseCondition.js +133 -0
- package/lib/exercises/math/python/variableType.d.ts +8 -0
- package/lib/exercises/math/python/variableType.d.ts.map +1 -0
- package/lib/exercises/math/python/variableType.js +118 -0
- package/lib/exercises/math/python/whileLoop.js +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticExplicitFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticExplicitFormulaUsage.js +1 -0
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindReason.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindReason.js +2 -1
- package/lib/exercises/math/sets/intervals/inequalityToInterval.d.ts.map +1 -1
- package/lib/exercises/math/sets/intervals/inequalityToInterval.js +21 -0
- package/lib/exercises/math/sets/intervals/intervalToInequality.d.ts.map +1 -1
- package/lib/exercises/math/sets/intervals/intervalToInequality.js +20 -0
- package/lib/exercises/math/sets/intervals/intervalsUnion.d.ts.map +1 -1
- package/lib/exercises/math/sets/intervals/intervalsUnion.js +19 -0
- package/lib/exercises/math/sets/setBelonging.d.ts.map +1 -1
- package/lib/exercises/math/sets/setBelonging.js +24 -0
- package/lib/exercises/pc/chemicalElements/weightPercent.d.ts.map +1 -1
- package/lib/exercises/pc/chemicalElements/weightPercent.js +0 -1
- package/lib/exercises/utils/getDistinctQuestions.d.ts.map +1 -1
- package/lib/exercises/utils/getDistinctQuestions.js +6 -0
- package/lib/index.d.ts +71 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/latexTester.d.ts.map +1 -1
- package/lib/latexTester.js +5 -2
- package/lib/math/numbers/decimals/decimal.d.ts +1 -1
- package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
- package/lib/math/numbers/decimals/decimal.js +5 -2
- package/lib/math/utils/stats/median.d.ts +2 -0
- package/lib/math/utils/stats/median.d.ts.map +1 -0
- package/lib/math/utils/stats/median.js +39 -0
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +5 -6
- package/lib/tests/pdfExo.test.d.ts.map +1 -1
- package/lib/tests/pdfExo.test.js +2 -2
- package/lib/tests/pdfs/mdCodeToLatex.d.ts.map +1 -1
- package/lib/tests/pdfs/mdCodeToLatex.js +10 -0
- package/lib/tests/pdfs/quizPdfPreambule.js +1 -1
- package/lib/tree/nodes/algebraicNode.d.ts +2 -0
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/nodeConstructor.js +1 -1
- package/lib/tree/nodes/numbers/numberNode.js +2 -2
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +10 -4
- package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/powerNode.js +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { randint } from "../../../math/utils/random/randint.js";
|
|
4
|
+
import { handleVEAError } from "../../../utils/errors/handleVEAError.js";
|
|
5
|
+
const getPropositions = (n, { answer }) => {
|
|
6
|
+
const propositions = [];
|
|
7
|
+
addValidProp(propositions, answer, "raw");
|
|
8
|
+
tryToAddWrongProp(propositions, "Nombre entier", "raw");
|
|
9
|
+
tryToAddWrongProp(propositions, "Nombre flottant", "raw");
|
|
10
|
+
tryToAddWrongProp(propositions, "Chaine de caractères", "raw");
|
|
11
|
+
return shuffleProps(propositions, n);
|
|
12
|
+
};
|
|
13
|
+
const getAnswer = (identifiers) => {
|
|
14
|
+
const { v, vType } = identifiers;
|
|
15
|
+
if (vType === "int") {
|
|
16
|
+
return "Nombre entier";
|
|
17
|
+
}
|
|
18
|
+
else if (vType === "float") {
|
|
19
|
+
return "Nombre flottant";
|
|
20
|
+
}
|
|
21
|
+
else if (vType === "str") {
|
|
22
|
+
return "Chaine de caractères";
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
throw new Error(`Unknown type: ${vType}`);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const getInstruction = (identifiers) => {
|
|
29
|
+
const { v, vType } = identifiers;
|
|
30
|
+
return `On exécute le script en Python ci-dessous :\n
|
|
31
|
+
\`\`\`python
|
|
32
|
+
v = ${vType === "str" ? `"${v}"` : v}
|
|
33
|
+
\`\`\`
|
|
34
|
+
\n
|
|
35
|
+
Quel est le type de la variable var ?
|
|
36
|
+
`;
|
|
37
|
+
};
|
|
38
|
+
const getHint = (identifiers) => {
|
|
39
|
+
return "En Python, le type d'une variable peut être : un nombre entier, un nombre flottant (c'est à dire avec une virgule), ou une chaîne de caractère (c'est à dire un texte).";
|
|
40
|
+
};
|
|
41
|
+
const getCorrection = (identifiers) => {
|
|
42
|
+
const { v, vType } = identifiers;
|
|
43
|
+
let explanationType = "";
|
|
44
|
+
if (vType === "int") {
|
|
45
|
+
explanationType = "Nombre entier";
|
|
46
|
+
}
|
|
47
|
+
else if (vType === "float") {
|
|
48
|
+
explanationType = "Nombre flottant";
|
|
49
|
+
}
|
|
50
|
+
else if (vType === "str") {
|
|
51
|
+
explanationType = "Chaine de caractères";
|
|
52
|
+
}
|
|
53
|
+
return `En Python, le type d'une variable peut être : un nombre entier, un nombre flottant (c'est à dire avec une virgule), ou une chaîne de caractère (c'est à dire un texte).
|
|
54
|
+
|
|
55
|
+
Ici, la variable \`v\` est de type ${explanationType.toLocaleLowerCase()}.`;
|
|
56
|
+
};
|
|
57
|
+
const getKeys = (identifiers) => {
|
|
58
|
+
return [];
|
|
59
|
+
};
|
|
60
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
61
|
+
try {
|
|
62
|
+
throw Error("VEA not implemented");
|
|
63
|
+
}
|
|
64
|
+
catch (err) {
|
|
65
|
+
return handleVEAError(err);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
const getVariableTypeQuestion = (ops) => {
|
|
69
|
+
const vTypes = ["int", "float", "str"];
|
|
70
|
+
const vType = vTypes[randint(0, vTypes.length)];
|
|
71
|
+
let v;
|
|
72
|
+
if (vType === "int") {
|
|
73
|
+
v = randint(0, 100);
|
|
74
|
+
}
|
|
75
|
+
else if (vType === "float") {
|
|
76
|
+
v = randint(0, 100) + Math.random().toFixed(2);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
const chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
80
|
+
const length = randint(3, 8);
|
|
81
|
+
let result = "";
|
|
82
|
+
for (let i = 0; i < length; i++) {
|
|
83
|
+
result += chars.charAt(randint(0, chars.length));
|
|
84
|
+
}
|
|
85
|
+
v = result;
|
|
86
|
+
}
|
|
87
|
+
const identifiers = { v, vType };
|
|
88
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
89
|
+
};
|
|
90
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
91
|
+
return {
|
|
92
|
+
answer: getAnswer(identifiers),
|
|
93
|
+
instruction: getInstruction(identifiers),
|
|
94
|
+
keys: getKeys(identifiers),
|
|
95
|
+
answerFormat: "raw",
|
|
96
|
+
identifiers,
|
|
97
|
+
hint: getHint(identifiers),
|
|
98
|
+
correction: getCorrection(identifiers),
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
export const variableType = {
|
|
102
|
+
id: "variableType",
|
|
103
|
+
label: "Déterminer le type d’une variable en Python",
|
|
104
|
+
isSingleStep: true,
|
|
105
|
+
generator: (nb, opts) => getDistinctQuestions(() => getVariableTypeQuestion(opts), nb),
|
|
106
|
+
qcmTimer: 60,
|
|
107
|
+
freeTimer: 60,
|
|
108
|
+
getPropositions,
|
|
109
|
+
isAnswerValid,
|
|
110
|
+
subject: "Mathématiques",
|
|
111
|
+
getInstruction,
|
|
112
|
+
getHint,
|
|
113
|
+
getCorrection,
|
|
114
|
+
getAnswer,
|
|
115
|
+
getQuestionFromIdentifiers,
|
|
116
|
+
hasHintAndCorrection: true,
|
|
117
|
+
answerType: "QCU",
|
|
118
|
+
};
|
|
@@ -17,7 +17,7 @@ const getAnswer = (identifiers) => {
|
|
|
17
17
|
const getInstruction = (identifiers) => {
|
|
18
18
|
const { a, initialValue, iterations, opIndex, step, x } = identifiers;
|
|
19
19
|
const op = operations[opIndex];
|
|
20
|
-
return `Qu'affichera le programme suivant ?
|
|
20
|
+
return `Qu'affichera le programme suivant \`var\` ?
|
|
21
21
|
\`\`\`
|
|
22
22
|
a = ${a}
|
|
23
23
|
n = ${initialValue}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arithmeticExplicitFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticExplicitFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;
|
|
1
|
+
{"version":3,"file":"arithmeticExplicitFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticExplicitFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA4FF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,CAchE,CAAC"}
|
|
@@ -71,6 +71,7 @@ const getPropositions = (n, { answer, firstValue, askedRank, reason }) => {
|
|
|
71
71
|
const isAnswerValid = (ans, { answer, askedRank }) => {
|
|
72
72
|
return [
|
|
73
73
|
answer,
|
|
74
|
+
`u${askedRank}=${answer}`,
|
|
74
75
|
`u_${askedRank}=${answer}`,
|
|
75
76
|
`u_{${askedRank}}=${answer}`,
|
|
76
77
|
].includes(ans);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arithmeticFindReason.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticFindReason.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"arithmeticFindReason.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticFindReason.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA0EF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAiBtD,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { numberVEA } from "../../../../exercises/vea/numberVEA.js";
|
|
3
4
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
4
5
|
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
5
6
|
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
@@ -63,7 +64,7 @@ const getPropositions = (n, { answer }) => {
|
|
|
63
64
|
return shuffle(propositions);
|
|
64
65
|
};
|
|
65
66
|
const isAnswerValid = (ans, { answer }) => {
|
|
66
|
-
return ans
|
|
67
|
+
return numberVEA(ans, answer);
|
|
67
68
|
};
|
|
68
69
|
export const arithmeticFindReason = {
|
|
69
70
|
id: "arithmeticFindReason",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inequalityToInterval.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sets/intervals/inequalityToInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"inequalityToInterval.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sets/intervals/inequalityToInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAQrC,OAAO,EAGL,uBAAuB,EACxB,MAAM,uCAAuC,CAAC;AAK/C,KAAK,WAAW,GAAG;IAIjB,mBAAmB,EAAE,uBAAuB,CAAC;CAC9C,CAAC;AAwIF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAetD,CAAC"}
|
|
@@ -41,6 +41,24 @@ const getInequalityToIntervalQuestion = () => {
|
|
|
41
41
|
};
|
|
42
42
|
return getQuestionFromIdentifiers(identifiers);
|
|
43
43
|
};
|
|
44
|
+
const getHint = (identifiers) => {
|
|
45
|
+
return `
|
|
46
|
+
- L'intervalle $[a;b]$ représente l'ensemble des nombres $x$ compris entre $a$ et $b$ inclus.
|
|
47
|
+
- L'intervalle $]a;b[$ représente l'ensemble des nombres $x$ compris entre $a$ et $b$ exclus.
|
|
48
|
+
- L'intervalle $[a;b[$ représente l'ensemble des nombres $x$ compris entre $a$ inclus et $b$ exclus.
|
|
49
|
+
- L'intervalle $]a;b]$ représente l'ensemble des nombres $x$ compris entre $a$ exclus et $b$ inclus.
|
|
50
|
+
- L'intervalle $]-\\infty; b]$ représente l'ensemble des nombres inférieurs ou égaux à $b$.
|
|
51
|
+
- L'intervalle $[a; +\\infty[$ représente l'ensemble des nombres supérieurs ou égaux à $a$.
|
|
52
|
+
`;
|
|
53
|
+
};
|
|
54
|
+
const getCorrection = (identifiers) => {
|
|
55
|
+
const { intervalIdentifiers } = identifiers;
|
|
56
|
+
const interval = IntervalNodeConstructor.fromIdentifiers(identifiers.intervalIdentifiers);
|
|
57
|
+
const inequality = interval.toInequality();
|
|
58
|
+
return `Si $${inequality.toTex()}$, alors $x$ est ${interval.toText(true, false)}.
|
|
59
|
+
|
|
60
|
+
On a donc $${inequality.toTex()} \\iff ${getAnswer(identifiers)}$.`;
|
|
61
|
+
};
|
|
44
62
|
const getQuestionFromIdentifiers = (identifiers) => {
|
|
45
63
|
const question = {
|
|
46
64
|
answer: getAnswer(identifiers),
|
|
@@ -59,6 +77,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
59
77
|
],
|
|
60
78
|
answerFormat: "tex",
|
|
61
79
|
identifiers,
|
|
80
|
+
hint: getHint(identifiers),
|
|
81
|
+
correction: getCorrection(identifiers),
|
|
62
82
|
};
|
|
63
83
|
return question;
|
|
64
84
|
};
|
|
@@ -96,4 +116,5 @@ export const inequalityToInterval = {
|
|
|
96
116
|
subject: "Mathématiques",
|
|
97
117
|
rebuildIdentifiers,
|
|
98
118
|
getQuestionFromIdentifiers,
|
|
119
|
+
hasHintAndCorrection: true,
|
|
99
120
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intervalToInequality.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sets/intervals/intervalToInequality.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"intervalToInequality.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sets/intervals/intervalToInequality.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAWrC,OAAO,EAGL,uBAAuB,EACxB,MAAM,uCAAuC,CAAC;AAM/C,KAAK,WAAW,GAAG;IAIjB,mBAAmB,EAAE,uBAAuB,CAAC;CAC9C,CAAC;AAqHF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAetD,CAAC"}
|
|
@@ -39,6 +39,23 @@ const getIntervalToInequalityQuestion = () => {
|
|
|
39
39
|
};
|
|
40
40
|
return getQuestionFromIdentifiers(identifiers);
|
|
41
41
|
};
|
|
42
|
+
const getHint = (identifiers) => {
|
|
43
|
+
return `
|
|
44
|
+
- L'intervalle $[a;b]$ représente l'ensemble des nombres $x$ compris entre $a$ et $b$ inclus.
|
|
45
|
+
- L'intervalle $]a;b[$ représente l'ensemble des nombres $x$ compris entre $a$ et $b$ exclus.
|
|
46
|
+
- L'intervalle $[a;b[$ représente l'ensemble des nombres $x$ compris entre $a$ inclus et $b$ exclus.
|
|
47
|
+
- L'intervalle $]a;b]$ représente l'ensemble des nombres $x$ compris entre $a$ exclus et $b$ inclus.
|
|
48
|
+
- L'intervalle $]-\\infty; b]$ représente l'ensemble des nombres inférieurs ou égaux à $b$.
|
|
49
|
+
- L'intervalle $[a; +\\infty[$ représente l'ensemble des nombres supérieurs ou égaux à $a$.
|
|
50
|
+
`;
|
|
51
|
+
};
|
|
52
|
+
const getCorrection = (identifiers) => {
|
|
53
|
+
const { intervalIdentifiers } = identifiers;
|
|
54
|
+
const interval = IntervalNodeConstructor.fromIdentifiers(identifiers.intervalIdentifiers);
|
|
55
|
+
return `L'intervalle $${interval.toTex()}$ représente tous les nombres ${interval.toText(true, false)}.
|
|
56
|
+
|
|
57
|
+
On a donc $x\\in ${interval.toTex()} \\iff ${getAnswer(identifiers)}$.`;
|
|
58
|
+
};
|
|
42
59
|
const getQuestionFromIdentifiers = (identifiers) => {
|
|
43
60
|
const question = {
|
|
44
61
|
answer: getAnswer(identifiers),
|
|
@@ -46,6 +63,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
46
63
|
keys: ["x", "inf", "sup", "geq", "leq", "infty"],
|
|
47
64
|
answerFormat: "tex",
|
|
48
65
|
identifiers,
|
|
66
|
+
hint: getHint(identifiers),
|
|
67
|
+
correction: getCorrection(identifiers),
|
|
49
68
|
};
|
|
50
69
|
return question;
|
|
51
70
|
};
|
|
@@ -78,4 +97,5 @@ export const intervalToInequality = {
|
|
|
78
97
|
subject: "Mathématiques",
|
|
79
98
|
rebuildIdentifiers,
|
|
80
99
|
getQuestionFromIdentifiers,
|
|
100
|
+
hasHintAndCorrection: true,
|
|
81
101
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intervalsUnion.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sets/intervals/intervalsUnion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"intervalsUnion.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sets/intervals/intervalsUnion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAGL,uBAAuB,EACxB,MAAM,uCAAuC,CAAC;AAK/C,KAAK,WAAW,GAAG;IAOjB,eAAe,EAAE,uBAAuB,CAAC;IACzC,eAAe,EAAE,uBAAuB,CAAC;CAC1C,CAAC;AAwIF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAehD,CAAC"}
|
|
@@ -73,6 +73,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
73
73
|
keys: ["infty", "lbracket", "rbracket", "semicolon", "cup", "cap"],
|
|
74
74
|
answerFormat: "tex",
|
|
75
75
|
identifiers,
|
|
76
|
+
hint: getHint(identifiers),
|
|
77
|
+
correction: getCorrection(identifiers),
|
|
76
78
|
};
|
|
77
79
|
return question;
|
|
78
80
|
};
|
|
@@ -101,6 +103,22 @@ const isAnswerValid = (ans, { answer }) => {
|
|
|
101
103
|
return handleVEAError(err);
|
|
102
104
|
}
|
|
103
105
|
};
|
|
106
|
+
const getCorrection = (identifiers) => {
|
|
107
|
+
const [int1, int2] = [
|
|
108
|
+
IntervalNodeConstructor.fromIdentifiers(identifiers.int1Identifiers),
|
|
109
|
+
IntervalNodeConstructor.fromIdentifiers(identifiers.int2Identifiers),
|
|
110
|
+
];
|
|
111
|
+
const union = int1.union(int2);
|
|
112
|
+
const answer = union.toTex();
|
|
113
|
+
return `$I$ contient les nombres ${int1.toText(true, false)}.
|
|
114
|
+
|
|
115
|
+
$J$ contient les nombres ${int2.toText(false, false)}.
|
|
116
|
+
|
|
117
|
+
$I\\cup J$ contient donc l'ensemble de ces nombres : c'est à dire $I\\cup J = ${answer}$.`;
|
|
118
|
+
};
|
|
119
|
+
const getHint = (identifiers) => {
|
|
120
|
+
return `Détermine l'ensemble des nombres qui appartiennent à $I$ et/ou à $J$.`;
|
|
121
|
+
};
|
|
104
122
|
export const intervalsUnion = {
|
|
105
123
|
id: "intervalsUnion",
|
|
106
124
|
connector: "=",
|
|
@@ -114,4 +132,5 @@ export const intervalsUnion = {
|
|
|
114
132
|
subject: "Mathématiques",
|
|
115
133
|
rebuildIdentifiers,
|
|
116
134
|
getQuestionFromIdentifiers,
|
|
135
|
+
hasHintAndCorrection: true,
|
|
117
136
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setBelonging.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sets/setBelonging.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"setBelonging.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sets/setBelonging.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAuHF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAiB9C,CAAC"}
|
|
@@ -25,6 +25,27 @@ const getAnswer = (identifiers) => {
|
|
|
25
25
|
}
|
|
26
26
|
return "";
|
|
27
27
|
};
|
|
28
|
+
const getHint = (identifiers) => {
|
|
29
|
+
return `
|
|
30
|
+
- $\\mathbb{N}$ est l'ensemble des nombres naturels (c'est à dire les nombres entiers positifs) ;
|
|
31
|
+
- $\\mathbb{Z}$ est l'ensemble des nombres relatifs (c'est à dire les nombres entiers positifs et négatifs) ;
|
|
32
|
+
- $\\mathbb{D}$ est l'ensemble des nombres décimaux (c'est à dire les nombres à virgule avec un nombre fini de chiffres après la virgule)
|
|
33
|
+
- $\\mathbb{Q}$ est l'ensemble des nombres rationnels (c'est à dire les fractions de numérateur et dénominateur entiers)
|
|
34
|
+
- $\\mathbb{R}$ est l'ensemble des nombres réels (c'est à dire l'ensemble des nombres qu'on peut placer sur une droite graduée)
|
|
35
|
+
`;
|
|
36
|
+
};
|
|
37
|
+
const getCorrection = (identifiers) => {
|
|
38
|
+
const { nb, type } = identifiers;
|
|
39
|
+
const sets = ["N", "Z", "D", "Q", "R"];
|
|
40
|
+
const labels = [
|
|
41
|
+
"nombre entier positif",
|
|
42
|
+
"nombre entier négatif",
|
|
43
|
+
"nombre décimal",
|
|
44
|
+
"nombre rationnel",
|
|
45
|
+
"nombre réel",
|
|
46
|
+
];
|
|
47
|
+
return `$${nb}$ est un ${labels[type]}. On a donc $x \\in ${getAnswer(identifiers)}$.`;
|
|
48
|
+
};
|
|
28
49
|
const getIdentifiers = (prevIdentifiers) => {
|
|
29
50
|
//N Z D Q R (racine2, pi)
|
|
30
51
|
//fraction simplifiable en décimal/entier
|
|
@@ -68,6 +89,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
68
89
|
keys: getKeys(identifiers),
|
|
69
90
|
answerFormat: "tex",
|
|
70
91
|
identifiers,
|
|
92
|
+
hint: getHint(identifiers),
|
|
93
|
+
correction: getCorrection(identifiers),
|
|
71
94
|
};
|
|
72
95
|
};
|
|
73
96
|
const getSetBelongingQuestion = () => {
|
|
@@ -105,4 +128,5 @@ export const setBelonging = {
|
|
|
105
128
|
getAnswer,
|
|
106
129
|
getQuestionFromIdentifiers,
|
|
107
130
|
hotFix,
|
|
131
|
+
hasHintAndCorrection: true,
|
|
108
132
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"weightPercent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/chemicalElements/weightPercent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;
|
|
1
|
+
{"version":3,"file":"weightPercent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/chemicalElements/weightPercent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AA6IF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAY/C,CAAC"}
|
|
@@ -97,7 +97,6 @@ const getPropositions = (n, { answer, type, elWeight, percent, totalWeight }) =>
|
|
|
97
97
|
while (propositions.length < n) {
|
|
98
98
|
tryToAddWrongProp(propositions, round(randfloat(1, 100), 1).frenchify() + (type === 3 ? "\\%" : "g"));
|
|
99
99
|
}
|
|
100
|
-
console.log("done");
|
|
101
100
|
return shuffleProps(propositions, n);
|
|
102
101
|
};
|
|
103
102
|
//m_A = P_A*m
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDistinctQuestions.d.ts","sourceRoot":"","sources":["../../../src/exercises/utils/getDistinctQuestions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,WAOnD;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,cACpB,MAAM,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,MAC/B,MAAM,QACJ,MAAM,kBACI,CAAC,EAAE,EAAE,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,EAAE,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,OAAO,KAC1E,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"getDistinctQuestions.d.ts","sourceRoot":"","sources":["../../../src/exercises/utils/getDistinctQuestions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,WAOnD;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,cACpB,MAAM,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,MAC/B,MAAM,QACJ,MAAM,kBACI,CAAC,EAAE,EAAE,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,EAAE,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,OAAO,KAC1E,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,EAkBpB,CAAC"}
|
|
@@ -21,10 +21,16 @@ export function equalTab(array1, array2) {
|
|
|
21
21
|
export const getDistinctQuestions = (generator, nb, max, discriminator) => {
|
|
22
22
|
const res = [];
|
|
23
23
|
const trueStop = max === undefined ? nb : Math.min(nb, max);
|
|
24
|
+
const maxAttempts = 1000;
|
|
25
|
+
let attempts = 0;
|
|
24
26
|
for (let i = 0; i < trueStop; i++) {
|
|
25
27
|
let question;
|
|
26
28
|
do {
|
|
27
29
|
question = generator();
|
|
30
|
+
// Coupe si boucle probablement infinie
|
|
31
|
+
// (lorsque le nombre de questions possibles à générer est inférieur à `trueStop`)
|
|
32
|
+
if (attempts++ > maxAttempts)
|
|
33
|
+
throw Error("Possiblement pas assez de questions possibles à generer");
|
|
28
34
|
} while (res.some((q) => compare(q, question, discriminator)));
|
|
29
35
|
res.push(question);
|
|
30
36
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -32,6 +32,41 @@ declare const mathExercises: (Exercise<{
|
|
|
32
32
|
}, {}> | Exercise<{
|
|
33
33
|
a: number;
|
|
34
34
|
b: number;
|
|
35
|
+
}, {}> | Exercise<{
|
|
36
|
+
a: number;
|
|
37
|
+
b: number;
|
|
38
|
+
isAskingParity: boolean;
|
|
39
|
+
}, {}> | Exercise<{
|
|
40
|
+
n: number;
|
|
41
|
+
}, {}> | Exercise<{
|
|
42
|
+
a: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
43
|
+
}, {}> | Exercise<{
|
|
44
|
+
a: number;
|
|
45
|
+
b: number;
|
|
46
|
+
c: number;
|
|
47
|
+
d: number;
|
|
48
|
+
x: number;
|
|
49
|
+
left: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
50
|
+
right: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
51
|
+
inequalitySign: boolean;
|
|
52
|
+
}, {}> | Exercise<{
|
|
53
|
+
aLimit: number;
|
|
54
|
+
bLimit: number;
|
|
55
|
+
x: number;
|
|
56
|
+
y: number;
|
|
57
|
+
case: "lt" | "lte" | "lt_gt";
|
|
58
|
+
expressionToCheck: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
59
|
+
}, {}> | Exercise<{
|
|
60
|
+
x: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
61
|
+
}, {}> | Exercise<{
|
|
62
|
+
x: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
63
|
+
y: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
64
|
+
}, {}> | Exercise<{
|
|
65
|
+
x: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
66
|
+
y: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
67
|
+
}, {}> | Exercise<{
|
|
68
|
+
point: import("./math/geometry/point.js").PointIdentifiers;
|
|
69
|
+
func: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
35
70
|
}, {}> | Exercise<{
|
|
36
71
|
integerFirst: boolean;
|
|
37
72
|
integer: number;
|
|
@@ -102,6 +137,10 @@ declare const mathExercises: (Exercise<{
|
|
|
102
137
|
}, {
|
|
103
138
|
allowNonIrreductible?: boolean;
|
|
104
139
|
}> | Exercise<{
|
|
140
|
+
a: number;
|
|
141
|
+
n: number;
|
|
142
|
+
isSimplified: boolean;
|
|
143
|
+
}, {}> | Exercise<{
|
|
105
144
|
numbers: number[];
|
|
106
145
|
}, {}> | Exercise<{
|
|
107
146
|
rand: number;
|
|
@@ -231,6 +270,8 @@ declare const mathExercises: (Exercise<{
|
|
|
231
270
|
}, {}> | Exercise<{
|
|
232
271
|
a: number;
|
|
233
272
|
sign: number;
|
|
273
|
+
}, {}> | Exercise<{
|
|
274
|
+
n: number;
|
|
234
275
|
}, {}> | Exercise<{
|
|
235
276
|
a: number;
|
|
236
277
|
b: number;
|
|
@@ -350,6 +391,10 @@ declare const mathExercises: (Exercise<{
|
|
|
350
391
|
b: number;
|
|
351
392
|
c?: number;
|
|
352
393
|
type: number;
|
|
394
|
+
}, {}> | Exercise<{
|
|
395
|
+
a: number;
|
|
396
|
+
isSum: boolean;
|
|
397
|
+
b: number;
|
|
353
398
|
}, {}> | Exercise<{
|
|
354
399
|
a: number;
|
|
355
400
|
b: number;
|
|
@@ -409,6 +454,10 @@ declare const mathExercises: (Exercise<{
|
|
|
409
454
|
}> | Exercise<{
|
|
410
455
|
k: number;
|
|
411
456
|
inequationSymbol: import("./math/inequations/inequation.js").InegalitySymbols;
|
|
457
|
+
}, {}> | Exercise<{
|
|
458
|
+
a: number;
|
|
459
|
+
lt: boolean;
|
|
460
|
+
b: number;
|
|
412
461
|
}, {}> | Exercise<{
|
|
413
462
|
rand: boolean;
|
|
414
463
|
poly1: number[];
|
|
@@ -524,6 +573,10 @@ declare const mathExercises: (Exercise<{
|
|
|
524
573
|
hours: number;
|
|
525
574
|
mins: number;
|
|
526
575
|
seconds: number;
|
|
576
|
+
}, {}> | Exercise<{
|
|
577
|
+
point: import("./math/geometry/point.js").PointIdentifiers;
|
|
578
|
+
}, {}> | Exercise<{
|
|
579
|
+
point: import("./math/geometry/point.js").PointIdentifiers;
|
|
527
580
|
}, {}> | Exercise<{
|
|
528
581
|
a: number;
|
|
529
582
|
}, {}> | Exercise<{
|
|
@@ -668,6 +721,12 @@ declare const mathExercises: (Exercise<{
|
|
|
668
721
|
b: number;
|
|
669
722
|
c: number;
|
|
670
723
|
isStrict: boolean;
|
|
724
|
+
}, {}> | Exercise<{
|
|
725
|
+
isSup: boolean;
|
|
726
|
+
n: number;
|
|
727
|
+
}, {}> | Exercise<{
|
|
728
|
+
isSup: boolean;
|
|
729
|
+
n: number;
|
|
671
730
|
}, {}> | Exercise<{
|
|
672
731
|
xA: number;
|
|
673
732
|
yA: number;
|
|
@@ -786,8 +845,12 @@ declare const mathExercises: (Exercise<{
|
|
|
786
845
|
inegalitySymbol: import("./math/inequations/inequation.js").InegalitySymbols;
|
|
787
846
|
a: number;
|
|
788
847
|
b: number;
|
|
848
|
+
}, {}> | Exercise<{
|
|
849
|
+
test: number;
|
|
789
850
|
}, {}> | Exercise<{
|
|
790
851
|
k: number;
|
|
852
|
+
}, {}> | Exercise<{
|
|
853
|
+
a: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
791
854
|
}, {}> | Exercise<{
|
|
792
855
|
a: number;
|
|
793
856
|
b: number;
|
|
@@ -945,6 +1008,8 @@ declare const mathExercises: (Exercise<{
|
|
|
945
1008
|
b: number;
|
|
946
1009
|
closure: import("./tree/nodes/sets/closure.js").ClosureType;
|
|
947
1010
|
type: number;
|
|
1011
|
+
}, {}> | Exercise<{
|
|
1012
|
+
a: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
948
1013
|
}, {}> | Exercise<{
|
|
949
1014
|
lowerBound: number;
|
|
950
1015
|
upperBound: number;
|
|
@@ -2077,6 +2142,12 @@ declare const mathExercises: (Exercise<{
|
|
|
2077
2142
|
op: string;
|
|
2078
2143
|
n: number;
|
|
2079
2144
|
p: number;
|
|
2145
|
+
}, {}> | Exercise<{
|
|
2146
|
+
isCondition: boolean;
|
|
2147
|
+
inputValue: number;
|
|
2148
|
+
}, {}> | Exercise<{
|
|
2149
|
+
v: string | number;
|
|
2150
|
+
vType: string;
|
|
2080
2151
|
}, {}> | Exercise<{
|
|
2081
2152
|
p: number;
|
|
2082
2153
|
n: number;
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,QAAA,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAA+B,CAAC;AACnD,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC"}
|
package/lib/latexTester.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"latexTester.d.ts","sourceRoot":"","sources":["../src/latexTester.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,UAAW,MAAM,
|
|
1
|
+
{"version":3,"file":"latexTester.d.ts","sourceRoot":"","sources":["../src/latexTester.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,UAAW,MAAM,2CAmKxC,CAAC"}
|
package/lib/latexTester.js
CHANGED
|
@@ -99,7 +99,8 @@ export const latexTester = (latex, isDefaultInMathMode = false) => {
|
|
|
99
99
|
if (cmd === "\\begin") {
|
|
100
100
|
//lstlisting
|
|
101
101
|
//array / tabular
|
|
102
|
-
if (substring.startsWith("\\begin{lstlisting}")
|
|
102
|
+
if (substring.startsWith("\\begin{lstlisting}") ||
|
|
103
|
+
substring.startsWith("\\lstInLine")) {
|
|
103
104
|
if (inPython)
|
|
104
105
|
throw new Error("Python not closed");
|
|
105
106
|
inPython = true;
|
|
@@ -142,10 +143,11 @@ export const latexTester = (latex, isDefaultInMathMode = false) => {
|
|
|
142
143
|
throw new Error("Python not closed");
|
|
143
144
|
return true;
|
|
144
145
|
};
|
|
145
|
-
const mustEscapeCharacters = ["%"
|
|
146
|
+
const mustEscapeCharacters = ["%"];
|
|
146
147
|
const mustBeInMath = ["%", "#", "_", "~", "^"];
|
|
147
148
|
const mustBeInArrays = ["&", "\\tabularnewline", "\\hline"];
|
|
148
149
|
const validCmds = [
|
|
150
|
+
"\\lstInLine",
|
|
149
151
|
"\\frac",
|
|
150
152
|
"\\exp",
|
|
151
153
|
"\\cos",
|
|
@@ -233,4 +235,5 @@ const validCmds = [
|
|
|
233
235
|
"\\Rightarrow",
|
|
234
236
|
"\\eta",
|
|
235
237
|
"\\Leftrightarrow",
|
|
238
|
+
"\\lstinline",
|
|
236
239
|
];
|
|
@@ -31,7 +31,7 @@ export declare class Decimal implements Nombre {
|
|
|
31
31
|
toScientificPart(): number;
|
|
32
32
|
toScientificNotation(decimals?: number): NumberNode | MultiplyNode;
|
|
33
33
|
getDigitAtRank(rank: number): number;
|
|
34
|
-
toRational(): Rational | import("../integer/integer.js").Integer;
|
|
34
|
+
toRational(simplify?: boolean): Rational | import("../integer/integer.js").Integer;
|
|
35
35
|
toTree(): NumberNode;
|
|
36
36
|
toPercentNode(): PercentNode;
|
|
37
37
|
toLowerBound(tenthPower: number): Decimal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decimal.d.ts","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B;;;;OAIG;IACH,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAIhC,oBAAoB,CAAC,KAAK,EAAE,MAAM;IAiClC,gBAAgB;IA6BhB,oBAAoB,CAAC,QAAQ,CAAC,EAAE,MAAM;IAuCtC,cAAc,CAAC,IAAI,EAAE,MAAM;IAS3B,UAAU,CAAC,QAAQ,CAAC,EAAE,OAAO;IAQ7B,MAAM;IAIN,aAAa;IAIb,YAAY,CAAC,UAAU,EAAE,MAAM;IAS/B,YAAY,CAAC,UAAU,EAAE,MAAM;CAShC"}
|
|
@@ -173,8 +173,11 @@ export class Decimal {
|
|
|
173
173
|
return Number(this.decimalPart[-rank - 1]);
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
toRational() {
|
|
177
|
-
|
|
176
|
+
toRational(simplify) {
|
|
177
|
+
const ratio = new Rational(this.multiplyByPowerOfTen(this.precision).value, 10 ** this.precision);
|
|
178
|
+
if (simplify)
|
|
179
|
+
return ratio.simplify();
|
|
180
|
+
return ratio;
|
|
178
181
|
}
|
|
179
182
|
toTree() {
|
|
180
183
|
return new NumberNode(this.value, this.tex);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"median.d.ts","sourceRoot":"","sources":["../../../../src/math/utils/stats/median.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,MAAM,iBAAkB,MAAM,EAAE,cAAc,MAAM,EAAE,WAgClE,CAAC"}
|