math-exercises 3.0.102 → 3.0.104

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 (71) hide show
  1. package/lib/exercises/math/curve/sqrtCurvePoint.d.ts.map +1 -1
  2. package/lib/exercises/math/curve/sqrtCurvePoint.js +4 -2
  3. package/lib/exercises/math/curve/squareCurvePoint.d.ts.map +1 -1
  4. package/lib/exercises/math/curve/squareCurvePoint.js +4 -2
  5. package/lib/exercises/math/functions/sign/equationFromSignTable.js +1 -1
  6. package/lib/exercises/math/functions/square/squareImageIntervalWithGraph.d.ts.map +1 -1
  7. package/lib/exercises/math/functions/square/squareImageIntervalWithGraph.js +10 -2
  8. package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.d.ts.map +1 -1
  9. package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.js +3 -2
  10. package/lib/exercises/math/geometry/vectors/constructions/traceVectorMultiple.d.ts.map +1 -1
  11. package/lib/exercises/math/geometry/vectors/constructions/traceVectorMultiple.js +8 -1
  12. package/lib/exercises/math/geometry/vectors/distributeAndReduceVectors.js +6 -7
  13. package/lib/exercises/math/geometry/vectors/parallelogram/parallelogramCriterion.js +1 -1
  14. package/lib/exercises/math/geometry/vectors/vectorCoordinatesFromTwoPoints.d.ts.map +1 -1
  15. package/lib/exercises/math/geometry/vectors/vectorCoordinatesFromTwoPoints.js +33 -10
  16. package/lib/exercises/math/geometry/vectors/vectorLinearCombination.d.ts.map +1 -1
  17. package/lib/exercises/math/geometry/vectors/vectorLinearCombination.js +39 -9
  18. package/lib/exercises/math/geometry/vectors/vectorNormCalculation.js +1 -1
  19. package/lib/exercises/math/geometry/vectors/vectorRepresentative.js +1 -1
  20. package/lib/exercises/math/probaStat/basicProbas/ballsBasicProbas.js +1 -1
  21. package/lib/exercises/math/probaStat/basicProbas/cardBasicProbas.d.ts.map +1 -1
  22. package/lib/exercises/math/probaStat/basicProbas/cardBasicProbas.js +1 -3
  23. package/lib/exercises/math/probaStat/basicProbas/rouletteProbas.d.ts.map +1 -1
  24. package/lib/exercises/math/probaStat/basicProbas/rouletteProbas.js +5 -3
  25. package/lib/exercises/math/probaStat/events/describeEvent.d.ts.map +1 -1
  26. package/lib/exercises/math/probaStat/events/describeEvent.js +4 -10
  27. package/lib/exercises/math/probaStat/events/eventNotation.d.ts.map +1 -1
  28. package/lib/exercises/math/probaStat/events/eventNotation.js +4 -10
  29. package/lib/exercises/math/probaStat/issuesCountingForCards.js +1 -1
  30. package/lib/exercises/math/probaStat/probaFromTableNoContext.d.ts.map +1 -1
  31. package/lib/exercises/math/probaStat/probaFromTableNoContext.js +5 -3
  32. package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
  33. package/lib/exercises/math/probaStat/probaFromTableWithContext.js +10 -2
  34. package/lib/exercises/math/probaStat/stats1var/averageLinearity.d.ts.map +1 -1
  35. package/lib/exercises/math/probaStat/stats1var/averageLinearity.js +5 -4
  36. package/lib/exercises/math/probaStat/stats1var/compareSeriesDispersion.d.ts.map +1 -1
  37. package/lib/exercises/math/probaStat/stats1var/compareSeriesDispersion.js +14 -32
  38. package/lib/exercises/math/probaStat/stats1var/getQuartileProportionQuestion.d.ts +1 -1
  39. package/lib/exercises/math/probaStat/stats1var/getQuartileProportionQuestion.d.ts.map +1 -1
  40. package/lib/exercises/math/probaStat/stats1var/getQuartileProportionQuestion.js +115 -94
  41. package/lib/exercises/math/probaStat/stats1var/interquartilesList.d.ts.map +1 -1
  42. package/lib/exercises/math/probaStat/stats1var/interquartilesList.js +1 -0
  43. package/lib/exercises/math/probaStat/stats1var/interquartilesTable.d.ts.map +1 -1
  44. package/lib/exercises/math/probaStat/stats1var/interquartilesTable.js +1 -0
  45. package/lib/exercises/math/probaStat/stats1var/quartiles.d.ts.map +1 -1
  46. package/lib/exercises/math/probaStat/stats1var/quartiles.js +1 -0
  47. package/lib/exercises/math/probaStat/stats1var/quartilesList.d.ts.map +1 -1
  48. package/lib/exercises/math/probaStat/stats1var/quartilesList.js +1 -0
  49. package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.d.ts.map +1 -1
  50. package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.js +1 -1
  51. package/lib/exercises/math/python/pythonForLoopInstructionCompletion.js +1 -1
  52. package/lib/exercises/math/python/variableType.js +1 -1
  53. package/lib/exercises/math/python/whileLoop.d.ts.map +1 -1
  54. package/lib/exercises/math/python/whileLoop.js +1 -0
  55. package/lib/exercises/math/python/whileLoopCount.js +2 -2
  56. package/lib/exercises/math/sampling/samplingFrequency.d.ts.map +1 -1
  57. package/lib/exercises/math/sampling/samplingFrequency.js +1 -3
  58. package/lib/exercises/math/sequences/genericSequenceVariations.js +3 -3
  59. package/lib/exercises/math/sequences/sequencePlot.js +1 -1
  60. package/lib/exercises/pc/electricity/kirchhoffVoltageLaw.js +1 -1
  61. package/lib/index.d.ts +1 -1
  62. package/lib/math/probability/binomial.d.ts +1 -0
  63. package/lib/math/probability/binomial.d.ts.map +1 -1
  64. package/lib/math/probability/binomial.js +20 -0
  65. package/lib/math/utils/stats/gaussianWithNoise.d.ts +3 -0
  66. package/lib/math/utils/stats/gaussianWithNoise.d.ts.map +1 -0
  67. package/lib/math/utils/stats/gaussianWithNoise.js +9 -0
  68. package/lib/playground.d.ts +5 -0
  69. package/lib/playground.d.ts.map +1 -1
  70. package/lib/playground.js +8 -1
  71. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"sqrtCurvePoint.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/curve/sqrtCurvePoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAatC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,gBAAgB,CAAC;CACzB,CAAC;AAuHF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAkBhD,CAAC"}
1
+ {"version":3,"file":"sqrtCurvePoint.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/curve/sqrtCurvePoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAatC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,gBAAgB,CAAC;CACzB,CAAC;AAyHF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAkBhD,CAAC"}
@@ -50,8 +50,10 @@ const getCorrection = (identifiers) => {
50
50
  const y = point.y;
51
51
  const isValidPoint = isPointOnCurve(identifiers);
52
52
  const conclusion = isValidPoint
53
- ? "Le point est donc sur la courbe."
54
- : "Le point n'est donc pas sur la courbe.";
53
+ ? `Le point est donc bien sur la courbe.`
54
+ : `Puisque $f\\left(${x.toTex()}\\right) = ${sqrt(x)
55
+ .simplify()
56
+ .toTex()}\\neq ${y.toTex()}$, le point n'est donc pas sur la courbe.`;
55
57
  return `$${point.toTexWithCoords()}$ appartient à la courbe de la fonction racine carrée si et seulement si :
56
58
 
57
59
  ${alignTex(sqrt(x).simplify().toTex() != sqrt(x).toTex()
@@ -1 +1 @@
1
- {"version":3,"file":"squareCurvePoint.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/curve/squareCurvePoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AActC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,gBAAgB,CAAC;CACzB,CAAC;AAyHF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAiBlD,CAAC"}
1
+ {"version":3,"file":"squareCurvePoint.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/curve/squareCurvePoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AActC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,gBAAgB,CAAC;CACzB,CAAC;AA2HF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAiBlD,CAAC"}
@@ -49,8 +49,10 @@ const getCorrection = (identifiers) => {
49
49
  const point = PointConstructor.fromIdentifiers(pointId);
50
50
  const isValidPoint = isPointOnCurve(identifiers);
51
51
  const conclusion = isValidPoint
52
- ? "Le point est donc sur la courbe."
53
- : "Le point n'est donc pas sur la courbe.";
52
+ ? `Le point est donc bien sur la courbe.`
53
+ : `Puisque $f(${point.x.toTex()}) = ${square(point.x)
54
+ .simplify()
55
+ .toTex()}\\neq ${point.y.toTex()}$, le point n'est donc pas sur la courbe.`;
54
56
  return `$${point.toTexWithCoords()}$ appartient à la courbe de la fonction carré si et seulement si :
55
57
 
56
58
  ${alignTex([
@@ -210,7 +210,7 @@ const getQuestionFromIdentifiers = (identifiers, opts) => {
210
210
  return {
211
211
  answer: getAnswer(identifiers, opts),
212
212
  instruction: getInstruction(identifiers, opts),
213
- answerFormat: "raw",
213
+ answerFormat: "tex",
214
214
  identifiers,
215
215
  hint: getHint(identifiers, opts),
216
216
  correction: getCorrection(identifiers, opts),
@@ -1 +1 @@
1
- {"version":3,"file":"squareImageIntervalWithGraph.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/square/squareImageIntervalWithGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAAW,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAMxE,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE,WAAW,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAoNF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAc9D,CAAC"}
1
+ {"version":3,"file":"squareImageIntervalWithGraph.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/square/squareImageIntervalWithGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAAW,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAMxE,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE,WAAW,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AA2NF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAc9D,CAAC"}
@@ -163,12 +163,20 @@ const getPropositions = (n, { answer, a, b, type, closure }) => {
163
163
  }
164
164
  return shuffleProps(propositions, n);
165
165
  };
166
- const isAnswerValid = (ans, { answer, a, b, closure, type }) => {
166
+ const isAnswerValid = (ans, { answer, ...identifiers }) => {
167
167
  try {
168
+ const intervalSolution = getAnswerNode(identifiers);
168
169
  const parsed = intervalParser(ans);
169
170
  if (!parsed)
170
171
  return false;
171
- return parsed.simplify().toTex() === answer;
172
+ if (parsed.closure !== intervalSolution.closure)
173
+ return false;
174
+ const a = parsed.a.evaluate();
175
+ const b = parsed.b.evaluate();
176
+ return (Math.abs(a - intervalSolution.a.evaluate()) < 3 &&
177
+ Math.abs(b - intervalSolution.b.evaluate()) < 3);
178
+ // return;
179
+ // return parsed.simplify().toTex() === answer;
172
180
  }
173
181
  catch (err) {
174
182
  return handleVEAError(err);
@@ -1 +1 @@
1
- {"version":3,"file":"pointImageFromTranslation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAQrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAMtC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAqKF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAiBpE,CAAC"}
1
+ {"version":3,"file":"pointImageFromTranslation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAQrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAMtC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAyKF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAiBpE,CAAC"}
@@ -73,8 +73,9 @@ const getStudentGGBOptions = (identifiers) => {
73
73
  coords: ggb.getCoordsForPoints([...points, endPoint]),
74
74
  });
75
75
  };
76
- const isGGBAnswerValid = (ans, { ggbAnswer }) => {
77
- const studentAns = ans.filter((c) => !["A", "B", "C", "D"].includes(c[0]));
76
+ const isGGBAnswerValid = (ans, { ggbAnswer, points, startPoint, translationPoints }) => {
77
+ const pointsUsed = points.map((p) => p.name);
78
+ const studentAns = ans.filter((c) => !pointsUsed.includes(c[0]));
78
79
  if (studentAns.length !== 1)
79
80
  return false;
80
81
  const studentPoint = studentAns[0].split("=")[1];
@@ -1 +1 @@
1
- {"version":3,"file":"traceVectorMultiple.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/constructions/traceVectorMultiple.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAOtC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AA0KF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAkBrD,CAAC"}
1
+ {"version":3,"file":"traceVectorMultiple.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/constructions/traceVectorMultiple.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAOtC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAiLF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAkBrD,CAAC"}
@@ -28,7 +28,14 @@ const getHint = (identifiers) => {
28
28
  const { startPointIndex, points, coeff, vectorPointsIndexes } = identifiers;
29
29
  const origin = identifiers.points[startPointIndex].name;
30
30
  const vec = `${identifiers.points[vectorPointsIndexes[0]].name}${identifiers.points[vectorPointsIndexes[1]].name}`;
31
- return `Rappelle toi que $-\\overrightarrow{v}$ est le vecteur de même norme et de même direction que $\\overrightarrow{v}$, mais de sens opposé.`;
31
+ const u = `\\overrightarrow{u}`;
32
+ return `
33
+ On considère un nombre réel $k\\neq 0$ et un vecteur $${u}\\neq \\overrightarrow{0}$. Le vecteur $k${u}$ est le vecteur :
34
+
35
+ - de même direction que $${u}$ ;
36
+ - de même sens que $${u}$ si $k>0$, et de sens contraire si $k<0$ ;
37
+ - de norme égale à $k||${u}||$ si $k>0$, et égale à $-k||${u}||$ si $k<0$.
38
+ `;
32
39
  };
33
40
  const getCorrection = (identifiers) => {
34
41
  const { startPointIndex, points, coeff, vectorPointsIndexes } = identifiers;
@@ -48,14 +48,13 @@ ${node.toTex()}
48
48
  $$`;
49
49
  };
50
50
  const getHint = (identifiers) => {
51
- if (identifiers.type === 0) {
52
- return `Regroupe les termes de même vecteur entre eux.`;
53
- }
54
- return `Utilise la propriété :
51
+ const u = "\\overrightarrow{u}";
52
+ const v = "\\overrightarrow{v}";
53
+ return `On rappelle les propriétés suivantes : pour tous vecteurs $${u}$ et $${v}$ et pour tous nombres réels $k$ et $k'$,
55
54
 
56
- $$
57
- k(a+b) = ka+kb
58
- $$`;
55
+ - $k\\left(${u}+${v}\\right) = k${u}+k${v}$ ;
56
+ - $k${u}+k'${u}=(k+k')${u}$ ;
57
+ - $k\\left(k'${u}\\right) = \\left(k\\times k'\\right)${u}$.`;
59
58
  };
60
59
  const getCorrection = (identifiers) => {
61
60
  const node = reifyAlgebraic(identifiers.expression);
@@ -73,7 +73,7 @@ Donner le nom du parallélogramme formé par ces vecteurs.`;
73
73
  Donner une égalité entre deux vecteurs issus de ce parallélogramme.`;
74
74
  };
75
75
  const getHint = (identifiers) => {
76
- return `$ABCD$ est un parallélogramme si et seulemtne si les vecteurs $\\overrightarrow{AB}$ et $\\overrightarrow{DC}$ sont égaux.`;
76
+ return `$ABCD$ est un parallélogramme si et seulement si les vecteurs $\\overrightarrow{AB}$ et $\\overrightarrow{DC}$ sont égaux.`;
77
77
  };
78
78
  const getCorrection = (identifiers) => {
79
79
  const { isAskingParallelogramName, pointNames } = identifiers;
@@ -1 +1 @@
1
- {"version":3,"file":"vectorCoordinatesFromTwoPoints.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/vectorCoordinatesFromTwoPoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAuGF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,CAchE,CAAC"}
1
+ {"version":3,"file":"vectorCoordinatesFromTwoPoints.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/vectorCoordinatesFromTwoPoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA4GF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,CAchE,CAAC"}
@@ -1,19 +1,24 @@
1
1
  import { shuffleProps, tryToAddWrongProp, addValidProp, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { Vector } from "../../../../math/geometry/vector.js";
3
4
  import { randint } from "../../../../math/utils/random/randint.js";
5
+ import { binom, isBinomialCoefficientNode, } from "../../../../tree/nodes/operators/binomialCoefficientNode.js";
4
6
  import { SubstractNode } from "../../../../tree/nodes/operators/substractNode.js";
7
+ import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
8
+ import { vectorParser } from "../../../../tree/parsers/vectorParser.js";
9
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
5
10
  import { alignTex } from "../../../../utils/latex/alignTex.js";
6
11
  import { randomLetter } from "../../../../utils/strings/randomLetter.js";
7
12
  const getInstruction = (identifiers) => {
8
13
  const { A, B, startLetter, endLetter } = identifiers;
9
- return `Soit $${startLetter}\\left(${A[0]};${A[1]}\\right)$ et $${endLetter}\\left(${B[0]};${B[1]}\\right)$.
14
+ return `Soient deux points $${startLetter}\\left(${A[0]};${A[1]}\\right)$ et $${endLetter}\\left(${B[0]};${B[1]}\\right)$.
10
15
 
11
16
  Quelles sont les coordonnées du vecteur $\\overrightarrow{${startLetter}${endLetter}}$ ?`;
12
17
  };
13
18
  const getAnswer = (identifiers) => {
14
19
  const { A, B, startLetter, endLetter } = identifiers;
15
- const answer = `\\left(${B[0] - A[0]};${B[1] - A[1]}\\right)`;
16
- return answer;
20
+ const vec = new Vector("u", (B[0] - A[0]).toTree(), (B[1] - A[1]).toTree());
21
+ return vec.toBinomCoords().toTex();
17
22
  };
18
23
  const getHint = (identifiers) => {
19
24
  return `Si $A(x_A;y_A)$ et $B(x_B;y_B)$ sont deux points, alors le vecteur $\\overrightarrow{AB}$ a pour coordonnées :
@@ -40,7 +45,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
40
45
  const question = {
41
46
  answer: getAnswer(identifiers),
42
47
  instruction: getInstruction(identifiers),
43
- keys: ["semicolon"],
48
+ keys: ["binom", "semicolon"],
44
49
  answerFormat: "tex",
45
50
  hint: getHint(identifiers),
46
51
  correction: getCorrection(identifiers),
@@ -62,16 +67,34 @@ const getVectorCoordinatesFromTwoPointsQuestion = () => {
62
67
  const getPropositions = (n, { answer, A, B }) => {
63
68
  const propositions = [];
64
69
  addValidProp(propositions, answer);
65
- tryToAddWrongProp(propositions, `\\left(${A[0] - B[0]};${A[1] - B[1]}\\right)`);
66
- tryToAddWrongProp(propositions, `\\left(${A[1] - A[0]};${B[1] - B[0]}\\right)`);
67
- tryToAddWrongProp(propositions, `\\left(${B[1] - B[0]};${A[1] - A[0]}\\right)`);
70
+ tryToAddWrongProp(propositions, binom(A[0] - B[0], A[1] - B[1]).toTex());
71
+ tryToAddWrongProp(propositions, binom(A[1] - A[0], B[1] - B[0]).toTex());
72
+ tryToAddWrongProp(propositions, binom(B[1] - B[0], A[1] - A[0]).toTex());
68
73
  while (propositions.length < n) {
69
- tryToAddWrongProp(propositions, `\\left(${randint(-10, 10)};${randint(-10, 10)}\\right)`);
74
+ tryToAddWrongProp(propositions, binom(randint(-10, 10), randint(-10, 10)).toTex());
70
75
  }
71
76
  return shuffleProps(propositions, n);
72
77
  };
73
- const isAnswerValid = (ans, { answer }) => {
74
- return [ans, ans.replace(",", ";"), "\\left(" + ans + "\\right)"].includes(answer);
78
+ const isAnswerValid = (ans, { answer, A, B }) => {
79
+ try {
80
+ const solVector = new Vector("u", (B[0] - A[0]).toTree(), (B[1] - A[1]).toTree());
81
+ if (ans.includes("binom")) {
82
+ const parsed = parseAlgebraic(ans);
83
+ if (!isBinomialCoefficientNode(parsed))
84
+ return false;
85
+ const vec = new Vector("u", parsed.leftChild, parsed.rightChild);
86
+ return solVector.simplify().toCoords() === vec.toCoords();
87
+ }
88
+ else {
89
+ const vec = vectorParser(ans);
90
+ if (!vec)
91
+ return false;
92
+ return solVector.simplify().toCoords() === vec.toCoords();
93
+ }
94
+ }
95
+ catch (err) {
96
+ return handleVEAError(err);
97
+ }
75
98
  };
76
99
  export const vectorCoordinatesFromTwoPoints = {
77
100
  id: "vectorCoordinatesFromTwoPoints",
@@ -1 +1 @@
1
- {"version":3,"file":"vectorLinearCombination.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/vectorLinearCombination.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,YAAY,CAAC;IAChB,CAAC,EAAE,YAAY,CAAC;CACjB,CAAC;AAEF,KAAK,YAAY,GAAG;IAClB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAyMF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAczD,CAAC"}
1
+ {"version":3,"file":"vectorLinearCombination.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/vectorLinearCombination.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,YAAY,CAAC;IAChB,CAAC,EAAE,YAAY,CAAC;CACjB,CAAC;AAEF,KAAK,YAAY,GAAG;IAClB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAsNF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAczD,CAAC"}
@@ -4,8 +4,12 @@ import { Vector, VectorConstructor } from "../../../../math/geometry/vector.js";
4
4
  import { randint } from "../../../../math/utils/random/randint.js";
5
5
  import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
6
6
  import { add, AddNode } from "../../../../tree/nodes/operators/addNode.js";
7
+ import { isBinomialCoefficientNode } from "../../../../tree/nodes/operators/binomialCoefficientNode.js";
7
8
  import { multiply, MultiplyNode, } from "../../../../tree/nodes/operators/multiplyNode.js";
8
9
  import { VariableNode } from "../../../../tree/nodes/variables/variableNode.js";
10
+ import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
11
+ import { vectorParser } from "../../../../tree/parsers/vectorParser.js";
12
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
9
13
  const getInstruction = (identifiers) => {
10
14
  const { a, b } = identifiers;
11
15
  const u = new Vector("u", identifiers.u.x.toTree(), identifiers.u.y.toTree());
@@ -18,13 +22,16 @@ $$
18
22
  ${getAddVectorTex(getMultiplyVectorTex(a, u), getMultiplyVectorTex(b, v))}
19
23
  $$`;
20
24
  };
21
- const getAnswer = (identifiers) => {
25
+ const getAnswerNode = (identifiers) => {
22
26
  const { a, b } = identifiers;
23
27
  const u = new Vector("u", identifiers.u.x.toTree(), identifiers.u.y.toTree());
24
28
  const v = new Vector("v", identifiers.v.x.toTree(), identifiers.v.y.toTree());
25
29
  const aUPlusBv = calculateLinearCombination(a, b, u, v);
26
- const correctAnswer = new Vector("au+bv", aUPlusBv.x, aUPlusBv.y);
27
- return `${correctAnswer.toInlineCoordsTex()}`;
30
+ return new Vector("au+bv", aUPlusBv.x, aUPlusBv.y);
31
+ };
32
+ const getAnswer = (identifiers) => {
33
+ const correctAnswer = getAnswerNode(identifiers);
34
+ return `${correctAnswer.toBinomCoords().toTex()}`;
28
35
  };
29
36
  const getHint = (identifiers) => {
30
37
  return `Calcule d'abord les coordonnées de chaque vecteur de la somme. Puis, additionne ces coordonnées.`;
@@ -65,7 +72,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
65
72
  const question = {
66
73
  answer: getAnswer(identifiers),
67
74
  instruction: getInstruction(identifiers),
68
- keys: ["semicolon"],
75
+ keys: ["binom", "semicolon"],
69
76
  answerFormat: "tex",
70
77
  identifiers,
71
78
  hint: getHint(identifiers),
@@ -103,14 +110,18 @@ const getPropositions = (n, { answer, a, b, u, v }) => {
103
110
  addValidProp(propositions, answer);
104
111
  const uVector = new Vector("u", new NumberNode(u.x), new NumberNode(u.y));
105
112
  const vVector = new Vector("v", new NumberNode(v.x), new NumberNode(v.y));
106
- generateProposition(a, b, uVector, vVector).forEach((value) => tryToAddWrongProp(propositions, value.toInlineCoordsTex()));
113
+ generateProposition(a, b, uVector, vVector).forEach((value) => tryToAddWrongProp(propositions, value.toBinomCoords().toTex()));
107
114
  let aRandom;
108
115
  let bRandom;
109
116
  while (propositions.length < n) {
110
117
  aRandom = randint(a - 2, a + 3, [a]);
111
118
  bRandom = randint(b - 2, b + 3, [b]);
112
- tryToAddWrongProp(propositions, calculateLinearCombination(aRandom, b, uVector, vVector).toInlineCoordsTex());
113
- tryToAddWrongProp(propositions, calculateLinearCombination(a, bRandom, uVector, vVector).toInlineCoordsTex());
119
+ tryToAddWrongProp(propositions, calculateLinearCombination(aRandom, b, uVector, vVector)
120
+ .toBinomCoords()
121
+ .toTex());
122
+ tryToAddWrongProp(propositions, calculateLinearCombination(a, bRandom, uVector, vVector)
123
+ .toBinomCoords()
124
+ .toTex());
114
125
  }
115
126
  return shuffleProps(propositions, n);
116
127
  };
@@ -135,8 +146,27 @@ const generateProposition = (a, b, v, u) => {
135
146
  const secondProposition = new Vector("au+bv", aUPlusbV.x, aUPlusbV.y);
136
147
  return [firtPropostion, secondProposition];
137
148
  };
138
- const isAnswerValid = (ans, { answer }) => {
139
- return [answer, answer.replace(";", ",")].includes(ans);
149
+ const isAnswerValid = (ans, { answer, ...identifiers }) => {
150
+ try {
151
+ const solVector = getAnswerNode(identifiers);
152
+ if (ans.includes("binom")) {
153
+ const parsed = parseAlgebraic(ans);
154
+ if (!isBinomialCoefficientNode(parsed))
155
+ return false;
156
+ const vec = new Vector("u", parsed.leftChild, parsed.rightChild);
157
+ console.log(solVector.toCoords(), vec.toCoords());
158
+ return solVector.simplify().toCoords() === vec.toCoords();
159
+ }
160
+ else {
161
+ const vec = vectorParser(ans);
162
+ if (!vec)
163
+ return false;
164
+ return solVector.simplify().toCoords() === vec.toCoords();
165
+ }
166
+ }
167
+ catch (err) {
168
+ return handleVEAError(err);
169
+ }
140
170
  };
141
171
  export const vectorLinearCombination = {
142
172
  id: "vectorLinearCombination",
@@ -14,7 +14,7 @@ const getAnswer = (identifiers) => {
14
14
  };
15
15
  const getInstruction = (identifiers) => {
16
16
  const u = new Vector("u", identifiers.x.toTree(), identifiers.y.toTree());
17
- return `Cacluler la norme du vecteur $${u.toTexWithCoords()}$`;
17
+ return `Calculer la norme du vecteur $${u.toTexWithCoords()}$.`;
18
18
  };
19
19
  const getHint = (identifiers) => {
20
20
  return `La norme d'un vecteur est la racine carrée de la somme des carrés de ses coordonnées. En d'autres termes, la norme du vecteur $\\overrightarrow{u}\\begin{pmatrix}x \\\\ y \\end{pmatrix}$ est :
@@ -38,7 +38,7 @@ const getInstruction = (identifiers) => {
38
38
 
39
39
  ![](https://heureuxhasarddocsbucket.s3.eu-west-3.amazonaws.com/mathliveV2/activities/quizzes/generator/pointsOnParallelogram2.png)
40
40
 
41
- Parmi les vecteurs suivants, lequel, ou lesquels, sont des représentants du vecteur $\\overrightarrow{${identifiers.vec}}$ ?`;
41
+ Parmi les vecteurs suivants, lequel ou lesquels sont des représentants du vecteur $\\overrightarrow{${identifiers.vec}}$ ?`;
42
42
  };
43
43
  const getHint = (identifiers) => {
44
44
  return `On appelle représentant d'un vecteur $\\overrightarrow{u}$ tout vecteur qui est égal à $\\overrightarrow{u}$.`;
@@ -25,7 +25,7 @@ const getAnswer = (identifiers) => {
25
25
  };
26
26
  const getHint = (identifiers) => {
27
27
  const { repartitions, colorAskedIndex } = identifiers;
28
- return `Puisque toutes les boules ont la même chance d'être tirée, la probabilité d'obtenir une boule ${colors[colorAskedIndex]} est le nombre de boules ${colors[colorAskedIndex]} divisé par le nombre total de boules.`;
28
+ return `Toutes les boules ont la même chance d'être tirée !`;
29
29
  };
30
30
  const getCorrection = (identifiers) => {
31
31
  const { repartitions, colorAskedIndex } = identifiers;
@@ -1 +1 @@
1
- {"version":3,"file":"cardBasicProbas.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/basicProbas/cardBasicProbas.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAQrC,OAAO,EAAE,UAAU,EAAe,MAAM,oCAAoC,CAAC;AAI7E,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB,CAAC;AAoJF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAgBjD,CAAC"}
1
+ {"version":3,"file":"cardBasicProbas.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/basicProbas/cardBasicProbas.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAQrC,OAAO,EAAE,UAAU,EAAe,MAAM,oCAAoC,CAAC;AAI7E,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB,CAAC;AAoJF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAcjD,CAAC"}
@@ -64,7 +64,7 @@ const getHint = (identifiers) => {
64
64
  const { questionType, value, color } = identifiers;
65
65
  return `Dans un jeu de cartes de $52$ cartes, il y a $13$ piques, $13$ trèfles, $13$ coeurs et $13$ carreaux.
66
66
 
67
- Chaque couleur est composé de l'as, du deux, du trois, etc.. jusqu'au dix, puis du valet, de la dame et du roi.`;
67
+ Chaque couleur est composée de l'as, du deux, du trois, etc.. jusqu'au dix, puis du valet, de la dame et du roi.`;
68
68
  };
69
69
  const getCorrection = (identifiers) => {
70
70
  const { questionType, value, color } = identifiers;
@@ -139,9 +139,7 @@ export const cardBasicProbas = {
139
139
  id: "cardBasicProbas",
140
140
  connector: "=",
141
141
  label: "Calcul de probabilité simple avec un jeu de cartes",
142
- levels: ["5ème", "4ème", "3ème", "2ndPro", "2nde", "CAP"],
143
142
  isSingleStep: true,
144
- sections: ["Probabilités"],
145
143
  generator: (nb) => getDistinctQuestions(getCardBasicProbasQuestion, nb),
146
144
  qcmTimer: 60,
147
145
  freeTimer: 60,
@@ -1 +1 @@
1
- {"version":3,"file":"rouletteProbas.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/basicProbas/rouletteProbas.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAoIF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAkBhD,CAAC"}
1
+ {"version":3,"file":"rouletteProbas.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/basicProbas/rouletteProbas.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAwIF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAkBhD,CAAC"}
@@ -27,7 +27,9 @@ const getAnswer = (identifiers) => {
27
27
  };
28
28
  const getInstruction = (identifiers) => {
29
29
  const { a, type } = identifiers;
30
- const event = type === 1 ? `un multiple de $${a}$` : `un numéro supérieur à $${a}$`;
30
+ const event = type === 1
31
+ ? `un multiple de $${a}$`
32
+ : `un numéro strictement supérieur à $${a - 1}$`;
31
33
  return `On lance une bille sur une roulette équilibrée qui comporte tous les numéros de $0$ à $36$.
32
34
 
33
35
  Calculer la probabilité de l'évènement "la bille s'arrête sur ${event}".`;
@@ -39,7 +41,7 @@ const getHint = (identifiers) => {
39
41
  return `N'oublie pas que $0$ est un multiple de $${a}$. De plus, n'oublie pas de compter $0$ dans le total des numéros possibles.`;
40
42
  case 2:
41
43
  default:
42
- return `Compte les nombres supérieurs à $${a}$ et inférieurs à $36$. De plus, n'oublie pas de compter $0$ dans le total des numéros possibles.`;
44
+ return `Compte les nombres strictement supérieurs à $${a - 1}$ et inférieurs à $36$. De plus, n'oublie pas de compter $0$ dans le total des numéros possibles.`;
43
45
  }
44
46
  };
45
47
  const getCorrection = (identifiers) => {
@@ -65,7 +67,7 @@ $$
65
67
  `;
66
68
  case 2:
67
69
  default:
68
- return `Il y a $${36 - a + 1}$ numéros supérieurs à $${a}$ et inférieurs à $36$.
70
+ return `Il y a $${36 - a + 1}$ numéros strictement supérieurs à $${a - 1}$ et inférieurs à $36$.
69
71
 
70
72
  Puisqu'il y a $37$ numéros possibles, et que la roulette est bien équilibrée, la probabilité recherchée est donc :
71
73
 
@@ -1 +1 @@
1
- {"version":3,"file":"describeEvent.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/events/describeEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,eAAe,EAAE,OAAO,CAAC;KAC1B,CAAC;IACF,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,eAAe,EAAE,OAAO,CAAC;KAC1B,CAAC;IACF,QAAQ,EAAE,OAAO,GAAG,cAAc,GAAG,MAAM,CAAC;CAC7C,CAAC;AA0LF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAkB/C,CAAC"}
1
+ {"version":3,"file":"describeEvent.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/events/describeEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,eAAe,EAAE,OAAO,CAAC;KAC1B,CAAC;IACF,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,eAAe,EAAE,OAAO,CAAC;KAC1B,CAAC;IACF,QAAQ,EAAE,OAAO,GAAG,cAAc,GAAG,MAAM,CAAC;CAC7C,CAAC;AAoLF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAkB/C,CAAC"}
@@ -87,16 +87,10 @@ const getInstruction = (identifiers) => {
87
87
  `Décrire par une phrase l'évènement $${overlineA} ${operator} ${overlineB}$.`);
88
88
  };
89
89
  const getHint = ({ question }) => {
90
- switch (question) {
91
- case "comp":
92
- return `Le contraire ($\\overline{A})$ d'un évènement $A$ signifie que l'évènement ne se réalise pas.`;
93
- case "union":
94
- return `L'union ($\\cup$) de deux événements signifie que l'un ou l'autre des évènements (ou les deux) se réalisent.`;
95
- case "intersection":
96
- return `L'intersection ($\\cap$) de deux événements signifie que les deux évènements se réalisent en même temps.`;
97
- default:
98
- return "";
99
- }
90
+ return `
91
+ - Le contraire ($\\overline{A})$ d'un évènement $A$ signifie que l'évènement ne se réalise pas.
92
+ - L'union ($A\\cup B$) de deux événements $A$ et $B$ signifie que l'un ou l'autre des évènements (ou les deux) se réalisent.
93
+ - L'intersection ($A\\cap B$) de deux événements $A$ et $B$ signifie que les deux évènements se réalisent en même temps.`;
100
94
  };
101
95
  const getCorrection = (identifiers) => {
102
96
  const { eventA, eventB, question } = identifiers;
@@ -1 +1 @@
1
- {"version":3,"file":"eventNotation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/events/eventNotation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,eAAe,EAAE,OAAO,CAAC;KAC1B,CAAC;IACF,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,eAAe,EAAE,OAAO,CAAC;KAC1B,CAAC;IACF,QAAQ,EAAE,OAAO,GAAG,cAAc,GAAG,MAAM,CAAC;CAC7C,CAAC;AA4JF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAkB/C,CAAC"}
1
+ {"version":3,"file":"eventNotation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/events/eventNotation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,eAAe,EAAE,OAAO,CAAC;KAC1B,CAAC;IACF,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,eAAe,EAAE,OAAO,CAAC;KAC1B,CAAC;IACF,QAAQ,EAAE,OAAO,GAAG,cAAc,GAAG,MAAM,CAAC;CAC7C,CAAC;AAsJF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAkB/C,CAAC"}
@@ -52,16 +52,10 @@ const getInstruction = (identifiers) => {
52
52
  return instruction + `Comment se note l'événement "${sentence}" ?`;
53
53
  };
54
54
  const getHint = ({ question }) => {
55
- switch (question) {
56
- case "comp":
57
- return `Le contraire ($\\overline{A})$ d'un évènement $A$ signifie que l'évènement ne se réalise pas.`;
58
- case "union":
59
- return `L'union ($\\cup$) de deux événements signifie que l'un ou l'autre des évènements (ou les deux) se réalisent.`;
60
- case "intersection":
61
- return `L'intersection ($\\cap$) de deux événements signifie que les deux évènements se réalisent en même temps.`;
62
- default:
63
- return "";
64
- }
55
+ return `
56
+ - Le contraire ($\\overline{A})$ d'un évènement $A$ signifie que l'évènement ne se réalise pas.
57
+ - L'union ($A\\cup B$) de deux événements $A$ et $B$ signifie que l'un ou l'autre des évènements (ou les deux) se réalisent.
58
+ - L'intersection ($A\\cap B$) de deux événements $A$ et $B$ signifie que les deux évènements se réalisent en même temps.`;
65
59
  };
66
60
  const getCorrection = (identifiers) => {
67
61
  const { eventA, eventB, question } = identifiers;
@@ -90,7 +90,7 @@ const getHint = (identifiers) => {
90
90
  const { questionType, value, color } = identifiers;
91
91
  return `Dans un jeu de cartes de $52$ cartes, il y a des cartes de pique, des cartes de trèfle, des cartes de coeur et des cartes de carreau. Les couleurs pique et trèfle sont des couleurs noires, et les couleurs carreau et coeur sont des couleurs rouges.
92
92
 
93
- Chaque couleur est composé de l'as, du deux, du trois, etc.. jusqu'au dix, puis du valet, de la dame et du roi.`;
93
+ Chaque couleur est composée de l'as, du deux, du trois, etc.. jusqu'au dix, puis du valet, de la dame et du roi.`;
94
94
  };
95
95
  const getCorrection = (identifiers) => {
96
96
  const { questionType, value, color } = identifiers;
@@ -1 +1 @@
1
- {"version":3,"file":"probaFromTableNoContext.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/probaFromTableNoContext.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAyTF,KAAK,OAAO,GAAG;IAEb,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAuBF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgBlE,CAAC"}
1
+ {"version":3,"file":"probaFromTableNoContext.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/probaFromTableNoContext.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAiUF,KAAK,OAAO,GAAG;IAEb,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAuBF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgBlE,CAAC"}
@@ -149,7 +149,7 @@ const getCorrection = (identifiers) => {
149
149
  : event === "P(\\overline A)"
150
150
  ? "\\overline{A}"
151
151
  : "\\overline{B}";
152
- return `On lit le total de la ${singleEvnmt.includes("A") ? "ligne" : "colonne"} $${singleEvnmt}$ : c'est $${probaFrac[0]}$. La probabilité $${event}$ vaut donc :
152
+ return `On lit le total de la ${singleEvnmt.includes("A") ? "ligne" : "colonne"} $${singleEvnmt}$ : c'est $${probaFrac[0]}$. Le total des issues se lit à l'intersection de la ligne "Total" et de la colonne "Total" : c'est $${probaFrac[1]}$. La probabilité $${event}$ vaut donc :
153
153
 
154
154
  $$
155
155
  ${event} = ${frac(probaFrac[0], probaFrac[1]).toSimplificationTex()}
@@ -166,7 +166,9 @@ $$`;
166
166
  const columnTotal = unionEvements[1] === "B" ? bTotal : bBarreTotal;
167
167
  return `On additionne les totaux de la ligne $${unionEvements[0]}$ et de la colonne $${unionEvements[1]}$ : cela donne $${rowTotal} + ${columnTotal} = ${rowTotal + columnTotal}$. On doit ensuite soustraire la case à l'intersection de la ligne $${unionEvements[0]}$ et de la colonne $${unionEvements[1]}$, car on l'a compté deux fois dans les totaux. Cela donne $${rowTotal + columnTotal} - ${rowTotal + columnTotal - probaFrac[0]} = ${probaFrac[0]}
168
168
  $.
169
-
169
+
170
+ Enfin, le total des issues se lit à l'intersection de la ligne "Total" et de la colonne "Total" : c'est $${probaFrac[1]}$.
171
+
170
172
  La probabilité $${event}$ vaut donc :
171
173
 
172
174
  $$
@@ -180,7 +182,7 @@ $$`;
180
182
  : event === "P(\\overline A \\cup B)"
181
183
  ? ["\\overline{A}", "B"]
182
184
  : ["\\overline{A}", "\\overline{B}"];
183
- return `On lit la case à l'intersection de la colonne $${interEvemnts[1]}$ et de la ligne $${interEvemnts[0]}$ : c'est $${probaFrac[0]}$. La probabilité $${event}$ vaut donc :
185
+ return `On lit la case à l'intersection de la colonne $${interEvemnts[1]}$ et de la ligne $${interEvemnts[0]}$ : c'est $${probaFrac[0]}$. Le total des issues se lit à l'intersection de la ligne "Total" et de la colonne "Total" : c'est $${probaFrac[1]}$. La probabilité $${event}$ vaut donc :
184
186
 
185
187
  $$
186
188
  ${event} = ${frac(probaFrac[0], probaFrac[1]).toSimplificationTex()}
@@ -1 +1 @@
1
- {"version":3,"file":"probaFromTableWithContext.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/probaFromTableWithContext.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AA6JF,KAAK,OAAO,GAAG,EAEd,CAAC;AA6HF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkBpE,CAAC"}
1
+ {"version":3,"file":"probaFromTableWithContext.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/probaFromTableWithContext.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AA6JF,KAAK,OAAO,GAAG,EAEd,CAAC;AAyIF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkBpE,CAAC"}
@@ -174,7 +174,11 @@ const getCorrection = (identifiers) => {
174
174
  ? "Porte des lunettes"
175
175
  : "Ne porte pas de lunettes";
176
176
  const isLine = event === "une fille" || event === "un garçon";
177
- return `On lit le total de la ${isLine ? "ligne" : "colonne"} "${singleEvnmt}" : c'est $${probaFrac[0]}$. La probabilité recherchée vaut donc :
177
+ return `On lit le total de la ${isLine ? "ligne" : "colonne"} "${singleEvnmt}" : c'est $${probaFrac[0]}$.
178
+
179
+ Le total des élèves se lit à l'intersection de la ligne "Total" et de la colonne "Total" : c'est $${probaFrac[1]}$.
180
+
181
+ La probabilité recherchée vaut donc :
178
182
 
179
183
  $$
180
184
  ${frac(probaFrac[0], probaFrac[1]).toSimplificationTex()}
@@ -195,6 +199,8 @@ $$`;
195
199
  On doit ensuite soustraire la case à l'intersection de la ligne "${unionEvements[0]}" et de la colonne "${unionEvements[1]}", car on l'a compté deux fois dans les totaux. Cela donne $${rowTotal + columnTotal} - ${rowTotal + columnTotal - probaFrac[0]} = ${probaFrac[0]}
196
200
  $.
197
201
 
202
+ Le total des élèves se lit à l'intersection de la ligne "Total" et de la colonne "Total" : c'est $${probaFrac[1]}$.
203
+
198
204
  La probabilité de tomber sur ${event} vaut donc :
199
205
 
200
206
  $$
@@ -207,7 +213,9 @@ $$`;
207
213
  .replace("une", "")
208
214
  .replace("un", "")
209
215
  .trim()}s" : c'est $${probaFrac[0]}$.
210
-
216
+
217
+ Le total des élèves se lit à l'intersection de la ligne "Total" et de la colonne "Total" : c'est $${probaFrac[1]}$.
218
+
211
219
  La probabilité de tomber sur ${event} vaut donc :
212
220
 
213
221
  $$
@@ -1 +1 @@
1
- {"version":3,"file":"averageLinearity.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/averageLinearity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAarC,KAAK,SAAS,GAAG,gBAAgB,GAAG,UAAU,GAAG,cAAc,GAAG,UAAU,CAAC;AAC7E,KAAK,WAAW,GACZ;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB,GACD;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAmON,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAkBlD,CAAC"}
1
+ {"version":3,"file":"averageLinearity.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/averageLinearity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAcrC,KAAK,SAAS,GAAG,gBAAgB,GAAG,UAAU,GAAG,cAAc,GAAG,UAAU,CAAC;AAC7E,KAAK,WAAW,GACZ;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB,GACD;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAmON,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAmBlD,CAAC"}