math-exercises 3.0.127 → 3.0.129
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.map +1 -1
- package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.js +14 -4
- 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 +3 -19
- package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.d.ts +4 -1
- package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.d.ts.map +1 -1
- package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.js +34 -11
- package/lib/exercises/math/calcul/ordering/compareFracAndDec.d.ts +2 -6
- package/lib/exercises/math/calcul/ordering/compareFracAndDec.d.ts.map +1 -1
- package/lib/exercises/math/calcul/ordering/compareFracAndDec.js +81 -192
- package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.d.ts.map +1 -1
- package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.js +20 -11
- 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 +6 -7
- 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/ordering/compareAMinusB.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.js +38 -34
- package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.js +1 -5
- 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 +0 -1
- package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.d.ts.map +1 -1
- package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.js +1 -2
- package/lib/exercises/math/conversion/minutesToHours.d.ts.map +1 -1
- package/lib/exercises/math/conversion/minutesToHours.js +6 -4
- package/lib/exercises/math/conversion/secondsToHours.d.ts.map +1 -1
- package/lib/exercises/math/conversion/secondsToHours.js +6 -4
- package/lib/exercises/math/dataRepresentations/barChartInterpreting.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/barChartInterpreting.js +5 -5
- package/lib/exercises/math/dataRepresentations/compareBoxPlot.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/compareBoxPlot.js +0 -1
- 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 +0 -1
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.js +0 -1
- package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.d.ts.map +1 -1
- 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/basics/coordsOfPointOnCurveFindY.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.js +0 -1
- 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/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/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 +0 -1
- 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/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/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 +6 -8
- 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 +7 -4
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isMultipleOrDivisor.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/arithmetics/isMultipleOrDivisor.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"isMultipleOrDivisor.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/arithmetics/isMultipleOrDivisor.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAK7C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,eAAe,CAAC;IACnB,CAAC,EAAE,eAAe,CAAC;CACpB,CAAC;AAyGF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAiBrD,CAAC"}
|
|
@@ -6,7 +6,6 @@ import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
|
6
6
|
import { DivideNode } from "../../../../tree/nodes/operators/divideNode.js";
|
|
7
7
|
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
8
8
|
import { random } from "../../../../utils/alea/random.js";
|
|
9
|
-
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
10
9
|
function isMultiple(a, b) {
|
|
11
10
|
return a !== 0 && b % a === 0;
|
|
12
11
|
}
|
|
@@ -66,14 +65,6 @@ $$`;
|
|
|
66
65
|
const getKeys = () => {
|
|
67
66
|
return [];
|
|
68
67
|
};
|
|
69
|
-
const isAnswerValid = () => {
|
|
70
|
-
try {
|
|
71
|
-
throw Error("VEA not implemented");
|
|
72
|
-
}
|
|
73
|
-
catch (err) {
|
|
74
|
-
return handleVEAError(err);
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
68
|
const getIsMultipleOrDivisorQuestion = () => {
|
|
78
69
|
const isMultiple = coinFlip();
|
|
79
70
|
const a = randint(10, 100);
|
|
@@ -105,7 +96,6 @@ export const isMultipleOrDivisor = {
|
|
|
105
96
|
qcmTimer: 60,
|
|
106
97
|
freeTimer: 60,
|
|
107
98
|
getPropositions,
|
|
108
|
-
isAnswerValid,
|
|
109
99
|
subject: "Mathématiques",
|
|
110
100
|
getInstruction,
|
|
111
101
|
getHint,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mentalProgramSolve.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/mentalCaluls/mentalProgramSolve.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAG7C,OAAO,EAGL,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;AAgCzC,KAAK,WAAW,GAAG;IACjB,qBAAqB,EAAE,eAAe,CAAC;IACvC,WAAW,EAAE,mBAAmB,CAAC;CAClC,CAAC;
|
|
1
|
+
{"version":3,"file":"mentalProgramSolve.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/mentalCaluls/mentalProgramSolve.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAG7C,OAAO,EAGL,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;AAgCzC,KAAK,WAAW,GAAG;IACjB,qBAAqB,EAAE,eAAe,CAAC;IACvC,WAAW,EAAE,mBAAmB,CAAC;CAClC,CAAC;AAkNF,KAAK,OAAO,GAAG;IACb,UAAU,EAAE,QAAQ,GAAG,SAAS,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAiCF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAyB7D,CAAC"}
|
|
@@ -42,10 +42,16 @@ const getPropositions = (n, { answer, progCalcIds, nodeIdsStartingNumber }) => {
|
|
|
42
42
|
const progCalc = ProgCalcConstructor.fromIdentifiers(progCalcIds);
|
|
43
43
|
const nodeFinalNumber = progCalc.apply(nodeStartingNumber).simplify();
|
|
44
44
|
//applies progCalc to finalNumber
|
|
45
|
-
|
|
45
|
+
const node1 = progCalc.apply(nodeFinalNumber);
|
|
46
|
+
if (node1) {
|
|
47
|
+
tryToAddWrongProp(propositions, node1.simplify().toTex());
|
|
48
|
+
}
|
|
46
49
|
//applies progCalc operations in reverse to finalNumber
|
|
47
50
|
const progCalcReversed = new ProgCalc(progCalc.operations.toReversed());
|
|
48
|
-
|
|
51
|
+
const node2 = progCalcReversed.apply(nodeFinalNumber);
|
|
52
|
+
if (node2) {
|
|
53
|
+
tryToAddWrongProp(propositions, node2.simplify().toTex());
|
|
54
|
+
}
|
|
49
55
|
//stops at intermediary step (stops before goal)
|
|
50
56
|
const progCalcInverse = progCalc.getInverseProgCalc();
|
|
51
57
|
const inverseOperations = progCalcInverse.operations;
|
|
@@ -54,7 +60,12 @@ const getPropositions = (n, { answer, progCalcIds, nodeIdsStartingNumber }) => {
|
|
|
54
60
|
const nodePrevious = arrStepNodes[arrStepNodes.length - 1].simplify();
|
|
55
61
|
const operation = inverseOperations[i];
|
|
56
62
|
const nodeStep = operation.func(nodePrevious);
|
|
57
|
-
|
|
63
|
+
if (nodeStep) {
|
|
64
|
+
arrStepNodes.push(nodeStep);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
58
69
|
}
|
|
59
70
|
shuffle(arrStepNodes).forEach((nodeStep) => {
|
|
60
71
|
if (propositions.length < n) {
|
|
@@ -227,5 +238,4 @@ export const mentalProgramSolve = {
|
|
|
227
238
|
getAnswer,
|
|
228
239
|
getQuestionFromIdentifiers,
|
|
229
240
|
hasHintAndCorrection: true,
|
|
230
|
-
answerType: "QCU",
|
|
231
241
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expressionNature.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/operations/expressionNature.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"expressionNature.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/operations/expressionNature.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAO7C,KAAK,WAAW,GAAG;IAAE,OAAO,EAAE,eAAe,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAuM/E,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAclD,CAAC"}
|
|
@@ -173,9 +173,6 @@ const getPropositions = (n, { answer }) => {
|
|
|
173
173
|
tryToAddWrongProp(propositions, "un quotient", "raw");
|
|
174
174
|
return shuffleProps(propositions, n);
|
|
175
175
|
};
|
|
176
|
-
const isAnswerValid = (ans, { answer }) => {
|
|
177
|
-
return ans === answer;
|
|
178
|
-
};
|
|
179
176
|
export const expressionNature = {
|
|
180
177
|
id: "expressionNature",
|
|
181
178
|
connector: "=",
|
|
@@ -185,7 +182,6 @@ export const expressionNature = {
|
|
|
185
182
|
qcmTimer: 60,
|
|
186
183
|
freeTimer: 60,
|
|
187
184
|
getPropositions,
|
|
188
|
-
isAnswerValid,
|
|
189
185
|
subject: "Mathématiques",
|
|
190
186
|
answerType: "QCU",
|
|
191
187
|
getQuestionFromIdentifiers,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compareA10N.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/ordering/compareA10N.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAmBrC,KAAK,IAAI,GAAG;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,IAAI,EAAE,CAAC;CACf,CAAC;AAwTF,KAAK,OAAO,GAAG;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AA0CF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"compareA10N.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/ordering/compareA10N.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAmBrC,KAAK,IAAI,GAAG;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,IAAI,EAAE,CAAC;CACf,CAAC;AAwTF,KAAK,OAAO,GAAG;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AA0CF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAetD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compareABUsingQuotient.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/ordering/compareABUsingQuotient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"compareABUsingQuotient.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/ordering/compareABUsingQuotient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAK7C,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,eAAe,EAAE,CAAC;CACnC,CAAC;AA2HF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAgBxD,CAAC"}
|
|
@@ -42,22 +42,7 @@ $$
|
|
|
42
42
|
const getAnswer = (identifiers) => {
|
|
43
43
|
const { orderedNodeIds } = identifiers;
|
|
44
44
|
const [A, B] = orderedNodeIds.map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds).toTex());
|
|
45
|
-
return `${B}
|
|
46
|
-
};
|
|
47
|
-
const isAnswerValid = (ans, { ...identifiers }) => {
|
|
48
|
-
const { orderedNodeIds } = identifiers;
|
|
49
|
-
const [A, B] = orderedNodeIds.map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds).toTex());
|
|
50
|
-
const compSymbol = ans.includes(">")
|
|
51
|
-
? ">"
|
|
52
|
-
: ans.includes("<")
|
|
53
|
-
? "<"
|
|
54
|
-
: undefined;
|
|
55
|
-
if (!compSymbol) {
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
return (compSymbol === ">" ? [B, A] : [A, B]).every((tex, i) => tex === ans.split(compSymbol)[i]);
|
|
60
|
-
}
|
|
45
|
+
return `${B}>${A}`;
|
|
61
46
|
};
|
|
62
47
|
const getPropositions = (nbProps, { ...identifiers }) => {
|
|
63
48
|
const { orderedNodeIds } = identifiers;
|
|
@@ -88,7 +73,7 @@ const getKeys = (identifiers) => {
|
|
|
88
73
|
};
|
|
89
74
|
const getCompareABUsingQuotientQuestion = () => {
|
|
90
75
|
const n = randint(2, 150);
|
|
91
|
-
const orderedNodesIncreasing = [add(1, sqrt(
|
|
76
|
+
const orderedNodesIncreasing = [add(1, sqrt(1 + n)), add(2, sqrt(n))];
|
|
92
77
|
return getQuestionFromIdentifiers({
|
|
93
78
|
orderedNodeIds: orderedNodesIncreasing.map((node) => node.toIdentifiers()),
|
|
94
79
|
});
|
|
@@ -113,11 +98,10 @@ export const compareABUsingQuotient = {
|
|
|
113
98
|
qcmTimer: 60,
|
|
114
99
|
freeTimer: 60,
|
|
115
100
|
getPropositions,
|
|
116
|
-
isAnswerValid,
|
|
117
101
|
getAnswer,
|
|
118
102
|
subject: "Mathématiques",
|
|
119
103
|
maxAllowedQuestions: 30,
|
|
120
104
|
getQuestionFromIdentifiers,
|
|
121
|
-
answerType: "QCU",
|
|
122
105
|
hasHintAndCorrection: true,
|
|
106
|
+
answerType: "QCU",
|
|
123
107
|
};
|
|
@@ -4,6 +4,9 @@ type Identifiers = {
|
|
|
4
4
|
nodeIds: NodeIdentifiers[];
|
|
5
5
|
texAnswers: string[];
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
type Options = {
|
|
8
|
+
isFracOfSums: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const compareFracABWithFracAPlusCBPlusC: Exercise<Identifiers, Options>;
|
|
8
11
|
export {};
|
|
9
12
|
//# sourceMappingURL=compareFracABWithFracAPlusCBPlusC.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compareFracABWithFracAPlusCBPlusC.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"compareFracABWithFracAPlusCBPlusC.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAY7C,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AA0MF,KAAK,OAAO,GAAG;IACb,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAgBF,eAAO,MAAM,iCAAiC,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAqB1E,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
1
|
+
import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { lcm } from "../../../../math/utils/arithmetic/lcm.js";
|
|
4
4
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
5
5
|
import { NodeConstructor, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
6
|
-
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
6
|
+
import { add, isAddNode } from "../../../../tree/nodes/operators/addNode.js";
|
|
7
7
|
import { frac, isFractionNode, } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
8
8
|
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
9
9
|
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
@@ -33,12 +33,17 @@ const getCorrection = (identifiers) => {
|
|
|
33
33
|
? frac(multiply(node.leftChild.simplify(), frac(sameDen, node.rightChild)).simplify(), sameDen)
|
|
34
34
|
: frac(multiply(node, sameDen).simplify(), sameDen));
|
|
35
35
|
const answer = getAnswer(identifiers);
|
|
36
|
-
|
|
36
|
+
const isFracOfSums = isAddNode(nodes[1].leftChild);
|
|
37
|
+
return `${isFracOfSums
|
|
38
|
+
? `On a :
|
|
37
39
|
|
|
38
40
|
$$
|
|
39
41
|
${nodes[1].toSimplificationTex()}
|
|
40
42
|
$$
|
|
41
43
|
|
|
44
|
+
`
|
|
45
|
+
: ``}
|
|
46
|
+
|
|
42
47
|
On veut donc comparer $${nodesSimplified[0].toTex()}$ et $${nodesSimplified[1].toTex()}$.
|
|
43
48
|
|
|
44
49
|
On peut choisir $${sameDen.frenchify()}$ comme dénominateur commun.
|
|
@@ -84,14 +89,19 @@ const getAnswer = (identifiers) => {
|
|
|
84
89
|
const { texAnswers } = identifiers;
|
|
85
90
|
return texAnswers[0];
|
|
86
91
|
};
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
};
|
|
90
|
-
const getCompareFracABWithFracAPlusCBPlusCQuestion = () => {
|
|
92
|
+
const getCompareFracABWithFracAPlusCBPlusCQuestion = (optsIn) => {
|
|
93
|
+
const opts = optsIn ?? optsDefault;
|
|
91
94
|
const a = randint(1, 10);
|
|
92
|
-
const b = randint(
|
|
95
|
+
const b = randint(2, 10, [a]);
|
|
93
96
|
const c = randint(1, 10);
|
|
94
|
-
const nodes = [
|
|
97
|
+
const nodes = [
|
|
98
|
+
frac(a, b),
|
|
99
|
+
(() => {
|
|
100
|
+
const nodeNum = opts.isFracOfSums ? add(a, c) : (a + c).toTree();
|
|
101
|
+
const nodeDec = opts.isFracOfSums ? add(b, c) : (b + c).toTree();
|
|
102
|
+
return frac(nodeNum, nodeDec);
|
|
103
|
+
})(),
|
|
104
|
+
];
|
|
95
105
|
const isOrderAsc = coinFlip();
|
|
96
106
|
const sortedNodes = nodes.toSorted((node1, node2) => (isOrderAsc ? +1 : -1) * (node1.evaluate() - node2.evaluate()));
|
|
97
107
|
const texAnswers = [
|
|
@@ -132,18 +142,31 @@ const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
|
132
142
|
};
|
|
133
143
|
return question;
|
|
134
144
|
};
|
|
145
|
+
const optsDefault = {
|
|
146
|
+
isFracOfSums: false,
|
|
147
|
+
};
|
|
148
|
+
const options = [
|
|
149
|
+
{
|
|
150
|
+
id: "isFracOfSums",
|
|
151
|
+
label: "Fraction de sommes ?",
|
|
152
|
+
target: GeneratorOptionTarget.generation,
|
|
153
|
+
type: GeneratorOptionType.checkbox,
|
|
154
|
+
values: [true, false],
|
|
155
|
+
defaultValue: optsDefault.isFracOfSums,
|
|
156
|
+
},
|
|
157
|
+
];
|
|
135
158
|
export const compareFracABWithFracAPlusCBPlusC = {
|
|
136
159
|
id: "compareFracABWithFracAPlusCBPlusC",
|
|
137
160
|
label: "Effectuer des comparaisons entre des fractions simples (de la forme $\\frac{a}{b}$ et $\\frac{a+c}{b+c}$)",
|
|
138
161
|
isSingleStep: true,
|
|
139
162
|
generator: (nb, opts) => getDistinctQuestions(() => getCompareFracABWithFracAPlusCBPlusCQuestion(opts), nb, 30),
|
|
163
|
+
options,
|
|
140
164
|
qcmTimer: 60,
|
|
141
165
|
freeTimer: 60,
|
|
142
|
-
isAnswerValid,
|
|
143
166
|
getPropositions,
|
|
144
167
|
subject: "Mathématiques",
|
|
145
168
|
maxAllowedQuestions: 30,
|
|
146
169
|
getQuestionFromIdentifiers,
|
|
147
|
-
answerType: "QCU",
|
|
148
170
|
hasHintAndCorrection: true,
|
|
171
|
+
answerType: "QCU",
|
|
149
172
|
};
|
|
@@ -5,18 +5,14 @@ type QCMItem = {
|
|
|
5
5
|
isValidAnswer: boolean;
|
|
6
6
|
};
|
|
7
7
|
type QuestionParam = {
|
|
8
|
-
|
|
8
|
+
letter: string;
|
|
9
9
|
trueName: string;
|
|
10
10
|
tex: string;
|
|
11
11
|
nodeIds: NodeIdentifiers;
|
|
12
12
|
explainTex: string;
|
|
13
13
|
};
|
|
14
14
|
type Identifiers = {
|
|
15
|
-
|
|
16
|
-
a: number;
|
|
17
|
-
b: number;
|
|
18
|
-
c: number;
|
|
19
|
-
dictFakeNameToQuestionParam: Record<string, QuestionParam>;
|
|
15
|
+
questionParams: QuestionParam[];
|
|
20
16
|
items: QCMItem[];
|
|
21
17
|
};
|
|
22
18
|
type Options = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compareFracAndDec.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/ordering/compareFracAndDec.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"compareFracAndDec.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/ordering/compareFracAndDec.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAW7C,KAAK,OAAO,GAAG;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,eAAe,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,KAAK,EAAE,OAAO,EAAE,CAAC;CAClB,CAAC;AA0SF,KAAK,OAAO,GAAG;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,yBAAyB,EAAE,OAAO,CAAC;CACpC,CAAC;AAuBF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgB5D,CAAC"}
|