math-exercises 3.0.189 → 3.0.191

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 (138) 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/dataRepresentations/scatterPlot/index.d.ts +6 -0
  10. package/lib/exercises/math/dataRepresentations/scatterPlot/index.d.ts.map +1 -0
  11. package/lib/exercises/math/dataRepresentations/scatterPlot/index.js +5 -0
  12. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotBuildScatterPlotFromDataTable.d.ts +12 -0
  13. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotBuildScatterPlotFromDataTable.d.ts.map +1 -0
  14. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotBuildScatterPlotFromDataTable.js +206 -0
  15. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotCommenting.d.ts +9 -0
  16. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotCommenting.d.ts.map +1 -0
  17. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotCommenting.js +210 -0
  18. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableFromScatterPlotData.d.ts +10 -0
  19. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableFromScatterPlotData.d.ts.map +1 -0
  20. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableFromScatterPlotData.js +252 -0
  21. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableWithDataClassesFromScatterPlotData.d.ts +12 -0
  22. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableWithDataClassesFromScatterPlotData.d.ts.map +1 -0
  23. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableWithDataClassesFromScatterPlotData.js +352 -0
  24. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotInterpreting.d.ts +11 -0
  25. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotInterpreting.d.ts.map +1 -0
  26. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotInterpreting.js +403 -0
  27. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.d.ts.map +1 -1
  28. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.js +3 -2
  29. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.d.ts.map +1 -1
  30. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.js +3 -2
  31. package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.d.ts.map +1 -1
  32. package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.js +3 -2
  33. package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.d.ts.map +1 -1
  34. package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.js +3 -2
  35. package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.d.ts.map +1 -1
  36. package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.js +3 -2
  37. package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.d.ts.map +1 -1
  38. package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.js +4 -3
  39. package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.d.ts.map +1 -1
  40. package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.js +4 -3
  41. package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.d.ts.map +1 -1
  42. package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.js +4 -3
  43. package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.d.ts.map +1 -1
  44. package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.js +3 -2
  45. package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.d.ts.map +1 -1
  46. package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.js +3 -2
  47. package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.d.ts.map +1 -1
  48. package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.js +8 -4
  49. package/lib/exercises/math/functions/affines/affineCompareTwoImagesFromVariations.d.ts +13 -0
  50. package/lib/exercises/math/functions/affines/affineCompareTwoImagesFromVariations.d.ts.map +1 -0
  51. package/lib/exercises/math/functions/affines/affineCompareTwoImagesFromVariations.js +205 -0
  52. package/lib/exercises/math/functions/affines/affineVarTableOnBoundedInterval.d.ts +9 -0
  53. package/lib/exercises/math/functions/affines/affineVarTableOnBoundedInterval.d.ts.map +1 -0
  54. package/lib/exercises/math/functions/affines/affineVarTableOnBoundedInterval.js +157 -0
  55. package/lib/exercises/math/functions/affines/affineVariations.d.ts +12 -0
  56. package/lib/exercises/math/functions/affines/affineVariations.d.ts.map +1 -0
  57. package/lib/exercises/math/functions/affines/affineVariations.js +176 -0
  58. package/lib/exercises/math/functions/affines/affineVariationsFromGraph.d.ts +8 -0
  59. package/lib/exercises/math/functions/affines/affineVariationsFromGraph.d.ts.map +1 -0
  60. package/lib/exercises/math/functions/affines/affineVariationsFromGraph.js +203 -0
  61. package/lib/exercises/math/functions/affines/affineVariationsFromTwoImages.d.ts +12 -0
  62. package/lib/exercises/math/functions/affines/affineVariationsFromTwoImages.d.ts.map +1 -0
  63. package/lib/exercises/math/functions/affines/affineVariationsFromTwoImages.js +259 -0
  64. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.d.ts.map +1 -1
  65. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.js +8 -6
  66. package/lib/exercises/math/functions/exponentials/estimateExponentialFunctionImageFromGeometricScatterplot.d.ts +2 -0
  67. package/lib/exercises/math/functions/exponentials/estimateExponentialFunctionImageFromGeometricScatterplot.d.ts.map +1 -0
  68. package/lib/exercises/math/functions/exponentials/estimateExponentialFunctionImageFromGeometricScatterplot.js +155 -0
  69. package/lib/exercises/math/functions/exponentials/exponentialFunctionImage.d.ts +9 -0
  70. package/lib/exercises/math/functions/exponentials/exponentialFunctionImage.d.ts.map +1 -0
  71. package/lib/exercises/math/functions/exponentials/exponentialFunctionImage.js +99 -0
  72. package/lib/exercises/math/functions/exponentials/exponentialsRawVariations.d.ts +8 -0
  73. package/lib/exercises/math/functions/exponentials/exponentialsRawVariations.d.ts.map +1 -0
  74. package/lib/exercises/math/functions/exponentials/exponentialsRawVariations.js +99 -0
  75. package/lib/exercises/math/functions/exponentials/index.d.ts +8 -0
  76. package/lib/exercises/math/functions/exponentials/index.d.ts.map +1 -1
  77. package/lib/exercises/math/functions/exponentials/index.js +9 -0
  78. package/lib/exercises/math/functions/exponentials/plausibleExponentialFunctionExpressionFromGraph.d.ts +12 -0
  79. package/lib/exercises/math/functions/exponentials/plausibleExponentialFunctionExpressionFromGraph.d.ts.map +1 -0
  80. package/lib/exercises/math/functions/exponentials/plausibleExponentialFunctionExpressionFromGraph.js +138 -0
  81. package/lib/exercises/math/functions/exponentials/readExponentialFunctionParamsOnGraph.d.ts +8 -0
  82. package/lib/exercises/math/functions/exponentials/readExponentialFunctionParamsOnGraph.d.ts.map +1 -0
  83. package/lib/exercises/math/functions/exponentials/readExponentialFunctionParamsOnGraph.js +142 -0
  84. package/lib/exercises/math/functions/exponentials/realPowersFraction.d.ts +10 -0
  85. package/lib/exercises/math/functions/exponentials/realPowersFraction.d.ts.map +1 -0
  86. package/lib/exercises/math/functions/exponentials/realPowersFraction.js +125 -0
  87. package/lib/exercises/math/functions/exponentials/realPowersMixOperations.d.ts +12 -0
  88. package/lib/exercises/math/functions/exponentials/realPowersMixOperations.d.ts.map +1 -0
  89. package/lib/exercises/math/functions/exponentials/realPowersMixOperations.js +148 -0
  90. package/lib/exercises/math/functions/exponentials/realPowersPower.d.ts +10 -0
  91. package/lib/exercises/math/functions/exponentials/realPowersPower.d.ts.map +1 -0
  92. package/lib/exercises/math/functions/exponentials/realPowersPower.js +128 -0
  93. package/lib/exercises/math/functions/exponentials/realPowersProduct.d.ts +10 -0
  94. package/lib/exercises/math/functions/exponentials/realPowersProduct.d.ts.map +1 -0
  95. package/lib/exercises/math/functions/exponentials/realPowersProduct.js +128 -0
  96. package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLineV2.d.ts.map +1 -1
  97. package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLineV2.js +7 -6
  98. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.d.ts.map +1 -1
  99. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.js +3 -2
  100. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.d.ts.map +1 -1
  101. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.js +7 -6
  102. package/lib/exercises/math/percent/percentToDecimal.d.ts.map +1 -1
  103. package/lib/exercises/math/percent/percentToDecimal.js +5 -4
  104. package/lib/exercises/math/probaStat/basicStats/calculateFrequencyInList.d.ts.map +1 -1
  105. package/lib/exercises/math/probaStat/basicStats/calculateFrequencyInList.js +5 -4
  106. package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
  107. package/lib/exercises/math/probaStat/probaFromTableWithContext.js +7 -8
  108. package/lib/exercises/math/probaStat/stats1var/medianWithList.d.ts.map +1 -1
  109. package/lib/exercises/math/probaStat/stats1var/medianWithList.js +5 -4
  110. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.d.ts.map +1 -1
  111. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.js +9 -9
  112. package/lib/exercises/math/sequences/geometric/geometricFindNextTermFromTwoConsecutiveTerms.d.ts +12 -0
  113. package/lib/exercises/math/sequences/geometric/geometricFindNextTermFromTwoConsecutiveTerms.d.ts.map +1 -0
  114. package/lib/exercises/math/sequences/geometric/geometricFindNextTermFromTwoConsecutiveTerms.js +217 -0
  115. package/lib/exercises/math/sequences/geometric/geometricFindRecurrenceFormula.d.ts +10 -0
  116. package/lib/exercises/math/sequences/geometric/geometricFindRecurrenceFormula.d.ts.map +1 -0
  117. package/lib/exercises/math/sequences/geometric/geometricFindRecurrenceFormula.js +186 -0
  118. package/lib/exercises/math/sequences/geometric/graph/geometricPlaceFirstPoints.d.ts +14 -0
  119. package/lib/exercises/math/sequences/geometric/graph/geometricPlaceFirstPoints.d.ts.map +1 -0
  120. package/lib/exercises/math/sequences/geometric/graph/geometricPlaceFirstPoints.js +189 -0
  121. package/lib/exercises/math/sequences/geometric/graph/index.d.ts +2 -0
  122. package/lib/exercises/math/sequences/geometric/graph/index.d.ts.map +1 -0
  123. package/lib/exercises/math/sequences/geometric/graph/index.js +1 -0
  124. package/lib/exercises/utils/options/arrayedOptions.d.ts +2 -0
  125. package/lib/exercises/utils/options/arrayedOptions.d.ts.map +1 -0
  126. package/lib/exercises/utils/options/arrayedOptions.js +16 -0
  127. package/lib/index.d.ts +33 -0
  128. package/lib/index.d.ts.map +1 -1
  129. package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts.map +1 -1
  130. package/lib/math/utils/sequences/situations/seqArithmeticSituations.js +20 -20
  131. package/lib/tree/nodes/algebraicNode.d.ts +3 -0
  132. package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
  133. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  134. package/lib/tree/nodes/operators/fractionNode.js +5 -3
  135. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  136. package/lib/tree/nodes/operators/multiplyNode.js +5 -3
  137. package/lib/tree/nodes/operators/powerNode.js +1 -1
  138. package/package.json +1 -1
@@ -0,0 +1,125 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, propWhile, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { randfloat } from "../../../../math/utils/random/randfloat.js";
4
+ import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
5
+ import { add } from "../../../../tree/nodes/operators/addNode.js";
6
+ import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
7
+ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
8
+ import { power } from "../../../../tree/nodes/operators/powerNode.js";
9
+ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
10
+ import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
11
+ import { coinFlip } from "../../../../utils/alea/coinFlip.js";
12
+ import { doWhile } from "../../../../utils/doWhile.js";
13
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
14
+ import { isInt } from "../../../../utils/isInt.js";
15
+ const getPropositions = (n, { answer, aIds, xIds, yIds }) => {
16
+ const propositions = [];
17
+ addValidProp(propositions, answer);
18
+ const a = reifyAlgebraic(aIds);
19
+ const x = reifyAlgebraic(xIds);
20
+ const y = reifyAlgebraic(yIds);
21
+ tryToAddWrongProp(propositions, power(a, add(x, y)).simplify().toTex());
22
+ tryToAddWrongProp(propositions, power(a, multiply(x, y)).simplify().toTex());
23
+ propWhile(propositions, n, () => {
24
+ tryToAddWrongProp(propositions, power(a, randfloat(0.1, 5, 1)).simplify().toTex());
25
+ });
26
+ return shuffleProps(propositions, n);
27
+ };
28
+ const getAnswer = (identifiers) => {
29
+ const { aIds, xIds, yIds } = identifiers;
30
+ const a = reifyAlgebraic(aIds);
31
+ const x = reifyAlgebraic(xIds);
32
+ const y = reifyAlgebraic(yIds);
33
+ return power(a, substract(x, y)).simplify().toTex();
34
+ };
35
+ const getInstruction = (identifiers) => {
36
+ const { aIds, xIds, yIds } = identifiers;
37
+ const a = reifyAlgebraic(aIds);
38
+ const x = reifyAlgebraic(xIds);
39
+ const y = reifyAlgebraic(yIds);
40
+ return `Écrire sous la forme d'une seule puissance :
41
+
42
+ $$
43
+ ${frac(power(a, x), power(a, y)).toTex()}
44
+ $$`;
45
+ };
46
+ const getHint = () => {
47
+ return `Utilise la propriété suivante : pour tous nombres réels positifs $x$ et $y$ et pour tout nombre réel $a>0$, on a :
48
+
49
+ $$
50
+ \\frac{a^x}{a^y}= a^{x-y}
51
+ $$`;
52
+ };
53
+ const getCorrection = (identifiers) => {
54
+ const { aIds, xIds, yIds } = identifiers;
55
+ const a = reifyAlgebraic(aIds);
56
+ const x = reifyAlgebraic(xIds);
57
+ const y = reifyAlgebraic(yIds);
58
+ return `Pour tous nombres réels positifs $x$ et $y$ et pour tout nombre réel $a>0$, on a :
59
+
60
+ $$
61
+ \\frac{a^x}{a^y}= a^{x-y}
62
+ $$
63
+
64
+ Ici, on a donc :
65
+
66
+ $$
67
+ ${frac(power(a, x), power(a, y)).toTex()} = ${power(a, substract(x, y)).toTex()} = ${getAnswer(identifiers)}
68
+ $$`;
69
+ };
70
+ const getKeys = () => {
71
+ return [];
72
+ };
73
+ const isAnswerValid = (ans, { answer }) => {
74
+ try {
75
+ const parsed = parseAlgebraic(ans);
76
+ if (!parsed)
77
+ return false;
78
+ return parsed.simplify({ forbidPowerDivision: true }).toTex() === answer;
79
+ }
80
+ catch (err) {
81
+ return handleVEAError(err);
82
+ }
83
+ };
84
+ const getRealPowersFractionQuestion = () => {
85
+ const a = randfloat(0.1, 5, 1, [1]);
86
+ let x = doWhile(() => randfloat(0.1, 5, 1), (v) => isInt(v));
87
+ let y = randfloat(0.1, 5, 1);
88
+ if (coinFlip())
89
+ [x, y] = [y, x]; //comme ca l'éventuel entier est n'importe ou
90
+ const identifiers = {
91
+ aIds: a.toTree().toIdentifiers(),
92
+ xIds: x.toTree().toIdentifiers(),
93
+ yIds: y.toTree().toIdentifiers(),
94
+ };
95
+ return getQuestionFromIdentifiers(identifiers);
96
+ };
97
+ const getQuestionFromIdentifiers = (identifiers) => {
98
+ return {
99
+ answer: getAnswer(identifiers),
100
+ instruction: getInstruction(identifiers),
101
+ keys: getKeys(identifiers),
102
+ answerFormat: "tex",
103
+ identifiers,
104
+ hint: getHint(identifiers),
105
+ correction: getCorrection(identifiers),
106
+ };
107
+ };
108
+ export const realPowersFraction = {
109
+ id: "realPowersFraction",
110
+ connector: "=",
111
+ label: "Simplifier une division de puissances réelles",
112
+ isSingleStep: true,
113
+ generator: (nb, opts) => getDistinctQuestions(() => getRealPowersFractionQuestion(opts), nb),
114
+ qcmTimer: 60,
115
+ freeTimer: 60,
116
+ getPropositions,
117
+ isAnswerValid,
118
+ subject: "Mathématiques",
119
+ getInstruction,
120
+ getHint,
121
+ getCorrection,
122
+ getAnswer,
123
+ getQuestionFromIdentifiers,
124
+ hasHintAndCorrection: true,
125
+ };
@@ -0,0 +1,12 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
3
+ type Identifiers = {
4
+ aIds: NodeIdentifiers;
5
+ xIds: NodeIdentifiers;
6
+ yIds: NodeIdentifiers;
7
+ zIds: NodeIdentifiers;
8
+ tIds: NodeIdentifiers;
9
+ };
10
+ export declare const realPowersMixOperations: Exercise<Identifiers>;
11
+ export {};
12
+ //# sourceMappingURL=realPowersMixOperations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"realPowersMixOperations.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/exponentials/realPowersMixOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAY7C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;AAwIF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAkBzD,CAAC"}
@@ -0,0 +1,148 @@
1
+ import { addValidProp, shuffleProps, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { randfloat } from "../../../../math/utils/random/randfloat.js";
4
+ import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
5
+ import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
6
+ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
7
+ import { power } from "../../../../tree/nodes/operators/powerNode.js";
8
+ import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
9
+ import { shuffle } from "../../../../utils/alea/shuffle.js";
10
+ import { doWhile } from "../../../../utils/doWhile.js";
11
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
12
+ import { isInt } from "../../../../utils/isInt.js";
13
+ import { alignTex } from "../../../../utils/latex/alignTex.js";
14
+ const getPropositions = (n, { answer, aIds }) => {
15
+ const propositions = [];
16
+ addValidProp(propositions, answer);
17
+ const a = reifyAlgebraic(aIds);
18
+ propWhile(propositions, n, () => {
19
+ tryToAddWrongProp(propositions, power(a, randfloat(0.1, 5, 1)).simplify().toTex());
20
+ });
21
+ return shuffleProps(propositions, n);
22
+ };
23
+ const getAnswer = (identifiers) => {
24
+ const statement = getStatement(identifiers);
25
+ return statement.simplify().toTex();
26
+ };
27
+ const getStatement = (identifiers) => {
28
+ const { aIds, tIds, xIds, yIds, zIds } = identifiers;
29
+ const a = reifyAlgebraic(aIds);
30
+ const x = reifyAlgebraic(xIds);
31
+ const y = reifyAlgebraic(yIds);
32
+ const z = reifyAlgebraic(zIds);
33
+ const t = reifyAlgebraic(tIds);
34
+ return frac(multiply(power(power(a, x), y), power(a, z)), power(a, t));
35
+ };
36
+ const getInstruction = (identifiers) => {
37
+ return `Écrire sous la forme d'une seule puissance :
38
+
39
+ $$
40
+ ${getStatement(identifiers).toTex()}
41
+ $$`;
42
+ };
43
+ const getHint = () => {
44
+ return `Utilise les propriétés suivantes : pour tous nombres réels positifs $x$ et $y$ et pour tout nombre réel $a>0$, on a :
45
+
46
+ - $a^x\\times a^y = a^{x+y}$
47
+ - $\\frac{a^x}{a^y}= a^{x-y}$
48
+ - $\\left(a^x\\right)^y = a^{x\\times y}$`;
49
+ };
50
+ const getCorrection = (identifiers) => {
51
+ //(a^x)^y*a^z / a^t
52
+ const statement = getStatement(identifiers);
53
+ return `Pour tous nombres réels positifs $x$ et $y$ et pour tout nombre réel $a>0$, on a :
54
+
55
+ - $a^x\\times a^y = a^{x+y}$
56
+ - $\\frac{a^x}{a^y}= a^{x-y}$
57
+ - $\\left(a^x\\right)^y = a^{x\\times y}$
58
+
59
+ Ici, on a donc :
60
+
61
+ ${alignTex([
62
+ [
63
+ statement.toTex(),
64
+ "=",
65
+ statement
66
+ .simplify({
67
+ forbidPowerDivision: true,
68
+ forbidPowerMultiply: true,
69
+ })
70
+ .toTex(),
71
+ ],
72
+ [
73
+ "",
74
+ "=",
75
+ statement
76
+ .simplify({
77
+ forbidPowerDivision: true,
78
+ })
79
+ .toTex(),
80
+ ],
81
+ ["", "=", getAnswer(identifiers)],
82
+ ])}`;
83
+ };
84
+ const getKeys = () => {
85
+ return [];
86
+ };
87
+ const isAnswerValid = (ans, { answer }) => {
88
+ try {
89
+ const parsed = parseAlgebraic(ans);
90
+ if (!parsed)
91
+ return false;
92
+ return (parsed
93
+ .simplify({
94
+ forbidPowerDivision: true,
95
+ forbidPowerMultiply: true,
96
+ forbidPowerPower: true,
97
+ })
98
+ .toTex() === answer);
99
+ }
100
+ catch (err) {
101
+ return handleVEAError(err);
102
+ }
103
+ };
104
+ const getRealPowersMixOperationsQuestion = () => {
105
+ const a = randfloat(0.1, 5, 1, [1]);
106
+ let x = doWhile(() => randfloat(0.1, 5, 1), (v) => isInt(v));
107
+ let y = randfloat(0.1, 5, 1);
108
+ let z = randfloat(0.1, 5, 1);
109
+ let t = randfloat(0.1, 5, 1);
110
+ [x, y, z, t] = shuffle([x, y, z, t]);
111
+ const identifiers = {
112
+ aIds: a.toTree().toIdentifiers(),
113
+ xIds: x.toTree().toIdentifiers(),
114
+ yIds: y.toTree().toIdentifiers(),
115
+ tIds: t.toTree().toIdentifiers(),
116
+ zIds: z.toTree().toIdentifiers(),
117
+ };
118
+ return getQuestionFromIdentifiers(identifiers);
119
+ };
120
+ const getQuestionFromIdentifiers = (identifiers) => {
121
+ return {
122
+ answer: getAnswer(identifiers),
123
+ instruction: getInstruction(identifiers),
124
+ keys: getKeys(identifiers),
125
+ answerFormat: "tex",
126
+ identifiers,
127
+ hint: getHint(identifiers),
128
+ correction: getCorrection(identifiers),
129
+ };
130
+ };
131
+ export const realPowersMixOperations = {
132
+ id: "realPowersMixOperations",
133
+ connector: "=",
134
+ label: "Simplifier un mélange de calculs avec des puissances réelles",
135
+ isSingleStep: true,
136
+ generator: (nb, opts) => getDistinctQuestions(() => getRealPowersMixOperationsQuestion(opts), nb),
137
+ qcmTimer: 60,
138
+ freeTimer: 60,
139
+ getPropositions,
140
+ isAnswerValid,
141
+ subject: "Mathématiques",
142
+ getInstruction,
143
+ getHint,
144
+ getCorrection,
145
+ getAnswer,
146
+ getQuestionFromIdentifiers,
147
+ hasHintAndCorrection: true,
148
+ };
@@ -0,0 +1,10 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
3
+ type Identifiers = {
4
+ aIds: NodeIdentifiers;
5
+ xIds: NodeIdentifiers;
6
+ yIds: NodeIdentifiers;
7
+ };
8
+ export declare const realPowersPower: Exercise<Identifiers>;
9
+ export {};
10
+ //# sourceMappingURL=realPowersPower.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"realPowersPower.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/exponentials/realPowersPower.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAY7C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;AA0HF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAkBjD,CAAC"}
@@ -0,0 +1,128 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, propWhile, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { randfloat } from "../../../../math/utils/random/randfloat.js";
4
+ import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
5
+ import { add } from "../../../../tree/nodes/operators/addNode.js";
6
+ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
7
+ import { power } from "../../../../tree/nodes/operators/powerNode.js";
8
+ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
9
+ import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
10
+ import { coinFlip } from "../../../../utils/alea/coinFlip.js";
11
+ import { doWhile } from "../../../../utils/doWhile.js";
12
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
13
+ import { isInt } from "../../../../utils/isInt.js";
14
+ const getPropositions = (n, { answer, aIds, xIds, yIds }) => {
15
+ const propositions = [];
16
+ addValidProp(propositions, answer);
17
+ const a = reifyAlgebraic(aIds);
18
+ const x = reifyAlgebraic(xIds);
19
+ const y = reifyAlgebraic(yIds);
20
+ tryToAddWrongProp(propositions, power(a, substract(x, y)).simplify().toTex());
21
+ tryToAddWrongProp(propositions, power(a, add(x, y)).simplify().toTex());
22
+ propWhile(propositions, n, () => {
23
+ tryToAddWrongProp(propositions, power(a, randfloat(0.1, 5, 1)).simplify().toTex());
24
+ });
25
+ return shuffleProps(propositions, n);
26
+ };
27
+ const getAnswer = (identifiers) => {
28
+ const { aIds, xIds, yIds } = identifiers;
29
+ const a = reifyAlgebraic(aIds);
30
+ const x = reifyAlgebraic(xIds);
31
+ const y = reifyAlgebraic(yIds);
32
+ return power(a, multiply(x, y)).simplify().toTex();
33
+ };
34
+ const getInstruction = (identifiers) => {
35
+ const { aIds, xIds, yIds } = identifiers;
36
+ const a = reifyAlgebraic(aIds);
37
+ const x = reifyAlgebraic(xIds);
38
+ const y = reifyAlgebraic(yIds);
39
+ return `Écrire sous la forme d'une seule puissance :
40
+
41
+ $$
42
+ ${power(power(a, x), y).toTex()}
43
+ $$`;
44
+ };
45
+ const getHint = () => {
46
+ return `Utilise la propriété suivante : pour tous nombres réels positifs $x$ et $y$ et pour tout nombre réel $a>0$, on a :
47
+
48
+ $$
49
+ \\left(a^x\\right)^y = a^{x\\times y}
50
+ $$`;
51
+ };
52
+ const getCorrection = (identifiers) => {
53
+ const { aIds, xIds, yIds } = identifiers;
54
+ const a = reifyAlgebraic(aIds);
55
+ const x = reifyAlgebraic(xIds);
56
+ const y = reifyAlgebraic(yIds);
57
+ return `Pour tous nombres réels positifs $x$ et $y$ et pour tout nombre réel $a>0$, on a :
58
+
59
+ $$
60
+ \\left(a^x\\right)^y = a^{x\\times y}
61
+ $$
62
+
63
+ Ici, on a donc :
64
+
65
+ $$
66
+ ${power(power(a, x), y).toTex()} = ${power(a, multiply(x, y)).toTex()} = ${getAnswer(identifiers)}
67
+ $$`;
68
+ };
69
+ const getKeys = () => {
70
+ return [];
71
+ };
72
+ const isAnswerValid = (ans, { answer }) => {
73
+ try {
74
+ const parsed = parseAlgebraic(ans);
75
+ if (!parsed)
76
+ return false;
77
+ return (parsed
78
+ .simplify({
79
+ forbidPowerPower: true,
80
+ })
81
+ .toTex() === answer);
82
+ }
83
+ catch (err) {
84
+ return handleVEAError(err);
85
+ }
86
+ };
87
+ const getRealPowersFractionQuestion = () => {
88
+ const a = randfloat(0.1, 5, 1, [1]);
89
+ let x = doWhile(() => randfloat(0.1, 5, 1), (v) => isInt(v));
90
+ let y = randfloat(0.1, 5, 1);
91
+ if (coinFlip())
92
+ [x, y] = [y, x]; //comme ca l'éventuel entier est n'importe ou
93
+ const identifiers = {
94
+ aIds: a.toTree().toIdentifiers(),
95
+ xIds: x.toTree().toIdentifiers(),
96
+ yIds: y.toTree().toIdentifiers(),
97
+ };
98
+ return getQuestionFromIdentifiers(identifiers);
99
+ };
100
+ const getQuestionFromIdentifiers = (identifiers) => {
101
+ return {
102
+ answer: getAnswer(identifiers),
103
+ instruction: getInstruction(identifiers),
104
+ keys: getKeys(identifiers),
105
+ answerFormat: "tex",
106
+ identifiers,
107
+ hint: getHint(identifiers),
108
+ correction: getCorrection(identifiers),
109
+ };
110
+ };
111
+ export const realPowersPower = {
112
+ id: "realPowersPower",
113
+ connector: "=",
114
+ label: "Simplifier une puissance de puissances réelles",
115
+ isSingleStep: true,
116
+ generator: (nb, opts) => getDistinctQuestions(() => getRealPowersFractionQuestion(opts), nb),
117
+ qcmTimer: 60,
118
+ freeTimer: 60,
119
+ getPropositions,
120
+ isAnswerValid,
121
+ subject: "Mathématiques",
122
+ getInstruction,
123
+ getHint,
124
+ getCorrection,
125
+ getAnswer,
126
+ getQuestionFromIdentifiers,
127
+ hasHintAndCorrection: true,
128
+ };
@@ -0,0 +1,10 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
3
+ type Identifiers = {
4
+ aIds: NodeIdentifiers;
5
+ xIds: NodeIdentifiers;
6
+ yIds: NodeIdentifiers;
7
+ };
8
+ export declare const realPowersProduct: Exercise<Identifiers>;
9
+ export {};
10
+ //# sourceMappingURL=realPowersProduct.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"realPowersProduct.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/exponentials/realPowersProduct.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAY7C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;AAuHF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAkBnD,CAAC"}
@@ -0,0 +1,128 @@
1
+ import { addValidProp, shuffleProps, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { randfloat } from "../../../../math/utils/random/randfloat.js";
4
+ import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
5
+ import { add } from "../../../../tree/nodes/operators/addNode.js";
6
+ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
7
+ import { power } from "../../../../tree/nodes/operators/powerNode.js";
8
+ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
9
+ import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
10
+ import { coinFlip } from "../../../../utils/alea/coinFlip.js";
11
+ import { doWhile } from "../../../../utils/doWhile.js";
12
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
13
+ import { isInt } from "../../../../utils/isInt.js";
14
+ const getPropositions = (n, { answer, aIds, xIds, yIds }) => {
15
+ const propositions = [];
16
+ addValidProp(propositions, answer);
17
+ const a = reifyAlgebraic(aIds);
18
+ const x = reifyAlgebraic(xIds);
19
+ const y = reifyAlgebraic(yIds);
20
+ tryToAddWrongProp(propositions, power(a, substract(x, y).simplify()).toTex());
21
+ tryToAddWrongProp(propositions, power(a, multiply(x, y).simplify()).toTex());
22
+ propWhile(propositions, n, () => {
23
+ tryToAddWrongProp(propositions, power(a, randfloat(0.1, 5, 1)).toTex());
24
+ });
25
+ return shuffleProps(propositions, n);
26
+ };
27
+ const getAnswer = (identifiers) => {
28
+ const { aIds, xIds, yIds } = identifiers;
29
+ const a = reifyAlgebraic(aIds);
30
+ const x = reifyAlgebraic(xIds);
31
+ const y = reifyAlgebraic(yIds);
32
+ return power(a, add(x, y)).simplify().toTex();
33
+ };
34
+ const getInstruction = (identifiers) => {
35
+ const { aIds, xIds, yIds } = identifiers;
36
+ const a = reifyAlgebraic(aIds);
37
+ const x = reifyAlgebraic(xIds);
38
+ const y = reifyAlgebraic(yIds);
39
+ return `Écrire sous la forme d'une seule puissance :
40
+
41
+ $$
42
+ ${multiply(power(a, x), power(a, y)).toTex()}
43
+ $$`;
44
+ };
45
+ const getHint = () => {
46
+ return `Utilise la propriété suivante : pour tous nombres réels positifs $x$ et $y$ et pour tout nombre réel $a>0$, on a :
47
+
48
+ $$
49
+ a^x\\times a^y = a^{x+y}
50
+ $$`;
51
+ };
52
+ const getCorrection = (identifiers) => {
53
+ const { aIds, xIds, yIds } = identifiers;
54
+ const a = reifyAlgebraic(aIds);
55
+ const x = reifyAlgebraic(xIds);
56
+ const y = reifyAlgebraic(yIds);
57
+ return `Pour tous nombres réels positifs $x$ et $y$ et pour tout nombre réel $a>0$, on a :
58
+
59
+ $$
60
+ a^x\\times a^y = a^{x+y}
61
+ $$
62
+
63
+ Ici, on a donc :
64
+
65
+ $$
66
+ ${multiply(power(a, x), power(a, y)).toTex()} = ${power(a, add(x, y)).toTex()} = ${getAnswer(identifiers)}
67
+ $$`;
68
+ };
69
+ const getKeys = () => {
70
+ return [];
71
+ };
72
+ const isAnswerValid = (ans, { answer }) => {
73
+ try {
74
+ const parsed = parseAlgebraic(ans);
75
+ if (!parsed)
76
+ return false;
77
+ return (parsed
78
+ .simplify({
79
+ forbidPowerMultiply: true,
80
+ })
81
+ .toTex() === answer);
82
+ }
83
+ catch (err) {
84
+ return handleVEAError(err);
85
+ }
86
+ };
87
+ const getRealPowersProductQuestion = () => {
88
+ const a = randfloat(0.1, 5, 1, [1]);
89
+ let x = doWhile(() => randfloat(0.1, 5, 1), (v) => isInt(v));
90
+ let y = randfloat(0.1, 5, 1);
91
+ if (coinFlip())
92
+ [x, y] = [y, x]; //comme ca l'éventuel entier est n'importe ou
93
+ const identifiers = {
94
+ aIds: a.toTree().toIdentifiers(),
95
+ xIds: x.toTree().toIdentifiers(),
96
+ yIds: y.toTree().toIdentifiers(),
97
+ };
98
+ return getQuestionFromIdentifiers(identifiers);
99
+ };
100
+ const getQuestionFromIdentifiers = (identifiers) => {
101
+ return {
102
+ answer: getAnswer(identifiers),
103
+ instruction: getInstruction(identifiers),
104
+ keys: getKeys(identifiers),
105
+ answerFormat: "tex",
106
+ identifiers,
107
+ hint: getHint(identifiers),
108
+ correction: getCorrection(identifiers),
109
+ };
110
+ };
111
+ export const realPowersProduct = {
112
+ id: "realPowersProduct",
113
+ connector: "=",
114
+ label: "Simplifier un produit de puissances réelles",
115
+ isSingleStep: true,
116
+ generator: (nb, opts) => getDistinctQuestions(() => getRealPowersProductQuestion(opts), nb),
117
+ qcmTimer: 60,
118
+ freeTimer: 60,
119
+ getPropositions,
120
+ isAnswerValid,
121
+ subject: "Mathématiques",
122
+ getInstruction,
123
+ getHint,
124
+ getCorrection,
125
+ getAnswer,
126
+ getQuestionFromIdentifiers,
127
+ hasHintAndCorrection: true,
128
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"placeAbscissOnSemiLineV2.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/placeAbscissOnSemiLineV2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAK1D,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAK7C,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,UAAU,CAAC;IACxB,QAAQ,EAAE,eAAe,CAAC;IAC1B,QAAQ,EAAE,eAAe,CAAC;IAC1B,QAAQ,EAAE,eAAe,CAAC;CAC3B,CAAC;AAwNF,KAAK,OAAO,GAAG;IACb,YAAY,EAAE,UAAU,GAAG,oBAAoB,CAAC;IAChD,UAAU,EAAE,SAAS,GAAG,YAAY,GAAG,UAAU,CAAC;CACnD,CAAC;AA6BF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAanE,CAAC"}
1
+ {"version":3,"file":"placeAbscissOnSemiLineV2.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/placeAbscissOnSemiLineV2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAQrC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAK1D,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAK7C,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,UAAU,CAAC;IACxB,QAAQ,EAAE,eAAe,CAAC;IAC1B,QAAQ,EAAE,eAAe,CAAC;IAC1B,QAAQ,EAAE,eAAe,CAAC;CAC3B,CAAC;AAwNF,KAAK,OAAO,GAAG;IACb,YAAY,EAAE,UAAU,GAAG,oBAAoB,CAAC;IAChD,UAAU,EAAE,SAAS,GAAG,YAAY,GAAG,UAAU,CAAC;CACnD,CAAC;AA6BF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAanE,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { GeneratorOptionTarget, GeneratorOptionType, } from "../../../../exercises/exercise.js";
2
2
  import { toolBarConstructor } from "../../../../exercises/utils/geogebra/toolBarConstructor.js";
3
3
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
4
+ import { defaultArrayedOptsWhereNeeded } from "../../../../exercises/utils/options/arrayedOptions.js";
4
5
  import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
5
6
  import { ggbPointToCoords } from "../../../../geogebra/parsers/ggbPointToCoords.js";
6
7
  import { parseGGBPoints } from "../../../../geogebra/parsers/parseGGBPoints.js";
@@ -88,10 +89,10 @@ const isGGBAnswerValid = (ans, { absciss2, axisUnit }) => {
88
89
  0.2 * axisUnitNode.evaluate());
89
90
  };
90
91
  const getPlaceAbscissOnSemiLineV2Question = (optsIn) => {
91
- const arrayedOptions = optsIn ?? optsDefault;
92
+ const arrayedOpts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
92
93
  const opts = {
93
- questionType: random(arrayedOptions.questionType),
94
- numberType: random(arrayedOptions.numberType),
94
+ questionType: random(arrayedOpts.questionType),
95
+ numberType: random(arrayedOpts.numberType),
95
96
  };
96
97
  const abscissType = (() => {
97
98
  switch (opts.numberType) {
@@ -169,7 +170,7 @@ const getQuestionFromIdentifiers = (identifiers, opts) => {
169
170
  };
170
171
  return question;
171
172
  };
172
- const optsDefault = {
173
+ const arrayedOptsDefault = {
173
174
  questionType: ["standard", "éviter le comptage"],
174
175
  numberType: ["Entiers", "Rationnels", "Décimaux"],
175
176
  };
@@ -180,7 +181,7 @@ const options = [
180
181
  target: GeneratorOptionTarget.generation,
181
182
  type: GeneratorOptionType.multiselect,
182
183
  values: ["standard", "éviter le comptage"],
183
- defaultValue: optsDefault.questionType,
184
+ defaultValue: arrayedOptsDefault.questionType,
184
185
  },
185
186
  {
186
187
  id: "numberType",
@@ -188,7 +189,7 @@ const options = [
188
189
  target: GeneratorOptionTarget.generation,
189
190
  type: GeneratorOptionType.multiselect,
190
191
  values: ["Entiers", "Rationnels", "Décimaux"],
191
- defaultValue: optsDefault.numberType,
192
+ defaultValue: arrayedOptsDefault.numberType,
192
193
  },
193
194
  ];
194
195
  export const placeAbscissOnSemiLineV2 = {
@@ -1 +1 @@
1
- {"version":3,"file":"scalarProductAlKashiBH.d.ts","sourceRoot":"","sources":["../../../../../../../src/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAGL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAwBnD,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,mBAAmB,CAAC;IACjC,SAAS,EAAE,gBAAgB,CAAC;CAC7B,CAAC;AAopBF,KAAK,OAAO,GAAG;IACb,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAuBF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CA2BjE,CAAC"}
1
+ {"version":3,"file":"scalarProductAlKashiBH.d.ts","sourceRoot":"","sources":["../../../../../../../src/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAGL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAwBnD,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,mBAAmB,CAAC;IACjC,SAAS,EAAE,gBAAgB,CAAC;CAC7B,CAAC;AAmpBF,KAAK,OAAO,GAAG;IACb,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAuBF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CA2BjE,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 { greenMain, orange } from "../../../../../../geogebra/colors.js";
4
5
  import { GeogebraConstructor } from "../../../../../../geogebra/geogebraConstructor.js";
5
6
  import { Angle } from "../../../../../../math/geometry/angle.js";
@@ -387,8 +388,8 @@ const isAnswerValid = (ans, { answer }) => {
387
388
  }
388
389
  };
389
390
  const getScalarProductAlKashiBHQuestion = (optsIn) => {
390
- const arrayedOptions = optsIn ?? arrayedOptsDefault;
391
- const sectorOfPointH = random(arrayedOptions.sectorOfPointH);
391
+ const arrayedOpts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
392
+ const sectorOfPointH = random(arrayedOpts.sectorOfPointH);
392
393
  function createRandomPoints() {
393
394
  const offsetBtoC = 10;
394
395
  const pointB = new Point("B", randfloat(0, 10), randfloat(0, 10));
@@ -1 +1 @@
1
- {"version":3,"file":"scalarProductComputeBH.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAoBT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAqBtC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,gBAAgB,EAAE,CAAC;CAC9B,CAAC;AAmeF,KAAK,OAAO,GAAG;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB,EAAE,OAAO,CAAC;CAC/B,CAAC;AA+BF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CA6BjE,CAAC"}
1
+ {"version":3,"file":"scalarProductComputeBH.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAoBT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAqBtC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,gBAAgB,EAAE,CAAC;CAC9B,CAAC;AAkeF,KAAK,OAAO,GAAG;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB,EAAE,OAAO,CAAC;CAC/B,CAAC;AA+BF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CA6BjE,CAAC"}