math-exercises 2.2.93 → 2.2.95

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 (196) hide show
  1. package/lib/exercises/math/calcul/fractions/fractionSquare.d.ts +8 -0
  2. package/lib/exercises/math/calcul/fractions/fractionSquare.d.ts.map +1 -0
  3. package/lib/exercises/math/calcul/fractions/fractionSquare.js +107 -0
  4. package/lib/exercises/math/calcul/fractions/fractionsSum.d.ts.map +1 -1
  5. package/lib/exercises/math/calcul/fractions/fractionsSum.js +2 -1
  6. package/lib/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.d.ts.map +1 -1
  7. package/lib/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.js +2 -1
  8. package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.d.ts.map +1 -1
  9. package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.js +2 -1
  10. package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.d.ts.map +1 -1
  11. package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.js +2 -1
  12. package/lib/exercises/math/calcul/fractions/index.d.ts +1 -0
  13. package/lib/exercises/math/calcul/fractions/index.d.ts.map +1 -1
  14. package/lib/exercises/math/calcul/fractions/index.js +1 -0
  15. package/lib/exercises/math/calcul/proportionality/findCoeffInProportionalTableNonIntegers.d.ts.map +1 -1
  16. package/lib/exercises/math/calcul/proportionality/findCoeffInProportionalTableNonIntegers.js +2 -1
  17. package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivityWithCoeff.d.ts.map +1 -1
  18. package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivityWithCoeff.js +0 -4
  19. package/lib/exercises/math/calculLitteral/distributivity/identitiesWithNonIntegers.d.ts.map +1 -1
  20. package/lib/exercises/math/calculLitteral/distributivity/identitiesWithNonIntegers.js +2 -1
  21. package/lib/exercises/math/calculLitteral/equation/choseOperationToSolveEquation.d.ts +9 -0
  22. package/lib/exercises/math/calculLitteral/equation/choseOperationToSolveEquation.d.ts.map +1 -1
  23. package/lib/exercises/math/calculLitteral/equation/choseOperationToSolveEquation.js +160 -126
  24. package/lib/exercises/math/calculLitteral/equation/equationSimpleSquare.d.ts.map +1 -1
  25. package/lib/exercises/math/calculLitteral/equation/equationSimpleSquare.js +2 -1
  26. package/lib/exercises/math/calculLitteral/equation/index.d.ts +1 -0
  27. package/lib/exercises/math/calculLitteral/equation/index.d.ts.map +1 -1
  28. package/lib/exercises/math/calculLitteral/equation/index.js +1 -0
  29. package/lib/exercises/math/calculLitteral/factorisation/factoByX.d.ts.map +1 -1
  30. package/lib/exercises/math/calculLitteral/factorisation/factoByX.js +2 -1
  31. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.d.ts.map +1 -1
  32. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.js +76 -41
  33. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.d.ts.map +1 -1
  34. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.js +71 -40
  35. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq3.d.ts.map +1 -1
  36. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq3.js +79 -47
  37. package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.d.ts.map +1 -1
  38. package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.js +2 -1
  39. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType0.d.ts.map +1 -1
  40. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType0.js +2 -1
  41. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType1.d.ts.map +1 -1
  42. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType1.js +2 -1
  43. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType2.d.ts.map +1 -1
  44. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType2.js +2 -1
  45. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.d.ts.map +1 -1
  46. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.js +2 -1
  47. package/lib/exercises/math/calculLitteral/inequations/squareFunctionInequation.d.ts.map +1 -1
  48. package/lib/exercises/math/calculLitteral/inequations/squareFunctionInequation.js +2 -1
  49. package/lib/exercises/math/derivation/derivative/convexityQuadrinomials.d.ts.map +1 -1
  50. package/lib/exercises/math/derivation/derivative/convexityQuadrinomials.js +2 -1
  51. package/lib/exercises/math/derivation/derivative/expDerivativeFour.d.ts.map +1 -1
  52. package/lib/exercises/math/derivation/derivative/expDerivativeFour.js +2 -1
  53. package/lib/exercises/math/derivation/derivative/expDerivativeThree.d.ts.map +1 -1
  54. package/lib/exercises/math/derivation/derivative/expDerivativeThree.js +2 -1
  55. package/lib/exercises/math/derivation/derivative/lnDerivativeThree.d.ts.map +1 -1
  56. package/lib/exercises/math/derivation/derivative/lnDerivativeThree.js +2 -1
  57. package/lib/exercises/math/derivation/derivative/quotientDerivative.d.ts.map +1 -1
  58. package/lib/exercises/math/derivation/derivative/quotientDerivative.js +2 -1
  59. package/lib/exercises/math/derivation/derivative/rootFunctionDerivative.d.ts.map +1 -1
  60. package/lib/exercises/math/derivation/derivative/rootFunctionDerivative.js +2 -1
  61. package/lib/exercises/math/derivation/derivative/sqrtCompositionDerivation.d.ts.map +1 -1
  62. package/lib/exercises/math/derivation/derivative/sqrtCompositionDerivation.js +2 -1
  63. package/lib/exercises/math/derivation/derivative/thirdDegreeDerivative.d.ts.map +1 -1
  64. package/lib/exercises/math/derivation/derivative/thirdDegreeDerivative.js +2 -1
  65. package/lib/exercises/math/derivation/derivative/thirdDegreeFunctionVariation.d.ts.map +1 -1
  66. package/lib/exercises/math/derivation/derivative/thirdDegreeFunctionVariation.js +2 -1
  67. package/lib/exercises/math/functions/absolute/absolueValueAffineEquation.d.ts.map +1 -1
  68. package/lib/exercises/math/functions/absolute/absolueValueAffineEquation.js +2 -1
  69. package/lib/exercises/math/functions/absolute/absolueValueInequationsSup.d.ts.map +1 -1
  70. package/lib/exercises/math/functions/absolute/absolueValueInequationsSup.js +2 -1
  71. package/lib/exercises/math/functions/absolute/absoluteValueInequations.d.ts.map +1 -1
  72. package/lib/exercises/math/functions/absolute/absoluteValueInequations.js +2 -1
  73. package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.d.ts.map +1 -1
  74. package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.js +2 -1
  75. package/lib/exercises/math/functions/affines/affineExpressionReading.d.ts.map +1 -1
  76. package/lib/exercises/math/functions/affines/affineExpressionReading.js +46 -23
  77. package/lib/exercises/math/functions/affines/signFunction.d.ts.map +1 -1
  78. package/lib/exercises/math/functions/affines/signFunction.js +2 -1
  79. package/lib/exercises/math/functions/basics/graphicEquation.d.ts.map +1 -1
  80. package/lib/exercises/math/functions/basics/graphicEquation.js +2 -1
  81. package/lib/exercises/math/functions/basics/graphicInequation.d.ts.map +1 -1
  82. package/lib/exercises/math/functions/basics/graphicInequation.js +2 -1
  83. package/lib/exercises/math/functions/basics/graphicInequationAffine.d.ts.map +1 -1
  84. package/lib/exercises/math/functions/basics/graphicInequationAffine.js +2 -1
  85. package/lib/exercises/math/functions/basics/imageFunction.d.ts.map +1 -1
  86. package/lib/exercises/math/functions/basics/imageFunction.js +2 -1
  87. package/lib/exercises/math/functions/basics/twoFunctionsInequation.d.ts.map +1 -1
  88. package/lib/exercises/math/functions/basics/twoFunctionsInequation.js +2 -1
  89. package/lib/exercises/math/functions/exponential/expEquation.d.ts.map +1 -1
  90. package/lib/exercises/math/functions/exponential/expEquation.js +2 -1
  91. package/lib/exercises/math/functions/logarithm/logPowerEquation.d.ts.map +1 -1
  92. package/lib/exercises/math/functions/logarithm/logPowerEquation.js +2 -1
  93. package/lib/exercises/math/functions/sign/affineProductSign.d.ts.map +1 -1
  94. package/lib/exercises/math/functions/sign/affineProductSign.js +2 -1
  95. package/lib/exercises/math/functions/square/squareImageInterval.d.ts.map +1 -1
  96. package/lib/exercises/math/functions/square/squareImageInterval.js +2 -1
  97. package/lib/exercises/math/functions/trinoms/coefficientsIdentification.d.ts.map +1 -1
  98. package/lib/exercises/math/functions/trinoms/coefficientsIdentification.js +2 -1
  99. package/lib/exercises/math/functions/trinoms/secondDegreeInequation.d.ts.map +1 -1
  100. package/lib/exercises/math/functions/trinoms/secondDegreeInequation.js +2 -1
  101. package/lib/exercises/math/functions/trinoms/trinomSignFromRoots.d.ts.map +1 -1
  102. package/lib/exercises/math/functions/trinoms/trinomSignFromRoots.js +2 -1
  103. package/lib/exercises/math/geometry/cartesian/readAbscissOnLine.d.ts.map +1 -1
  104. package/lib/exercises/math/geometry/cartesian/readAbscissOnLine.js +2 -1
  105. package/lib/exercises/math/geometry/cartesian/readAbscissOnSemiLine.d.ts.map +1 -1
  106. package/lib/exercises/math/geometry/cartesian/readAbscissOnSemiLine.js +2 -1
  107. package/lib/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.d.ts.map +1 -1
  108. package/lib/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.js +2 -1
  109. package/lib/exercises/math/geometry/parametric/extractPointFromParametricLine.d.ts.map +1 -1
  110. package/lib/exercises/math/geometry/parametric/extractPointFromParametricLine.js +2 -1
  111. package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.d.ts.map +1 -1
  112. package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.js +2 -1
  113. package/lib/exercises/math/matrices/matrixInversibilityDomain.d.ts.map +1 -1
  114. package/lib/exercises/math/matrices/matrixInversibilityDomain.js +2 -1
  115. package/lib/exercises/math/percent/findRightCalcul.d.ts +10 -0
  116. package/lib/exercises/math/percent/findRightCalcul.d.ts.map +1 -0
  117. package/lib/exercises/math/percent/findRightCalcul.js +116 -0
  118. package/lib/exercises/math/percent/htToTTC.d.ts.map +1 -1
  119. package/lib/exercises/math/percent/htToTTC.js +34 -12
  120. package/lib/exercises/math/percent/index.d.ts +2 -0
  121. package/lib/exercises/math/percent/index.d.ts.map +1 -1
  122. package/lib/exercises/math/percent/index.js +2 -0
  123. package/lib/exercises/math/percent/percentToDecimal.d.ts.map +1 -1
  124. package/lib/exercises/math/percent/percentToDecimal.js +6 -2
  125. package/lib/exercises/math/percent/percentWritings.d.ts +8 -0
  126. package/lib/exercises/math/percent/percentWritings.d.ts.map +1 -0
  127. package/lib/exercises/math/percent/percentWritings.js +145 -0
  128. package/lib/exercises/math/percent/ttcToHT.d.ts.map +1 -1
  129. package/lib/exercises/math/percent/ttcToHT.js +33 -12
  130. package/lib/exercises/math/powers/powersMixOperations.d.ts.map +1 -1
  131. package/lib/exercises/math/powers/powersMixOperations.js +2 -1
  132. package/lib/exercises/math/probaStat/probabilityTree.d.ts.map +1 -1
  133. package/lib/exercises/math/probaStat/probabilityTree.js +2 -1
  134. package/lib/exercises/math/sampling/confidenceInterval.d.ts.map +1 -1
  135. package/lib/exercises/math/sampling/confidenceInterval.js +2 -1
  136. package/lib/exercises/math/sampling/fluctuationInterval.d.ts.map +1 -1
  137. package/lib/exercises/math/sampling/fluctuationInterval.js +2 -1
  138. package/lib/exercises/math/sequences/geometric/geometricExplicitFormulaUsage.d.ts.map +1 -1
  139. package/lib/exercises/math/sequences/geometric/geometricExplicitFormulaUsage.js +55 -23
  140. package/lib/exercises/math/sets/intervals/inequalityToInterval.d.ts.map +1 -1
  141. package/lib/exercises/math/sets/intervals/inequalityToInterval.js +2 -1
  142. package/lib/exercises/math/sets/intervals/intervalsIntersection.d.ts.map +1 -1
  143. package/lib/exercises/math/sets/intervals/intervalsIntersection.js +2 -1
  144. package/lib/exercises/math/sets/intervals/intervalsUnion.d.ts.map +1 -1
  145. package/lib/exercises/math/sets/intervals/intervalsUnion.js +2 -1
  146. package/lib/exercises/math/trigonometry/degreeToRadians.d.ts.map +1 -1
  147. package/lib/exercises/math/trigonometry/degreeToRadians.js +2 -1
  148. package/lib/exercises/math/trigonometry/mainAngleMeasure.d.ts.map +1 -1
  149. package/lib/exercises/math/trigonometry/mainAngleMeasure.js +2 -1
  150. package/lib/exercises/vea/equationVEA.d.ts.map +1 -1
  151. package/lib/exercises/vea/equationVEA.js +2 -1
  152. package/lib/exercises/vea/rationalVEA.d.ts.map +1 -1
  153. package/lib/exercises/vea/rationalVEA.js +2 -1
  154. package/lib/exercises/vea/sqrtVEA.d.ts.map +1 -1
  155. package/lib/exercises/vea/sqrtVEA.js +2 -1
  156. package/lib/index.d.ts +16 -0
  157. package/lib/index.d.ts.map +1 -1
  158. package/lib/playground.d.ts.map +1 -1
  159. package/lib/playground.js +1 -12
  160. package/lib/tree/nodes/functions/oppositeNode.d.ts.map +1 -1
  161. package/lib/tree/nodes/functions/oppositeNode.js +1 -1
  162. package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
  163. package/lib/tree/nodes/operators/addNode.js +1 -1
  164. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  165. package/lib/tree/nodes/operators/fractionNode.js +3 -2
  166. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  167. package/lib/tree/nodes/operators/multiplyNode.js +1 -1
  168. package/lib/tree/parsers/affineParser.d.ts.map +1 -1
  169. package/lib/tree/parsers/affineParser.js +2 -1
  170. package/lib/tree/parsers/discreteSetParser.d.ts.map +1 -1
  171. package/lib/tree/parsers/discreteSetParser.js +2 -3
  172. package/lib/tree/parsers/equationSolutionParser.d.ts.map +1 -1
  173. package/lib/tree/parsers/equationSolutionParser.js +2 -1
  174. package/lib/tree/parsers/inequationParser.d.ts.map +1 -1
  175. package/lib/tree/parsers/inequationParser.js +2 -1
  176. package/lib/tree/parsers/intervalParser.d.ts.map +1 -1
  177. package/lib/tree/parsers/intervalParser.js +3 -2
  178. package/lib/tree/parsers/latexParser.d.ts.map +1 -1
  179. package/lib/tree/parsers/latexParser.js +12 -0
  180. package/lib/tree/parsers/monomParser.d.ts.map +1 -1
  181. package/lib/tree/parsers/monomParser.js +2 -1
  182. package/lib/tree/parsers/polynomialParser.d.ts.map +1 -1
  183. package/lib/tree/parsers/polynomialParser.js +2 -1
  184. package/lib/tree/parsers/powerParser.d.ts.map +1 -1
  185. package/lib/tree/parsers/powerParser.js +2 -1
  186. package/lib/tree/parsers/sqrtParser.d.ts.map +1 -1
  187. package/lib/tree/parsers/sqrtParser.js +2 -1
  188. package/lib/tree/parsers/trinomParser.d.ts.map +1 -1
  189. package/lib/tree/parsers/trinomParser.js +2 -1
  190. package/lib/tree/parsers/unionIntervalParser.d.ts.map +1 -1
  191. package/lib/tree/parsers/unionIntervalParser.js +2 -1
  192. package/lib/utils/alea/random.js +1 -1
  193. package/lib/utils/errors/handleVEAError.d.ts +2 -0
  194. package/lib/utils/errors/handleVEAError.d.ts.map +1 -0
  195. package/lib/utils/errors/handleVEAError.js +9 -0
  196. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wCAAwC,CAAC;AACvD,cAAc,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wCAAwC,CAAC;AACvD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iCAAiC,CAAC"}
@@ -28,3 +28,4 @@ __exportStar(require("./firstDegreeEquationIntType3"), exports);
28
28
  __exportStar(require("./equationFromSentenceExercise"), exports);
29
29
  __exportStar(require("./binomialsTrinomialsProposedSolutions"), exports);
30
30
  __exportStar(require("./equationWithDistributivity"), exports);
31
+ __exportStar(require("./choseOperationToSolveEquation"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"factoByX.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoByX.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAiBlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAqJF,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAiB1C,CAAC"}
1
+ {"version":3,"file":"factoByX.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoByX.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAkBlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAqJF,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAiB1C,CAAC"}
@@ -11,6 +11,7 @@ const addNode_1 = require("../../../../tree/nodes/operators/addNode");
11
11
  const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
12
12
  const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
13
13
  const latexParser_1 = require("../../../../tree/parsers/latexParser");
14
+ const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
14
15
  const alignTex_1 = require("../../../../utils/latex/alignTex");
15
16
  const getPropositions = (n, { answer, ...identifiers }) => {
16
17
  const propositions = [];
@@ -106,7 +107,7 @@ const isAnswerValid = (ans, { answer, ...identifiers }) => {
106
107
  .toTex() === statement.toTex());
107
108
  }
108
109
  catch (err) {
109
- return false;
110
+ return (0, handleVEAError_1.handleVEAError)(err);
110
111
  }
111
112
  };
112
113
  const getFactoByXQuestion = (ops) => {
@@ -1 +1 @@
1
- {"version":3,"file":"factoIdRmq1.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoIdRmq1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAalC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAgGF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAc7C,CAAC"}
1
+ {"version":3,"file":"factoIdRmq1.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoIdRmq1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,0BAA0B,CAAC;AAuBlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAqIF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAkB7C,CAAC"}
@@ -11,47 +11,76 @@ const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
11
11
  const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
12
12
  const alignTex_1 = require("../../../../utils/latex/alignTex");
13
13
  const shuffle_1 = require("../../../../utils/alea/shuffle");
14
- const gcd_1 = require("../../../../math/utils/arithmetic/gcd");
15
- const getFactoType1Question = () => {
16
- const affine = affine_1.AffineConstructor.random({ min: 1, max: 10 }, {
17
- min: 1,
18
- max: 10,
19
- });
14
+ const latexParser_1 = require("../../../../tree/parsers/latexParser");
15
+ const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
16
+ const getStatementNode = (identifiers) => {
17
+ const affine = new affine_1.Affine(identifiers.a, identifiers.b);
20
18
  const statementTree = affine.multiply(affine).toTree();
21
- const aMonom = new affine_1.Affine(affine.a, 0).toTree();
22
- const answerTree = new powerNode_1.PowerNode(affine.toTree(), new numberNode_1.NumberNode(2));
23
- const answer = answerTree.toTex();
19
+ return statementTree;
20
+ };
21
+ const getStartStatement = (identifiers) => {
22
+ const statementTree = getStatementNode(identifiers);
24
23
  const statementTex = statementTree.toTex();
25
- const question = {
26
- instruction: `Factoriser : $${statementTex}$`,
27
- startStatement: statementTex,
28
- answer,
29
- keys: ["x"],
30
- answerFormat: "tex",
31
- identifiers: { a: affine.a, b: affine.b },
32
- hint: `Essaie de réécrire cette expression sous la forme
24
+ return statementTex;
25
+ };
26
+ const getInstruction = (identifiers) => {
27
+ return `Factoriser :
28
+
29
+ $$
30
+ ${getStartStatement(identifiers)}
31
+ $$`;
32
+ };
33
+ const getHint = (identifiers) => {
34
+ return `Essaie de réécrire cette expression sous la forme
33
35
 
34
36
  $$
35
37
  a^2 + 2ab+b^2
36
- $$`,
37
- correction: `
38
- On utilise l'identité remarquable
39
-
38
+ $$`;
39
+ };
40
+ const getCorrection = (identifiers) => {
41
+ const affine = new affine_1.Affine(identifiers.a, identifiers.b);
42
+ const aMonom = new affine_1.Affine(affine.a, 0).toTree();
43
+ const statementTex = getStartStatement(identifiers);
44
+ const answer = getAnswer(identifiers);
45
+ return `On utilise l'identité remarquable
46
+
40
47
  $$
41
48
  a^2 + 2ab+b^2 = (a+b)^2
42
49
  $$
43
-
50
+
44
51
  en prenant $a=${aMonom.toTex()}$ et $b=${affine.b}$ :
45
52
 
46
53
  ${(0, alignTex_1.alignTex)([
47
- [
48
- statementTex,
49
- "=",
50
- new addNode_1.AddNode(new addNode_1.AddNode(new powerNode_1.SquareNode(aMonom), new multiplyNode_1.MultiplyNode((2).toTree(), new multiplyNode_1.MultiplyNode(aMonom, affine.b.toTree()))), new powerNode_1.SquareNode(affine.b.toTree())).toTex(),
51
- ],
52
- ["", "=", answer],
53
- ])}
54
- `,
54
+ [
55
+ statementTex,
56
+ "=",
57
+ new addNode_1.AddNode(new addNode_1.AddNode(new powerNode_1.SquareNode(aMonom), new multiplyNode_1.MultiplyNode((2).toTree(), new multiplyNode_1.MultiplyNode(aMonom, affine.b.toTree()))), new powerNode_1.SquareNode(affine.b.toTree())).toTex(),
58
+ ],
59
+ ["", "=", answer],
60
+ ])}
61
+ `;
62
+ };
63
+ const getAnswer = (identifiers) => {
64
+ const affine = new affine_1.Affine(identifiers.a, identifiers.b);
65
+ const answerTree = new powerNode_1.PowerNode(affine.toTree(), new numberNode_1.NumberNode(2));
66
+ const answer = answerTree.simplify().toTex();
67
+ return answer;
68
+ };
69
+ const getFactoType1Question = () => {
70
+ const affine = affine_1.AffineConstructor.random({ min: 1, max: 10 }, {
71
+ min: 1,
72
+ max: 10,
73
+ });
74
+ const identifiers = { a: affine.a, b: affine.b };
75
+ const question = {
76
+ instruction: getInstruction(identifiers),
77
+ startStatement: getStartStatement(identifiers),
78
+ answer: getAnswer(identifiers),
79
+ keys: ["x"],
80
+ answerFormat: "tex",
81
+ identifiers,
82
+ hint: getHint(identifiers),
83
+ correction: getCorrection(identifiers),
55
84
  };
56
85
  return question;
57
86
  };
@@ -65,18 +94,20 @@ const getPropositions = (n, { answer, a, b }) => {
65
94
  }
66
95
  return (0, shuffle_1.shuffle)(propositions);
67
96
  };
68
- const isAnswerValid = (ans, { a, b }) => {
69
- const affine = new affine_1.Affine(a, b);
70
- const answerTree = new powerNode_1.SquareNode(affine.toTree());
71
- const validLatexs = answerTree.toAllValidTexs();
72
- const pgcd = (0, gcd_1.gcd)(a, b);
73
- if (pgcd !== 1) {
74
- const affine2 = new affine_1.Affine(a / pgcd, b / pgcd);
75
- const coeff = pgcd ** 2;
76
- const answerTree2 = new multiplyNode_1.MultiplyNode(coeff.toTree(), affine2.toTree());
77
- validLatexs.push(...answerTree2.toAllValidTexs());
97
+ const isAnswerValid = (ans, { answer, a, b }) => {
98
+ try {
99
+ const parsed = (0, latexParser_1.parseAlgebraic)(ans);
100
+ if (!parsed)
101
+ return false;
102
+ if (!(0, multiplyNode_1.isMultiplyNode)(parsed) &&
103
+ !(0, powerNode_1.isSquareNode)(parsed) &&
104
+ !(0, powerNode_1.isPowerNode)(parsed))
105
+ return false;
106
+ return parsed.simplify().toTex() === answer;
107
+ }
108
+ catch (err) {
109
+ return (0, handleVEAError_1.handleVEAError)(err);
78
110
  }
79
- return validLatexs.includes(ans);
80
111
  };
81
112
  exports.factoIdRmq1 = {
82
113
  id: "factoIdRmq1",
@@ -92,4 +123,8 @@ exports.factoIdRmq1 = {
92
123
  isAnswerValid,
93
124
  subject: "Mathématiques",
94
125
  hasHintAndCorrection: true,
126
+ getInstruction,
127
+ getAnswer,
128
+ getHint,
129
+ getCorrection,
95
130
  };
@@ -1 +1 @@
1
- {"version":3,"file":"factoIdRmq2.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoIdRmq2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAclC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAgGF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAc7C,CAAC"}
1
+ {"version":3,"file":"factoIdRmq2.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoIdRmq2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,0BAA0B,CAAC;AAwBlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA+HF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAkB7C,CAAC"}
@@ -12,31 +12,40 @@ const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
12
12
  const substractNode_1 = require("../../../../tree/nodes/operators/substractNode");
13
13
  const alignTex_1 = require("../../../../utils/latex/alignTex");
14
14
  const shuffle_1 = require("../../../../utils/alea/shuffle");
15
- const gcd_1 = require("../../../../math/utils/arithmetic/gcd");
16
- const getFactoType1Question = () => {
17
- const affine = affine_1.AffineConstructor.random({
18
- min: 1,
19
- max: 10,
20
- }, { min: -9, max: 0 });
21
- const statementTree = affine.multiply(affine).toTree();
22
- const statementTex = statementTree.toTex();
15
+ const latexParser_1 = require("../../../../tree/parsers/latexParser");
16
+ const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
17
+ const getInstruction = (identifiers) => {
18
+ return `Factoriser :
19
+
20
+ $$
21
+ ${getStartStatement(identifiers)}
22
+ $$`;
23
+ };
24
+ const getAnswer = (identifiers) => {
25
+ const affine = new affine_1.Affine(identifiers.a, identifiers.b);
23
26
  const answerTree = new powerNode_1.PowerNode(affine.toTree(), new numberNode_1.NumberNode(2));
24
- const answer = answerTree.toTex();
25
- const aMonom = new affine_1.Affine(affine.a, 0).toTree();
26
- const question = {
27
- instruction: `Factoriser : $${statementTex}$`,
28
- startStatement: statementTex,
29
- answer,
30
- keys: ["x"],
31
- answerFormat: "tex",
32
- identifiers: { a: affine.a, b: affine.b },
33
- hint: `Essaie de réécrire cette expression sous la forme
27
+ const answer = answerTree.simplify().toTex();
28
+ return answer;
29
+ };
30
+ const getHint = (identifiers) => {
31
+ return `Essaie de réécrire cette expression sous la forme
34
32
 
35
33
  $$
36
34
  a^2 - 2ab+b^2
37
- $$`,
38
- correction: `
39
- On utilise l'identité remarquable
35
+ $$`;
36
+ };
37
+ const getStartStatement = (identifiers) => {
38
+ const affine = new affine_1.Affine(identifiers.a, identifiers.b);
39
+ const statementTree = affine.multiply(affine).toTree();
40
+ const statementTex = statementTree.toTex();
41
+ return statementTex;
42
+ };
43
+ const getCorrection = (identifiers) => {
44
+ const affine = new affine_1.Affine(identifiers.a, identifiers.b);
45
+ const answer = getAnswer(identifiers);
46
+ const statementTex = getStartStatement(identifiers);
47
+ const aMonom = new affine_1.Affine(affine.a, 0).toTree();
48
+ return `On utilise l'identité remarquable
40
49
 
41
50
  $$
42
51
  a^2 - 2ab+b^2 = (a-b)^2
@@ -45,14 +54,30 @@ $$
45
54
  en prenant $a=${aMonom.toTex()}$ et $b=${-affine.b}$ :
46
55
 
47
56
  ${(0, alignTex_1.alignTex)([
48
- [
49
- statementTex,
50
- "=",
51
- new addNode_1.AddNode(new substractNode_1.SubstractNode(new powerNode_1.SquareNode(aMonom), new multiplyNode_1.MultiplyNode((2).toTree(), new multiplyNode_1.MultiplyNode(aMonom, (-affine.b).toTree()))), new powerNode_1.SquareNode((-affine.b).toTree())).toTex(),
52
- ],
53
- ["", "=", answer],
54
- ])}
55
- `,
57
+ [
58
+ statementTex,
59
+ "=",
60
+ new addNode_1.AddNode(new substractNode_1.SubstractNode(new powerNode_1.SquareNode(aMonom), new multiplyNode_1.MultiplyNode((2).toTree(), new multiplyNode_1.MultiplyNode(aMonom, (-affine.b).toTree()))), new powerNode_1.SquareNode((-affine.b).toTree())).toTex(),
61
+ ],
62
+ ["", "=", answer],
63
+ ])}
64
+ `;
65
+ };
66
+ const getFactoType1Question = () => {
67
+ const affine = affine_1.AffineConstructor.random({
68
+ min: 1,
69
+ max: 10,
70
+ }, { min: -9, max: 0 });
71
+ const identifiers = { a: affine.a, b: affine.b };
72
+ const question = {
73
+ instruction: getInstruction(identifiers),
74
+ startStatement: getStartStatement(identifiers),
75
+ answer: getAnswer(identifiers),
76
+ keys: ["x"],
77
+ answerFormat: "tex",
78
+ identifiers,
79
+ hint: getHint(identifiers),
80
+ correction: getCorrection(identifiers),
56
81
  };
57
82
  return question;
58
83
  };
@@ -67,18 +92,20 @@ const getPropositions = (n, { answer, a, b }) => {
67
92
  }
68
93
  return (0, shuffle_1.shuffle)(propositions);
69
94
  };
70
- const isAnswerValid = (ans, { a, b }) => {
71
- const affine = new affine_1.Affine(a, b);
72
- const answerTree = new powerNode_1.SquareNode(affine.toTree());
73
- const validLatexs = answerTree.toAllValidTexs();
74
- const pgcd = (0, gcd_1.gcd)(a, Math.abs(b));
75
- if (pgcd !== 1) {
76
- const affine2 = new affine_1.Affine(a / pgcd, b / pgcd);
77
- const coeff = pgcd ** 2;
78
- const answerTree2 = new multiplyNode_1.MultiplyNode(coeff.toTree(), affine2.toTree());
79
- validLatexs.push(...answerTree2.toAllValidTexs());
95
+ const isAnswerValid = (ans, { answer, a, b }) => {
96
+ try {
97
+ const parsed = (0, latexParser_1.parseAlgebraic)(ans);
98
+ if (!parsed)
99
+ return false;
100
+ if (!(0, multiplyNode_1.isMultiplyNode)(parsed) &&
101
+ !(0, powerNode_1.isSquareNode)(parsed) &&
102
+ !(0, powerNode_1.isPowerNode)(parsed))
103
+ return false;
104
+ return parsed.simplify().toTex() === answer;
105
+ }
106
+ catch (err) {
107
+ return (0, handleVEAError_1.handleVEAError)(err);
80
108
  }
81
- return validLatexs.includes(ans);
82
109
  };
83
110
  exports.factoIdRmq2 = {
84
111
  id: "factoIdRmq2",
@@ -94,4 +121,8 @@ exports.factoIdRmq2 = {
94
121
  isAnswerValid,
95
122
  subject: "Mathématiques",
96
123
  hasHintAndCorrection: true,
124
+ getAnswer,
125
+ getCorrection,
126
+ getHint,
127
+ getInstruction,
97
128
  };
@@ -1 +1 @@
1
- {"version":3,"file":"factoIdRmq3.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoIdRmq3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AA4HF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAc7C,CAAC"}
1
+ {"version":3,"file":"factoIdRmq3.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoIdRmq3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAmBlC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAmKF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAkB7C,CAAC"}
@@ -4,41 +4,42 @@ exports.factoIdRmq3 = void 0;
4
4
  const exercise_1 = require("../../../../exercises/exercise");
5
5
  const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
6
  const affine_1 = require("../../../../math/polynomials/affine");
7
- const gcd_1 = require("../../../../math/utils/arithmetic/gcd");
8
7
  const randint_1 = require("../../../../math/utils/random/randint");
9
8
  const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
10
9
  const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
11
10
  const substractNode_1 = require("../../../../tree/nodes/operators/substractNode");
11
+ const latexParser_1 = require("../../../../tree/parsers/latexParser");
12
+ const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
12
13
  const alignTex_1 = require("../../../../utils/latex/alignTex");
13
- const getFactoType1Question = () => {
14
- const affine = affine_1.AffineConstructor.random({
15
- min: 1,
16
- max: 11,
17
- }, { excludes: [0] });
18
- const affine2 = new affine_1.Affine(affine.a, -affine.b);
19
- const statementTree = affine.multiply(affine2).toTree();
20
- const statementTex = statementTree.toTex();
21
- const bPositive = Math.abs(affine.b);
22
- const aMonom = new multiplyNode_1.MultiplyNode(affine.a.toTree(), "x".toTree());
14
+ const getAnswer = (identifiers) => {
15
+ const affine = new affine_1.Affine(identifiers.affine1Coeffs[1], identifiers.affine1Coeffs[0]);
16
+ const affine2 = new affine_1.Affine(identifiers.affine2Coeffs[1], identifiers.affine2Coeffs[0]);
23
17
  const answerTree = new multiplyNode_1.MultiplyNode(affine.toTree(), affine2.toTree());
24
- const answer = answerTree.toTex();
25
- const question = {
26
- instruction: `Factoriser : $${statementTree.toTex()}$`,
27
- startStatement: statementTree.toTex(),
28
- answer,
29
- keys: ["x"],
30
- answerFormat: "tex",
31
- identifiers: {
32
- affine1Coeffs: affine.coefficients,
33
- affine2Coeffs: affine2.coefficients,
34
- },
35
- hint: `Utilise l'identité remarquable
18
+ const answer = answerTree.simplify().toTex();
19
+ return answer;
20
+ };
21
+ const getInstruction = (identifiers) => {
22
+ return `Factoriser :
23
+
24
+ $$
25
+ ${getStartStatement(identifiers)}
26
+ $$`;
27
+ };
28
+ const getHint = (identifiers) => {
29
+ return `Utilise l'identité remarquable
36
30
 
37
31
  $$
38
32
  a^2 - b^2 = (a-b)(a+b)
39
- $$`,
40
- correction: `
41
- On utilise l'identité remarquable
33
+ $$`;
34
+ };
35
+ const getCorrection = (identifiers) => {
36
+ const affine = new affine_1.Affine(identifiers.affine1Coeffs[1], identifiers.affine1Coeffs[0]);
37
+ const affine2 = new affine_1.Affine(identifiers.affine2Coeffs[1], identifiers.affine2Coeffs[0]);
38
+ const statementTex = getStartStatement(identifiers);
39
+ const answer = getAnswer(identifiers);
40
+ const bPositive = Math.abs(affine.b);
41
+ const aMonom = new multiplyNode_1.MultiplyNode(affine.a.toTree(), "x".toTree());
42
+ return `On utilise l'identité remarquable
42
43
 
43
44
  $$
44
45
  a^2 - b^2=(a-b)(a+b)
@@ -47,13 +48,39 @@ $$
47
48
  en prenant $a=${aMonom.toTex()}$ et $b=${bPositive}$ :
48
49
 
49
50
  ${(0, alignTex_1.alignTex)([
50
- [
51
- statementTex,
52
- "=",
53
- new substractNode_1.SubstractNode(new powerNode_1.SquareNode(aMonom), new powerNode_1.SquareNode(bPositive.toTree())).toTex(),
54
- ],
55
- ["", "=", answer],
56
- ])}`,
51
+ [
52
+ statementTex,
53
+ "=",
54
+ new substractNode_1.SubstractNode(new powerNode_1.SquareNode(aMonom), new powerNode_1.SquareNode(bPositive.toTree())).toTex(),
55
+ ],
56
+ ["", "=", answer],
57
+ ])}`;
58
+ };
59
+ const getStartStatement = (identifiers) => {
60
+ const affine = new affine_1.Affine(identifiers.affine1Coeffs[1], identifiers.affine1Coeffs[0]);
61
+ const affine2 = new affine_1.Affine(identifiers.affine2Coeffs[1], identifiers.affine2Coeffs[0]);
62
+ const statementTree = affine.multiply(affine2).toTree();
63
+ return statementTree.toTex();
64
+ };
65
+ const getFactoType1Question = () => {
66
+ const affine = affine_1.AffineConstructor.random({
67
+ min: 1,
68
+ max: 11,
69
+ }, { excludes: [0] });
70
+ const affine2 = new affine_1.Affine(affine.a, -affine.b);
71
+ const identifiers = {
72
+ affine1Coeffs: affine.coefficients,
73
+ affine2Coeffs: affine2.coefficients,
74
+ };
75
+ const question = {
76
+ instruction: getInstruction(identifiers),
77
+ startStatement: getStartStatement(identifiers),
78
+ answer: getAnswer(identifiers),
79
+ keys: ["x"],
80
+ answerFormat: "tex",
81
+ identifiers,
82
+ hint: getHint(identifiers),
83
+ correction: getCorrection(identifiers),
57
84
  };
58
85
  return question;
59
86
  };
@@ -72,21 +99,22 @@ const getPropositions = (n, { answer, affine1Coeffs, affine2Coeffs }) => {
72
99
  }
73
100
  return (0, exercise_1.shuffleProps)(propositions, n);
74
101
  };
75
- const isAnswerValid = (ans, { affine1Coeffs, affine2Coeffs }) => {
76
- const affine = new affine_1.Affine(affine1Coeffs[1], affine1Coeffs[0]);
77
- const affine2 = new affine_1.Affine(affine2Coeffs[1], affine2Coeffs[0]);
78
- const answerTree = new multiplyNode_1.MultiplyNode(affine.toTree(), affine2.toTree());
79
- const validLatexs = answerTree.toAllValidTexs();
80
- const pgcd = (0, gcd_1.gcd)(Math.abs(affine1Coeffs[1]), Math.abs(affine1Coeffs[0]));
81
- if (pgcd !== 1) {
82
- const affineA = new affine_1.Affine(affine1Coeffs[1] / pgcd, affine1Coeffs[0] / pgcd);
83
- const affineB = new affine_1.Affine(affine2Coeffs[1] / pgcd, affine2Coeffs[0] / pgcd);
84
- const answer2 = new multiplyNode_1.MultiplyNode(affineA.toTree(), affineB.toTree());
85
- const coeff = pgcd ** 2;
86
- const answerTree2 = new multiplyNode_1.MultiplyNode(coeff.toTree(), answer2);
87
- validLatexs.push(...answerTree2.toAllValidTexs());
102
+ const isAnswerValid = (ans, { answer, ...identifiers }) => {
103
+ try {
104
+ const parsed = (0, latexParser_1.parseAlgebraic)(ans);
105
+ if (!parsed)
106
+ return false;
107
+ if (!(0, multiplyNode_1.isMultiplyNode)(parsed) &&
108
+ !(0, powerNode_1.isSquareNode)(parsed) &&
109
+ !(0, powerNode_1.isPowerNode)(parsed))
110
+ return false;
111
+ return (parsed
112
+ .simplify({ towardsDistribute: true, forbidFactorize: true })
113
+ .toTex() === getStartStatement(identifiers));
114
+ }
115
+ catch (err) {
116
+ return (0, handleVEAError_1.handleVEAError)(err);
88
117
  }
89
- return validLatexs.includes(ans);
90
118
  };
91
119
  exports.factoIdRmq3 = {
92
120
  id: "factoIdRmq3",
@@ -102,4 +130,8 @@ exports.factoIdRmq3 = {
102
130
  isAnswerValid,
103
131
  subject: "Mathématiques",
104
132
  hasHintAndCorrection: true,
133
+ getInstruction,
134
+ getHint,
135
+ getAnswer,
136
+ getCorrection,
105
137
  };
@@ -1 +1 @@
1
- {"version":3,"file":"factoType1Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoType1Exercise.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAkBlC;;;GAGG;AACH,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAgKF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAepD,CAAC"}
1
+ {"version":3,"file":"factoType1Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoType1Exercise.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAmBlC;;;GAGG;AACH,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAgKF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAepD,CAAC"}
@@ -14,6 +14,7 @@ const substractNode_1 = require("../../../../tree/nodes/operators/substractNode"
14
14
  const latexParser_1 = require("../../../../tree/parsers/latexParser");
15
15
  const random_1 = require("../../../../utils/alea/random");
16
16
  const shuffle_1 = require("../../../../utils/alea/shuffle");
17
+ const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
17
18
  const getStatementNode = (identifiers) => {
18
19
  const { affinesCoeffs, operation } = identifiers;
19
20
  const affines = affinesCoeffs.map((coeffs) => new affine_1.Affine(coeffs[1], coeffs[0]));
@@ -118,7 +119,7 @@ const isAnswerValid = (ans, { answer, ...identifiers }) => {
118
119
  return simp.toTex() === answerSimp.toTex();
119
120
  }
120
121
  catch (err) {
121
- return false;
122
+ return (0, handleVEAError_1.handleVEAError)(err);
122
123
  }
123
124
  };
124
125
  exports.factoType1Exercise = {
@@ -1 +1 @@
1
- {"version":3,"file":"firstDegreeInequationsType0.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/inequations/firstDegreeInequationsType0.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAe3C,cAAc;AAEd,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,gBAAgB,CAAC;CAC5B,CAAC;AA6JF,KAAK,OAAO,GAAG;IACb,wBAAwB,EAAE,MAAM,CAAC;CAClC,CAAC;AAGF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAqBtE,CAAC"}
1
+ {"version":3,"file":"firstDegreeInequationsType0.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/inequations/firstDegreeInequationsType0.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAgB3C,cAAc;AAEd,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,gBAAgB,CAAC;CAC5B,CAAC;AA6JF,KAAK,OAAO,GAAG;IACb,wBAAwB,EAAE,MAAM,CAAC;CAClC,CAAC;AAGF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAqBtE,CAAC"}
@@ -15,6 +15,7 @@ const inequationParser_1 = require("../../../../tree/parsers/inequationParser");
15
15
  const intervalParser_1 = require("../../../../tree/parsers/intervalParser");
16
16
  const coinFlip_1 = require("../../../../utils/alea/coinFlip");
17
17
  const shuffle_1 = require("../../../../utils/alea/shuffle");
18
+ const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
18
19
  const getHint = (identifiers) => {
19
20
  return `Pour résoudre cette inéquation, il faut isoler $x$ à gauche. Pour cela, il faut effectuer des deux côtés de l'inéquation la bonne opération qui permet de supprimer le terme $${identifiers.b < 0 ? "" : "+"}${identifiers.b}$.`;
20
21
  };
@@ -115,7 +116,7 @@ const isAnswerValid = (ans, { answer, ineqType, b, c }, opts) => {
115
116
  }
116
117
  }
117
118
  catch (err) {
118
- return false;
119
+ return (0, handleVEAError_1.handleVEAError)(err);
119
120
  }
120
121
  };
121
122
  const options = [inequationSolutionFormat_1.inequationSolutionFormat];
@@ -1 +1 @@
1
- {"version":3,"file":"firstDegreeInequationsType1.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/inequations/firstDegreeInequationsType1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAc3C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,gBAAgB,CAAC;CAC5B,CAAC;AAgLF,KAAK,OAAO,GAAG;IACb,wBAAwB,EAAE,MAAM,CAAC;CAClC,CAAC;AAGF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAsBtE,CAAC"}
1
+ {"version":3,"file":"firstDegreeInequationsType1.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/inequations/firstDegreeInequationsType1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAe3C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,gBAAgB,CAAC;CAC5B,CAAC;AAgLF,KAAK,OAAO,GAAG;IACb,wBAAwB,EAAE,MAAM,CAAC;CAClC,CAAC;AAGF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAsBtE,CAAC"}
@@ -15,6 +15,7 @@ const inequationParser_1 = require("../../../../tree/parsers/inequationParser");
15
15
  const intervalParser_1 = require("../../../../tree/parsers/intervalParser");
16
16
  const coinFlip_1 = require("../../../../utils/alea/coinFlip");
17
17
  const shuffle_1 = require("../../../../utils/alea/shuffle");
18
+ const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
18
19
  /**ax<b */
19
20
  const getHint = (identifiers) => {
20
21
  return `Pour résoudre cette inéquation, il faut isoler $x$ à gauche. Pour cela, il faut effectuer des deux côtés de l'inéquation la bonne opération qui permet de supprimer le facteur $${identifiers.a}$.`;
@@ -124,7 +125,7 @@ const isAnswerValid = (ans, { answer, a, b, ineqType }, opts) => {
124
125
  }
125
126
  }
126
127
  catch (err) {
127
- return false;
128
+ return (0, handleVEAError_1.handleVEAError)(err);
128
129
  }
129
130
  };
130
131
  const options = [inequationSolutionFormat_1.inequationSolutionFormat];
@@ -1 +1 @@
1
- {"version":3,"file":"firstDegreeInequationsType2.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/inequations/firstDegreeInequationsType2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAW3C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAwIF,KAAK,OAAO,GAAG;IACb,wBAAwB,EAAE,MAAM,CAAC;CAClC,CAAC;AAGF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkBtE,CAAC"}
1
+ {"version":3,"file":"firstDegreeInequationsType2.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/inequations/firstDegreeInequationsType2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAY3C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAwIF,KAAK,OAAO,GAAG;IACb,wBAAwB,EAAE,MAAM,CAAC;CAClC,CAAC;AAGF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkBtE,CAAC"}
@@ -14,6 +14,7 @@ const inequationParser_1 = require("../../../../tree/parsers/inequationParser");
14
14
  const intervalParser_1 = require("../../../../tree/parsers/intervalParser");
15
15
  const coinFlip_1 = require("../../../../utils/alea/coinFlip");
16
16
  const shuffle_1 = require("../../../../utils/alea/shuffle");
17
+ const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
17
18
  /**ax+b<c */
18
19
  const getKeys = (identifiers, opts) => {
19
20
  const isInterval = opts?.inequationSolutionFormat === "Intervalle (S = [a;b])";
@@ -99,7 +100,7 @@ const isAnswerValid = (ans, { answer, a, b, c, ineqType }, opts) => {
99
100
  }
100
101
  }
101
102
  catch (err) {
102
- return false;
103
+ return (0, handleVEAError_1.handleVEAError)(err);
103
104
  }
104
105
  };
105
106
  const options = [inequationSolutionFormat_1.inequationSolutionFormat];
@@ -1 +1 @@
1
- {"version":3,"file":"firstDegreeInequationsType3.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAW3C,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAmJF,KAAK,OAAO,GAAG;IACb,wBAAwB,EAAE,MAAM,CAAC;CAClC,CAAC;AAGF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkBtE,CAAC"}
1
+ {"version":3,"file":"firstDegreeInequationsType3.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAY3C,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAmJF,KAAK,OAAO,GAAG;IACb,wBAAwB,EAAE,MAAM,CAAC;CAClC,CAAC;AAGF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkBtE,CAAC"}
@@ -14,6 +14,7 @@ const inequationParser_1 = require("../../../../tree/parsers/inequationParser");
14
14
  const intervalParser_1 = require("../../../../tree/parsers/intervalParser");
15
15
  const coinFlip_1 = require("../../../../utils/alea/coinFlip");
16
16
  const shuffle_1 = require("../../../../utils/alea/shuffle");
17
+ const handleVEAError_1 = require("../../../../utils/errors/handleVEAError");
17
18
  /**ax+b<cx+d */
18
19
  const getInstruction = (identifiers) => {
19
20
  const { ineqType, a, b, c, d } = identifiers;
@@ -108,7 +109,7 @@ const isAnswerValid = (ans, { answer, a, b, c, d, ineqType }, opts) => {
108
109
  }
109
110
  }
110
111
  catch (err) {
111
- return false;
112
+ return (0, handleVEAError_1.handleVEAError)(err);
112
113
  }
113
114
  };
114
115
  const options = [inequationSolutionFormat_1.inequationSolutionFormat];
@@ -1 +1 @@
1
- {"version":3,"file":"squareFunctionInequation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/inequations/squareFunctionInequation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAe3C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,gBAAgB,EAAE,gBAAgB,CAAC;CACpC,CAAC;AAqFF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAgB1D,CAAC"}
1
+ {"version":3,"file":"squareFunctionInequation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/inequations/squareFunctionInequation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,gBAAgB,EAGjB,MAAM,mCAAmC,CAAC;AAgB3C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,gBAAgB,EAAE,gBAAgB,CAAC;CACpC,CAAC;AAqFF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAgB1D,CAAC"}