math-exercises 3.0.126 → 3.0.128
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/exercises/math/calcul/arithmetics/isMultipleOrDivisor.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/isMultipleOrDivisor.js +0 -10
- package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.d.ts +1 -1
- package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.d.ts.map +1 -1
- package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.js +66 -42
- package/lib/exercises/math/calcul/operations/expressionNature.d.ts.map +1 -1
- package/lib/exercises/math/calcul/operations/expressionNature.js +0 -4
- package/lib/exercises/math/calcul/ordering/compareA10N.d.ts.map +1 -1
- package/lib/exercises/math/calcul/ordering/compareA10N.js +0 -1
- package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.d.ts.map +1 -1
- package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.js +6 -105
- package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.d.ts.map +1 -1
- package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.js +22 -9
- package/lib/exercises/math/calcul/ordering/compareFracAndDec.d.ts.map +1 -1
- package/lib/exercises/math/calcul/ordering/compareFracAndDec.js +7 -7
- package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.d.ts.map +1 -1
- package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.js +23 -14
- package/lib/exercises/math/calcul/ordering/decimalOrdering.d.ts.map +1 -1
- package/lib/exercises/math/calcul/ordering/decimalOrdering.js +0 -4
- package/lib/exercises/math/calcul/ordering/decimalOrderingNoRelatives.d.ts.map +1 -1
- package/lib/exercises/math/calcul/ordering/decimalOrderingNoRelatives.js +0 -4
- package/lib/exercises/math/calcul/ordering/integerOrdering.d.ts.map +1 -1
- package/lib/exercises/math/calcul/ordering/integerOrdering.js +0 -4
- package/lib/exercises/math/calcul/proportionality/findCoeffInProportionalTableNonIntegers.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/findCoeffInProportionalTableNonIntegers.js +0 -1
- package/lib/exercises/math/calcul/proportionality/isTableProportional.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/isTableProportional.js +0 -4
- package/lib/exercises/math/calcul/proportionality/isTableProportionalNonInteger.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/isTableProportionalNonInteger.js +0 -4
- package/lib/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.d.ts.map +1 -1
- package/lib/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.js +0 -1
- package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.d.ts.map +1 -1
- package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.js +0 -1
- package/lib/exercises/math/calcul/rounding/getPhysicalOrderOfMagnitude.d.ts.map +1 -1
- package/lib/exercises/math/calcul/rounding/getPhysicalOrderOfMagnitude.js +28 -14
- package/lib/exercises/math/calcul/sign/signFromAx.d.ts.map +1 -1
- package/lib/exercises/math/calcul/sign/signFromAx.js +0 -10
- package/lib/exercises/math/calculLitteral/equation/equationFromProblem.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationFromProblem.js +63 -24
- package/lib/exercises/math/calculLitteral/inequations/isInequalityTrue.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/inequations/isInequalityTrue.js +0 -10
- package/lib/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.js +6 -27
- package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.js +41 -39
- package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.js +1 -2
- package/lib/exercises/math/calculLitteral/simplifying/valuateExpression.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/simplifying/valuateExpression.js +0 -10
- package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.js +68 -23
- package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.d.ts +4 -1
- package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.d.ts.map +1 -1
- package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.js +52 -35
- package/lib/exercises/math/conversion/minutesToHours.d.ts.map +1 -1
- package/lib/exercises/math/conversion/minutesToHours.js +0 -1
- package/lib/exercises/math/conversion/prefixToNumber.d.ts.map +1 -1
- package/lib/exercises/math/conversion/prefixToNumber.js +14 -4
- package/lib/exercises/math/conversion/secondsToHours.d.ts.map +1 -1
- package/lib/exercises/math/conversion/secondsToHours.js +1 -2
- package/lib/exercises/math/dataRepresentations/barChartInterpreting.d.ts +5 -2
- package/lib/exercises/math/dataRepresentations/barChartInterpreting.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/barChartInterpreting.js +47 -31
- package/lib/exercises/math/dataRepresentations/cartesianGraphExtremaReading.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/cartesianGraphExtremaReading.js +5 -4
- package/lib/exercises/math/dataRepresentations/compareBoxPlot.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/compareBoxPlot.js +0 -1
- package/lib/exercises/math/dataRepresentations/dataToGraphGraphToData.js +4 -4
- package/lib/exercises/math/dataRepresentations/graphReading.js +13 -13
- package/lib/exercises/math/dataRepresentations/histogramReading.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/histogramReading.js +32 -32
- package/lib/exercises/math/dataRepresentations/plausibleGraph.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/plausibleGraph.js +53 -4
- package/lib/exercises/math/derivation/convexity/convexityQuadrinomials.d.ts.map +1 -1
- package/lib/exercises/math/derivation/convexity/convexityQuadrinomials.js +0 -1
- package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.d.ts.map +1 -1
- package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.js +0 -4
- package/lib/exercises/math/functions/affines/affineAdjustmentComplete.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineAdjustmentComplete.js +0 -1
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.js +17 -4
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.js +27 -10
- package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.js +33 -16
- package/lib/exercises/math/functions/affines/recognizeAffineGraph.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/recognizeAffineGraph.js +0 -4
- package/lib/exercises/math/functions/affines/representationOfAffine.d.ts +3 -0
- package/lib/exercises/math/functions/affines/representationOfAffine.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/representationOfAffine.js +121 -30
- package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.js +29 -11
- package/lib/exercises/math/functions/basics/isPointOnFunction.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/isPointOnFunction.js +0 -10
- package/lib/exercises/math/functions/basics/signOfFunction.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/signOfFunction.js +0 -10
- package/lib/exercises/math/functions/composition/functionComposition.d.ts.map +1 -1
- package/lib/exercises/math/functions/composition/functionComposition.js +2 -2
- package/lib/exercises/math/functions/cube/isPointOnCubicFunction.d.ts.map +1 -1
- package/lib/exercises/math/functions/cube/isPointOnCubicFunction.js +0 -10
- package/lib/exercises/math/functions/exponentials/exponentialsVariations.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponentials/exponentialsVariations.js +0 -4
- package/lib/exercises/math/functions/inverse/compareInverseValues.d.ts.map +1 -1
- package/lib/exercises/math/functions/inverse/compareInverseValues.js +0 -1
- package/lib/exercises/math/functions/inverse/isPointOnReciprocalFunction.d.ts.map +1 -1
- package/lib/exercises/math/functions/inverse/isPointOnReciprocalFunction.js +0 -10
- package/lib/exercises/math/functions/parity/parityFromAlgebra.d.ts.map +1 -1
- package/lib/exercises/math/functions/parity/parityFromAlgebra.js +0 -4
- package/lib/exercises/math/functions/square/compareSquaredValues.d.ts.map +1 -1
- package/lib/exercises/math/functions/square/compareSquaredValues.js +0 -10
- package/lib/exercises/math/geometry/convexity/convexityTrinomialsGeo.d.ts.map +1 -1
- package/lib/exercises/math/geometry/convexity/convexityTrinomialsGeo.js +0 -4
- package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.js +0 -4
- package/lib/exercises/math/geometry/lines/isPointOnCartesianLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/isPointOnCartesianLine.js +0 -4
- package/lib/exercises/math/geometry/lines/isPointOnLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/isPointOnLine.js +0 -4
- package/lib/exercises/math/geometry/lines/linesRelativePositions.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/linesRelativePositions.js +0 -4
- package/lib/exercises/math/geometry/parametric/pointFromParametricLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/parametric/pointFromParametricLine.js +0 -4
- package/lib/exercises/math/geometry/pythagore/isTriangleRight.d.ts.map +1 -1
- package/lib/exercises/math/geometry/pythagore/isTriangleRight.js +0 -4
- package/lib/exercises/math/geometry/quadrilaterals/parallelogramRectangle.d.ts.map +1 -1
- package/lib/exercises/math/geometry/quadrilaterals/parallelogramRectangle.js +0 -4
- package/lib/exercises/math/geometry/quadrilaterals/parallelogramRhombus.d.ts.map +1 -1
- package/lib/exercises/math/geometry/quadrilaterals/parallelogramRhombus.js +0 -4
- package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.d.ts.map +1 -1
- package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.js +0 -4
- package/lib/exercises/math/geometry/shapes/basicShapesRecognition.d.ts.map +1 -1
- package/lib/exercises/math/geometry/shapes/basicShapesRecognition.js +6 -7
- package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromBasis.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromBasis.js +0 -10
- package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromPicture.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromPicture.js +0 -10
- package/lib/exercises/math/geometry/vectors/equalCaracteristicFromGraph.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/equalCaracteristicFromGraph.js +0 -4
- package/lib/exercises/math/percent/evolutions/findRightCalculForPriceEvolution.d.ts.map +1 -1
- package/lib/exercises/math/percent/evolutions/findRightCalculForPriceEvolution.js +0 -4
- package/lib/exercises/math/probaStat/basicProbas/mostLeastProbable.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/basicProbas/mostLeastProbable.js +0 -10
- package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.js +24 -9
- package/lib/exercises/math/probaStat/checkEquiprobability.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/checkEquiprobability.js +0 -10
- package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.js +9 -6
- package/lib/exercises/math/probaStat/events/describeEvent.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/events/describeEvent.js +0 -10
- package/lib/exercises/math/probaStat/events/eventNotation.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/events/eventNotation.js +0 -10
- package/lib/exercises/math/probaStat/probaAsSumOfProbas.d.ts +0 -1
- package/lib/exercises/math/probaStat/probaAsSumOfProbas.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaAsSumOfProbas.js +13 -14
- package/lib/exercises/math/probaStat/stats1var/compareSeriesDispersion.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/compareSeriesDispersion.js +0 -4
- package/lib/exercises/math/probaStat/stats1var/getQuartileProportionQuestion.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/getQuartileProportionQuestion.js +0 -10
- package/lib/exercises/math/probaStat/stats1var/interpretIndicatorsForLists.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/interpretIndicatorsForLists.js +2 -3
- package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.js +26 -25
- package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.js +0 -4
- package/lib/exercises/math/python/pythonForLoopInstructionCompletion.d.ts.map +1 -1
- package/lib/exercises/math/python/pythonForLoopInstructionCompletion.js +0 -10
- package/lib/exercises/math/python/pythonIfStatementCompletion.d.ts.map +1 -1
- package/lib/exercises/math/python/pythonIfStatementCompletion.js +7 -8
- package/lib/exercises/math/python/pythonSimpleFunctionInstructionCompletion.d.ts.map +1 -1
- package/lib/exercises/math/python/pythonSimpleFunctionInstructionCompletion.js +0 -10
- package/lib/exercises/math/python/pythonWhileStatementCompletion.d.ts.map +1 -1
- package/lib/exercises/math/python/pythonWhileStatementCompletion.js +5 -6
- package/lib/exercises/math/python/pythonWhileStatementOperationCompletion.d.ts.map +1 -1
- package/lib/exercises/math/python/pythonWhileStatementOperationCompletion.js +5 -6
- package/lib/exercises/math/python/variableType.d.ts.map +1 -1
- package/lib/exercises/math/python/variableType.js +0 -10
- package/lib/exercises/math/sampling/isSamplingRepresentative.d.ts.map +1 -1
- package/lib/exercises/math/sampling/isSamplingRepresentative.js +0 -4
- package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromFirstTerms.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromFirstTerms.js +0 -4
- package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromGraph.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromGraph.js +0 -4
- package/lib/exercises/math/sequences/geometric/geometricVariations.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricVariations.js +0 -4
- package/lib/exercises/math/sets/intervals/isNumberInInterval.d.ts.map +1 -1
- package/lib/exercises/math/sets/intervals/isNumberInInterval.js +0 -10
- package/lib/exercises/math/sets/isNumberDecimal.d.ts.map +1 -1
- package/lib/exercises/math/sets/isNumberDecimal.js +0 -10
- package/lib/exercises/math/sets/nameOfNumberSets.d.ts.map +1 -1
- package/lib/exercises/math/sets/nameOfNumberSets.js +0 -10
- package/lib/exercises/pc/chemicalElements/atomicStructureOfNucleus.d.ts.map +1 -1
- package/lib/exercises/pc/chemicalElements/atomicStructureOfNucleus.js +0 -1
- package/lib/exercises/pc/chemicalElements/identifyRightElectronicConfiguration.d.ts.map +1 -1
- package/lib/exercises/pc/chemicalElements/identifyRightElectronicConfiguration.js +0 -4
- package/lib/exercises/pc/chemicalReactions/identifyLimitingReagent.d.ts.map +1 -1
- package/lib/exercises/pc/chemicalReactions/identifyLimitingReagent.js +0 -4
- package/lib/exercises/pc/chemicalReactions/identifyStoichiometricMixture.d.ts.map +1 -1
- package/lib/exercises/pc/chemicalReactions/identifyStoichiometricMixture.js +0 -4
- package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.d.ts.map +1 -1
- package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.js +0 -4
- package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.d.ts.map +1 -1
- package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.js +0 -4
- package/lib/exercises/pc/moleculeNomenclature.d.ts.map +1 -1
- package/lib/exercises/pc/moleculeNomenclature.js +0 -4
- package/lib/exercises/pc/motion/motionReference.d.ts.map +1 -1
- package/lib/exercises/pc/motion/motionReference.js +0 -4
- package/lib/exercises/pc/motion/typeOfAcceleration.d.ts.map +1 -1
- package/lib/exercises/pc/motion/typeOfAcceleration.js +0 -4
- package/lib/exercises/pc/sound/frequencyComparison.d.ts.map +1 -1
- package/lib/exercises/pc/sound/frequencyComparison.js +0 -4
- package/lib/index.d.ts +10 -5
- package/lib/index.d.ts.map +1 -1
- package/lib/math/progCalc/progCalc.d.ts +3 -3
- package/lib/math/progCalc/progCalc.d.ts.map +1 -1
- package/lib/math/progCalc/progCalc.js +13 -3
- package/lib/tests/exoTest.d.ts.map +1 -1
- package/lib/tests/exoTest.js +7 -0
- package/lib/tests/questionTest.d.ts.map +1 -1
- package/lib/tests/questionTest.js +3 -2
- package/package.json +1 -1
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
4
|
+
import { sqrt } from "../../../../tree/nodes/functions/sqrtNode.js";
|
|
5
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
6
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
4
7
|
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
5
8
|
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
6
9
|
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
@@ -11,10 +14,10 @@ const getInstruction = (identifiers) => {
|
|
|
11
14
|
comparer $${b} ${isAdd ? "+" : "-"} \\sqrt{${a}}$ et $${b} ${isAdd ? "+" : "-"} \\sqrt{${a + 1}}$.`;
|
|
12
15
|
};
|
|
13
16
|
const getHint = (identifiers) => {
|
|
14
|
-
const { a
|
|
17
|
+
const { a } = identifiers;
|
|
15
18
|
return `En partant de $\\sqrt{${a}} < \\sqrt{${a + 1}}$,
|
|
16
19
|
|
|
17
|
-
essaie de te ramener
|
|
20
|
+
essaie de te ramener aux expressions demandées
|
|
18
21
|
|
|
19
22
|
par des opérations que l'on effectue à droite et à gauche de l'inégalité.
|
|
20
23
|
|
|
@@ -22,7 +25,7 @@ Attention si tu multiplies à droite et à gauche d'une inégalité par un nombr
|
|
|
22
25
|
};
|
|
23
26
|
const getCorrection = (identifiers) => {
|
|
24
27
|
const { a, b, isAdd } = identifiers;
|
|
25
|
-
return `
|
|
28
|
+
return `On sait que :
|
|
26
29
|
|
|
27
30
|
$$
|
|
28
31
|
\\sqrt{${a}} < \\sqrt{${a + 1}}
|
|
@@ -45,16 +48,23 @@ $$
|
|
|
45
48
|
|
|
46
49
|
`;
|
|
47
50
|
};
|
|
51
|
+
const getAnswerNodes = (identifiers) => {
|
|
52
|
+
const { a, b, isAdd } = identifiers;
|
|
53
|
+
const addSub = isAdd ? add : substract;
|
|
54
|
+
const nodeWithA = addSub(b, sqrt(a));
|
|
55
|
+
const nodeWithAPlus1 = addSub(b, sqrt(add(a, 1)));
|
|
56
|
+
return isAdd ? [nodeWithA, nodeWithAPlus1] : [nodeWithAPlus1, nodeWithA];
|
|
57
|
+
};
|
|
48
58
|
const getAnswer = (identifiers) => {
|
|
49
59
|
const { a, b, isAdd } = identifiers;
|
|
50
|
-
return `${b}
|
|
60
|
+
return `${b}${isAdd ? "+" : "-"}\\sqrt{${a}}${isAdd ? "<" : ">"}${b}${isAdd ? "+" : "-"}\\sqrt{${a + 1}}`;
|
|
51
61
|
};
|
|
52
|
-
const isAnswerValid = (ans, { answer }) => {
|
|
62
|
+
const isAnswerValid = (ans, { answer, ...identifiers }) => {
|
|
53
63
|
function getOrderedNodesFromTex(tex, compSymbol) {
|
|
54
64
|
return tex
|
|
55
65
|
.split(compSymbol)
|
|
56
66
|
.map((str) => parseAlgebraic(str))
|
|
57
|
-
.toSorted(() => (compSymbol === "<" ?
|
|
67
|
+
.toSorted(() => (compSymbol === "<" ? +1 : -1));
|
|
58
68
|
}
|
|
59
69
|
try {
|
|
60
70
|
const compSymbol = ans.includes("<")
|
|
@@ -64,9 +74,9 @@ const isAnswerValid = (ans, { answer }) => {
|
|
|
64
74
|
: undefined;
|
|
65
75
|
if (compSymbol) {
|
|
66
76
|
const [ansNode1, ansNode2] = getOrderedNodesFromTex(ans, compSymbol);
|
|
67
|
-
const [answerNode1, answerNode2] =
|
|
68
|
-
return (ansNode1.simplify().
|
|
69
|
-
ansNode2.simplify().
|
|
77
|
+
const [answerNode1, answerNode2] = getAnswerNodes(identifiers);
|
|
78
|
+
return (substract(ansNode1, answerNode1).simplify().evaluate() === 0 &&
|
|
79
|
+
substract(ansNode2, answerNode2).simplify().evaluate() === 0);
|
|
70
80
|
}
|
|
71
81
|
else {
|
|
72
82
|
return false;
|
|
@@ -79,8 +89,8 @@ const isAnswerValid = (ans, { answer }) => {
|
|
|
79
89
|
const getPropositions = (nbProps, { answer, ...identifiers }) => {
|
|
80
90
|
const { a, b, isAdd } = identifiers;
|
|
81
91
|
const propositions = [];
|
|
82
|
-
addValidProp(propositions, `${b}
|
|
83
|
-
tryToAddWrongProp(propositions, `${b}
|
|
92
|
+
addValidProp(propositions, `${b}${isAdd ? "+" : "-"}\\sqrt{${a}}${isAdd ? "<" : ">"}${b}${isAdd ? "+" : "-"}\\sqrt{${a + 1}}`, "tex");
|
|
93
|
+
tryToAddWrongProp(propositions, `${b}${isAdd ? "+" : "-"}\\sqrt{${a}}${!isAdd ? "<" : ">"}${b}${isAdd ? "+" : "-"}\\sqrt{${a + 1}}`, "tex");
|
|
84
94
|
return shuffleProps(propositions, nbProps);
|
|
85
95
|
};
|
|
86
96
|
const getKeys = (identifiers) => {
|
|
@@ -89,8 +99,8 @@ const getKeys = (identifiers) => {
|
|
|
89
99
|
"inf",
|
|
90
100
|
"sup",
|
|
91
101
|
...[
|
|
92
|
-
`${b}
|
|
93
|
-
`${b}
|
|
102
|
+
`${b}${isAdd ? "+" : "-"}\\sqrt{${a}}`,
|
|
103
|
+
`${b}${isAdd ? "+" : "-"}\\sqrt{${a + 1}}`,
|
|
94
104
|
].map((tex) => {
|
|
95
105
|
return {
|
|
96
106
|
id: "custom",
|
|
@@ -135,6 +145,5 @@ export const compareWithSquareRoots = {
|
|
|
135
145
|
subject: "Mathématiques",
|
|
136
146
|
maxAllowedQuestions: 30,
|
|
137
147
|
getQuestionFromIdentifiers,
|
|
138
|
-
answerType: "QCU",
|
|
139
148
|
hasHintAndCorrection: true,
|
|
140
149
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decimalOrdering.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/ordering/decimalOrdering.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"decimalOrdering.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/ordering/decimalOrdering.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAmF1D,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAajD,CAAC"}
|
|
@@ -76,9 +76,6 @@ const getPropositions = (n, { answer }) => {
|
|
|
76
76
|
tryToAddWrongProp(propositions, "=");
|
|
77
77
|
return shuffleProps(propositions, n);
|
|
78
78
|
};
|
|
79
|
-
const isAnswerValid = (ans, { answer }) => {
|
|
80
|
-
return ans === answer;
|
|
81
|
-
};
|
|
82
79
|
export const decimalOrdering = {
|
|
83
80
|
id: "decimalOrdering",
|
|
84
81
|
connector: "\\iff",
|
|
@@ -88,7 +85,6 @@ export const decimalOrdering = {
|
|
|
88
85
|
qcmTimer: 60,
|
|
89
86
|
freeTimer: 60,
|
|
90
87
|
getPropositions,
|
|
91
|
-
isAnswerValid,
|
|
92
88
|
subject: "Mathématiques",
|
|
93
89
|
answerType: "QCU",
|
|
94
90
|
getQuestionFromIdentifiers,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decimalOrderingNoRelatives.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/ordering/decimalOrderingNoRelatives.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"decimalOrderingNoRelatives.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/ordering/decimalOrderingNoRelatives.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAmF1D,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAa5D,CAAC"}
|
|
@@ -72,9 +72,6 @@ const getPropositions = (n, { answer }) => {
|
|
|
72
72
|
tryToAddWrongProp(propositions, "=");
|
|
73
73
|
return shuffleProps(propositions, n);
|
|
74
74
|
};
|
|
75
|
-
const isAnswerValid = (ans, { answer }) => {
|
|
76
|
-
return ans === answer;
|
|
77
|
-
};
|
|
78
75
|
export const decimalOrderingNoRelatives = {
|
|
79
76
|
id: "decimalOrderingNoRelatives",
|
|
80
77
|
connector: "\\iff",
|
|
@@ -84,7 +81,6 @@ export const decimalOrderingNoRelatives = {
|
|
|
84
81
|
qcmTimer: 60,
|
|
85
82
|
freeTimer: 60,
|
|
86
83
|
getPropositions,
|
|
87
|
-
isAnswerValid,
|
|
88
84
|
subject: "Mathématiques",
|
|
89
85
|
answerType: "QCU",
|
|
90
86
|
getQuestionFromIdentifiers,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integerOrdering.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/ordering/integerOrdering.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"integerOrdering.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/ordering/integerOrdering.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAgEF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAajD,CAAC"}
|
|
@@ -58,9 +58,6 @@ const getPropositions = (n, { answer }) => {
|
|
|
58
58
|
tryToAddWrongProp(propositions, "=");
|
|
59
59
|
return shuffleProps(propositions, n);
|
|
60
60
|
};
|
|
61
|
-
const isAnswerValid = (ans, { answer }) => {
|
|
62
|
-
return ans === answer;
|
|
63
|
-
};
|
|
64
61
|
export const integerOrdering = {
|
|
65
62
|
id: "integerOrdering",
|
|
66
63
|
connector: "\\iff",
|
|
@@ -70,7 +67,6 @@ export const integerOrdering = {
|
|
|
70
67
|
qcmTimer: 60,
|
|
71
68
|
freeTimer: 60,
|
|
72
69
|
getPropositions,
|
|
73
|
-
isAnswerValid,
|
|
74
70
|
answerType: "QCU",
|
|
75
71
|
subject: "Mathématiques",
|
|
76
72
|
getQuestionFromIdentifiers,
|
package/lib/exercises/math/calcul/proportionality/findCoeffInProportionalTableNonIntegers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findCoeffInProportionalTableNonIntegers.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/proportionality/findCoeffInProportionalTableNonIntegers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAS7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AA+HF,KAAK,OAAO,GAAG;IACb,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B,CAAC;AAoBF,eAAO,MAAM,uCAAuC,EAAE,QAAQ,CAC5D,WAAW,EACX,OAAO,
|
|
1
|
+
{"version":3,"file":"findCoeffInProportionalTableNonIntegers.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/proportionality/findCoeffInProportionalTableNonIntegers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAS7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AA+HF,KAAK,OAAO,GAAG;IACb,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B,CAAC;AAoBF,eAAO,MAAM,uCAAuC,EAAE,QAAQ,CAC5D,WAAW,EACX,OAAO,CAsBR,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isTableProportional.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/proportionality/isTableProportional.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"isTableProportional.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/proportionality/isTableProportional.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAgG5D,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAcrD,CAAC"}
|
|
@@ -86,9 +86,6 @@ const getPropositions = (n, { answer }) => {
|
|
|
86
86
|
tryToAddWrongProp(propositions, "On ne peut pas savoir", "raw");
|
|
87
87
|
return shuffleProps(propositions, n);
|
|
88
88
|
};
|
|
89
|
-
const isAnswerValid = (ans, { answer }) => {
|
|
90
|
-
return ans === answer;
|
|
91
|
-
};
|
|
92
89
|
export const isTableProportional = {
|
|
93
90
|
id: "isVTableProportional",
|
|
94
91
|
label: "Reconnaître un tableau de proportionnalité",
|
|
@@ -97,7 +94,6 @@ export const isTableProportional = {
|
|
|
97
94
|
qcmTimer: 60,
|
|
98
95
|
freeTimer: 60,
|
|
99
96
|
getPropositions,
|
|
100
|
-
isAnswerValid,
|
|
101
97
|
answerType: "QCU",
|
|
102
98
|
subject: "Mathématiques",
|
|
103
99
|
hasHintAndCorrection: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isTableProportionalNonInteger.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/proportionality/isTableProportionalNonInteger.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"isTableProportionalNonInteger.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/proportionality/isTableProportionalNonInteger.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAS7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,eAAe,EAAE,OAAO,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAkCF,KAAK,OAAO,GAAG;IACb,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B,CAAC;AAmGF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAoBxE,CAAC"}
|
|
@@ -37,9 +37,6 @@ ${mdTable([xTexs.map((v) => dollarize(v)), yTexs.map((v) => dollarize(v))])}
|
|
|
37
37
|
const getKeys = () => {
|
|
38
38
|
return [];
|
|
39
39
|
};
|
|
40
|
-
const isAnswerValid = () => {
|
|
41
|
-
throw Error("VEA not implemented");
|
|
42
|
-
};
|
|
43
40
|
// ["Entier", "Décimal", "Fraction"],
|
|
44
41
|
// ["Entières", "Décimales", "Fractions"],
|
|
45
42
|
const getIsTableProportionalNonIntegerQuestion = (opts) => {
|
|
@@ -128,7 +125,6 @@ export const isTableProportionalNonInteger = {
|
|
|
128
125
|
qcmTimer: 60,
|
|
129
126
|
freeTimer: 60,
|
|
130
127
|
getPropositions,
|
|
131
|
-
isAnswerValid,
|
|
132
128
|
subject: "Mathématiques",
|
|
133
129
|
// getHint,
|
|
134
130
|
// getCorrection,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"estimateAroundPow10NTimesAroundPow10N.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA+EF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"estimateAroundPow10NTimesAroundPow10N.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA+EF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAAC,WAAW,CAmBvE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"estimatePow10NPlusPow10MinusN.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAwFF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"estimatePow10NPlusPow10MinusN.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAwFF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAmB/D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPhysicalOrderOfMagnitude.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/rounding/getPhysicalOrderOfMagnitude.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"getPhysicalOrderOfMagnitude.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/rounding/getPhysicalOrderOfMagnitude.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAwHrC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAqGF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAsB7D,CAAC"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { addValidProp, shuffleProps, tryToAddWrongProp, propWhile, } from "../../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
4
|
-
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
5
4
|
import { doWhile } from "../../../../utils/doWhile.js";
|
|
6
|
-
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
7
5
|
const physicalFacts = [
|
|
8
6
|
{
|
|
9
7
|
question: "du diamètre d'un atome d'hydrogène",
|
|
@@ -132,7 +130,7 @@ const getPropositions = (n, { answer, factIndex }) => {
|
|
|
132
130
|
};
|
|
133
131
|
const getAnswer = ({ factIndex }) => {
|
|
134
132
|
const item = physicalFacts[factIndex];
|
|
135
|
-
const power = Math.
|
|
133
|
+
const power = Math.round(Math.log10(item.value));
|
|
136
134
|
return `10^{${power}}\\ ${item.unit}`;
|
|
137
135
|
};
|
|
138
136
|
const getInstruction = ({ factIndex }) => {
|
|
@@ -151,16 +149,33 @@ On cherche la puissance de $10$ la plus proche : c'est $10^{${power}}$.
|
|
|
151
149
|
Un ordre de grandeur ${item.question} est donc $10^{${power}}\\ ${item.unit}$.`;
|
|
152
150
|
};
|
|
153
151
|
const getKeys = () => [];
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
152
|
+
// const getKeys: GetKeys<Identifiers> = ({ factIndex }) => {
|
|
153
|
+
// const item = physicalFacts[factIndex];
|
|
154
|
+
// return [
|
|
155
|
+
// {
|
|
156
|
+
// id: "custom",
|
|
157
|
+
// label: item.unit,
|
|
158
|
+
// labelType: "tex",
|
|
159
|
+
// mathfieldInstructions: {
|
|
160
|
+
// method: "write",
|
|
161
|
+
// content: `\\ ${item.unit}`,
|
|
162
|
+
// },
|
|
163
|
+
// },
|
|
164
|
+
// ] as KeyProps[];
|
|
165
|
+
// };
|
|
166
|
+
// const isAnswerValid: VEA<Identifiers> = (ans, { answer, factIndex }) => {
|
|
167
|
+
// const item = physicalFacts[factIndex];
|
|
168
|
+
// if (!ans.includes(item.unit.replaceAll("textrm", "text"))) {
|
|
169
|
+
// return false;
|
|
170
|
+
// }
|
|
171
|
+
// try {
|
|
172
|
+
// const ansNode = parseAlgebraic(ans.split("\\")[0]);
|
|
173
|
+
// const answerNode = parseAlgebraic(answer.split("\\")[0]);
|
|
174
|
+
// return substract(ansNode, answerNode).simplify().evaluate() === 0;
|
|
175
|
+
// } catch (err) {
|
|
176
|
+
// return handleVEAError(err);
|
|
177
|
+
// }
|
|
178
|
+
// };
|
|
164
179
|
const getGetPhysicalOrderOfMagnitudeQuestion = () => {
|
|
165
180
|
const factIndex = Math.floor(Math.random() * physicalFacts.length);
|
|
166
181
|
const identifiers = { factIndex };
|
|
@@ -185,7 +200,6 @@ export const getPhysicalOrderOfMagnitude = {
|
|
|
185
200
|
qcmTimer: 60,
|
|
186
201
|
freeTimer: 60,
|
|
187
202
|
getPropositions,
|
|
188
|
-
isAnswerValid,
|
|
189
203
|
subject: "Mathématiques",
|
|
190
204
|
getInstruction,
|
|
191
205
|
getHint,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signFromAx.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/sign/signFromAx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"signFromAx.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/sign/signFromAx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAsGF,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,WAAW,CAiB5C,CAAC"}
|
|
@@ -4,7 +4,6 @@ import { randint } from "../../../../math/utils/random/randint.js";
|
|
|
4
4
|
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
5
5
|
import { monom } from "../../../../tree/nodes/polynomials/monomNode.js";
|
|
6
6
|
import { probaLawFlip } from "../../../../utils/alea/probaLawFlip.js";
|
|
7
|
-
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
8
7
|
//-x pos/nég/nul
|
|
9
8
|
//ax pos/nég/nul avec a>0 donné ou <0
|
|
10
9
|
const getPropositions = (n, { answer }) => {
|
|
@@ -63,14 +62,6 @@ const getCorrection = (identifiers) => {
|
|
|
63
62
|
const getKeys = () => {
|
|
64
63
|
return [];
|
|
65
64
|
};
|
|
66
|
-
const isAnswerValid = () => {
|
|
67
|
-
try {
|
|
68
|
-
throw Error("VEA not implemented");
|
|
69
|
-
}
|
|
70
|
-
catch (err) {
|
|
71
|
-
return handleVEAError(err);
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
65
|
const getSignFromAxQuestion = () => {
|
|
75
66
|
const identifiers = {
|
|
76
67
|
a: randint(-9, 10, [0, 1]),
|
|
@@ -102,7 +93,6 @@ export const signFromAx = {
|
|
|
102
93
|
qcmTimer: 60,
|
|
103
94
|
freeTimer: 60,
|
|
104
95
|
getPropositions,
|
|
105
|
-
isAnswerValid,
|
|
106
96
|
subject: "Mathématiques",
|
|
107
97
|
getInstruction,
|
|
108
98
|
getHint,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equationFromProblem.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationFromProblem.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"equationFromProblem.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationFromProblem.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAKlE,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAetE,KAAK,WAAW,GAAG;IACjB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,yBAAyB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC;IACzE,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,YAAY,EAAE,eAAe,CAAC;CAC/B,CAAC;AA6qBF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAcrD,CAAC"}
|
|
@@ -10,7 +10,8 @@ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
|
10
10
|
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
11
11
|
import { random, randomMany } from "../../../../utils/alea/random.js";
|
|
12
12
|
import { isOperatorNode, OperatorIds, } from "../../../../tree/nodes/operators/operatorNode.js";
|
|
13
|
-
import {
|
|
13
|
+
import { mdTable } from "../../../../utils/markdown/mdTable.js";
|
|
14
|
+
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
14
15
|
class ProblemConstructor {
|
|
15
16
|
static byHydratingSkeleton(skeleton, groupNameToVarNameToValue, mysteryVarPath, shuffleArrays) {
|
|
16
17
|
const shuffleFuncs = shuffleArrays.map((shuffleArray) => {
|
|
@@ -70,6 +71,16 @@ class Problem {
|
|
|
70
71
|
.filter((node) => !!node);
|
|
71
72
|
});
|
|
72
73
|
}
|
|
74
|
+
getExplanationString() {
|
|
75
|
+
const arrArr = Object.values(this.groups).map((group) => [
|
|
76
|
+
`\\text{${group.getScalarString(this.mysteryVar).replaceAll("$", "")}}`,
|
|
77
|
+
`:`,
|
|
78
|
+
`${group
|
|
79
|
+
.getNode(this.mysteryVar, this.groups, this.shuffleFuncs)
|
|
80
|
+
.toTex()}`,
|
|
81
|
+
]);
|
|
82
|
+
return alignTex(arrArr, false);
|
|
83
|
+
}
|
|
73
84
|
}
|
|
74
85
|
class ProblemVarGroup {
|
|
75
86
|
skeleton;
|
|
@@ -84,6 +95,9 @@ class ProblemVarGroup {
|
|
|
84
95
|
getNode(mysteryVar, groups, shuffleFuncs) {
|
|
85
96
|
return this.skeleton.nodeFunc(this, mysteryVar, groups, shuffleFuncs);
|
|
86
97
|
}
|
|
98
|
+
getScalarString(mysteryVar) {
|
|
99
|
+
return `${this.skeleton.strToScalar} ${this.toTex(mysteryVar)}`;
|
|
100
|
+
}
|
|
87
101
|
}
|
|
88
102
|
class ProblemVar {
|
|
89
103
|
skeleton;
|
|
@@ -101,12 +115,14 @@ class ProblemVar {
|
|
|
101
115
|
}
|
|
102
116
|
class ProblemVarSkeletonGroup {
|
|
103
117
|
vars;
|
|
118
|
+
strToScalar;
|
|
104
119
|
strFunc;
|
|
105
120
|
nodeFunc;
|
|
106
121
|
isCanBeMysteryGroup;
|
|
107
122
|
isComputed;
|
|
108
|
-
constructor(vars, strFunc, nodeFunc, isCanBeMysteryGroup, isComputed) {
|
|
123
|
+
constructor(vars, strToScalar, strFunc, nodeFunc, isCanBeMysteryGroup, isComputed) {
|
|
109
124
|
this.vars = vars;
|
|
125
|
+
this.strToScalar = strToScalar;
|
|
110
126
|
this.strFunc = strFunc;
|
|
111
127
|
this.nodeFunc = nodeFunc;
|
|
112
128
|
this.isCanBeMysteryGroup = isCanBeMysteryGroup;
|
|
@@ -154,14 +170,11 @@ const skeletons = [
|
|
|
154
170
|
Elle a pris trois pâtes à pizza à 1,95 € l’unité et deux pots de sauce tomate.
|
|
155
171
|
Elle a payé au total 8,37 €.
|
|
156
172
|
Quel est le prix, noté a, d'un pot de sauce ?`, (_group, mysteryVar, groups, shuffleFuncs) => {
|
|
157
|
-
const {
|
|
158
|
-
const [gp1, gp2] = shuffleFuncs[0](
|
|
159
|
-
return `Clara a acheté des ingrédients pour réaliser des pizzas.
|
|
160
|
-
Elle a pris ${gp1.toTex(mysteryVar)} et, dans un autre rayon, ${gp2.toTex(mysteryVar)}.
|
|
161
|
-
Elle a payé au total $${total
|
|
173
|
+
const { total, ...groupsWithoutTotal } = groups;
|
|
174
|
+
const [gp1, gp2] = shuffleFuncs[0](Object.values(groupsWithoutTotal));
|
|
175
|
+
return `Clara a acheté des ingrédients pour réaliser des pizzas. Elle a pris ${gp1.toTex(mysteryVar)} et, dans un autre rayon, ${gp2.toTex(mysteryVar)}. Elle a payé au total $${total
|
|
162
176
|
.getNode(mysteryVar, groups, shuffleFuncs)
|
|
163
|
-
.toTex()}$ €.
|
|
164
|
-
${mysteryVar.skeleton.question}`;
|
|
177
|
+
.toTex()}$ €. ${mysteryVar.skeleton.question}`;
|
|
165
178
|
}, (_group, mysteryVar, groups, shuffleFuncs) => {
|
|
166
179
|
const { pizza, sauce } = groups;
|
|
167
180
|
const [gp1, gp2] = shuffleFuncs[0]([pizza, sauce]);
|
|
@@ -184,7 +197,7 @@ ${mysteryVar.skeleton.question}`;
|
|
|
184
197
|
return randfloat(0.5, 4, 2, []).toTree();
|
|
185
198
|
},
|
|
186
199
|
},
|
|
187
|
-
}, (group, mysteryVar) => {
|
|
200
|
+
}, "le coût pour", (group, mysteryVar) => {
|
|
188
201
|
switch (mysteryVar?.skeleton.varName) {
|
|
189
202
|
case "n":
|
|
190
203
|
return `des pâtes à pizza à $${group.vars.price.value.toTex()}$ € l’unité`;
|
|
@@ -223,7 +236,7 @@ ${mysteryVar.skeleton.question}`;
|
|
|
223
236
|
return randfloat(0.5, 4, 2, []).toTree();
|
|
224
237
|
},
|
|
225
238
|
},
|
|
226
|
-
}, (group, mysteryVar) => {
|
|
239
|
+
}, "le coût pour", (group, mysteryVar) => {
|
|
227
240
|
switch (mysteryVar?.skeleton.varName) {
|
|
228
241
|
case "m":
|
|
229
242
|
return `des boîtes de sauce tomate à $${group.vars.price.value.toTex()}$ € l’unité`;
|
|
@@ -251,11 +264,11 @@ ${mysteryVar.skeleton.question}`;
|
|
|
251
264
|
str: "le coût total",
|
|
252
265
|
question: `Quel est le coût total, noté $t$, de ses achats ?`,
|
|
253
266
|
},
|
|
254
|
-
}, () => {
|
|
255
|
-
return "
|
|
267
|
+
}, "le", () => {
|
|
268
|
+
return "coût total";
|
|
256
269
|
}, (_group, _mysteryVar, groups, shuffleFuncs) => {
|
|
257
|
-
const {
|
|
258
|
-
const orderedNodes = shuffleFuncs[0](
|
|
270
|
+
const { total, ...groupsWithoutTotal } = groups;
|
|
271
|
+
const orderedNodes = shuffleFuncs[0](Object.values(groupsWithoutTotal)).map((group) => group.getNode());
|
|
259
272
|
// console.log(
|
|
260
273
|
// "orderedNodes[0].leftChild",
|
|
261
274
|
// (orderedNodes[0] as MultiplyNode).leftChild,
|
|
@@ -278,11 +291,34 @@ const getInstruction = (identifiers) => {
|
|
|
278
291
|
const { problemSkeletonIndex, groupNameToVarNameToValue, mysteryVarPath, shuffleArrays, } = identifiers;
|
|
279
292
|
const skeleton = skeletons[problemSkeletonIndex];
|
|
280
293
|
const problem = ProblemConstructor.byHydratingSkeleton(skeleton, groupNameToVarNameToValue, mysteryVarPath, shuffleArrays);
|
|
281
|
-
return
|
|
282
|
-
|
|
294
|
+
return `${mdTable([[""], [problem.frenchStr]])}
|
|
295
|
+
|
|
296
|
+
Parmi les équations suivantes, laquelle modélise cette situation ?`;
|
|
297
|
+
};
|
|
298
|
+
const getHint = (identifiers) => {
|
|
299
|
+
const { problemSkeletonIndex, groupNameToVarNameToValue, mysteryVarPath, shuffleArrays, } = identifiers;
|
|
300
|
+
const skeleton = skeletons[problemSkeletonIndex];
|
|
301
|
+
const problem = ProblemConstructor.byHydratingSkeleton(skeleton, groupNameToVarNameToValue, mysteryVarPath, shuffleArrays);
|
|
302
|
+
return `${Object.values(problem.groups).map((group) => `Quel est ${group.getScalarString(problem.mysteryVar)} ?`).join(`
|
|
303
|
+
|
|
304
|
+
`)}`;
|
|
305
|
+
};
|
|
306
|
+
const getCorrection = (identifiers) => {
|
|
307
|
+
const { problemSkeletonIndex, groupNameToVarNameToValue, mysteryVarPath, shuffleArrays, } = identifiers;
|
|
308
|
+
const skeleton = skeletons[problemSkeletonIndex];
|
|
309
|
+
const problem = ProblemConstructor.byHydratingSkeleton(skeleton, groupNameToVarNameToValue, mysteryVarPath, shuffleArrays);
|
|
310
|
+
return `On peut former les expressions suivantes:
|
|
311
|
+
${problem.getExplanationString()}
|
|
312
|
+
|
|
313
|
+
L'équation qui modélise la situation est donc:
|
|
314
|
+
|
|
315
|
+
$$
|
|
316
|
+
${getAnswer(identifiers)}
|
|
317
|
+
$$
|
|
318
|
+
|
|
319
|
+
`;
|
|
283
320
|
};
|
|
284
321
|
const getAnswerNode = (identifiers) => {
|
|
285
|
-
console.log("getAnswerNode", identifiers);
|
|
286
322
|
const { problemSkeletonIndex, groupNameToVarNameToValue, mysteryVarPath, shuffleArrays, } = identifiers;
|
|
287
323
|
const skeleton = skeletons[problemSkeletonIndex];
|
|
288
324
|
const problem = ProblemConstructor.byHydratingSkeleton(skeleton, groupNameToVarNameToValue, mysteryVarPath, shuffleArrays);
|
|
@@ -333,6 +369,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
333
369
|
const question = {
|
|
334
370
|
answer: getAnswer(identifiers),
|
|
335
371
|
instruction: getInstruction(identifiers),
|
|
372
|
+
hint: getHint(identifiers),
|
|
373
|
+
correction: getCorrection(identifiers),
|
|
336
374
|
keys: getKeys(identifiers),
|
|
337
375
|
answerFormat: "tex",
|
|
338
376
|
identifiers,
|
|
@@ -394,11 +432,11 @@ const getPropositions = (n, { answer, ...identifiers }) => {
|
|
|
394
432
|
}
|
|
395
433
|
return shuffleProps(propositions, n);
|
|
396
434
|
};
|
|
397
|
-
const isAnswerValid = (ans, { answer, ...identifiers }) => {
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
};
|
|
435
|
+
// const isAnswerValid: VEA<Identifiers> = (ans, { answer, ...identifiers }) => {
|
|
436
|
+
// const answerNode = getAnswerNode(identifiers); //!TODO: this call crashes but it's a mystery
|
|
437
|
+
// const ansNode = parseLatex(ans);
|
|
438
|
+
// return substract(ansNode, answerNode).evaluate() === 0;
|
|
439
|
+
// };
|
|
402
440
|
export const equationFromProblem = {
|
|
403
441
|
id: "equationFromProblem",
|
|
404
442
|
label: "Traduire un problème en une équation mathématique",
|
|
@@ -407,8 +445,9 @@ export const equationFromProblem = {
|
|
|
407
445
|
qcmTimer: 60,
|
|
408
446
|
freeTimer: 60,
|
|
409
447
|
getPropositions,
|
|
410
|
-
isAnswerValid,
|
|
448
|
+
// isAnswerValid,
|
|
411
449
|
subject: "Mathématiques",
|
|
412
450
|
getQuestionFromIdentifiers,
|
|
413
451
|
answerType: "QCU",
|
|
452
|
+
hasHintAndCorrection: true,
|
|
414
453
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isInequalityTrue.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/inequations/isInequalityTrue.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"isInequalityTrue.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/inequations/isInequalityTrue.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAE7C,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,IAAI,EAAE,eAAe,CAAC;IACtB,KAAK,EAAE,eAAe,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAyJF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAiBlD,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
4
|
-
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
5
4
|
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
6
5
|
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
7
6
|
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
@@ -106,14 +105,6 @@ Puisque $${leftSimTex} ${isTrue ? sign : reverseSign(sign)} ${rightSimTex}$, l'i
|
|
|
106
105
|
const getKeys = () => {
|
|
107
106
|
return [];
|
|
108
107
|
};
|
|
109
|
-
const isAnswerValid = (ans, { answer }) => {
|
|
110
|
-
try {
|
|
111
|
-
return ans === answer;
|
|
112
|
-
}
|
|
113
|
-
catch (err) {
|
|
114
|
-
return handleVEAError(err);
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
108
|
const getIsInequalityTrueQuestion = () => {
|
|
118
109
|
const a = randint(-10, 10, [0]);
|
|
119
110
|
const b = randint(-10, 10, [0]);
|
|
@@ -156,7 +147,6 @@ export const isInequalityTrue = {
|
|
|
156
147
|
qcmTimer: 60,
|
|
157
148
|
freeTimer: 60,
|
|
158
149
|
getPropositions,
|
|
159
|
-
isAnswerValid,
|
|
160
150
|
subject: "Mathématiques",
|
|
161
151
|
getInstruction,
|
|
162
152
|
getHint,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isolateUInInvXPlusInvYEqualsInvU.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"isolateUInInvXPlusInvYEqualsInvU.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAKrC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAqEF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CAmBlE,CAAC;AAUF,eAAO,MAAM,kCAAkC,EAAE,QAAQ,CAAC,WAAW,CAoBpE,CAAC"}
|