math-exercises 3.0.72 → 3.0.74
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/divisorsList.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/divisorsList.js +37 -2
- 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 +11 -0
- package/lib/exercises/math/calcul/arithmetics/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/index.js +11 -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/isMultipleOrDivisor.d.ts +9 -0
- package/lib/exercises/math/calcul/arithmetics/isMultipleOrDivisor.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/isMultipleOrDivisor.js +123 -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/paritySumsAndProducts.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/paritySumsAndProducts.js +114 -0
- package/lib/exercises/math/calcul/arithmetics/pgcdCalcul.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/pgcdCalcul.js +28 -1
- package/lib/exercises/math/calcul/arithmetics/ppcmCalcul.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/ppcmCalcul.js +1 -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/primeNumbers.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/primeNumbers.js +37 -2
- 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/arithmetics/whichMultipleAmI.d.ts +9 -0
- package/lib/exercises/math/calcul/arithmetics/whichMultipleAmI.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/whichMultipleAmI.js +131 -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/distributivity/doubleDistributivitySubstract.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivitySubstract.js +52 -4
- package/lib/exercises/math/calculLitteral/distributivity/identitiesWithNonIntegers.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/identitiesWithNonIntegers.js +109 -4
- 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.js +1 -0
- package/lib/exercises/math/functions/basics/inverseImageFunctionTable.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/inverseImageFunctionTable.js +19 -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/cubicEquation.d.ts.map +1 -1
- package/lib/exercises/math/functions/cube/cubicEquation.js +16 -8
- 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/percent/evolutions/findRightCalculForPriceEvolution.d.ts.map +1 -1
- package/lib/exercises/math/percent/evolutions/findRightCalculForPriceEvolution.js +39 -8
- 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/cardBasicProbas.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/cardBasicProbas.js +37 -0
- package/lib/exercises/math/probaStat/issuesCountingForCards.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/issuesCountingForCards.js +27 -0
- package/lib/exercises/math/probaStat/probaFromTableNoContext.d.ts +3 -1
- package/lib/exercises/math/probaStat/probaFromTableNoContext.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaFromTableNoContext.js +126 -7
- package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaFromTableWithContext.js +131 -3
- package/lib/exercises/math/python/index.d.ts +3 -0
- package/lib/exercises/math/python/index.d.ts.map +1 -1
- package/lib/exercises/math/python/index.js +3 -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/python/whileLoopCount.d.ts +8 -0
- package/lib/exercises/math/python/whileLoopCount.d.ts.map +1 -0
- package/lib/exercises/math/python/whileLoopCount.js +94 -0
- 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/math/squareRoots/simpifySquareRoot.d.ts.map +1 -1
- package/lib/exercises/math/squareRoots/simpifySquareRoot.js +41 -0
- package/lib/exercises/math/squareRoots/squareRootEquation.d.ts.map +1 -1
- package/lib/exercises/math/squareRoots/squareRootEquation.js +25 -0
- package/lib/exercises/math/squareRoots/squareRootIdentities.d.ts.map +1 -1
- package/lib/exercises/math/squareRoots/squareRootIdentities.js +106 -5
- package/lib/exercises/math/squareRoots/squareRootsDistributivity.d.ts.map +1 -1
- package/lib/exercises/math/squareRoots/squareRootsDistributivity.js +29 -2
- package/lib/exercises/math/squareRoots/squareRootsFractions.d.ts.map +1 -1
- package/lib/exercises/math/squareRoots/squareRootsFractions.js +33 -4
- package/lib/exercises/math/squareRoots/squareRootsProducts.d.ts.map +1 -1
- package/lib/exercises/math/squareRoots/squareRootsProducts.js +27 -4
- package/lib/exercises/math/squareRoots/squareRootsSum.d.ts.map +1 -1
- package/lib/exercises/math/squareRoots/squareRootsSum.js +33 -1
- package/lib/exercises/math/squareRoots/squareRootsToSquare.d.ts.map +1 -1
- package/lib/exercises/math/squareRoots/squareRootsToSquare.js +46 -4
- 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 +82 -1
- 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/playground.d.ts.map +1 -1
- package/lib/playground.js +9 -7
- 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/functions/absNode.d.ts +2 -2
- package/lib/tree/nodes/functions/absNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/absNode.js +5 -2
- 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/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +15 -6
- 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,78 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
4
|
+
const getPropositions = (n, { answer }) => {
|
|
5
|
+
const propositions = [];
|
|
6
|
+
addValidProp(propositions, answer);
|
|
7
|
+
while (propositions.length < n) {
|
|
8
|
+
throw Error("QCM not implemented");
|
|
9
|
+
}
|
|
10
|
+
return shuffleProps(propositions, n);
|
|
11
|
+
};
|
|
12
|
+
const getAnswer = (identifiers) => {
|
|
13
|
+
return "";
|
|
14
|
+
};
|
|
15
|
+
const getInstruction = (identifiers) => {
|
|
16
|
+
return `Soit $f(x) = 3x$. Compléter le tableau suivant : `;
|
|
17
|
+
};
|
|
18
|
+
const getHint = (identifiers) => {
|
|
19
|
+
return "";
|
|
20
|
+
};
|
|
21
|
+
const getCorrection = (identifiers) => {
|
|
22
|
+
return "";
|
|
23
|
+
};
|
|
24
|
+
const getKeys = (identifiers) => {
|
|
25
|
+
return [];
|
|
26
|
+
};
|
|
27
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
28
|
+
try {
|
|
29
|
+
throw Error("VEA not implemented");
|
|
30
|
+
}
|
|
31
|
+
catch (err) {
|
|
32
|
+
return handleVEAError(err);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const getValueTableCompletionQuestion = (ops) => {
|
|
36
|
+
const identifiers = {
|
|
37
|
+
test: Math.random(),
|
|
38
|
+
};
|
|
39
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
40
|
+
};
|
|
41
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
42
|
+
return {
|
|
43
|
+
answer: getAnswer(identifiers),
|
|
44
|
+
instruction: getInstruction(identifiers),
|
|
45
|
+
keys: getKeys(identifiers),
|
|
46
|
+
answerFormat: "tex",
|
|
47
|
+
identifiers,
|
|
48
|
+
hint: getHint(identifiers),
|
|
49
|
+
correction: getCorrection(identifiers),
|
|
50
|
+
initTable: [
|
|
51
|
+
["x", "1", "", "3", ""],
|
|
52
|
+
["f(x)", "3", "", "", "12"],
|
|
53
|
+
],
|
|
54
|
+
answerTable: [
|
|
55
|
+
["x", "1", "2", "3", "4"],
|
|
56
|
+
["f(x)", "3", "6", "9", "12"],
|
|
57
|
+
],
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
export const valueTableCompletion = {
|
|
61
|
+
id: "valueTableCompletion",
|
|
62
|
+
connector: "=",
|
|
63
|
+
label: "Tableau valeurs",
|
|
64
|
+
isSingleStep: true,
|
|
65
|
+
generator: (nb, opts) => getDistinctQuestions(() => getValueTableCompletionQuestion(opts), nb),
|
|
66
|
+
qcmTimer: 60,
|
|
67
|
+
freeTimer: 60,
|
|
68
|
+
getPropositions,
|
|
69
|
+
isAnswerValid,
|
|
70
|
+
subject: "Mathématiques",
|
|
71
|
+
getInstruction,
|
|
72
|
+
getHint,
|
|
73
|
+
getCorrection,
|
|
74
|
+
getAnswer,
|
|
75
|
+
getQuestionFromIdentifiers,
|
|
76
|
+
hasHintAndCorrection: true,
|
|
77
|
+
answerType: "valueTable",
|
|
78
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cubicEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/cube/cubicEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"cubicEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/cube/cubicEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA4EF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAiB/C,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQue
|
|
|
3
3
|
import { equationKeys } from "../../../../exercises/utils/keys/equationKeys.js";
|
|
4
4
|
import { equationVEA } from "../../../../exercises/vea/equationVEA.js";
|
|
5
5
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
6
|
+
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
6
7
|
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
7
8
|
const getInstruction = (identifiers) => {
|
|
8
9
|
const k = identifiers.k;
|
|
@@ -18,12 +19,18 @@ const getAnswer = (identifiers) => {
|
|
|
18
19
|
const answer = `S=\\left\\{${x}\\right\\}`;
|
|
19
20
|
return answer;
|
|
20
21
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
const getHint = (identifiers) => {
|
|
23
|
+
return `Quel est le nombre qui, quand on le mulitplie $3$ fois par lui-même, donne $${identifiers.k}$ ?`;
|
|
24
|
+
};
|
|
25
|
+
const getCorrection = (identifiers) => {
|
|
26
|
+
const k = identifiers.k;
|
|
27
|
+
const x = Math.cbrt(k);
|
|
28
|
+
return `Puisque $${x}^3 = ${multiply(multiply(x, x), x).toTex()} = ${k}$, la solution de cette équation est :
|
|
29
|
+
|
|
30
|
+
$$
|
|
31
|
+
${getAnswer(identifiers)}
|
|
32
|
+
$$ `;
|
|
33
|
+
};
|
|
27
34
|
const getCubicEquationQuestion = () => {
|
|
28
35
|
const x = randint(-10, 11);
|
|
29
36
|
const k = x ** 3;
|
|
@@ -37,8 +44,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
37
44
|
keys: equationKeys,
|
|
38
45
|
answerFormat: "tex",
|
|
39
46
|
identifiers,
|
|
40
|
-
|
|
41
|
-
|
|
47
|
+
hint: getHint(identifiers),
|
|
48
|
+
correction: getCorrection(identifiers),
|
|
42
49
|
};
|
|
43
50
|
return question;
|
|
44
51
|
};
|
|
@@ -70,4 +77,5 @@ export const cubicEquation = {
|
|
|
70
77
|
getInstruction,
|
|
71
78
|
getAnswer,
|
|
72
79
|
getQuestionFromIdentifiers,
|
|
80
|
+
hasHintAndCorrection: true,
|
|
73
81
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
a: NodeIdentifiers;
|
|
5
|
+
};
|
|
6
|
+
export declare const imageOfCubeFunction: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=imageOfCubeFunction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imageOfCubeFunction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/cube/imageOfCubeFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAW7C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,eAAe,CAAC;CACpB,CAAC;AAmJF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAiBrD,CAAC"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { RationalConstructor } from "../../../../math/numbers/rationals/rational.js";
|
|
4
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
5
|
+
import { NodeIds } from "../../../../tree/nodes/node.js";
|
|
6
|
+
import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
7
|
+
import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
|
|
8
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
9
|
+
import { divide } from "../../../../tree/nodes/operators/divideNode.js";
|
|
10
|
+
import { FractionNode } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
11
|
+
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
12
|
+
import { power } from "../../../../tree/nodes/operators/powerNode.js";
|
|
13
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
14
|
+
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
15
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
16
|
+
const simplifyOpts = {
|
|
17
|
+
calculatePowers: true,
|
|
18
|
+
distributePowersOnFrac: true,
|
|
19
|
+
};
|
|
20
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
21
|
+
const propositions = [];
|
|
22
|
+
addValidProp(propositions, answer);
|
|
23
|
+
const { a } = identifiers;
|
|
24
|
+
if (a.id === NodeIds.fraction) {
|
|
25
|
+
const frac = reifyAlgebraic(a);
|
|
26
|
+
// Erreurs potentielles pour les fractions:
|
|
27
|
+
// - l'élève ne fait le cube que sur le nominateur et dénominateur
|
|
28
|
+
// - l'élève multiplie par 3 à la place de faire un cube
|
|
29
|
+
tryToAddWrongProp(propositions, new FractionNode(frac.leftChild, power(frac.rightChild, 3))
|
|
30
|
+
.simplify(simplifyOpts)
|
|
31
|
+
.toTex());
|
|
32
|
+
tryToAddWrongProp(propositions, new FractionNode(power(frac.leftChild, 3), frac.rightChild)
|
|
33
|
+
.simplify(simplifyOpts)
|
|
34
|
+
.toTex());
|
|
35
|
+
tryToAddWrongProp(propositions, new FractionNode(frac.leftChild, multiply(frac.rightChild, 3))
|
|
36
|
+
.simplify(simplifyOpts)
|
|
37
|
+
.toTex());
|
|
38
|
+
tryToAddWrongProp(propositions, new FractionNode(multiply(frac.leftChild, 3), frac.rightChild)
|
|
39
|
+
.simplify(simplifyOpts)
|
|
40
|
+
.toTex());
|
|
41
|
+
tryToAddWrongProp(propositions, multiply(frac, 3).simplify().toTex());
|
|
42
|
+
}
|
|
43
|
+
else if (a.id === NodeIds.number) {
|
|
44
|
+
const N = reifyAlgebraic(a);
|
|
45
|
+
// Erreurs potentielles pour les nombres:
|
|
46
|
+
// - Division par 3
|
|
47
|
+
// - Multiplication par 3 (sauf pour le cas N = 3)
|
|
48
|
+
// - Cube de N+1
|
|
49
|
+
// - Cube de N-1
|
|
50
|
+
if (N.value != 3)
|
|
51
|
+
tryToAddWrongProp(propositions, multiply(N, 3).simplify().toTex());
|
|
52
|
+
tryToAddWrongProp(propositions, divide(N, 3).simplify().toTex());
|
|
53
|
+
tryToAddWrongProp(propositions, power(substract(N, 1), 3).simplify(simplifyOpts).toTex());
|
|
54
|
+
tryToAddWrongProp(propositions, power(add(N, 1), 3).simplify(simplifyOpts).toTex());
|
|
55
|
+
}
|
|
56
|
+
return shuffleProps(propositions, n);
|
|
57
|
+
};
|
|
58
|
+
const getAnswer = (identifiers) => {
|
|
59
|
+
const { a } = identifiers;
|
|
60
|
+
const correctAnswer = power(reifyAlgebraic(a), 3);
|
|
61
|
+
return correctAnswer.simplify(simplifyOpts).toTex();
|
|
62
|
+
};
|
|
63
|
+
const getInstruction = (identifiers) => {
|
|
64
|
+
const { a } = identifiers;
|
|
65
|
+
const nNode = reifyAlgebraic(a);
|
|
66
|
+
return `Calculer l'image de $${nNode.toTex()}$ par la fonction cube.`;
|
|
67
|
+
};
|
|
68
|
+
const getHint = (identifiers) => {
|
|
69
|
+
return `La fonction cube est la fonction définie par :
|
|
70
|
+
|
|
71
|
+
$$
|
|
72
|
+
f(x) = x^3
|
|
73
|
+
$$`;
|
|
74
|
+
};
|
|
75
|
+
const getCorrection = (identifiers) => {
|
|
76
|
+
const { a } = identifiers;
|
|
77
|
+
const aNode = reifyAlgebraic(a);
|
|
78
|
+
return `L'image de $${aNode.toTex()}$ par $f(x) = x^3$ est :
|
|
79
|
+
|
|
80
|
+
$$
|
|
81
|
+
f\\left(${aNode.toTex()}\\right) = ${power(aNode, 3).toTex()} = ${getAnswer(identifiers)}
|
|
82
|
+
$$`;
|
|
83
|
+
};
|
|
84
|
+
const getKeys = (identifiers) => {
|
|
85
|
+
return [];
|
|
86
|
+
};
|
|
87
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
88
|
+
try {
|
|
89
|
+
const studentAnswer = parseAlgebraic(ans);
|
|
90
|
+
const correctAnswer = parseAlgebraic(answer);
|
|
91
|
+
return studentAnswer
|
|
92
|
+
.simplify(simplifyOpts)
|
|
93
|
+
.equals(correctAnswer.simplify(simplifyOpts));
|
|
94
|
+
}
|
|
95
|
+
catch (err) {
|
|
96
|
+
return handleVEAError(err);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
const getImageOfCubeFunctionQuestion = (ops) => {
|
|
100
|
+
let a = null;
|
|
101
|
+
// Soit un nombre, soit une fraction
|
|
102
|
+
const choice = randint(1, 3);
|
|
103
|
+
switch (choice) {
|
|
104
|
+
case 1:
|
|
105
|
+
a = new NumberNode(randint(-8, 8));
|
|
106
|
+
break;
|
|
107
|
+
case 2:
|
|
108
|
+
default:
|
|
109
|
+
a = RationalConstructor.randomIrreductible(12).toTree();
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
const identifiers = { a: a.toIdentifiers() };
|
|
113
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
114
|
+
};
|
|
115
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
116
|
+
return {
|
|
117
|
+
answer: getAnswer(identifiers),
|
|
118
|
+
instruction: getInstruction(identifiers),
|
|
119
|
+
keys: getKeys(identifiers),
|
|
120
|
+
answerFormat: "tex",
|
|
121
|
+
identifiers,
|
|
122
|
+
hint: getHint(identifiers),
|
|
123
|
+
correction: getCorrection(identifiers),
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
export const imageOfCubeFunction = {
|
|
127
|
+
id: "imageOfCubeFunction",
|
|
128
|
+
label: "Calcul d'image par la fonction cube",
|
|
129
|
+
isSingleStep: true,
|
|
130
|
+
generator: (nb, opts) => getDistinctQuestions(() => getImageOfCubeFunctionQuestion(opts), nb),
|
|
131
|
+
qcmTimer: 60,
|
|
132
|
+
freeTimer: 60,
|
|
133
|
+
getPropositions,
|
|
134
|
+
isAnswerValid,
|
|
135
|
+
subject: "Mathématiques",
|
|
136
|
+
getInstruction,
|
|
137
|
+
getHint,
|
|
138
|
+
getCorrection,
|
|
139
|
+
getAnswer,
|
|
140
|
+
getQuestionFromIdentifiers,
|
|
141
|
+
hasHintAndCorrection: true,
|
|
142
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/cube/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/cube/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
a: NodeIdentifiers;
|
|
5
|
+
};
|
|
6
|
+
export declare const getImageOfSquareRootFunction: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=getImageOfSquareRootFunction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getImageOfSquareRootFunction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/square/getImageOfSquareRootFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAW7C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,eAAe,CAAC;CACpB,CAAC;AAmIF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAoB9D,CAAC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { RationalConstructor } from "../../../../math/numbers/rationals/rational.js";
|
|
4
|
+
import { gcd } from "../../../../math/utils/arithmetic/gcd.js";
|
|
5
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
6
|
+
import { sqrt } from "../../../../tree/nodes/functions/sqrtNode.js";
|
|
7
|
+
import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
8
|
+
import { isNumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
|
|
9
|
+
import { frac, isFractionNode, } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
10
|
+
import { isPowerNode, square } from "../../../../tree/nodes/operators/powerNode.js";
|
|
11
|
+
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
12
|
+
import { random } from "../../../../utils/alea/random.js";
|
|
13
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
14
|
+
const getPropositions = (n, { answer }) => {
|
|
15
|
+
const propositions = [];
|
|
16
|
+
addValidProp(propositions, answer);
|
|
17
|
+
while (propositions.length < n) {
|
|
18
|
+
const randomNumber = randint(0, 100);
|
|
19
|
+
const randomNumberNode = randomNumber.toTree();
|
|
20
|
+
const randomNumberSquare = square(randomNumberNode);
|
|
21
|
+
const randomFraction = RationalConstructor.randomIrreductible().toTree();
|
|
22
|
+
const choices = [randomNumberNode, randomNumberSquare, randomFraction];
|
|
23
|
+
const randomChoice = random(choices);
|
|
24
|
+
tryToAddWrongProp(propositions, randomChoice.toTex());
|
|
25
|
+
}
|
|
26
|
+
return shuffleProps(propositions, n);
|
|
27
|
+
};
|
|
28
|
+
const getAnswer = (identifiers) => {
|
|
29
|
+
const { a } = identifiers;
|
|
30
|
+
const sqrtNode = sqrt(reifyAlgebraic(a));
|
|
31
|
+
const x = sqrtNode.simplify().toTex();
|
|
32
|
+
return x;
|
|
33
|
+
};
|
|
34
|
+
const getInstruction = (identifiers) => {
|
|
35
|
+
const { a } = identifiers;
|
|
36
|
+
return `Déterminer l'image de $${reifyAlgebraic(a).toTex()}$ par la fonction racine carrée.`;
|
|
37
|
+
};
|
|
38
|
+
const getHint = (identifiers) => {
|
|
39
|
+
const { a } = identifiers;
|
|
40
|
+
return `Quel est le nombre qui, multiplié par lui-même, donne $${reifyAlgebraic(a).toTex()}$ ?`;
|
|
41
|
+
};
|
|
42
|
+
const getCorrection = (identifiers) => {
|
|
43
|
+
const { a } = identifiers;
|
|
44
|
+
const aNode = reifyAlgebraic(a);
|
|
45
|
+
const tex = aNode.toTex();
|
|
46
|
+
const answer = getAnswer(identifiers);
|
|
47
|
+
switch (true) {
|
|
48
|
+
case isNumberNode(aNode):
|
|
49
|
+
return `On remarque que $${tex} = ${answer}^2$.
|
|
50
|
+
|
|
51
|
+
Ici on a donc $\\sqrt{${tex}} = ${answer}$.`;
|
|
52
|
+
case isPowerNode(aNode):
|
|
53
|
+
return `On sait que $\\sqrt{x^2} = |x|$.
|
|
54
|
+
|
|
55
|
+
Ici on a donc $\\sqrt{${tex}} = ${answer}$.`;
|
|
56
|
+
case isFractionNode(aNode):
|
|
57
|
+
return `On sait que $\\sqrt{\\frac{a}{b}} = \\frac{\\sqrt{a}}{\\sqrt{b}}$.
|
|
58
|
+
|
|
59
|
+
Ici on a donc $\\sqrt{${tex}} = ${answer}$.`;
|
|
60
|
+
default:
|
|
61
|
+
throw new Error(`getCorrection: nœud inattendu rencontré (${aNode.constructor.name})`);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
const getKeys = (identifiers) => {
|
|
65
|
+
return [];
|
|
66
|
+
};
|
|
67
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
68
|
+
try {
|
|
69
|
+
const ansNode = parseAlgebraic(ans);
|
|
70
|
+
const answerNode = parseAlgebraic(answer);
|
|
71
|
+
if (!isNumberNode(ansNode) && !isFractionNode(ansNode))
|
|
72
|
+
return false;
|
|
73
|
+
return ansNode.simplify().equals(answerNode.simplify());
|
|
74
|
+
}
|
|
75
|
+
catch (err) {
|
|
76
|
+
return handleVEAError(err);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
const getGetImageOfSquareRootFunctionQuestion = (ops) => {
|
|
80
|
+
const xTreeValue = randint(1, 11) ** 2;
|
|
81
|
+
const xTree = xTreeValue.toTree();
|
|
82
|
+
const randomIntTree = randint(1, 100).toTree();
|
|
83
|
+
let denom = randint(2, 10);
|
|
84
|
+
let numer = randint(1, 10);
|
|
85
|
+
while (gcd(numer, denom) !== 1) {
|
|
86
|
+
denom = randint(2, 10);
|
|
87
|
+
numer = randint(1, 10);
|
|
88
|
+
}
|
|
89
|
+
const fractionTree = frac(numer ** 2, denom ** 2);
|
|
90
|
+
const candidates = [randomIntTree, fractionTree];
|
|
91
|
+
const chosenInputTree = candidates[randint(0, candidates.length)];
|
|
92
|
+
const squaredTree = square(chosenInputTree);
|
|
93
|
+
const choices = [
|
|
94
|
+
xTree.toIdentifiers(),
|
|
95
|
+
squaredTree.toIdentifiers(),
|
|
96
|
+
fractionTree.toIdentifiers(),
|
|
97
|
+
];
|
|
98
|
+
const a = random(choices);
|
|
99
|
+
return getQuestionFromIdentifiers({ a });
|
|
100
|
+
};
|
|
101
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
102
|
+
return {
|
|
103
|
+
answer: getAnswer(identifiers),
|
|
104
|
+
instruction: getInstruction(identifiers),
|
|
105
|
+
keys: getKeys(identifiers),
|
|
106
|
+
answerFormat: "tex",
|
|
107
|
+
identifiers,
|
|
108
|
+
hint: getHint(identifiers),
|
|
109
|
+
correction: getCorrection(identifiers),
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
export const getImageOfSquareRootFunction = {
|
|
113
|
+
id: "getImageOfSquareRootFunction",
|
|
114
|
+
label: "Calculer une image par la fonction racine carrée",
|
|
115
|
+
isSingleStep: true,
|
|
116
|
+
generator: (nb, opts) => getDistinctQuestions(() => getGetImageOfSquareRootFunctionQuestion(opts), nb),
|
|
117
|
+
qcmTimer: 60,
|
|
118
|
+
freeTimer: 60,
|
|
119
|
+
getPropositions,
|
|
120
|
+
isAnswerValid,
|
|
121
|
+
subject: "Mathématiques",
|
|
122
|
+
getInstruction,
|
|
123
|
+
getHint,
|
|
124
|
+
getCorrection,
|
|
125
|
+
getAnswer,
|
|
126
|
+
getQuestionFromIdentifiers,
|
|
127
|
+
hasHintAndCorrection: true,
|
|
128
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/square/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/square/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,mCAAmC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AAqPF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAuBnD,CAAC"}
|
|
@@ -55,8 +55,37 @@ const getInstruction = (identifiers) => {
|
|
|
55
55
|
|
|
56
56
|
Pour ${instruction}, il faut utiliser... `;
|
|
57
57
|
};
|
|
58
|
-
// const getHint: GetHint<Identifiers> = (identifiers) => {
|
|
59
|
-
//
|
|
58
|
+
// const getHint: GetHint<Identifiers> = (identifiers) => {
|
|
59
|
+
// return `Voici les énoncés des théorèmes de Pythagore et de Thalès, et leurs réciproques :
|
|
60
|
+
// - **Théorème de Pythagore** : Dans un triangle rectangle, le carré de l'hypoténuse est égal à la somme des carrés des deux autres côtés.
|
|
61
|
+
// - **Réciproque du théorème de Pythagore** : Si dans un triangle, le carré de l'hypoténuse est égal à la somme des carrés des deux autres côtés, alors le triangle est rectangle.
|
|
62
|
+
// - **Théorème de Thalès** : Soit un triangle $ABC$, et $D$ un point sur la droite $(AB)$ et $E$ un point sur la droite $(AC)$. Si les droites $(DE)$ et $(BC)$ sont parallèles, alors :
|
|
63
|
+
// $$
|
|
64
|
+
// \\frac{AD}{AB}=\\frac{AE}{AC}=\\frac{DE}{BC}
|
|
65
|
+
// $$
|
|
66
|
+
// - **Réciproque du théorème de Thalès** : Soit un triangle $ABC$, et $D$ un point sur la droite $(AB)$ et $E$ un point sur la droite $(AC)$. Si $\\frac{AD}{AB}=\\frac{AE}{AC}$, alors les droites $(AB)$ et $(AC)$ sont parallèles.`;
|
|
67
|
+
// };
|
|
68
|
+
// const getCorrection: GetCorrection<Identifiers> = (identifiers) => {
|
|
69
|
+
// const { isAskingLength, pointsIdentifiers, isSegmentHeight } = identifiers;
|
|
70
|
+
// const points = pointsIdentifiers.map((p) =>
|
|
71
|
+
// PointConstructor.fromIdentifiers(p),
|
|
72
|
+
// );
|
|
73
|
+
// if (isSegmentHeight) {
|
|
74
|
+
// if(isAskingLength){
|
|
75
|
+
// // ("Pythagore");
|
|
76
|
+
// return ``
|
|
77
|
+
// } else {
|
|
78
|
+
// // ("Recip pythagore");
|
|
79
|
+
// }
|
|
80
|
+
// } else {
|
|
81
|
+
// if (isAskingLength) {
|
|
82
|
+
// // ("Thales");
|
|
83
|
+
// } else {
|
|
84
|
+
// // ("Recip thales");
|
|
85
|
+
// }
|
|
86
|
+
// }
|
|
87
|
+
// return ``;
|
|
88
|
+
// };
|
|
60
89
|
const getGGBOptions = (identifiers) => {
|
|
61
90
|
const { isAskingLength, lengths, pointsIdentifiers, isSegmentHeight } = identifiers;
|
|
62
91
|
const points = pointsIdentifiers.map((p) => PointConstructor.fromIdentifiers(p));
|
|
@@ -198,6 +227,7 @@ export const pythagoreOrThales = {
|
|
|
198
227
|
shouldSpreadPropositions: true,
|
|
199
228
|
},
|
|
200
229
|
getQuestionFromIdentifiers,
|
|
230
|
+
// hasHintAndCorrection: true,
|
|
201
231
|
};
|
|
202
232
|
const getSubTriangle = ({ triangle, insidePointsNames, ratio, isPapillon, }) => {
|
|
203
233
|
const [A, B, C] = triangle.points;
|
|
@@ -3,6 +3,7 @@ export * from "./calculLitteral/index.js";
|
|
|
3
3
|
export * from "./combinatory/index.js";
|
|
4
4
|
export * from "./complex/index.js";
|
|
5
5
|
export * from "./conversion/index.js";
|
|
6
|
+
export * from "./curve/index.js";
|
|
6
7
|
export * from "./derivation/index.js";
|
|
7
8
|
export * from "./equaDiff/index.js";
|
|
8
9
|
export * from "./functions/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/math/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/math/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC"}
|
|
@@ -3,6 +3,7 @@ export * from "./calculLitteral/index.js";
|
|
|
3
3
|
export * from "./combinatory/index.js";
|
|
4
4
|
export * from "./complex/index.js";
|
|
5
5
|
export * from "./conversion/index.js";
|
|
6
|
+
export * from "./curve/index.js";
|
|
6
7
|
export * from "./derivation/index.js";
|
|
7
8
|
export * from "./equaDiff/index.js";
|
|
8
9
|
export * from "./functions/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findRightCalculForPriceEvolution.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/percent/evolutions/findRightCalculForPriceEvolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;
|
|
1
|
+
{"version":3,"file":"findRightCalculForPriceEvolution.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/percent/evolutions/findRightCalculForPriceEvolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAmLF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CAelE,CAAC"}
|
|
@@ -54,12 +54,42 @@ const getInstruction = (identifiers) => {
|
|
|
54
54
|
}
|
|
55
55
|
return "";
|
|
56
56
|
};
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
const getHint = (identifiers) => {
|
|
58
|
+
const { askingFinalPrice, evolution, price, type } = identifiers;
|
|
59
|
+
const isHausse = evolution > 0;
|
|
60
|
+
if (askingFinalPrice) {
|
|
61
|
+
return `On doit ${isHausse ? "augmenter" : "diminuer"} $${price}€$ de $${Math.abs(evolution)}\\%$.
|
|
62
|
+
|
|
63
|
+
Pour ${isHausse ? "augmenter" : "diminuer"} un nombre $x$ de $t\\%$, on multiplie $x$ par $1${isHausse ? "+" : "-"}\\frac{t}{100}$.`;
|
|
64
|
+
}
|
|
65
|
+
return `On cherche ce que vaut $${Math.abs(evolution)}\\%$ de $${price}€$.
|
|
66
|
+
|
|
67
|
+
Pour calculer $t\\%$ d'un nombre, on le multiplie par $\\frac{t}{100}$.`;
|
|
68
|
+
};
|
|
69
|
+
const getCorrection = (identifiers) => {
|
|
70
|
+
const { askingFinalPrice, evolution, price, type } = identifiers;
|
|
71
|
+
const isHausse = evolution > 0;
|
|
72
|
+
if (askingFinalPrice) {
|
|
73
|
+
return `On doit ${isHausse ? "augmenter" : "diminuer"} $${price}€$ de $${Math.abs(evolution)}\\%$.
|
|
74
|
+
|
|
75
|
+
Pour ${isHausse ? "augmenter" : "diminuer"} un nombre $x$ de $t\\%$, on multiplie $x$ par $1${isHausse ? "+" : "-"}\\frac{t}{100}$.
|
|
76
|
+
|
|
77
|
+
Le calcul à faire ici est donc :
|
|
78
|
+
|
|
79
|
+
$$
|
|
80
|
+
${getAnswer(identifiers)}
|
|
81
|
+
$$`;
|
|
82
|
+
}
|
|
83
|
+
return `On cherche ce que vaut $${Math.abs(evolution)}\\%$ de $${price}€$.
|
|
84
|
+
|
|
85
|
+
Pour calculer $t\\%$ d'un nombre, on le multiplie par $\\frac{t}{100}$.
|
|
86
|
+
|
|
87
|
+
Le calcul à faire ici est donc :
|
|
88
|
+
|
|
89
|
+
$$
|
|
90
|
+
${getAnswer(identifiers)}
|
|
91
|
+
$$`;
|
|
92
|
+
};
|
|
63
93
|
const getKeys = (identifiers) => {
|
|
64
94
|
return [];
|
|
65
95
|
};
|
|
@@ -92,8 +122,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
92
122
|
keys: getKeys(identifiers),
|
|
93
123
|
answerFormat: "tex",
|
|
94
124
|
identifiers,
|
|
95
|
-
|
|
96
|
-
|
|
125
|
+
hint: getHint(identifiers),
|
|
126
|
+
correction: getCorrection(identifiers),
|
|
97
127
|
};
|
|
98
128
|
return question;
|
|
99
129
|
};
|
|
@@ -110,4 +140,5 @@ export const findRightCalculForPriceEvolution = {
|
|
|
110
140
|
subject: "Mathématiques",
|
|
111
141
|
answerType: "QCU",
|
|
112
142
|
getQuestionFromIdentifiers,
|
|
143
|
+
hasHintAndCorrection: true,
|
|
113
144
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decimalToScientific.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/decimalToScientific.ts"],"names":[],"mappings":"AAyBA,OAAO,EACL,QAAQ,EAgBT,MAAM,mBAAmB,CAAC;AAG3B,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;
|
|
1
|
+
{"version":3,"file":"decimalToScientific.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/decimalToScientific.ts"],"names":[],"mappings":"AAyBA,OAAO,EACL,QAAQ,EAgBT,MAAM,mBAAmB,CAAC;AAG3B,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAoIF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAerD,CAAC"}
|
|
@@ -104,7 +104,6 @@ const isAnswerValid = (ans, { decimal }) => {
|
|
|
104
104
|
return false;
|
|
105
105
|
if (parsed.rightChild.leftChild.value !== 10)
|
|
106
106
|
return false;
|
|
107
|
-
console.log(parsed.simplify({ calculatePowers: true }).toTex(), decimal.frenchify());
|
|
108
107
|
return (parsed.simplify({ calculatePowers: true }).toTex() ===
|
|
109
108
|
decimal.frenchify());
|
|
110
109
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"powersMixOperations.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/powersMixOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAwBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvB,CAAC;
|
|
1
|
+
{"version":3,"file":"powersMixOperations.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/powersMixOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAwBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvB,CAAC;AA0KF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAcrD,CAAC"}
|
|
@@ -27,7 +27,6 @@ const getPropositions = (n, { answer, ...identifiers }) => {
|
|
|
27
27
|
return shuffleProps(propositions, n);
|
|
28
28
|
};
|
|
29
29
|
const getAnswer = (identifiers) => {
|
|
30
|
-
const statement = getStatementNode(identifiers);
|
|
31
30
|
const { a, b, k, l, m, n } = identifiers;
|
|
32
31
|
if (a !== b) {
|
|
33
32
|
const pow = k + l * m;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ballsBasicProbas.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/ballsBasicProbas.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAoGF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"ballsBasicProbas.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/ballsBasicProbas.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAoGF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAclD,CAAC"}
|