math-exercises 3.0.188 → 3.0.190

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 (144) hide show
  1. package/lib/exercises/math/calcul/decimals/decimalFractionToDecimal.d.ts.map +1 -1
  2. package/lib/exercises/math/calcul/decimals/decimalFractionToDecimal.js +5 -4
  3. package/lib/exercises/math/calculLitteral/equation/factorizeEquation.d.ts.map +1 -1
  4. package/lib/exercises/math/calculLitteral/equation/factorizeEquation.js +9 -8
  5. package/lib/exercises/math/calculLitteral/equation/isEqualityTrue.d.ts.map +1 -1
  6. package/lib/exercises/math/calculLitteral/equation/isEqualityTrue.js +7 -6
  7. package/lib/exercises/math/dataRepresentations/barChartInterpreting.d.ts.map +1 -1
  8. package/lib/exercises/math/dataRepresentations/barChartInterpreting.js +5 -4
  9. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.d.ts.map +1 -1
  10. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.js +3 -2
  11. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.d.ts.map +1 -1
  12. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.js +3 -2
  13. package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.d.ts.map +1 -1
  14. package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.js +45 -37
  15. package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.d.ts.map +1 -1
  16. package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.js +3 -2
  17. package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.d.ts.map +1 -1
  18. package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.js +3 -2
  19. package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.d.ts.map +1 -1
  20. package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.js +3 -2
  21. package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.d.ts.map +1 -1
  22. package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.js +4 -3
  23. package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.d.ts.map +1 -1
  24. package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.js +20 -64
  25. package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.d.ts.map +1 -1
  26. package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.js +3 -2
  27. package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.d.ts.map +1 -1
  28. package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.js +3 -2
  29. package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.d.ts.map +1 -1
  30. package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.js +4 -3
  31. package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.d.ts.map +1 -1
  32. package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.js +27 -35
  33. package/lib/exercises/math/functions/affines/adjustment/affineAdjustment.d.ts +8 -0
  34. package/lib/exercises/math/functions/affines/adjustment/affineAdjustment.d.ts.map +1 -0
  35. package/lib/exercises/math/functions/affines/adjustment/affineAdjustment.js +129 -0
  36. package/lib/exercises/math/functions/affines/adjustment/affineAdjustmentComplete.d.ts +8 -0
  37. package/lib/exercises/math/functions/affines/adjustment/affineAdjustmentComplete.d.ts.map +1 -0
  38. package/lib/exercises/math/functions/affines/adjustment/affineAdjustmentComplete.js +108 -0
  39. package/lib/exercises/math/functions/affines/adjustment/affineAdjustmentRsquared.d.ts +8 -0
  40. package/lib/exercises/math/functions/affines/adjustment/affineAdjustmentRsquared.d.ts.map +1 -0
  41. package/lib/exercises/math/functions/affines/adjustment/affineAdjustmentRsquared.js +92 -0
  42. package/lib/exercises/math/functions/affines/adjustment/index.d.ts +4 -0
  43. package/lib/exercises/math/functions/affines/adjustment/index.d.ts.map +1 -0
  44. package/lib/exercises/math/functions/affines/adjustment/index.js +3 -0
  45. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.d.ts.map +1 -1
  46. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.js +8 -6
  47. package/lib/exercises/math/functions/affines/index.d.ts +2 -4
  48. package/lib/exercises/math/functions/affines/index.d.ts.map +1 -1
  49. package/lib/exercises/math/functions/affines/index.js +2 -4
  50. package/lib/exercises/math/functions/affines/situations/affineFromExercise.d.ts +10 -0
  51. package/lib/exercises/math/functions/affines/situations/affineFromExercise.d.ts.map +1 -0
  52. package/lib/exercises/math/functions/affines/situations/affineFromExercise.js +219 -0
  53. package/lib/exercises/math/functions/affines/situations/affineModelisationSituations.d.ts +10 -0
  54. package/lib/exercises/math/functions/affines/situations/affineModelisationSituations.d.ts.map +1 -0
  55. package/lib/exercises/math/functions/affines/situations/affineModelisationSituations.js +69 -0
  56. package/lib/exercises/math/functions/affines/situations/affineSituationComputeAntecedent.d.ts +10 -0
  57. package/lib/exercises/math/functions/affines/situations/affineSituationComputeAntecedent.d.ts.map +1 -0
  58. package/lib/exercises/math/functions/affines/situations/affineSituationComputeAntecedent.js +133 -0
  59. package/lib/exercises/math/functions/affines/situations/affineSituationComputeImage.d.ts +10 -0
  60. package/lib/exercises/math/functions/affines/situations/affineSituationComputeImage.d.ts.map +1 -0
  61. package/lib/exercises/math/functions/affines/situations/affineSituationComputeImage.js +229 -0
  62. package/lib/exercises/math/functions/affines/situations/affineSituationThreshold.d.ts +10 -0
  63. package/lib/exercises/math/functions/affines/situations/affineSituationThreshold.d.ts.map +1 -0
  64. package/lib/exercises/math/functions/affines/situations/affineSituationThreshold.js +166 -0
  65. package/lib/exercises/math/functions/affines/situations/affineSituationVariation.d.ts +9 -0
  66. package/lib/exercises/math/functions/affines/situations/affineSituationVariation.d.ts.map +1 -0
  67. package/lib/exercises/math/functions/affines/situations/affineSituationVariation.js +78 -0
  68. package/lib/exercises/math/functions/affines/situations/index.d.ts +6 -0
  69. package/lib/exercises/math/functions/affines/situations/index.d.ts.map +1 -0
  70. package/lib/exercises/math/functions/affines/situations/index.js +5 -0
  71. package/lib/exercises/math/functions/exponentials/estimateExponentialFunctionImageFromGeometricScatterplot.d.ts +2 -0
  72. package/lib/exercises/math/functions/exponentials/estimateExponentialFunctionImageFromGeometricScatterplot.d.ts.map +1 -0
  73. package/lib/exercises/math/functions/exponentials/estimateExponentialFunctionImageFromGeometricScatterplot.js +155 -0
  74. package/lib/exercises/math/functions/exponentials/exponentialsRawVariations.d.ts +8 -0
  75. package/lib/exercises/math/functions/exponentials/exponentialsRawVariations.d.ts.map +1 -0
  76. package/lib/exercises/math/functions/exponentials/exponentialsRawVariations.js +99 -0
  77. package/lib/exercises/math/functions/exponentials/index.d.ts +3 -0
  78. package/lib/exercises/math/functions/exponentials/index.d.ts.map +1 -1
  79. package/lib/exercises/math/functions/exponentials/index.js +4 -0
  80. package/lib/exercises/math/functions/exponentials/plausibleExponentialFunctionExpressionFromGraph.d.ts +12 -0
  81. package/lib/exercises/math/functions/exponentials/plausibleExponentialFunctionExpressionFromGraph.d.ts.map +1 -0
  82. package/lib/exercises/math/functions/exponentials/plausibleExponentialFunctionExpressionFromGraph.js +138 -0
  83. package/lib/exercises/math/functions/exponentials/readExponentialFunctionParamsOnGraph.d.ts +8 -0
  84. package/lib/exercises/math/functions/exponentials/readExponentialFunctionParamsOnGraph.d.ts.map +1 -0
  85. package/lib/exercises/math/functions/exponentials/readExponentialFunctionParamsOnGraph.js +142 -0
  86. package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLineV2.d.ts.map +1 -1
  87. package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLineV2.js +7 -6
  88. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.d.ts.map +1 -1
  89. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.js +3 -2
  90. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.d.ts.map +1 -1
  91. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.js +7 -6
  92. package/lib/exercises/math/percent/percentToDecimal.d.ts.map +1 -1
  93. package/lib/exercises/math/percent/percentToDecimal.js +5 -4
  94. package/lib/exercises/math/probaStat/basicStats/calculateFrequencyInList.d.ts.map +1 -1
  95. package/lib/exercises/math/probaStat/basicStats/calculateFrequencyInList.js +5 -4
  96. package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
  97. package/lib/exercises/math/probaStat/probaFromTableWithContext.js +7 -8
  98. package/lib/exercises/math/probaStat/randomVariable/index.d.ts +1 -7
  99. package/lib/exercises/math/probaStat/randomVariable/index.d.ts.map +1 -1
  100. package/lib/exercises/math/probaStat/randomVariable/index.js +1 -7
  101. package/lib/exercises/math/probaStat/randomVariable/situations/index.d.ts +8 -0
  102. package/lib/exercises/math/probaStat/randomVariable/situations/index.d.ts.map +1 -0
  103. package/lib/exercises/math/probaStat/randomVariable/situations/index.js +7 -0
  104. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationAverage.d.ts +11 -0
  105. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationAverage.d.ts.map +1 -0
  106. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationAverage.js +112 -0
  107. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationComputeProbability.d.ts +9 -0
  108. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationComputeProbability.d.ts.map +1 -0
  109. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationComputeProbability.js +176 -0
  110. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationIsGameFavorable.d.ts +8 -0
  111. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationIsGameFavorable.d.ts.map +1 -0
  112. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationIsGameFavorable.js +94 -0
  113. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationProbabilityLaw.d.ts +9 -0
  114. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationProbabilityLaw.d.ts.map +1 -0
  115. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationProbabilityLaw.js +166 -0
  116. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationStandardDeviation.d.ts +8 -0
  117. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationStandardDeviation.d.ts.map +1 -0
  118. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationStandardDeviation.js +133 -0
  119. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationValues.d.ts +8 -0
  120. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationValues.d.ts.map +1 -0
  121. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationValues.js +211 -0
  122. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationVariance.d.ts +8 -0
  123. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationVariance.d.ts.map +1 -0
  124. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationVariance.js +113 -0
  125. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituations.d.ts +41 -0
  126. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituations.d.ts.map +1 -0
  127. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituations.js +173 -0
  128. package/lib/exercises/math/probaStat/stats1var/medianWithList.d.ts.map +1 -1
  129. package/lib/exercises/math/probaStat/stats1var/medianWithList.js +5 -4
  130. package/lib/exercises/math/python/list/pyListMutationMix.d.ts.map +1 -1
  131. package/lib/exercises/math/python/list/pyListMutationMix.js +11 -6
  132. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.d.ts.map +1 -1
  133. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.js +9 -9
  134. package/lib/exercises/utils/options/arrayedOptions.d.ts +2 -0
  135. package/lib/exercises/utils/options/arrayedOptions.d.ts.map +1 -0
  136. package/lib/exercises/utils/options/arrayedOptions.js +16 -0
  137. package/lib/index.d.ts +56 -24
  138. package/lib/index.d.ts.map +1 -1
  139. package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts.map +1 -1
  140. package/lib/math/utils/sequences/situations/seqArithmeticSituations.js +20 -20
  141. package/lib/tree/utilities/nodeUtils.d.ts +2 -0
  142. package/lib/tree/utilities/nodeUtils.d.ts.map +1 -1
  143. package/lib/tree/utilities/nodeUtils.js +40 -0
  144. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"decimalFractionToDecimal.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/decimals/decimalFractionToDecimal.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAoBrC,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAgQF,KAAK,OAAO,GAAG;IACb,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AA4BF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgBnE,CAAC"}
1
+ {"version":3,"file":"decimalFractionToDecimal.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/decimals/decimalFractionToDecimal.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAqBrC,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AA+PF,KAAK,OAAO,GAAG;IACb,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AA4BF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgBnE,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { defaultArrayedOptsWhereNeeded } from "../../../../exercises/utils/options/arrayedOptions.js";
3
4
  import { Decimal } from "../../../../math/numbers/decimals/decimal.js";
4
5
  import { randint } from "../../../../math/utils/random/randint.js";
5
6
  import { isNumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
@@ -167,9 +168,9 @@ const isAnswerValid = (ans, { answer, isFractionToDigital, nb }) => {
167
168
  }
168
169
  };
169
170
  const getDecimalFractionToDecimalQuestion = (optsIn) => {
170
- const arrayedOptions = optsIn ?? optsDefault;
171
+ const arrayedOpts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
171
172
  const opts = {
172
- conversionType: random(arrayedOptions.conversionType),
173
+ conversionType: random(arrayedOpts.conversionType),
173
174
  };
174
175
  const isFractionToDigital = opts.conversionType === "Fraction vers nombre à virgule";
175
176
  const nb = (() => {
@@ -205,7 +206,7 @@ const getQuestionFromIdentifiers = (identifiers, opts) => {
205
206
  };
206
207
  return question;
207
208
  };
208
- const optsDefault = {
209
+ const arrayedOptsDefault = {
209
210
  conversionType: [
210
211
  "Fraction vers nombre à virgule",
211
212
  "Nombre à virgule vers fraction",
@@ -221,7 +222,7 @@ const options = [
221
222
  "Fraction vers nombre à virgule",
222
223
  "Nombre à virgule vers fraction",
223
224
  ],
224
- defaultValue: optsDefault.conversionType,
225
+ defaultValue: arrayedOptsDefault.conversionType,
225
226
  },
226
227
  ];
227
228
  export const decimalFractionToDecimal = {
@@ -1 +1 @@
1
- {"version":3,"file":"factorizeEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/factorizeEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAyCrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,OAAO,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAqRF,KAAK,OAAO,GAAG;IACb,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC;AAsBF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAyB5D,CAAC"}
1
+ {"version":3,"file":"factorizeEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/factorizeEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AA0CrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,OAAO,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAsRF,KAAK,OAAO,GAAG;IACb,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC;AAsBF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAyB5D,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { addValidProp, shuffleProps, tryToAddWrongProp, propWhile, GeneratorOptionTarget, GeneratorOptionType, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { defaultArrayedOptsWhereNeeded } from "../../../../exercises/utils/options/arrayedOptions.js";
3
4
  import { SetVEA } from "../../../../exercises/vea/setVEA.js";
4
5
  import { randint } from "../../../../math/utils/random/randint.js";
5
6
  import { EquationSolutionNode } from "../../../../tree/nodes/equations/equationSolutionNode.js";
@@ -33,7 +34,7 @@ const getTexForEquationSolutionNode = (nodeAnswer, opts) => {
33
34
  }
34
35
  };
35
36
  const getPropositions = (n, { answer, ...identifiers }, optsIn) => {
36
- const opts = optsIn ?? optsDefault;
37
+ const opts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
37
38
  const { a, isSum, b } = identifiers;
38
39
  const propositions = [];
39
40
  addValidProp(propositions, answer);
@@ -65,7 +66,7 @@ const getAnswerNode = (identifiers) => {
65
66
  return nodeAnswer;
66
67
  };
67
68
  const getAnswer = (identifiers, optsIn) => {
68
- const opts = optsIn ?? optsDefault;
69
+ const opts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
69
70
  const answerNode = getAnswerNode(identifiers);
70
71
  return getTexForEquationSolutionNode(answerNode, opts);
71
72
  };
@@ -95,7 +96,7 @@ ${left.toTex()} = ${multiply(isSum ? -1 : 1, right).toTex()} \\iff ${eq
95
96
  $$`;
96
97
  };
97
98
  const getCorrection = (identifiers, optsIn) => {
98
- const opts = optsIn ?? optsDefault;
99
+ const opts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
99
100
  const answerInputTypeDefault = "S={...;...}";
100
101
  const answerInputType = opts.answerInputTypes.includes(answerInputTypeDefault)
101
102
  ? answerInputTypeDefault
@@ -138,7 +139,7 @@ ${getAnswer(identifiers, opts)}
138
139
  $$`;
139
140
  };
140
141
  const getKeys = (_, optsIn) => {
141
- const opts = optsIn ?? optsDefault;
142
+ const opts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
142
143
  const { answerInputTypes } = opts;
143
144
  return [
144
145
  ...answerInputTypes.reduce((acc, answerInputType) => {
@@ -164,7 +165,7 @@ const getKeys = (_, optsIn) => {
164
165
  ];
165
166
  };
166
167
  const isAnswerValid = (ans, { answer: _, ...identifiers }, optsIn) => {
167
- const opts = optsIn ?? optsDefault;
168
+ const opts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
168
169
  const answerNode = getAnswerNode(identifiers);
169
170
  const arrNodeAnswer = answerNode.solutionsSet.elements;
170
171
  function getParsedNodesForAnswerInputType(ans, answerInputType) {
@@ -209,7 +210,7 @@ const isAnswerValid = (ans, { answer: _, ...identifiers }, optsIn) => {
209
210
  return opts.answerInputTypes.some((answerInputType) => isAnswerValidForAnswerInputType(answerInputType));
210
211
  };
211
212
  const getFactorizeEquationQuestion = (optsIn) => {
212
- const opts = optsIn ?? optsDefault;
213
+ const opts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
213
214
  const a = randint(1, 10);
214
215
  const b = randint(1, 10);
215
216
  const isSum = coinFlip();
@@ -228,7 +229,7 @@ const getQuestionFromIdentifiers = (identifiers, opts) => {
228
229
  options: opts,
229
230
  };
230
231
  };
231
- const optsDefault = {
232
+ const arrayedOptsDefault = {
232
233
  answerInputTypes: ["x=... ou x=...", "S={...;...}"],
233
234
  };
234
235
  const options = [
@@ -238,7 +239,7 @@ const options = [
238
239
  target: GeneratorOptionTarget.generation,
239
240
  type: GeneratorOptionType.multiselect,
240
241
  values: ["x=... ou x=...", "S={...;...}"],
241
- defaultValue: optsDefault.answerInputTypes,
242
+ defaultValue: arrayedOptsDefault.answerInputTypes,
242
243
  },
243
244
  ];
244
245
  export const factorizeEquation = {
@@ -1 +1 @@
1
- {"version":3,"file":"isEqualityTrue.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/isEqualityTrue.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAkB7C,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAChD,YAAY,EAAE,eAAe,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAkUF,KAAK,OAAO,GAAG;IACb,SAAS,EAAE,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;IAC7C,aAAa,EAAE,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;CAClD,CAAC;AA6BF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkB1D,CAAC"}
1
+ {"version":3,"file":"isEqualityTrue.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/isEqualityTrue.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAQrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAkB7C,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAChD,YAAY,EAAE,eAAe,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAgUF,KAAK,OAAO,GAAG;IACb,SAAS,EAAE,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;IAC7C,aAAa,EAAE,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;CAClD,CAAC;AA6BF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkB1D,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { addValidProp, tryToAddWrongProp, GeneratorOptionTarget, GeneratorOptionType, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { defaultArrayedOptsWhereNeeded } from "../../../../exercises/utils/options/arrayedOptions.js";
3
4
  import { nodeBySubstitutingVar } from "../../../../math/utils/functions/functionComposition.js";
4
5
  import { randfloat } from "../../../../math/utils/random/randfloat.js";
5
6
  import { randint } from "../../../../math/utils/random/randint.js";
@@ -102,10 +103,10 @@ const getKeys = () => {
102
103
  return [];
103
104
  };
104
105
  const getIsEqualityTrue1Question = (optsIn) => {
105
- const arrayedOptions = optsIn ?? optsDefault;
106
+ const arrayedOpts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
106
107
  const opts = {
107
- typeCoeff: random(arrayedOptions.typeCoeff),
108
- typeTestValue: random(arrayedOptions.typeTestValue),
108
+ typeCoeff: random(arrayedOpts.typeCoeff),
109
+ typeTestValue: random(arrayedOpts.typeTestValue),
109
110
  };
110
111
  const roundDecimalTo = 1;
111
112
  const varName = random(varNames);
@@ -272,7 +273,7 @@ const getQuestionFromIdentifiers = (identifiers, opts) => {
272
273
  };
273
274
  return question;
274
275
  };
275
- const optsDefault = {
276
+ const arrayedOptsDefault = {
276
277
  typeCoeff: ["Entier"],
277
278
  typeTestValue: ["Entier", "Fraction", "Décimal"],
278
279
  };
@@ -283,7 +284,7 @@ const options = [
283
284
  target: GeneratorOptionTarget.generation,
284
285
  type: GeneratorOptionType.multiselect,
285
286
  values: ["Entier", "Fraction", "Décimal"],
286
- defaultValue: optsDefault.typeCoeff,
287
+ defaultValue: arrayedOptsDefault.typeCoeff,
287
288
  },
288
289
  {
289
290
  id: "typeTestValue",
@@ -291,7 +292,7 @@ const options = [
291
292
  target: GeneratorOptionTarget.generation,
292
293
  type: GeneratorOptionType.multiselect,
293
294
  values: ["Entier", "Fraction", "Décimal"],
294
- defaultValue: optsDefault.typeTestValue,
295
+ defaultValue: arrayedOptsDefault.typeTestValue,
295
296
  },
296
297
  ];
297
298
  export const isEqualityTrue1 = {
@@ -1 +1 @@
1
- {"version":3,"file":"barChartInterpreting.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/barChartInterpreting.ts"],"names":[],"mappings":"AAAA,OAAO,EAYL,QAAQ,EAKT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,cAAc,GAAG,cAAc,CAAC;IACtC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,UAAU,GAAG;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,aAAa,GAAG,UAAU,GAAG,SAAS,CAAC;AAE5C,KAAK,QAAQ,GAAG;IACd,KAAK,EAAE,aAAa,CAAC;IACrB,KAAK,EAAE,aAAa,CAAC;CACtB,CAAC;AAEF,KAAK,QAAQ,GAAG;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,GAAG,GAAG;IACT,KAAK,EAAE,QAAQ,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;AAEF,KAAK,QAAQ,GAAG;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,UAAU,EAAE,QAAQ,EAAE,CAAC;CACxB,CAAC;AA6tBF,KAAK,OAAO,GAAG;IACb,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAsBF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAe/D,CAAC"}
1
+ {"version":3,"file":"barChartInterpreting.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/barChartInterpreting.ts"],"names":[],"mappings":"AAAA,OAAO,EAYL,QAAQ,EAKT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,cAAc,GAAG,cAAc,CAAC;IACtC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,UAAU,GAAG;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,aAAa,GAAG,UAAU,GAAG,SAAS,CAAC;AAE5C,KAAK,QAAQ,GAAG;IACd,KAAK,EAAE,aAAa,CAAC;IACrB,KAAK,EAAE,aAAa,CAAC;CACtB,CAAC;AAEF,KAAK,QAAQ,GAAG;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,GAAG,GAAG;IACT,KAAK,EAAE,QAAQ,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;AAEF,KAAK,QAAQ,GAAG;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,UAAU,EAAE,QAAQ,EAAE,CAAC;CACxB,CAAC;AA4tBF,KAAK,OAAO,GAAG;IACb,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAsBF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAe/D,CAAC"}
@@ -8,6 +8,7 @@ import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuesti
8
8
  import { randint } from "../../../math/utils/random/randint.js";
9
9
  import { GeogebraConstructor } from "../../../geogebra/geogebraConstructor.js";
10
10
  import { capitalize } from "../../../utils/strings/capitalize.js";
11
+ import { defaultArrayedOptsWhereNeeded } from "../../../exercises/utils/options/arrayedOptions.js";
11
12
  class BarChartConstructor {
12
13
  static stylesPools = {
13
14
  color: [
@@ -427,9 +428,9 @@ const getGGBOptions = (identifiers, opts) => {
427
428
  }
428
429
  };
429
430
  const getBarChartInterpretingQuestion = (optsIn) => {
430
- const arrayedOptions = optsIn ?? optsDefault;
431
+ const arrayedOpts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
431
432
  const opts = {
432
- displayType: random(arrayedOptions.displayType),
433
+ displayType: random(arrayedOpts.displayType),
433
434
  };
434
435
  const styleType = "color";
435
436
  const displayType = opts.displayType;
@@ -512,7 +513,7 @@ const getQuestionFromIdentifiers = (identifiers, opts) => {
512
513
  };
513
514
  return question;
514
515
  };
515
- const optsDefault = {
516
+ const arrayedOptsDefault = {
516
517
  displayType: ["faisceaux", "empilements"],
517
518
  };
518
519
  const options = [
@@ -522,7 +523,7 @@ const options = [
522
523
  target: GeneratorOptionTarget.generation,
523
524
  type: GeneratorOptionType.multiselect,
524
525
  values: ["faisceaux", "empilements"],
525
- defaultValue: optsDefault.displayType,
526
+ defaultValue: arrayedOptsDefault.displayType,
526
527
  },
527
528
  ];
528
529
  export const barChartInterpreting = {
@@ -1 +1 @@
1
- {"version":3,"file":"derivativeEquationSolving1.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/derivativeEquationSolving1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAYrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA6B7C,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,eAAe,CAAC;IAC9B,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,eAAe,EAAE,CAAC;CACjC,CAAC;AA6SF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAoCF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAerE,CAAC"}
1
+ {"version":3,"file":"derivativeEquationSolving1.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/derivativeEquationSolving1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAarC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA6B7C,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,eAAe,CAAC;IAC9B,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,eAAe,EAAE,CAAC;CACjC,CAAC;AA4SF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAoCF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAerE,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { defaultArrayedOptsWhereNeeded } from "../../../../exercises/utils/options/arrayedOptions.js";
3
4
  import { SetVEA } from "../../../../exercises/vea/setVEA.js";
4
5
  import { createIntegratedPolynomialNode, createNodeFPolynomialFromRoots, } from "../../../../math/utils/polynomial/polynomialUtils.js";
5
6
  import { randint } from "../../../../math/utils/random/randint.js";
@@ -223,8 +224,8 @@ const createRandomIdentifiers = (typeF) => {
223
224
  return identifiers;
224
225
  };
225
226
  const getDerivativeEquationSolving1Question = (optsIn) => {
226
- const arrayedOptions = optsIn ?? arrayedOptsDefault;
227
- const typeF = random(arrayedOptions.typeF);
227
+ const arrayedOpts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
228
+ const typeF = random(arrayedOpts.typeF);
228
229
  const identifiers = createRandomIdentifiers(typeF);
229
230
  return getQuestionFromIdentifiers(identifiers);
230
231
  };
@@ -1 +1 @@
1
- {"version":3,"file":"derivativeEquationSolving3.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/derivativeEquationSolving3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAarC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA6B7C,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,eAAe,CAAC;IAC9B,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AA6TF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAoCF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAerE,CAAC"}
1
+ {"version":3,"file":"derivativeEquationSolving3.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/derivativeEquationSolving3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAcrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA6B7C,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,eAAe,CAAC;IAC9B,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AA4TF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAoCF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAerE,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { defaultArrayedOptsWhereNeeded } from "../../../../exercises/utils/options/arrayedOptions.js";
3
4
  import { SetVEA } from "../../../../exercises/vea/setVEA.js";
4
5
  import { nodeBySubstitutingVar } from "../../../../math/utils/functions/functionComposition.js";
5
6
  import { createIntegratedPolynomialNode, createNodeFPolynomialFromRoots, } from "../../../../math/utils/polynomial/polynomialUtils.js";
@@ -236,8 +237,8 @@ const createRandomIdentifiers = (typeF) => {
236
237
  return identifiers;
237
238
  };
238
239
  const getDerivativeEquationSolving3Question = (optsIn) => {
239
- const arrayedOptions = optsIn ?? arrayedOptsDefault;
240
- const typeF = random(arrayedOptions.typeF);
240
+ const arrayedOpts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
241
+ const typeF = random(arrayedOpts.typeF);
241
242
  const identifiers = createRandomIdentifiers(typeF);
242
243
  return getQuestionFromIdentifiers(identifiers);
243
244
  };
@@ -1 +1 @@
1
- {"version":3,"file":"valueDerivativeFromFunctionExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAgF7C,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,eAAe,CAAC;IAC/B,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AA0QF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAgDF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAC1D,WAAW,EACX,OAAO,CAoBR,CAAC"}
1
+ {"version":3,"file":"valueDerivativeFromFunctionExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAUrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAgF7C,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,eAAe,CAAC;IAC/B,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAoQF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAgDF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAC1D,WAAW,EACX,OAAO,CAoBR,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { addValidProp, tryToAddWrongProp, propWhile, shuffleProps, GeneratorOptionTarget, GeneratorOptionType, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { defaultArrayedOptsWhereNeeded } from "../../../../exercises/utils/options/arrayedOptions.js";
3
4
  import { AffineConstructor } from "../../../../math/polynomials/affine.js";
4
5
  import { PolynomialConstructor } from "../../../../math/polynomials/polynomial.js";
5
6
  import { TrinomConstructor } from "../../../../math/polynomials/trinom.js";
@@ -155,32 +156,37 @@ const getPropositions = (n, { answer, ...identifiers }) => {
155
156
  const { nodeIdsXAsked, nodeIdsF } = identifiers;
156
157
  const [nodeXAsked, nodeF] = [nodeIdsXAsked, nodeIdsF].map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
157
158
  const nodeDerivative = getPrettyDerivativeNode(nodeF);
158
- function tryToAddWrongPropWithSuccess(propositions, tex, format) {
159
+ function tryToAddWrongPropWithSuccess(propositions, func) {
159
160
  const nbPropsBefore = propositions.length;
160
- tryToAddWrongProp(propositions, tex, format);
161
- const nbPropsAfter = propositions.length;
162
- return nbPropsAfter !== nbPropsBefore;
161
+ try {
162
+ tryToAddWrongProp(propositions, func());
163
+ const nbPropsAfter = propositions.length;
164
+ return nbPropsAfter !== nbPropsBefore;
165
+ }
166
+ catch (_) {
167
+ return false;
168
+ }
163
169
  }
164
170
  propWhile(propositions, n, () => {
165
- if (!tryToAddWrongPropWithSuccess(propositions, (() => {
171
+ if (!tryToAddWrongPropWithSuccess(propositions, () => {
166
172
  const nodeFShuffled = NodeShuffler.deepShuffle(nodeF);
167
173
  const identifiersWrong = {
168
174
  ...identifiers,
169
175
  nodeIdsF: nodeFShuffled.toIdentifiers(),
170
176
  };
171
177
  return getAnswer(identifiersWrong);
172
- })())) {
173
- if (!tryToAddWrongPropWithSuccess(propositions, (() => {
178
+ })) {
179
+ if (!tryToAddWrongPropWithSuccess(propositions, () => {
174
180
  const nodeDerivativeShuffled = NodeShuffler.deepShuffle(nodeDerivative);
175
181
  const nodeWrong = nodeBySubstitutingVar(nodeDerivativeShuffled, nodeXAsked, "x".toTree()).simplify();
176
182
  return nodeWrong.simplify().toTex();
177
- })())) {
183
+ })) {
178
184
  try {
179
- tryToAddWrongPropWithSuccess(propositions, (() => {
185
+ tryToAddWrongPropWithSuccess(propositions, () => {
180
186
  const typeF = random(arrayedOptsDefault.typeF);
181
187
  const identifiersWrong = createRandomIdentifiers(typeF);
182
188
  return getAnswer(identifiersWrong);
183
- })());
189
+ });
184
190
  }
185
191
  catch (_) {
186
192
  tryToAddWrongProp(propositions, randint(-20, 20).frenchify());
@@ -214,48 +220,50 @@ const createRandomIdentifiers = (typeF) => {
214
220
  };
215
221
  return identifiers;
216
222
  };
217
- const getValueDerivativeFromFunctionExpressionQuestion = (optsIn) => {
218
- const arrayedOptions = optsIn ?? arrayedOptsDefault;
219
- const typeF = random(arrayedOptions.typeF);
223
+ const isIdentifiersQCPassed = (identifiers) => {
224
+ const isExploding = (identifiers) => {
225
+ const { nodeIdsXAsked, nodeIdsF } = identifiers;
226
+ const [nodeXAsked, nodeF] = [nodeIdsXAsked, nodeIdsF].map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
227
+ const nodeDerivative = getPrettyDerivativeNode(nodeF);
228
+ let isExploding = false;
229
+ try {
230
+ const _nodeValueFunction = nodeBySubstitutingVar(nodeF, nodeXAsked, "x".toTree()).simplify();
231
+ const _nodeValueDerivative = nodeBySubstitutingVar(nodeDerivative, nodeXAsked, "x".toTree()).simplify();
232
+ getAnswer(identifiers);
233
+ }
234
+ catch (_) {
235
+ isExploding = true;
236
+ }
237
+ return isExploding;
238
+ };
239
+ return !isExploding(identifiers);
240
+ };
241
+ const createQCPassedIdentifiers = (typeF) => {
220
242
  let identifiers;
221
- let isValid = false;
222
243
  let counter = -1;
244
+ let isValid = false;
223
245
  while (!isValid && counter < 100) {
224
246
  counter++;
225
247
  const identifiersCandidate = createRandomIdentifiers(typeF);
226
- const isExploding = (identifiers) => {
227
- const { nodeIdsXAsked, nodeIdsF } = identifiers;
228
- const [nodeXAsked, nodeF] = [nodeIdsXAsked, nodeIdsF].map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
229
- const nodeDerivative = getPrettyDerivativeNode(nodeF);
230
- let isExploding = false;
231
- try {
232
- const _nodeValueFunction = nodeBySubstitutingVar(nodeF, nodeXAsked, "x".toTree()).simplify();
233
- const _nodeValueDerivative = nodeBySubstitutingVar(nodeDerivative, nodeXAsked, "x".toTree()).simplify();
234
- }
235
- catch (_) {
236
- isExploding = true;
237
- }
238
- return isExploding;
239
- };
240
- isValid = !isExploding(identifiersCandidate);
248
+ isValid = isIdentifiersQCPassed(identifiersCandidate);
241
249
  if (isValid) {
242
250
  identifiers = identifiersCandidate;
243
251
  }
244
252
  }
245
253
  if (!isValid) {
246
254
  const identifiersDefault = {
247
- nodeIdsXAsked: {
248
- id: 7,
249
- value: 3,
250
- },
251
- nodeIdsF: {
252
- id: 10,
253
- name: "x",
254
- },
255
+ nodeIdsXAsked: (3).toTree().toIdentifiers(),
256
+ nodeIdsF: "x".toTree().toIdentifiers(),
255
257
  typeF: "$x$",
256
258
  };
257
259
  identifiers = identifiersDefault;
258
260
  }
261
+ return identifiers;
262
+ };
263
+ const getValueDerivativeFromFunctionExpressionQuestion = (optsIn) => {
264
+ const arrayedOpts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
265
+ const typeF = random(arrayedOpts.typeF);
266
+ const identifiers = createQCPassedIdentifiers(typeF);
259
267
  return getQuestionFromIdentifiers(identifiers);
260
268
  };
261
269
  const getQuestionFromIdentifiers = (identifiers) => {
@@ -1 +1 @@
1
- {"version":3,"file":"problemMaximizeProfitFindProduction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAIL,0BAA0B,EAC3B,MAAM,6DAA6D,CAAC;AAYrE,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAQ7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,MAAM,EAAE,0BAA0B,EAAE,CAAC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAqaF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAsBF,eAAO,MAAM,mCAAmC,EAAE,QAAQ,CACxD,WAAW,EACX,OAAO,CAoBR,CAAC"}
1
+ {"version":3,"file":"problemMaximizeProfitFindProduction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAQrC,OAAO,EAIL,0BAA0B,EAC3B,MAAM,6DAA6D,CAAC;AAYrE,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAQ7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,MAAM,EAAE,0BAA0B,EAAE,CAAC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAoaF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAsBF,eAAO,MAAM,mCAAmC,EAAE,QAAQ,CACxD,WAAW,EACX,OAAO,CAoBR,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { addValidProp, tryToAddWrongProp, propWhile, GeneratorOptionTarget, GeneratorOptionType, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { defaultArrayedOptsWhereNeeded } from "../../../../exercises/utils/options/arrayedOptions.js";
3
4
  import { numberVEA } from "../../../../exercises/vea/numberVEA.js";
4
5
  import { blueMain, orange, red } from "../../../../geogebra/colors.js";
5
6
  import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
@@ -294,8 +295,8 @@ const isIdentifiersQCPassed = (identifiers) => {
294
295
  return !isExploding(identifiers);
295
296
  };
296
297
  const getProblemMaximizeProfitFindProductionQuestion = (optsIn) => {
297
- const arrayedOptions = optsIn ?? arrayedOptsDefault;
298
- const typeF = random(arrayedOptions.typeF);
298
+ const arrayedOpts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
299
+ const typeF = random(arrayedOpts.typeF);
299
300
  let identifiers;
300
301
  let counter = -1;
301
302
  let isValid = false;
@@ -1 +1 @@
1
- {"version":3,"file":"problemMovementOnLineFindSpeedAtPoint.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA0E7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,oBAAoB,EAAE,eAAe,CAAC;IACtC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AA0RF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAoCF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAC1D,WAAW,EACX,OAAO,CAqBR,CAAC"}
1
+ {"version":3,"file":"problemMovementOnLineFindSpeedAtPoint.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAUrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA0E7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,oBAAoB,EAAE,eAAe,CAAC;IACtC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAyRF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAoCF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAC1D,WAAW,EACX,OAAO,CAqBR,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { addValidProp, tryToAddWrongProp, propWhile, GeneratorOptionTarget, GeneratorOptionType, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { defaultArrayedOptsWhereNeeded } from "../../../../exercises/utils/options/arrayedOptions.js";
3
4
  import { AffineConstructor } from "../../../../math/polynomials/affine.js";
4
5
  import { nodeBySubstitutingVar } from "../../../../math/utils/functions/functionComposition.js";
5
6
  import { getArrNodeCoeffOfPolynomialNode } from "../../../../math/utils/polynomial/polynomialUtils.js";
@@ -247,8 +248,8 @@ const isIdentifiersQCPassed = (identifiers) => {
247
248
  return !isExploding(identifiers);
248
249
  };
249
250
  const getProblemMovementOnLineFindSpeedAtPointQuestion = (optsIn) => {
250
- const arrayedOptions = optsIn ?? arrayedOptsDefault;
251
- const typeF = random(arrayedOptions.typeF);
251
+ const arrayedOpts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
252
+ const typeF = random(arrayedOpts.typeF);
252
253
  let identifiers;
253
254
  let counter = -1;
254
255
  let isValid = false;
@@ -1 +1 @@
1
- {"version":3,"file":"tangentEquationFromFunctionExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAUrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAgF7C,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,eAAe,CAAC;IAC/B,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAqXF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAgDF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAC1D,WAAW,EACX,OAAO,CAqBR,CAAC"}
1
+ {"version":3,"file":"tangentEquationFromFunctionExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAWrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAgF7C,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,eAAe,CAAC;IAC/B,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAoXF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAgDF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAC1D,WAAW,EACX,OAAO,CAqBR,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { addValidProp, tryToAddWrongProp, propWhile, shuffleProps, GeneratorOptionTarget, GeneratorOptionType, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { defaultArrayedOptsWhereNeeded } from "../../../../exercises/utils/options/arrayedOptions.js";
3
4
  import { polynomialVEA } from "../../../../exercises/vea/polynomialVEA.js";
4
5
  import { AffineConstructor } from "../../../../math/polynomials/affine.js";
5
6
  import { PolynomialConstructor } from "../../../../math/polynomials/polynomial.js";
@@ -305,8 +306,8 @@ const isIdentifiersQCPassed = (identifiers) => {
305
306
  return !isExploding(identifiers) && isVEAOk(identifiers);
306
307
  };
307
308
  const getTangentEquationFromFunctionExpressionQuestion = (optsIn) => {
308
- const arrayedOptions = optsIn ?? arrayedOptsDefault;
309
- const typeF = random(arrayedOptions.typeF);
309
+ const arrayedOpts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
310
+ const typeF = random(arrayedOpts.typeF);
310
311
  let identifiers;
311
312
  let isValid = false;
312
313
  let counter = -1;
@@ -1 +1 @@
1
- {"version":3,"file":"findAbscissaOfExtremaFromFunctionExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA4R7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA2LF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAoCF,eAAO,MAAM,2CAA2C,EAAE,QAAQ,CAChE,WAAW,EACX,OAAO,CAqBR,CAAC"}
1
+ {"version":3,"file":"findAbscissaOfExtremaFromFunctionExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA6R7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA0LF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAoCF,eAAO,MAAM,2CAA2C,EAAE,QAAQ,CAChE,WAAW,EACX,OAAO,CAqBR,CAAC"}
@@ -13,6 +13,7 @@ import { discreteSetParser } from "../../../../tree/parsers/discreteSetParser.js
13
13
  import { SetVEA } from "../../../../exercises/vea/setVEA.js";
14
14
  import { dividersOf } from "../../../../math/utils/arithmetic/dividersOf.js";
15
15
  import { probaFlip } from "../../../../utils/alea/probaFlip.js";
16
+ import { defaultArrayedOptsWhereNeeded } from "../../../../exercises/utils/options/arrayedOptions.js";
16
17
  const tryToSimplify = (node, simplifyOptions) => {
17
18
  try {
18
19
  return node.simplify(simplifyOptions);
@@ -353,9 +354,9 @@ const createRandomIdentifiers = (typeF, typeRoots) => {
353
354
  return identifiers;
354
355
  };
355
356
  const getFindAbscissaOfExtremaFromFunctionExpressionQuestion = (optsIn) => {
356
- const arrayedOptions = optsIn ?? arrayedOptsDefault;
357
- const typeF = random(arrayedOptions.typeF);
358
- const typeRoots = random(arrayedOptions.typeRoots);
357
+ const arrayedOpts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
358
+ const typeF = random(arrayedOpts.typeF);
359
+ const typeRoots = random(arrayedOpts.typeRoots);
359
360
  const identifiers = createRandomIdentifiers(typeF, typeRoots);
360
361
  return getQuestionFromIdentifiers(identifiers);
361
362
  };
@@ -1 +1 @@
1
- {"version":3,"file":"findExtremaFromFunctionExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/findExtremaFromFunctionExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA+R7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAwUF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAoCF,eAAO,MAAM,iCAAiC,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAqB1E,CAAC"}
1
+ {"version":3,"file":"findExtremaFromFunctionExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/findExtremaFromFunctionExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAmS7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAiSF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAqCF,eAAO,MAAM,iCAAiC,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAqB1E,CAAC"}