math-exercises 3.0.177 → 3.0.178

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 (95) hide show
  1. package/lib/exercises/math/derivation/variations/readExtremaAbscissFromDerivativeCurve.js +1 -1
  2. package/lib/exercises/math/functions/trinoms/sign/index.d.ts +1 -0
  3. package/lib/exercises/math/functions/trinoms/sign/index.d.ts.map +1 -1
  4. package/lib/exercises/math/functions/trinoms/sign/index.js +1 -0
  5. package/lib/exercises/math/functions/trinoms/sign/signOfProductOfAffineAndTrinom.d.ts +8 -0
  6. package/lib/exercises/math/functions/trinoms/sign/signOfProductOfAffineAndTrinom.d.ts.map +1 -0
  7. package/lib/exercises/math/functions/trinoms/sign/signOfProductOfAffineAndTrinom.js +233 -0
  8. package/lib/exercises/math/geometry/angles/parallelogramFourthAngle.d.ts.map +1 -1
  9. package/lib/exercises/math/geometry/angles/parallelogramFourthAngle.js +10 -10
  10. package/lib/exercises/math/geometry/quadrilaterals/parallelogramAngles.js +8 -8
  11. package/lib/exercises/math/geometry/triangles/similar/isSimilarTrianglesWithAngles.js +6 -6
  12. package/lib/exercises/math/geometry/triangles/triangleThirdAngleValue.js +8 -8
  13. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.js +1 -1
  14. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.js +2 -2
  15. package/lib/exercises/math/geometry/vectors/scalarProduct/angleFromScalarProduct.js +2 -2
  16. package/lib/exercises/math/probaStat/randomVariable/index.d.ts.map +1 -1
  17. package/lib/exercises/math/probaStat/randomVariable/index.js +1 -0
  18. package/lib/exercises/math/python/index.d.ts +1 -0
  19. package/lib/exercises/math/python/index.d.ts.map +1 -1
  20. package/lib/exercises/math/python/index.js +1 -0
  21. package/lib/exercises/math/python/sequences/pySequenceThresholdInstructionCompletion.d.ts.map +1 -1
  22. package/lib/exercises/math/python/sequences/pySequenceThresholdInstructionCompletion.js +11 -8
  23. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFromTwoTerms.d.ts.map +1 -1
  24. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFromTwoTerms.js +4 -3
  25. package/lib/exercises/math/sequences/arithmetic/index.d.ts +4 -3
  26. package/lib/exercises/math/sequences/arithmetic/index.d.ts.map +1 -1
  27. package/lib/exercises/math/sequences/arithmetic/index.js +4 -3
  28. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindExplicitFormulaFromSituation.d.ts.map +1 -1
  29. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindExplicitFormulaFromSituation.js +3 -2
  30. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.d.ts.map +1 -1
  31. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.js +8 -6
  32. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindThresholdFromSituation.d.ts.map +1 -1
  33. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindThresholdFromSituation.js +6 -5
  34. package/lib/exercises/math/sequences/arithmetic/situations/index.d.ts +0 -2
  35. package/lib/exercises/math/sequences/arithmetic/situations/index.d.ts.map +1 -1
  36. package/lib/exercises/math/sequences/arithmetic/situations/index.js +2 -2
  37. package/lib/exercises/math/sequences/arithmetic/sum/arithmeticComputeSumWithDots.d.ts +1 -0
  38. package/lib/exercises/math/sequences/arithmetic/sum/arithmeticComputeSumWithDots.d.ts.map +1 -1
  39. package/lib/exercises/math/sequences/arithmetic/sum/arithmeticComputeSumWithDots.js +65 -14
  40. package/lib/exercises/math/sequences/arithmetic/sum/index.d.ts +0 -1
  41. package/lib/exercises/math/sequences/arithmetic/sum/index.d.ts.map +1 -1
  42. package/lib/exercises/math/sequences/arithmetic/sum/index.js +1 -1
  43. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoConsecutiveTerms.d.ts +14 -0
  44. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoConsecutiveTerms.d.ts.map +1 -0
  45. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoConsecutiveTerms.js +291 -0
  46. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoTerms.d.ts.map +1 -1
  47. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoTerms.js +4 -3
  48. package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoConsecutiveTerms.d.ts +15 -0
  49. package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoConsecutiveTerms.d.ts.map +1 -0
  50. package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoConsecutiveTerms.js +249 -0
  51. package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoTerms.js +1 -1
  52. package/lib/exercises/math/sequences/geometric/index.d.ts +6 -2
  53. package/lib/exercises/math/sequences/geometric/index.d.ts.map +1 -1
  54. package/lib/exercises/math/sequences/geometric/index.js +6 -2
  55. package/lib/exercises/math/sequences/geometric/situations/geometricFindExplicitFormulaFromSituation.d.ts.map +1 -1
  56. package/lib/exercises/math/sequences/geometric/situations/geometricFindExplicitFormulaFromSituation.js +3 -2
  57. package/lib/exercises/math/sequences/geometric/situations/geometricFindTermFromSituation.js +1 -1
  58. package/lib/exercises/math/sequences/geometric/sum/geometricComputeSumWithDots.js +2 -2
  59. package/lib/exercises/math/sequences/graph/placeFirstSequencePoints.js +2 -2
  60. package/lib/exercises/math/sequences/index.d.ts +1 -0
  61. package/lib/exercises/math/sequences/index.d.ts.map +1 -1
  62. package/lib/exercises/math/sequences/index.js +1 -0
  63. package/lib/exercises/math/sequences/seqArithmGeom/seqArithmGeomRecurrenceFormulaUsage.d.ts.map +1 -1
  64. package/lib/exercises/math/sequences/seqArithmGeom/seqArithmGeomRecurrenceFormulaUsage.js +5 -9
  65. package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.2d.js +1 -1
  66. package/lib/exercises/math/trigonometry/triangle/trigonometryAngleCalcul.js +2 -2
  67. package/lib/exercises/pc/snellDescartes.js +2 -2
  68. package/lib/index.d.ts +152 -21
  69. package/lib/index.d.ts.map +1 -1
  70. package/lib/latexTester.d.ts.map +1 -1
  71. package/lib/latexTester.js +8 -5
  72. package/lib/math/polynomials/affine.d.ts +1 -0
  73. package/lib/math/polynomials/affine.d.ts.map +1 -1
  74. package/lib/math/polynomials/affine.js +5 -0
  75. package/lib/math/utils/arithmetic/primeFactors.js +1 -1
  76. package/lib/math/utils/functions/functionComposition.d.ts.map +1 -1
  77. package/lib/math/utils/functions/functionComposition.js +18 -1
  78. package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts +18 -4
  79. package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts.map +1 -1
  80. package/lib/math/utils/sequences/situations/seqArithmeticSituations.js +437 -336
  81. package/lib/math/utils/sequences/situations/seqArithmeticUtils.d.ts.map +1 -1
  82. package/lib/math/utils/sequences/situations/seqArithmeticUtils.js +3 -1
  83. package/lib/math/utils/sequences/situations/seqGeometricSituations.d.ts +5 -0
  84. package/lib/math/utils/sequences/situations/seqGeometricSituations.d.ts.map +1 -1
  85. package/lib/math/utils/sequences/situations/seqGeometricSituations.js +58 -25
  86. package/lib/prototypesEnhancement.d.ts +1 -0
  87. package/lib/prototypesEnhancement.d.ts.map +1 -1
  88. package/lib/prototypesEnhancement.js +3 -0
  89. package/lib/tests/pdfs/mdCodeToLatex.d.ts.map +1 -1
  90. package/lib/tests/pdfs/mdCodeToLatex.js +8 -15
  91. package/lib/tests/questionTest.d.ts.map +1 -1
  92. package/lib/tests/questionTest.js +6 -3
  93. package/lib/tree/nodes/geometry/degree.js +1 -1
  94. package/lib/tree/parsers/degreeParser.js +2 -2
  95. package/package.json +1 -1
@@ -165,10 +165,10 @@ export const readExtremaAbscissFromDerivativeCurve = {
165
165
  subject: "Mathématiques",
166
166
  getHint,
167
167
  getCorrection,
168
+ hasHintAndCorrection: true,
168
169
  getInstruction,
169
170
  getAnswer,
170
171
  getGGBOptions,
171
172
  hasGeogebra: true,
172
173
  getQuestionFromIdentifiers,
173
- hasHintAndCorrection: true,
174
174
  };
@@ -2,4 +2,5 @@ export * from "./trinomSignFromRoots.js";
2
2
  export * from "./trinomSignFromFacto.js";
3
3
  export * from "./trinomSignTableFromAlgebraicForm.js";
4
4
  export * from "./parabolaSignTable.js";
5
+ export * from "./signOfProductOfAffineAndTrinom.js";
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/sign/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uCAAuC,CAAC;AACtD,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/sign/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uCAAuC,CAAC;AACtD,cAAc,wBAAwB,CAAC;AACvC,cAAc,qCAAqC,CAAC"}
@@ -2,3 +2,4 @@ export * from "./trinomSignFromRoots.js";
2
2
  export * from "./trinomSignFromFacto.js";
3
3
  export * from "./trinomSignTableFromAlgebraicForm.js";
4
4
  export * from "./parabolaSignTable.js";
5
+ export * from "./signOfProductOfAffineAndTrinom.js";
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ affineCoeffs: number[];
4
+ trinomCoeffs: number[];
5
+ };
6
+ export declare const signOfProductOfAffineAndTrinom: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=signOfProductOfAffineAndTrinom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signOfProductOfAffineAndTrinom.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/sign/signOfProductOfAffineAndTrinom.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AA2PF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,CAqBhE,CAAC"}
@@ -0,0 +1,233 @@
1
+ import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
2
+ import { signTableVEA } from "../../../../../exercises/vea/signTableVEA.js";
3
+ import { Affine, AffineConstructor } from "../../../../../math/polynomials/affine.js";
4
+ import { Trinom, TrinomConstructor } from "../../../../../math/polynomials/trinom.js";
5
+ import { firstDegreeInequationResolutionTex } from "../../../../../tree/nodes/inequations/inequationNode.js";
6
+ import { MinusInfinityNode, PlusInfinityNode, } from "../../../../../tree/nodes/numbers/infiniteNode.js";
7
+ import { multiply } from "../../../../../tree/nodes/operators/multiplyNode.js";
8
+ import { ClosureType } from "../../../../../tree/nodes/sets/closure.js";
9
+ import { IntervalNode } from "../../../../../tree/nodes/sets/intervalNode.js";
10
+ import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
11
+ const getAnswerTable = (identifiers) => {
12
+ const fcts = buildFcts(identifiers);
13
+ const roots = [
14
+ fcts.affine.getRoot().toTree(),
15
+ ...fcts.trinom.getRootsNode(),
16
+ ].sort((a, b) => a.evaluate() - b.evaluate());
17
+ const affineRootIndex = roots.findIndex((r) => r.evaluate() === fcts.affine.getRoot().toTree().evaluate());
18
+ const startAffSign = fcts.affine.a > 0 ? "-" : "+";
19
+ const endAffSign = startAffSign === "+" ? "-" : "+";
20
+ const trinomSigns = fcts.trinom.a > 0 ? ["+", "-", "+"] : ["-", "+", "-"];
21
+ const partial = [
22
+ [
23
+ "$x$",
24
+ "-\\infty",
25
+ "\\ ",
26
+ roots[0].toTex(),
27
+ "\\ ",
28
+ roots[1].toTex(),
29
+ "\\ ",
30
+ roots[2].toTex(),
31
+ "\\ ",
32
+ "+\\infty",
33
+ ],
34
+ [
35
+ `$${fcts.affine.toTree().toTex()}$`,
36
+ "\\ ",
37
+ startAffSign,
38
+ affineRootIndex === 0 ? "0" : startAffSign,
39
+ affineRootIndex === 0 ? endAffSign : startAffSign,
40
+ affineRootIndex === 1
41
+ ? "0"
42
+ : affineRootIndex === 0
43
+ ? endAffSign
44
+ : startAffSign,
45
+ affineRootIndex < 2 ? endAffSign : startAffSign,
46
+ affineRootIndex === 2 ? "0" : endAffSign,
47
+ endAffSign,
48
+ "\\ ",
49
+ ],
50
+ [
51
+ `$${fcts.trinom.toTree().toTex()}$`,
52
+ "\\ ",
53
+ trinomSigns[0],
54
+ affineRootIndex === 0 ? trinomSigns[0] : "0",
55
+ affineRootIndex === 0 ? trinomSigns[0] : trinomSigns[1],
56
+ affineRootIndex === 1 ? trinomSigns[1] : "0",
57
+ affineRootIndex === 2 ? trinomSigns[2] : trinomSigns[1],
58
+ affineRootIndex === 2 ? trinomSigns[2] : "0",
59
+ trinomSigns[2],
60
+ "\\ ",
61
+ ],
62
+ ];
63
+ const buildSign = (sign1, sign2) => {
64
+ if (sign1 === sign2)
65
+ return "+";
66
+ return "-";
67
+ };
68
+ const thirdLine = [
69
+ `$${buildF(identifiers).toTex()}$`,
70
+ "\\ ",
71
+ buildSign(partial[1][2], partial[2][2]),
72
+ "0",
73
+ buildSign(partial[1][4], partial[2][4]),
74
+ "0",
75
+ buildSign(partial[1][6], partial[2][6]),
76
+ "0",
77
+ buildSign(partial[1][8], partial[2][8]),
78
+ "\\ ",
79
+ ];
80
+ return [...partial, thirdLine];
81
+ };
82
+ const buildF = (identifiers) => {
83
+ const { affineCoeffs, trinomCoeffs } = identifiers;
84
+ const affine = new Affine(affineCoeffs[1], affineCoeffs[0]);
85
+ const trinom = new Trinom(trinomCoeffs[2], trinomCoeffs[1], trinomCoeffs[0]);
86
+ return multiply(affine.toTree(), trinom.toTree());
87
+ };
88
+ const buildFcts = (identifiers) => {
89
+ const { affineCoeffs, trinomCoeffs } = identifiers;
90
+ const affine = new Affine(affineCoeffs[1], affineCoeffs[0]);
91
+ const trinom = new Trinom(trinomCoeffs[2], trinomCoeffs[1], trinomCoeffs[0]);
92
+ return { affine, trinom };
93
+ };
94
+ const getInstruction = (identifiers) => {
95
+ const fcts = buildFcts(identifiers);
96
+ return `Soit $f$ la fonction définie sur $\\mathbb{R}$ par :
97
+
98
+ $$
99
+ f(x) = ${multiply(fcts.affine.toTree(), fcts.trinom.toTree()).toTex()}
100
+ $$
101
+
102
+ Dresser le tableau de signes de $f$.`;
103
+ };
104
+ const getHint = () => {
105
+ return `$f(x)$ est un produit de deux fonctions : une fonction affine $g$ et une fonction polynôme du second degré $h$.
106
+
107
+ Détermine le signe de la fonction affine en résolvant l'inéquation $g(x)\\geq 0$.
108
+
109
+ Puis détermine le signe de la fonction polynôme du second degré $g$ en trouvant ses racines.
110
+
111
+ Enfin, entre tes résultats dans le tableau. Le signe de $f(x)$ s'obtiendra alors en utilisant la règle des signes.`;
112
+ };
113
+ const getCorrection = (identifiers) => {
114
+ const fcts = buildFcts(identifiers);
115
+ const trinomRoots = fcts.trinom.getRootsNode();
116
+ const affRoot = fcts.affine.getRoot().toTree();
117
+ const allRoots = [affRoot, ...trinomRoots].sort((a, b) => a.evaluate() - b.evaluate());
118
+ const firstSign = fcts.affine.a * fcts.trinom.a > 0 ? "négative" : "positive";
119
+ const alternateSign = fcts.affine.a * fcts.trinom.a > 0 ? "positive" : "négative";
120
+ return `On commence par déterminer le signe de $${fcts.affine
121
+ .toTree()
122
+ .toTex()}$ :
123
+
124
+ $$
125
+ ${firstDegreeInequationResolutionTex(fcts.affine, "\\ge", (0).toTree())}
126
+ $$
127
+
128
+ Puis, on détermine le signe de $${fcts.trinom
129
+ .toTree()
130
+ .toTex()}$. Pour cela, on calcule ses racines. On trouve $\\Delta = ${fcts.trinom
131
+ .getDeltaNode()
132
+ .toTex()}$, donc cette fonction admet deux racines :
133
+
134
+ $$
135
+ x_1 = ${trinomRoots[0].toTex()}
136
+ $$
137
+
138
+ et
139
+
140
+ $$
141
+ x_2 = ${trinomRoots[1].toTex()}
142
+ $$
143
+
144
+ Cette fonction est donc ${fcts.trinom.a > 0 ? "négative" : "positive"} sur $${new IntervalNode(trinomRoots[0], trinomRoots[1], ClosureType.FF).toTex()}$, et ${fcts.trinom.a > 0 ? "positive" : "négative"} sur le reste de $\\mathbb{R}$.
145
+
146
+ On note toutes ces informations dans un tableau de signes. On applique enfin la règle des signes pour trouver le signe de $f$.
147
+
148
+ On en conclut que $f$ est ${firstSign} sur $${new IntervalNode(MinusInfinityNode, allRoots[0], ClosureType.OF).toTex()}$ et sur $${new IntervalNode(allRoots[1], allRoots[2], ClosureType.FF).toTex()}$, et elle est ${alternateSign} sur $${new IntervalNode(allRoots[0], allRoots[1], ClosureType.FF).toTex()}$ et sur $${new IntervalNode(allRoots[2], PlusInfinityNode, ClosureType.FO).toTex()}$.`;
149
+ };
150
+ const getKeys = () => {
151
+ return ["infty"];
152
+ };
153
+ const isAnswerTableValid = (ans, { answerTable }) => {
154
+ try {
155
+ return signTableVEA(ans, answerTable);
156
+ }
157
+ catch (err) {
158
+ return handleVEAError(err);
159
+ }
160
+ };
161
+ const getSignOfProductOfAffineAndTrinomQuestion = () => {
162
+ let affine;
163
+ let trinom;
164
+ do {
165
+ affine = AffineConstructor.randomNiceRoot();
166
+ trinom = TrinomConstructor.randomNiceRoots(2);
167
+ } while (trinom
168
+ .getRootsNode()
169
+ .some((root) => root.evaluate() === affine.getRoot().toTree().evaluate()));
170
+ const identifiers = {
171
+ affineCoeffs: affine.coefficients,
172
+ trinomCoeffs: trinom.coefficients,
173
+ };
174
+ return getQuestionFromIdentifiers(identifiers);
175
+ };
176
+ const getQuestionFromIdentifiers = (identifiers) => {
177
+ const fcts = buildFcts(identifiers);
178
+ const f = buildF(identifiers);
179
+ return {
180
+ answerTable: getAnswerTable(identifiers),
181
+ instruction: getInstruction(identifiers),
182
+ keys: getKeys(identifiers),
183
+ answerFormat: "tex",
184
+ identifiers,
185
+ hint: getHint(identifiers),
186
+ correction: getCorrection(identifiers),
187
+ initTable: [
188
+ ["$x$", "", "\\ ", "", "\\ ", "", "\\ ", "", "\\ ", "+\\infty"],
189
+ [
190
+ `$${fcts.affine.toTree().toTex()}$`,
191
+ "\\ ",
192
+ "",
193
+ "",
194
+ "",
195
+ "",
196
+ "",
197
+ "",
198
+ "",
199
+ "\\ ",
200
+ ],
201
+ [
202
+ `$${fcts.trinom.toTree().toTex()}$`,
203
+ "\\ ",
204
+ "",
205
+ "",
206
+ "",
207
+ "",
208
+ "",
209
+ "",
210
+ "",
211
+ "\\ ",
212
+ ],
213
+ [`$${f.toTex()}$`, "\\ ", "", "", "", "", "", "", "", "\\ "],
214
+ ],
215
+ };
216
+ };
217
+ export const signOfProductOfAffineAndTrinom = {
218
+ id: "signOfProductOfAffineAndTrinom",
219
+ label: "Dresser le tableau de signes du produit d'une fonction affine et d'une fonction polynôme du second degré",
220
+ isSingleStep: true,
221
+ generator: (nb, opts) => getDistinctQuestions(() => getSignOfProductOfAffineAndTrinomQuestion(opts), nb),
222
+ qcmTimer: 60,
223
+ freeTimer: 60,
224
+ isAnswerTableValid,
225
+ subject: "Mathématiques",
226
+ getInstruction,
227
+ getHint,
228
+ getCorrection,
229
+ getAnswerTable,
230
+ getQuestionFromIdentifiers,
231
+ hasHintAndCorrection: true,
232
+ answerType: "signTable",
233
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"parallelogramFourthAngle.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/angles/parallelogramFourthAngle.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AA4FF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAkB1D,CAAC"}
1
+ {"version":3,"file":"parallelogramFourthAngle.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/angles/parallelogramFourthAngle.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAyFF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAkB1D,CAAC"}
@@ -6,21 +6,21 @@ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
6
6
  const getPropositions = (n, { answer, singleAngle, doubleAngle }) => {
7
7
  const propositions = [];
8
8
  addValidProp(propositions, answer);
9
- tryToAddWrongProp(propositions, `${singleAngle}^{\\circ}`);
10
- tryToAddWrongProp(propositions, `${doubleAngle}^{\\circ}`);
11
- tryToAddWrongProp(propositions, `${360 - singleAngle}^{\\circ}`);
12
- tryToAddWrongProp(propositions, `${360 - doubleAngle}^{\\circ}`);
13
- tryToAddWrongProp(propositions, `${360 - singleAngle - doubleAngle}^{\\circ}`);
14
- tryToAddWrongProp(propositions, `${Math.abs(180 - 2 * singleAngle - doubleAngle)}^{\\circ}`);
9
+ tryToAddWrongProp(propositions, `${singleAngle}^\\circ`);
10
+ tryToAddWrongProp(propositions, `${doubleAngle}^\\circ`);
11
+ tryToAddWrongProp(propositions, `${360 - singleAngle}^\\circ`);
12
+ tryToAddWrongProp(propositions, `${360 - doubleAngle}^\\circ`);
13
+ tryToAddWrongProp(propositions, `${360 - singleAngle - doubleAngle}^\\circ`);
14
+ tryToAddWrongProp(propositions, `${Math.abs(180 - 2 * singleAngle - doubleAngle)}^\\circ`);
15
15
  return shuffleProps(propositions, n);
16
16
  };
17
17
  const getAnswer = (identifiers) => {
18
18
  const { singleAngle, doubleAngle } = identifiers;
19
19
  const fourthAngle = 360 - singleAngle - 2 * doubleAngle;
20
- return `${fourthAngle}^{\\circ}`;
20
+ return `${fourthAngle}^\\circ`;
21
21
  };
22
22
  const getInstruction = (identifiers) => {
23
- return `Un parallélogramme a deux angles de mesure $${identifiers.doubleAngle}^{\\circ}$ et un angle de mesure $${identifiers.singleAngle}^{\\circ}$.
23
+ return `Un parallélogramme a deux angles de mesure $${identifiers.doubleAngle}^\\circ$ et un angle de mesure $${identifiers.singleAngle}^\\circ$.
24
24
 
25
25
  Quelle est la mesure de son quatrième angle ?`;
26
26
  };
@@ -33,13 +33,13 @@ const getCorrection = (identifiers) => {
33
33
  return `La somme des angles d'un parallélogramme est égale à $360°$. Ici, la somme des trois angles connus vaut :
34
34
 
35
35
  $$
36
- ${singleAngle}^{\\circ} + 2\\times ${doubleAngle}^{\\circ} = ${sum}^{\\circ}
36
+ ${singleAngle}^\\circ + 2\\times ${doubleAngle}^\\circ = ${sum}^\\circ
37
37
  $$
38
38
 
39
39
  Le quatrième angle vaut donc :
40
40
 
41
41
  $$
42
- 360^{\\circ} - ${sum}^{\\circ} = ${singleAngle} ^{\\circ}
42
+ 360^\\circ - ${sum}^\\circ = ${singleAngle} ^\\circ
43
43
  $$`;
44
44
  };
45
45
  const isAnswerValid = (ans, { answer }) => {
@@ -12,11 +12,11 @@ const getPropositions = (n, { answer, ...identifiers }) => {
12
12
  const para = ParallelogramConstructor.fromIdentifiers(identifiers.paraIdentifiers);
13
13
  const value = round(para.angles[identifiers.givenAngleIndex].evaluate(), 0);
14
14
  addValidProp(propositions, answer);
15
- tryToAddWrongProp(propositions, "180^{\\circ}");
16
- tryToAddWrongProp(propositions, (180 - value).frenchify() + "^{\\circ}");
17
- tryToAddWrongProp(propositions, value.frenchify() + "^{\\circ}");
15
+ tryToAddWrongProp(propositions, "180^\\circ");
16
+ tryToAddWrongProp(propositions, (180 - value).frenchify() + "^\\circ");
17
+ tryToAddWrongProp(propositions, value.frenchify() + "^\\circ");
18
18
  propWhile(propositions, n, () => {
19
- tryToAddWrongProp(propositions, randint(20, 160) + "^{\\circ}");
19
+ tryToAddWrongProp(propositions, randint(20, 160) + "^\\circ");
20
20
  });
21
21
  return shuffleProps(propositions, n);
22
22
  };
@@ -24,19 +24,19 @@ const getAnswer = (identifiers) => {
24
24
  const para = ParallelogramConstructor.fromIdentifiers(identifiers.paraIdentifiers);
25
25
  const value = round(para.angles[identifiers.givenAngleIndex].evaluate(), 0);
26
26
  const isOpposite = identifiers.askedAngleIndex === (identifiers.givenAngleIndex + 2) % 4;
27
- return (isOpposite ? value : 180 - value).frenchify() + "^{\\circ}";
27
+ return (isOpposite ? value : 180 - value).frenchify() + "^\\circ";
28
28
  };
29
29
  const getInstruction = (identifiers) => {
30
30
  const para = ParallelogramConstructor.fromIdentifiers(identifiers.paraIdentifiers);
31
31
  const value = round(para.angles[identifiers.givenAngleIndex].evaluate(), 0);
32
32
  return `On considère le parallélogramme $ABCD$ ci-dessous.
33
33
 
34
- L'angle $${para.angles[identifiers.givenAngleIndex].toTex()}$ vaut $${value}^{\\circ}$.
34
+ L'angle $${para.angles[identifiers.givenAngleIndex].toTex()}$ vaut $${value}^\\circ$.
35
35
 
36
36
  Que vaut l'angle $${para.angles[identifiers.askedAngleIndex].toTex()}$ ?`;
37
37
  };
38
38
  const getHint = () => {
39
- return "Dans un parallélogramme, la somme totale des angles vaut $360^{\\circ}$. Les angles opposés sont égaux, et la somme de deux angles consécutifs est égale à $180^{\\circ}$.";
39
+ return "Dans un parallélogramme, la somme totale des angles vaut $360^\\circ$. Les angles opposés sont égaux, et la somme de deux angles consécutifs est égale à $180^\\circ$.";
40
40
  };
41
41
  const getCorrection = (identifiers) => {
42
42
  const para = ParallelogramConstructor.fromIdentifiers(identifiers.paraIdentifiers);
@@ -51,7 +51,7 @@ On a donc :
51
51
  $$
52
52
  ${askedAngle.toTex()} = ${getAnswer(identifiers)}
53
53
  $$`
54
- : `Dans un parallélogramme, la somme de deux angles consécutifs vaut $180^{\\circ}$.
54
+ : `Dans un parallélogramme, la somme de deux angles consécutifs vaut $180^\\circ$.
55
55
 
56
56
  Ainsi,
57
57
 
@@ -24,8 +24,8 @@ const getInstruction = (identifiers) => {
24
24
  const { firstAngleValue, sameAngleValue, secondAngleValue, triangleNames } = identifiers;
25
25
  return `On considère deux triangles :
26
26
 
27
- - le triangle $${triangleNames[0]}$, dans lequel l'angle $\\widehat{${triangleNames[0][0]}}$ a une mesure de $${sameAngleValue.frenchify()}^{\\circ}$ et l'angle $\\widehat{${triangleNames[0][1]}}$ a une mesure de $${firstAngleValue.frenchify()}^{\\circ}$ ;
28
- - le triangle $${triangleNames[1]}$, dans lequel l'angle $\\widehat{${triangleNames[1][0]}}$ a une mesure de $${sameAngleValue.frenchify()}^{\\circ}$ et l'angle $\\widehat{${triangleNames[1][1]}}$ a une mesure de $${secondAngleValue.frenchify()}^{\\circ}$.
27
+ - le triangle $${triangleNames[0]}$, dans lequel l'angle $\\widehat{${triangleNames[0][0]}}$ a une mesure de $${sameAngleValue.frenchify()}^\\circ$ et l'angle $\\widehat{${triangleNames[0][1]}}$ a une mesure de $${firstAngleValue.frenchify()}^\\circ$ ;
28
+ - le triangle $${triangleNames[1]}$, dans lequel l'angle $\\widehat{${triangleNames[1][0]}}$ a une mesure de $${sameAngleValue.frenchify()}^\\circ$ et l'angle $\\widehat{${triangleNames[1][1]}}$ a une mesure de $${secondAngleValue.frenchify()}^\\circ$.
29
29
 
30
30
  Les triangles $${triangleNames[0]}$ et $${triangleNames[1]}$ sont-ils semblables ?`;
31
31
  };
@@ -42,25 +42,25 @@ On calcule donc la mesure du troisième angle de chacun des triangles. Pour cela
42
42
  - pour le triangle $${triangleNames[0]}$, la somme des deux angles connus vaut :
43
43
 
44
44
  $$
45
- ${sameAngleValue.frenchify()}^{\\circ} + ${firstAngleValue.frenchify()}^{\\circ} = ${round(sameAngleValue + firstAngleValue, 4).frenchify()}^{\\circ}
45
+ ${sameAngleValue.frenchify()}^\\circ + ${firstAngleValue.frenchify()}^\\circ = ${round(sameAngleValue + firstAngleValue, 4).frenchify()}^\\circ
46
46
  $$
47
47
 
48
48
  donc le troisième angle vaut :
49
49
 
50
50
  $$
51
- 180 - ${round(sameAngleValue + firstAngleValue, 4).frenchify()} = ${round(180 - (sameAngleValue + firstAngleValue), 4).frenchify()}^{\\circ}
51
+ 180 - ${round(sameAngleValue + firstAngleValue, 4).frenchify()} = ${round(180 - (sameAngleValue + firstAngleValue), 4).frenchify()}^\\circ
52
52
  $$
53
53
 
54
54
  - pour le triangle $${triangleNames[1]}$, la somme des deux angles connus vaut :
55
55
 
56
56
  $$
57
- ${sameAngleValue.frenchify()}^{\\circ} + ${secondAngleValue.frenchify()}^{\\circ} = ${round(sameAngleValue + secondAngleValue, 4).frenchify()}^{\\circ}
57
+ ${sameAngleValue.frenchify()}^\\circ + ${secondAngleValue.frenchify()}^\\circ = ${round(sameAngleValue + secondAngleValue, 4).frenchify()}^\\circ
58
58
  $$
59
59
 
60
60
  donc le troisième angle vaut :
61
61
 
62
62
  $$
63
- 180 - ${round(sameAngleValue + secondAngleValue, 4).frenchify()} = ${round(180 - (sameAngleValue + secondAngleValue), 4).frenchify()}^{\\circ}
63
+ 180 - ${round(sameAngleValue + secondAngleValue, 4).frenchify()} = ${round(180 - (sameAngleValue + secondAngleValue), 4).frenchify()}^\\circ
64
64
  $$
65
65
 
66
66
  ${isSimilar
@@ -18,10 +18,10 @@ const getPropositions = (n, { answer, angleAsked, triangleIdentifiers }) => {
18
18
  triangle.angles[(angleAsked + 2) % 3].getValueNode(true),
19
19
  ];
20
20
  const addAnglesEv = add(angles[0], angles[1]).evaluate();
21
- tryToAddWrongProp(propositions, "180^{\\circ}");
22
- tryToAddWrongProp(propositions, addAnglesEv.frenchify() + "^{\\circ}");
21
+ tryToAddWrongProp(propositions, "180^\\circ");
22
+ tryToAddWrongProp(propositions, addAnglesEv.frenchify() + "^\\circ");
23
23
  propWhile(propositions, n, () => {
24
- tryToAddWrongProp(propositions, randint(20, 160) + "^{\\circ}");
24
+ tryToAddWrongProp(propositions, randint(20, 160) + "^\\circ");
25
25
  });
26
26
  return shuffleProps(propositions, n);
27
27
  };
@@ -34,7 +34,7 @@ const getAnswer = (identifiers) => {
34
34
  ];
35
35
  const addAngles = add(angles[0], angles[1]);
36
36
  const simp = addAngles.simplify();
37
- return substract(180, simp).simplify().toTex() + "^{\\circ}";
37
+ return substract(180, simp).simplify().toTex() + "^\\circ";
38
38
  };
39
39
  const getInstruction = (identifiers) => {
40
40
  const { triangleIdentifiers, angleAsked } = identifiers;
@@ -42,10 +42,10 @@ const getInstruction = (identifiers) => {
42
42
  const angles = [
43
43
  `${triangle.angles[(angleAsked + 1) % 3].toTex()}=${triangle.angles[(angleAsked + 1) % 3]
44
44
  .getValueNode(true)
45
- .toTex()}^{\\circ}`,
45
+ .toTex()}^\\circ`,
46
46
  `${triangle.angles[(angleAsked + 2) % 3].toTex()}=${triangle.angles[(angleAsked + 2) % 3]
47
47
  .getValueNode(true)
48
- .toTex()}^{\\circ}`,
48
+ .toTex()}^\\circ`,
49
49
  ];
50
50
  return `Dans le triangle $${triangle.name}$ ci-dessous, on a $${angles[0]}$ et $${angles[1]}$.
51
51
 
@@ -68,13 +68,13 @@ const getCorrection = (identifiers) => {
68
68
  En additionnant les deux angles donnés dans l'énoncé, on obtient :
69
69
 
70
70
  $$
71
- ${angles[0].toTex()}^{\\circ} + ${angles[1].toTex()}^{\\circ} =${simp.toTex()}^{\\circ}
71
+ ${angles[0].toTex()}^\\circ + ${angles[1].toTex()}^\\circ =${simp.toTex()}^\\circ
72
72
  $$
73
73
 
74
74
  L'angle recherché a donc une mesure de :
75
75
 
76
76
  $$
77
- 180^{\\circ} - ${simp.toTex()}^{\\circ}=${getAnswer(identifiers)}
77
+ 180^\\circ - ${simp.toTex()}^\\circ=${getAnswer(identifiers)}
78
78
  $$`;
79
79
  };
80
80
  const getGGBOptions = (identifiers) => {
@@ -198,7 +198,7 @@ const getKeys = () => {
198
198
  };
199
199
  const isAnswerValid = (ans, { answer, ...identifiers }) => {
200
200
  const strForKeyIdDegreeReceivedFromTests = "^\\circ";
201
- const strForKeyIdDegreeReceivedFromFront = "^{\\circ}"; //different from strForKeyIdDegreeSent: "^\\circ"
201
+ const strForKeyIdDegreeReceivedFromFront = "^\\circ"; //different from strForKeyIdDegreeSent: "^\\circ"
202
202
  const ansRefined = ans
203
203
  .replace(strForKeyIdDegreeReceivedFromTests, "")
204
204
  .replace(strForKeyIdDegreeReceivedFromFront, "");
@@ -62,7 +62,7 @@ ${triangle.sides
62
62
 
63
63
  - $${triangle.angles[indexAngle].toTexMini()} = ${triangle.angles[indexAngle]
64
64
  .evaluate()
65
- .frenchify()} {}^{\\circ} $
65
+ .frenchify()} {}^\\circ $
66
66
 
67
67
  Calculer la longueur $${triangle.sides[indexSide].toTex()}$ (donner une valeur arrondie à $${precision}$ décimales).`;
68
68
  };
@@ -73,7 +73,7 @@ const getAnswerStuff = (identifiers) => {
73
73
  const nodeAngleInDegrees = triangle.angles[indexAngle].evaluate().toTree();
74
74
  const nodeAngleInRadians = multiply(nodeAngleInDegrees, frac(PiNode, 180));
75
75
  //"nodeStr"
76
- const nodeStrLengthSquared = substract(add(power(sides[1].getLengthNode(), 2), power(sides[2].getLengthNode(), 2)), multiply(2, multiply(multiply(sides[1].getLengthNode(), sides[2].getLengthNode()), cos(multiply(nodeAngleInDegrees, "{}^{\\circ}".toTree())))));
76
+ const nodeStrLengthSquared = substract(add(power(sides[1].getLengthNode(), 2), power(sides[2].getLengthNode(), 2)), multiply(2, multiply(multiply(sides[1].getLengthNode(), sides[2].getLengthNode()), cos(multiply(nodeAngleInDegrees, "{}^\\circ".toTree())))));
77
77
  const nodeStrLength = sqrt(nodeStrLengthSquared.simplify());
78
78
  //"true" nodes
79
79
  const nodeLengthSquared = substract(add(power(sides[1].getLengthNode(), 2), power(sides[2].getLengthNode(), 2)), multiply(2, multiply(multiply(sides[1].getLengthNode(), sides[2].getLengthNode()), cos(nodeAngleInRadians))));
@@ -17,7 +17,7 @@ const getPropositions = (n, { answer }) => {
17
17
  const propositions = [];
18
18
  addValidProp(propositions, answer);
19
19
  propWhile(propositions, n, () => {
20
- tryToAddWrongProp(propositions, randint(0, 180) + "^{\\circ}");
20
+ tryToAddWrongProp(propositions, randint(0, 180) + "^\\circ");
21
21
  });
22
22
  return shuffleProps(propositions, n);
23
23
  };
@@ -30,7 +30,7 @@ const getAnswer = (identifiers) => {
30
30
  const normV = v.getNorm();
31
31
  const cos = frac(ps, multiply(normU, normV)).simplify();
32
32
  const arc = round((180 * Math.acos(cos.evaluate())) / Math.PI, 0);
33
- return arc.frenchify() + "^{\\circ}";
33
+ return arc.frenchify() + "^\\circ";
34
34
  };
35
35
  const getInstruction = (identifiers) => {
36
36
  const points = getPoints(identifiers);
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/randomVariable/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sCAAsC,CAAC;AAErD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,4CAA4C,CAAC;AAE3D,cAAc,iDAAiD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/randomVariable/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sCAAsC,CAAC;AAGrD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,4CAA4C,CAAC;AAE3D,cAAc,iDAAiD,CAAC"}
@@ -3,6 +3,7 @@ export * from "./randomVariableVariance.js";
3
3
  export * from "./isTableProbabilityLaw.js";
4
4
  export * from "./randomVariableStandardDeviation.js";
5
5
  // export * from "./findValueForFairRandomVariable.js";
6
+ // export * from "./findValueToMatchRandomVariableAverage.js";
6
7
  export * from "./findValueToMatchRandomVariableAverage.js";
7
8
  export * from "./calculateProbaFromVATableLaw.js";
8
9
  export * from "./randomVariableSituationValues.js";
@@ -18,4 +18,5 @@ export * from "./pythonWhileStatementCompletion.js";
18
18
  export * from "./pythonWhileStatementOperationCompletion.js";
19
19
  export * from "./pythonForLoopInstructionCompletion.js";
20
20
  export * from "./pythonSimpleFunctionInstructionCompletion.js";
21
+ export * from "./sequences/index.js";
21
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/python/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,qCAAqC,CAAC;AACpD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,yCAAyC,CAAC;AACxD,cAAc,gDAAgD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/python/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,qCAAqC,CAAC;AACpD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,yCAAyC,CAAC;AACxD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,sBAAsB,CAAC"}
@@ -18,3 +18,4 @@ export * from "./pythonWhileStatementCompletion.js";
18
18
  export * from "./pythonWhileStatementOperationCompletion.js";
19
19
  export * from "./pythonForLoopInstructionCompletion.js";
20
20
  export * from "./pythonSimpleFunctionInstructionCompletion.js";
21
+ export * from "./sequences/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"pySequenceThresholdInstructionCompletion.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/python/sequences/pySequenceThresholdInstructionCompletion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,sBAAsB,EACvB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAEL,oBAAoB,EACrB,MAAM,iDAAiD,CAAC;AAKzD,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAkB7C,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,eAAe,CAAC;IACpC,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAykBF,KAAK,OAAO,GAAG,sBAAsB,GACnC,oBAAoB,GAAG;IACrB,eAAe,EAAE,OAAO,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAoCJ,eAAO,MAAM,wCAAwC,EAAE,QAAQ,CAC7D,WAAW,EACX,OAAO,CAkBR,CAAC"}
1
+ {"version":3,"file":"pySequenceThresholdInstructionCompletion.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/python/sequences/pySequenceThresholdInstructionCompletion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,sBAAsB,EACvB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAEL,oBAAoB,EACrB,MAAM,iDAAiD,CAAC;AAKzD,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAkB7C,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,eAAe,CAAC;IACpC,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AA4kBF,KAAK,OAAO,GAAG,sBAAsB,GACnC,oBAAoB,GAAG;IACrB,eAAe,EAAE,OAAO,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAoCJ,eAAO,MAAM,wCAAwC,EAAE,QAAQ,CAC7D,WAAW,EACX,OAAO,CAkBR,CAAC"}
@@ -122,7 +122,7 @@ const getInstruction = (identifiers, optsIn) => {
122
122
  const firstRank = opts.firstTermRankOne ? 1 : 0;
123
123
  const { isUsePythonList, typeSequence } = opts;
124
124
  const { valueLimit } = identifiers;
125
- return `On considère une suite $(u_{n})$ positive, strictement croissante et ${typeSequence}.
125
+ return `On considère une suite $(u_{n})$ positive et strictement croissante.
126
126
  ${typeSequence === "convergente"
127
127
  ? `Sa limite vaut $${valueLimit.frenchify()}$.`
128
128
  : ``}
@@ -420,16 +420,19 @@ const getPropositions = (n, { answer, ...identifiers }, optsIn) => {
420
420
  }
421
421
  return shuffleProps(propositions, n);
422
422
  };
423
- const createRandomIdentifiers = (_opts) => {
423
+ const createRandomIdentifiers = (opts) => {
424
424
  const valueThreshold = randfloat(100, 200, 1);
425
425
  const valueLimit = randfloat(0, 200, 1, [0]);
426
426
  const nodeDistanceMax = power(10, randint(-8, -1));
427
- const keyIncomplete = random([
428
- "strInitialization",
429
- "strWhile",
430
- "strLoopBody",
431
- "strPrint",
432
- ]);
427
+ // const keyIncomplete = random([
428
+ // "strInitialization",
429
+ // "strWhile",
430
+ // "strLoopBody",
431
+ // "strPrint",
432
+ // ]);
433
+ const keyIncomplete = opts.isUsePythonDef
434
+ ? random(["strWhile", "strPrint"])
435
+ : "strWhile";
433
436
  const identifiers = {
434
437
  valueThreshold,
435
438
  valueLimit,
@@ -1 +1 @@
1
- {"version":3,"file":"arithmeticFindExplicitFormulaFromTwoTerms.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFromTwoTerms.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,sBAAsB,EACvB,MAAM,mDAAmD,CAAC;AAiB3D,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAwOF,KAAK,OAAO,GAAG,sBAAsB,CAAC;AAMtC,eAAO,MAAM,yCAAyC,EAAE,QAAQ,CAC9D,WAAW,EACX,OAAO,CAoBR,CAAC"}
1
+ {"version":3,"file":"arithmeticFindExplicitFormulaFromTwoTerms.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFromTwoTerms.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,sBAAsB,EACvB,MAAM,mDAAmD,CAAC;AAiB3D,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA4OF,KAAK,OAAO,GAAG,sBAAsB,CAAC;AAMtC,eAAO,MAAM,yCAAyC,EAAE,QAAQ,CAC9D,WAAW,EACX,OAAO,CAoBR,CAAC"}
@@ -117,10 +117,12 @@ const getPropositions = (n, { answer, ...identifiers }, optsIn) => {
117
117
  const isAnswerValid = (ans, { answer, ...identifiers }, optsIn) => {
118
118
  const opts = optsIn ?? optsDefault;
119
119
  try {
120
+ //TODO faire fonctionner parseAlgebraic("u_n=3+2n") (token _ not implemented)
121
+ const nodeAnswer = getAnswerNode(identifiers, opts);
120
122
  if (!ans.includes("=")) {
121
- return false;
123
+ // return false;
124
+ ans = nodeAnswer.leftChild.toTex() + "=" + ans;
122
125
  }
123
- //TODO faire fonctionner parseAlgebraic("u_n=3+2n") (token _ not implemented)
124
126
  // const nodeAns = parseAlgebraic(ans);
125
127
  const nodeAns = (() => {
126
128
  const [lhs, rhs] = ans.split("=");
@@ -131,7 +133,6 @@ const isAnswerValid = (ans, { answer, ...identifiers }, optsIn) => {
131
133
  if (!isEqualNode(nodeAns)) {
132
134
  return false;
133
135
  }
134
- const nodeAnswer = getAnswerNode(identifiers, opts);
135
136
  const isValidLhs = () => nodeAns.leftChild.toTex() === nodeAnswer.leftChild.toTex();
136
137
  const isValidRhs = () => {
137
138
  const nodeAnsRhs = nodeAns.rightChild;