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.
Files changed (193) hide show
  1. package/lib/exercises/math/calcul/arithmetics/isMultipleOrDivisor.d.ts.map +1 -1
  2. package/lib/exercises/math/calcul/arithmetics/isMultipleOrDivisor.js +0 -10
  3. package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.d.ts.map +1 -1
  4. package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.js +14 -4
  5. package/lib/exercises/math/calcul/operations/expressionNature.d.ts.map +1 -1
  6. package/lib/exercises/math/calcul/operations/expressionNature.js +0 -4
  7. package/lib/exercises/math/calcul/ordering/compareA10N.d.ts.map +1 -1
  8. package/lib/exercises/math/calcul/ordering/compareA10N.js +0 -1
  9. package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.d.ts.map +1 -1
  10. package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.js +3 -19
  11. package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.d.ts +4 -1
  12. package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.d.ts.map +1 -1
  13. package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.js +34 -11
  14. package/lib/exercises/math/calcul/ordering/compareFracAndDec.d.ts +2 -6
  15. package/lib/exercises/math/calcul/ordering/compareFracAndDec.d.ts.map +1 -1
  16. package/lib/exercises/math/calcul/ordering/compareFracAndDec.js +81 -192
  17. package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.d.ts.map +1 -1
  18. package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.js +20 -11
  19. package/lib/exercises/math/calcul/ordering/decimalOrdering.d.ts.map +1 -1
  20. package/lib/exercises/math/calcul/ordering/decimalOrdering.js +0 -4
  21. package/lib/exercises/math/calcul/ordering/decimalOrderingNoRelatives.d.ts.map +1 -1
  22. package/lib/exercises/math/calcul/ordering/decimalOrderingNoRelatives.js +0 -4
  23. package/lib/exercises/math/calcul/ordering/integerOrdering.d.ts.map +1 -1
  24. package/lib/exercises/math/calcul/ordering/integerOrdering.js +0 -4
  25. package/lib/exercises/math/calcul/proportionality/findCoeffInProportionalTableNonIntegers.d.ts.map +1 -1
  26. package/lib/exercises/math/calcul/proportionality/findCoeffInProportionalTableNonIntegers.js +0 -1
  27. package/lib/exercises/math/calcul/proportionality/isTableProportional.d.ts.map +1 -1
  28. package/lib/exercises/math/calcul/proportionality/isTableProportional.js +0 -4
  29. package/lib/exercises/math/calcul/proportionality/isTableProportionalNonInteger.d.ts.map +1 -1
  30. package/lib/exercises/math/calcul/proportionality/isTableProportionalNonInteger.js +0 -4
  31. package/lib/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.d.ts.map +1 -1
  32. package/lib/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.js +0 -1
  33. package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.d.ts.map +1 -1
  34. package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.js +0 -1
  35. package/lib/exercises/math/calcul/rounding/getPhysicalOrderOfMagnitude.d.ts.map +1 -1
  36. package/lib/exercises/math/calcul/rounding/getPhysicalOrderOfMagnitude.js +28 -14
  37. package/lib/exercises/math/calcul/sign/signFromAx.d.ts.map +1 -1
  38. package/lib/exercises/math/calcul/sign/signFromAx.js +0 -10
  39. package/lib/exercises/math/calculLitteral/equation/equationFromProblem.d.ts.map +1 -1
  40. package/lib/exercises/math/calculLitteral/equation/equationFromProblem.js +6 -7
  41. package/lib/exercises/math/calculLitteral/inequations/isInequalityTrue.d.ts.map +1 -1
  42. package/lib/exercises/math/calculLitteral/inequations/isInequalityTrue.js +0 -10
  43. package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.d.ts.map +1 -1
  44. package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.js +38 -34
  45. package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.d.ts.map +1 -1
  46. package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.js +1 -5
  47. package/lib/exercises/math/calculLitteral/simplifying/valuateExpression.d.ts.map +1 -1
  48. package/lib/exercises/math/calculLitteral/simplifying/valuateExpression.js +0 -10
  49. package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.d.ts.map +1 -1
  50. package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.js +0 -1
  51. package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.d.ts.map +1 -1
  52. package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.js +1 -2
  53. package/lib/exercises/math/conversion/minutesToHours.d.ts.map +1 -1
  54. package/lib/exercises/math/conversion/minutesToHours.js +6 -4
  55. package/lib/exercises/math/conversion/secondsToHours.d.ts.map +1 -1
  56. package/lib/exercises/math/conversion/secondsToHours.js +6 -4
  57. package/lib/exercises/math/dataRepresentations/barChartInterpreting.d.ts.map +1 -1
  58. package/lib/exercises/math/dataRepresentations/barChartInterpreting.js +5 -5
  59. package/lib/exercises/math/dataRepresentations/compareBoxPlot.d.ts.map +1 -1
  60. package/lib/exercises/math/dataRepresentations/compareBoxPlot.js +0 -1
  61. package/lib/exercises/math/derivation/convexity/convexityQuadrinomials.d.ts.map +1 -1
  62. package/lib/exercises/math/derivation/convexity/convexityQuadrinomials.js +0 -1
  63. package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.d.ts.map +1 -1
  64. package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.js +0 -4
  65. package/lib/exercises/math/functions/affines/affineAdjustmentComplete.d.ts.map +1 -1
  66. package/lib/exercises/math/functions/affines/affineAdjustmentComplete.js +0 -1
  67. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.d.ts.map +1 -1
  68. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.js +0 -1
  69. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.d.ts.map +1 -1
  70. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.js +0 -1
  71. package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.d.ts.map +1 -1
  72. package/lib/exercises/math/functions/affines/recognizeAffineGraph.d.ts.map +1 -1
  73. package/lib/exercises/math/functions/affines/recognizeAffineGraph.js +0 -4
  74. package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.d.ts.map +1 -1
  75. package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.js +0 -1
  76. package/lib/exercises/math/functions/basics/isPointOnFunction.d.ts.map +1 -1
  77. package/lib/exercises/math/functions/basics/isPointOnFunction.js +0 -10
  78. package/lib/exercises/math/functions/basics/signOfFunction.d.ts.map +1 -1
  79. package/lib/exercises/math/functions/basics/signOfFunction.js +0 -10
  80. package/lib/exercises/math/functions/cube/isPointOnCubicFunction.d.ts.map +1 -1
  81. package/lib/exercises/math/functions/cube/isPointOnCubicFunction.js +0 -10
  82. package/lib/exercises/math/functions/exponentials/exponentialsVariations.d.ts.map +1 -1
  83. package/lib/exercises/math/functions/exponentials/exponentialsVariations.js +0 -4
  84. package/lib/exercises/math/functions/inverse/compareInverseValues.d.ts.map +1 -1
  85. package/lib/exercises/math/functions/inverse/compareInverseValues.js +0 -1
  86. package/lib/exercises/math/functions/inverse/isPointOnReciprocalFunction.d.ts.map +1 -1
  87. package/lib/exercises/math/functions/inverse/isPointOnReciprocalFunction.js +0 -10
  88. package/lib/exercises/math/functions/parity/parityFromAlgebra.d.ts.map +1 -1
  89. package/lib/exercises/math/functions/parity/parityFromAlgebra.js +0 -4
  90. package/lib/exercises/math/functions/square/compareSquaredValues.d.ts.map +1 -1
  91. package/lib/exercises/math/functions/square/compareSquaredValues.js +0 -10
  92. package/lib/exercises/math/geometry/convexity/convexityTrinomialsGeo.d.ts.map +1 -1
  93. package/lib/exercises/math/geometry/convexity/convexityTrinomialsGeo.js +0 -4
  94. package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.d.ts.map +1 -1
  95. package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.js +0 -4
  96. package/lib/exercises/math/geometry/lines/isPointOnCartesianLine.d.ts.map +1 -1
  97. package/lib/exercises/math/geometry/lines/isPointOnCartesianLine.js +0 -4
  98. package/lib/exercises/math/geometry/lines/isPointOnLine.d.ts.map +1 -1
  99. package/lib/exercises/math/geometry/lines/isPointOnLine.js +0 -4
  100. package/lib/exercises/math/geometry/lines/linesRelativePositions.d.ts.map +1 -1
  101. package/lib/exercises/math/geometry/lines/linesRelativePositions.js +0 -4
  102. package/lib/exercises/math/geometry/parametric/pointFromParametricLine.d.ts.map +1 -1
  103. package/lib/exercises/math/geometry/parametric/pointFromParametricLine.js +0 -4
  104. package/lib/exercises/math/geometry/pythagore/isTriangleRight.d.ts.map +1 -1
  105. package/lib/exercises/math/geometry/pythagore/isTriangleRight.js +0 -4
  106. package/lib/exercises/math/geometry/quadrilaterals/parallelogramRectangle.d.ts.map +1 -1
  107. package/lib/exercises/math/geometry/quadrilaterals/parallelogramRectangle.js +0 -4
  108. package/lib/exercises/math/geometry/quadrilaterals/parallelogramRhombus.d.ts.map +1 -1
  109. package/lib/exercises/math/geometry/quadrilaterals/parallelogramRhombus.js +0 -4
  110. package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.d.ts.map +1 -1
  111. package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.js +0 -4
  112. package/lib/exercises/math/geometry/shapes/basicShapesRecognition.d.ts.map +1 -1
  113. package/lib/exercises/math/geometry/shapes/basicShapesRecognition.js +6 -7
  114. package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromBasis.d.ts.map +1 -1
  115. package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromBasis.js +0 -10
  116. package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromPicture.d.ts.map +1 -1
  117. package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromPicture.js +0 -10
  118. package/lib/exercises/math/geometry/vectors/equalCaracteristicFromGraph.d.ts.map +1 -1
  119. package/lib/exercises/math/geometry/vectors/equalCaracteristicFromGraph.js +0 -4
  120. package/lib/exercises/math/percent/evolutions/findRightCalculForPriceEvolution.d.ts.map +1 -1
  121. package/lib/exercises/math/percent/evolutions/findRightCalculForPriceEvolution.js +0 -4
  122. package/lib/exercises/math/probaStat/basicProbas/mostLeastProbable.d.ts.map +1 -1
  123. package/lib/exercises/math/probaStat/basicProbas/mostLeastProbable.js +0 -10
  124. package/lib/exercises/math/probaStat/checkEquiprobability.d.ts.map +1 -1
  125. package/lib/exercises/math/probaStat/checkEquiprobability.js +0 -10
  126. package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.d.ts.map +1 -1
  127. package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.js +0 -1
  128. package/lib/exercises/math/probaStat/events/describeEvent.d.ts.map +1 -1
  129. package/lib/exercises/math/probaStat/events/describeEvent.js +0 -10
  130. package/lib/exercises/math/probaStat/events/eventNotation.d.ts.map +1 -1
  131. package/lib/exercises/math/probaStat/events/eventNotation.js +0 -10
  132. package/lib/exercises/math/probaStat/stats1var/compareSeriesDispersion.d.ts.map +1 -1
  133. package/lib/exercises/math/probaStat/stats1var/compareSeriesDispersion.js +0 -4
  134. package/lib/exercises/math/probaStat/stats1var/getQuartileProportionQuestion.d.ts.map +1 -1
  135. package/lib/exercises/math/probaStat/stats1var/getQuartileProportionQuestion.js +0 -10
  136. package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.d.ts.map +1 -1
  137. package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.js +0 -4
  138. package/lib/exercises/math/python/pythonForLoopInstructionCompletion.d.ts.map +1 -1
  139. package/lib/exercises/math/python/pythonForLoopInstructionCompletion.js +0 -10
  140. package/lib/exercises/math/python/pythonIfStatementCompletion.d.ts.map +1 -1
  141. package/lib/exercises/math/python/pythonIfStatementCompletion.js +7 -8
  142. package/lib/exercises/math/python/pythonSimpleFunctionInstructionCompletion.d.ts.map +1 -1
  143. package/lib/exercises/math/python/pythonSimpleFunctionInstructionCompletion.js +0 -10
  144. package/lib/exercises/math/python/pythonWhileStatementCompletion.d.ts.map +1 -1
  145. package/lib/exercises/math/python/pythonWhileStatementCompletion.js +5 -6
  146. package/lib/exercises/math/python/pythonWhileStatementOperationCompletion.d.ts.map +1 -1
  147. package/lib/exercises/math/python/pythonWhileStatementOperationCompletion.js +5 -6
  148. package/lib/exercises/math/python/variableType.d.ts.map +1 -1
  149. package/lib/exercises/math/python/variableType.js +0 -10
  150. package/lib/exercises/math/sampling/isSamplingRepresentative.d.ts.map +1 -1
  151. package/lib/exercises/math/sampling/isSamplingRepresentative.js +0 -4
  152. package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromFirstTerms.d.ts.map +1 -1
  153. package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromFirstTerms.js +0 -4
  154. package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromGraph.d.ts.map +1 -1
  155. package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromGraph.js +0 -4
  156. package/lib/exercises/math/sequences/geometric/geometricVariations.d.ts.map +1 -1
  157. package/lib/exercises/math/sequences/geometric/geometricVariations.js +0 -4
  158. package/lib/exercises/math/sets/intervals/isNumberInInterval.d.ts.map +1 -1
  159. package/lib/exercises/math/sets/intervals/isNumberInInterval.js +0 -10
  160. package/lib/exercises/math/sets/isNumberDecimal.d.ts.map +1 -1
  161. package/lib/exercises/math/sets/isNumberDecimal.js +0 -10
  162. package/lib/exercises/math/sets/nameOfNumberSets.d.ts.map +1 -1
  163. package/lib/exercises/math/sets/nameOfNumberSets.js +0 -10
  164. package/lib/exercises/pc/chemicalElements/atomicStructureOfNucleus.d.ts.map +1 -1
  165. package/lib/exercises/pc/chemicalElements/atomicStructureOfNucleus.js +0 -1
  166. package/lib/exercises/pc/chemicalElements/identifyRightElectronicConfiguration.d.ts.map +1 -1
  167. package/lib/exercises/pc/chemicalElements/identifyRightElectronicConfiguration.js +0 -4
  168. package/lib/exercises/pc/chemicalReactions/identifyLimitingReagent.d.ts.map +1 -1
  169. package/lib/exercises/pc/chemicalReactions/identifyLimitingReagent.js +0 -4
  170. package/lib/exercises/pc/chemicalReactions/identifyStoichiometricMixture.d.ts.map +1 -1
  171. package/lib/exercises/pc/chemicalReactions/identifyStoichiometricMixture.js +0 -4
  172. package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.d.ts.map +1 -1
  173. package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.js +0 -4
  174. package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.d.ts.map +1 -1
  175. package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.js +0 -4
  176. package/lib/exercises/pc/moleculeNomenclature.d.ts.map +1 -1
  177. package/lib/exercises/pc/moleculeNomenclature.js +0 -4
  178. package/lib/exercises/pc/motion/motionReference.d.ts.map +1 -1
  179. package/lib/exercises/pc/motion/motionReference.js +0 -4
  180. package/lib/exercises/pc/motion/typeOfAcceleration.d.ts.map +1 -1
  181. package/lib/exercises/pc/motion/typeOfAcceleration.js +0 -4
  182. package/lib/exercises/pc/sound/frequencyComparison.d.ts.map +1 -1
  183. package/lib/exercises/pc/sound/frequencyComparison.js +0 -4
  184. package/lib/index.d.ts +6 -8
  185. package/lib/index.d.ts.map +1 -1
  186. package/lib/math/progCalc/progCalc.d.ts +3 -3
  187. package/lib/math/progCalc/progCalc.d.ts.map +1 -1
  188. package/lib/math/progCalc/progCalc.js +13 -3
  189. package/lib/tests/exoTest.d.ts.map +1 -1
  190. package/lib/tests/exoTest.js +7 -0
  191. package/lib/tests/questionTest.d.ts.map +1 -1
  192. package/lib/tests/questionTest.js +7 -4
  193. 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,EAcT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAM7C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,eAAe,CAAC;IACnB,CAAC,EAAE,eAAe,CAAC;CACpB,CAAC;AAgHF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAkBrD,CAAC"}
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;AA8MF,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,CA0B7D,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
- tryToAddWrongProp(propositions, progCalc.apply(nodeFinalNumber).simplify().toTex());
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
- tryToAddWrongProp(propositions, progCalcReversed.apply(nodeFinalNumber).simplify().toTex());
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
- arrStepNodes.push(nodeStep);
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,EAYT,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;AA2M/E,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAelD,CAAC"}
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,CAgBtD,CAAC"}
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"}
@@ -322,6 +322,5 @@ export const compareA10N = {
322
322
  subject: "Mathématiques",
323
323
  maxAllowedQuestions: 30,
324
324
  getQuestionFromIdentifiers,
325
- answerType: "QCU",
326
325
  hasHintAndCorrection: true,
327
326
  };
@@ -1 +1 @@
1
- {"version":3,"file":"compareABUsingQuotient.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/ordering/compareABUsingQuotient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAK7C,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,eAAe,EAAE,CAAC;CACnC,CAAC;AA+IF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAiBxD,CAAC"}
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} > ${A}`;
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(add(1, n))), add(2, sqrt(n))];
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
- export declare const compareFracABWithFracAPlusCBPlusC: Exercise<Identifiers>;
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,EAaT,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;AA4LF,eAAO,MAAM,iCAAiC,EAAE,QAAQ,CAAC,WAAW,CAoBnE,CAAC"}
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
- return `On a :
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 isAnswerValid = (ans, { texAnswers }) => {
88
- return texAnswers.includes(ans);
89
- };
90
- const getCompareFracABWithFracAPlusCBPlusCQuestion = () => {
92
+ const getCompareFracABWithFracAPlusCBPlusCQuestion = (optsIn) => {
93
+ const opts = optsIn ?? optsDefault;
91
94
  const a = randint(1, 10);
92
- const b = randint(1, 10, [a]);
95
+ const b = randint(2, 10, [a]);
93
96
  const c = randint(1, 10);
94
- const nodes = [frac(a, b), frac(add(a, c), add(b, c))];
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
- fakeName: string;
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
- sign: number;
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;AAY7C,KAAK,OAAO,GAAG;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,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,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,2BAA2B,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAC3D,KAAK,EAAE,OAAO,EAAE,CAAC;CAClB,CAAC;AAkYF,KAAK,OAAO,GAAG;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,yBAAyB,EAAE,OAAO,CAAC;CACpC,CAAC;AA+BF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAiB5D,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"}