math-exercises 3.0.126 → 3.0.127

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 (64) hide show
  1. package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.d.ts +1 -1
  2. package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.d.ts.map +1 -1
  3. package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.js +56 -42
  4. package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.d.ts.map +1 -1
  5. package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.js +5 -103
  6. package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.d.ts.map +1 -1
  7. package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.js +22 -8
  8. package/lib/exercises/math/calcul/ordering/compareFracAndDec.d.ts.map +1 -1
  9. package/lib/exercises/math/calcul/ordering/compareFracAndDec.js +7 -6
  10. package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.d.ts.map +1 -1
  11. package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.js +4 -4
  12. package/lib/exercises/math/calculLitteral/equation/equationFromProblem.d.ts.map +1 -1
  13. package/lib/exercises/math/calculLitteral/equation/equationFromProblem.js +57 -17
  14. package/lib/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.d.ts.map +1 -1
  15. package/lib/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.js +6 -27
  16. package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.d.ts.map +1 -1
  17. package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.js +3 -5
  18. package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.js +1 -1
  19. package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.d.ts.map +1 -1
  20. package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.js +69 -23
  21. package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.d.ts +4 -1
  22. package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.d.ts.map +1 -1
  23. package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.js +52 -34
  24. package/lib/exercises/math/conversion/prefixToNumber.d.ts.map +1 -1
  25. package/lib/exercises/math/conversion/prefixToNumber.js +14 -4
  26. package/lib/exercises/math/conversion/secondsToHours.js +1 -1
  27. package/lib/exercises/math/dataRepresentations/barChartInterpreting.d.ts +5 -2
  28. package/lib/exercises/math/dataRepresentations/barChartInterpreting.d.ts.map +1 -1
  29. package/lib/exercises/math/dataRepresentations/barChartInterpreting.js +47 -31
  30. package/lib/exercises/math/dataRepresentations/cartesianGraphExtremaReading.d.ts.map +1 -1
  31. package/lib/exercises/math/dataRepresentations/cartesianGraphExtremaReading.js +5 -4
  32. package/lib/exercises/math/dataRepresentations/dataToGraphGraphToData.js +4 -4
  33. package/lib/exercises/math/dataRepresentations/graphReading.js +13 -13
  34. package/lib/exercises/math/dataRepresentations/histogramReading.d.ts.map +1 -1
  35. package/lib/exercises/math/dataRepresentations/histogramReading.js +32 -32
  36. package/lib/exercises/math/dataRepresentations/plausibleGraph.d.ts.map +1 -1
  37. package/lib/exercises/math/dataRepresentations/plausibleGraph.js +53 -4
  38. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.d.ts.map +1 -1
  39. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.js +17 -3
  40. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.d.ts.map +1 -1
  41. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.js +27 -9
  42. package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.d.ts.map +1 -1
  43. package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.js +33 -16
  44. package/lib/exercises/math/functions/affines/representationOfAffine.d.ts +3 -0
  45. package/lib/exercises/math/functions/affines/representationOfAffine.d.ts.map +1 -1
  46. package/lib/exercises/math/functions/affines/representationOfAffine.js +121 -30
  47. package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.d.ts.map +1 -1
  48. package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.js +29 -10
  49. package/lib/exercises/math/functions/composition/functionComposition.d.ts.map +1 -1
  50. package/lib/exercises/math/functions/composition/functionComposition.js +2 -2
  51. package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.d.ts.map +1 -1
  52. package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.js +24 -9
  53. package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.d.ts.map +1 -1
  54. package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.js +9 -5
  55. package/lib/exercises/math/probaStat/probaAsSumOfProbas.d.ts +0 -1
  56. package/lib/exercises/math/probaStat/probaAsSumOfProbas.d.ts.map +1 -1
  57. package/lib/exercises/math/probaStat/probaAsSumOfProbas.js +13 -14
  58. package/lib/exercises/math/probaStat/stats1var/interpretIndicatorsForLists.d.ts.map +1 -1
  59. package/lib/exercises/math/probaStat/stats1var/interpretIndicatorsForLists.js +2 -3
  60. package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.d.ts.map +1 -1
  61. package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.js +26 -25
  62. package/lib/index.d.ts +10 -5
  63. package/lib/index.d.ts.map +1 -1
  64. package/package.json +1 -1
@@ -1,9 +1,12 @@
1
1
  import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { Point } from "../../../../math/geometry/point.js";
3
4
  import { Affine, AffineConstructor } from "../../../../math/polynomials/affine.js";
4
5
  import { Polynomial } from "../../../../math/polynomials/polynomial.js";
5
6
  import { randint } from "../../../../math/utils/random/randint.js";
6
7
  import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
8
+ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
9
+ import { pointParser } from "../../../../tree/parsers/pointParser.js";
7
10
  const getInstruction = (identifiers) => {
8
11
  const { xValue, coeffs } = identifiers;
9
12
  const affine = AffineConstructor.fromCoeffs(coeffs);
@@ -15,11 +18,15 @@ $$
15
18
 
16
19
  Quelles sont les coordonnées de $M$ ?`;
17
20
  };
18
- const getAnswer = (identifiers) => {
21
+ const getAnswerPoint = (identifiers) => {
19
22
  const { xValue, coeffs } = identifiers;
20
23
  const polynome = AffineConstructor.fromCoeffs(coeffs);
21
24
  const yValue = polynome.calculate(xValue);
22
- const answer = `(${xValue.frenchify()};${yValue.frenchify()})`;
25
+ return new Point("A", xValue, yValue);
26
+ };
27
+ const getAnswer = (identifiers) => {
28
+ const answerPoint = getAnswerPoint(identifiers);
29
+ const answer = `(${answerPoint.x.toTex()};${answerPoint.y.toTex()})`;
23
30
  return answer;
24
31
  };
25
32
  const getHint = (identifiers) => {
@@ -61,12 +68,22 @@ const getPropositions = (n, { answer, coeffs, xValue }) => {
61
68
  const propositions = [];
62
69
  addValidProp(propositions, answer);
63
70
  const poly = AffineConstructor.fromCoeffs(coeffs);
64
- tryToAddWrongProp(propositions, `(${m.frenchify()}, ${p.frenchify()})`);
65
- tryToAddWrongProp(propositions, `(${p.frenchify()}, ${m.frenchify()})`);
66
- tryToAddWrongProp(propositions, `(${xValue.frenchify()}, ${multiply(m, xValue).simplify().toTex()})`);
67
- tryToAddWrongProp(propositions, `(${xValue.frenchify()}, ${poly.calculate(1).frenchify()})`);
71
+ tryToAddWrongProp(propositions, `(${m.frenchify()};${p.frenchify()})`);
72
+ tryToAddWrongProp(propositions, `(${p.frenchify()};${m.frenchify()})`);
73
+ tryToAddWrongProp(propositions, `(${xValue.frenchify()};${multiply(m, xValue).simplify().toTex()})`);
74
+ tryToAddWrongProp(propositions, `(${xValue.frenchify()};${poly.calculate(1).frenchify()})`);
68
75
  return shuffleProps(propositions, n);
69
76
  };
77
+ const isAnswerValid = (ans, { answer, ...identifiers }) => {
78
+ const pointAns = pointParser(ans);
79
+ if (!pointAns)
80
+ return false;
81
+ const pointAnswer = getAnswerPoint(identifiers);
82
+ return [
83
+ [pointAns.x, pointAnswer.x],
84
+ [pointAns.y, pointAnswer.y],
85
+ ].every(([ansNode, answerNode]) => substract(ansNode, answerNode).simplify().evaluate() === 0);
86
+ };
70
87
  const getCoordsOfPointOnAffineFindYQuestion = () => {
71
88
  const polynome1 = new Polynomial([randint(-9, 10), randint(-5, 6, [0])]);
72
89
  const xValue = randint(-9, 10);
@@ -77,7 +94,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
77
94
  const question = {
78
95
  instruction: getInstruction(identifiers),
79
96
  answer: getAnswer(identifiers),
80
- keys: [],
97
+ keys: ["semicolon"],
81
98
  answerFormat: "tex",
82
99
  identifiers,
83
100
  hint: getHint(identifiers),
@@ -87,10 +104,11 @@ const getQuestionFromIdentifiers = (identifiers) => {
87
104
  };
88
105
  export const coordsOfPointOnAffineFindY = {
89
106
  id: "coordsOfPointOnAffineFindY",
90
- getPropositions,
91
- label: "Déterminer les coordonnées d'un point appartenant à une courbe et dont on connaît l'abscisse",
107
+ label: "Déterminer les coordonnées d'un point appartenant à une droite et dont on connaît l'abscisse",
92
108
  isSingleStep: true,
93
109
  generator: (nb) => getDistinctQuestions(getCoordsOfPointOnAffineFindYQuestion, nb),
110
+ getPropositions,
111
+ isAnswerValid,
94
112
  qcmTimer: 60,
95
113
  freeTimer: 60,
96
114
  subject: "Mathématiques",
@@ -1 +1 @@
1
- {"version":3,"file":"drawAffineFromProgCalc.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/drawAffineFromProgCalc.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAEL,mBAAmB,EAEpB,MAAM,iCAAiC,CAAC;AAMzC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,mBAAmB,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAgNF,KAAK,OAAO,GAAG;IACb,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC5B,oBAAoB,EAAE,OAAO,CAAC;CAC/B,CAAC;AAwBF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAmBjE,CAAC"}
1
+ {"version":3,"file":"drawAffineFromProgCalc.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/drawAffineFromProgCalc.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAEL,mBAAmB,EAEpB,MAAM,iCAAiC,CAAC;AAOzC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,mBAAmB,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AA+NF,KAAK,OAAO,GAAG;IACb,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC5B,oBAAoB,EAAE,OAAO,CAAC;CAC/B,CAAC;AAwBF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAmBjE,CAAC"}
@@ -17,9 +17,8 @@ const getInstruction = (identifiers) => {
17
17
  const progCalc = ProgCalcConstructor.fromIdentifiers(progCalcIds);
18
18
  return `La fonction $ ${funcName} $ est définie par le programme de calcul suivant :
19
19
 
20
- ${progCalc.getArrOfFrenchStrings().map((str) => `
21
-
22
- ${str}
20
+ ${progCalc.getArrOfFrenchStrings().map((str) => `> ${str}`).join(`
21
+
23
22
  `)}
24
23
 
25
24
  Dans le repère, tracer la représentation de la fonction $ ${funcName} $.`;
@@ -35,23 +34,41 @@ Le point de coordonnées $ (x;${funcName}(x)) $ appartient à la droite qu'il fa
35
34
  `;
36
35
  };
37
36
  const getCorrection = (identifiers) => {
38
- const { progCalcIds, funcName } = identifiers;
37
+ const { funcName, progCalcIds } = identifiers;
39
38
  const progCalc = ProgCalcConstructor.fromIdentifiers(progCalcIds);
40
- const xA = 0;
41
- const yA = progCalc.apply(xA.toTree()).evaluate();
42
- const xB = 1;
43
- const yB = progCalc.apply(xB.toTree()).evaluate();
44
- return `
45
- Toutes les fonctions dans le programme de calcul sont des fonctions affines,
46
- la fonction $ ${funcName} $ est donc une fonction affine. On va donc tracer une droite.
39
+ const nodeProgCalc = progCalc.toTree("x".toTree());
40
+ const nodeXA = (0).toTree();
41
+ const nodeYA = progCalc.apply(nodeXA).simplify();
42
+ const nodeXB = (1).toTree();
43
+ const nodeYB = progCalc.apply(nodeXB).simplify();
44
+ return `Si on exécute le programme de calcul avec $x$, on obtient:
45
+
46
+ $$
47
+ ${funcName}(x) =
48
+ ${nodeProgCalc.toTex({
49
+ allowMinusAnywhereInFraction: true,
50
+ allowDoubleMinus: true,
51
+ forceTimesSign: true,
52
+ forceParenthesis: true,
53
+ })} = ${nodeProgCalc
54
+ .simplify({
55
+ forbidFactorize: true,
56
+ towardsDistribute: true,
57
+ forceDistributeFractions: true,
58
+ })
59
+ .toTex()}
60
+ $$
61
+
62
+ On reconnaît l'expression d'une fonction affine.
63
+ On va donc tracer une droite.
47
64
 
48
- Si on exécute le programme de calcul avec la valeur $ ${xA} $, on obtient $ ${yA} $.
49
- La droite passe donc par le point de coordonnées $(${xA};${yA})$.
65
+ Si on exécute le programme de calcul avec la valeur $ ${nodeXA.toTex()} $, on obtient $ ${nodeYA.toTex()} $.
66
+ La droite passe donc par le point de coordonnées $(${nodeXA.toTex()};${nodeYA.toTex()})$.
50
67
 
51
- Si on exécute le programme de calcul avec la valeur $ ${xB} $, on obtient $ ${yB} $.
52
- La droite passe donc par le point de coordonnées $(${xB};${yB})$.
68
+ Si on exécute le programme de calcul avec la valeur $ ${nodeXB.toTex()} $, on obtient $ ${nodeYB.toTex()} $.
69
+ La droite passe donc par le point de coordonnées $(${nodeXB.toTex()};${nodeYB.toTex()})$.
53
70
 
54
- On place donc les deux points de coordonnées $(${xA};${yA})$ et $(${xB};${yB})$,
71
+ On place donc les deux points de coordonnées $(${nodeXA.toTex()};${nodeYA.toTex()})$ et $(${nodeXB.toTex()};${nodeYB.toTex()})$,
55
72
  puis on trace la droite passant par ces deux points.
56
73
  `;
57
74
  };
@@ -1,7 +1,10 @@
1
1
  import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { PointIdentifiers } from "../../../../math/geometry/point.js";
2
3
  type Item = {
3
4
  tex: string;
4
5
  isValid: boolean;
6
+ point?: PointIdentifiers | undefined;
7
+ isPointValid?: boolean;
5
8
  };
6
9
  type Identifiers = {
7
10
  fName: string;
@@ -1 +1 @@
1
- {"version":3,"file":"representationOfAffine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/representationOfAffine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,IAAI,GAAG;IACV,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,IAAI,EAAE,CAAC;CACf,CAAC;AAwOF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAexD,CAAC"}
1
+ {"version":3,"file":"representationOfAffine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/representationOfAffine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAWtC,KAAK,IAAI,GAAG;IACV,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;IACrC,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,IAAI,EAAE,CAAC;CACf,CAAC;AAmWF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAexD,CAAC"}
@@ -1,9 +1,11 @@
1
1
  import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { Point, PointConstructor, } from "../../../../math/geometry/point.js";
3
4
  import { AffineConstructor } from "../../../../math/polynomials/affine.js";
4
5
  import { randint } from "../../../../math/utils/random/randint.js";
5
6
  import { add } from "../../../../tree/nodes/operators/addNode.js";
6
7
  import { substract } from "../../../../tree/nodes/operators/substractNode.js";
8
+ import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
7
9
  import { coinFlip } from "../../../../utils/alea/coinFlip.js";
8
10
  import { random } from "../../../../utils/alea/random.js";
9
11
  import { shuffle } from "../../../../utils/alea/shuffle.js";
@@ -18,36 +20,83 @@ const primordialRightsAndWrongs = {
18
20
  `une fonction affine`,
19
21
  ],
20
22
  };
21
- const createRightsAndWrongs = (validSuffixFunc, invalidSuffixFuncs) => {
23
+ const createRightsAndWrongs = (validSuffixObj, invalidSuffixObjs) => {
22
24
  return {
23
- rights: primordialRightsAndWrongs.rights.map((rightStr) => (pointName) => validSuffixFunc(rightStr, pointName)),
25
+ rights: primordialRightsAndWrongs.rights.map((rightStr) => (pointName) => {
26
+ const point = validSuffixObj.nodeX &&
27
+ validSuffixObj.nodeY &&
28
+ new Point(pointName, validSuffixObj.nodeX, validSuffixObj.nodeY);
29
+ return {
30
+ str: validSuffixObj.suffixFunc(rightStr, pointName),
31
+ point,
32
+ isPointValid: point ? true : undefined,
33
+ };
34
+ }),
24
35
  wrongs: [
25
- ...primordialRightsAndWrongs.wrongs.map((wrongStr) => (pointName) => validSuffixFunc(wrongStr, pointName)),
26
- ...invalidSuffixFuncs.flatMap((invalidSuffixFunc) => primordialRightsAndWrongs.rights.map((rightStr) => (pointName) => invalidSuffixFunc(rightStr, pointName))),
36
+ ...primordialRightsAndWrongs.wrongs.map((wrongStr) => (pointName) => {
37
+ const point = validSuffixObj.nodeX &&
38
+ validSuffixObj.nodeY &&
39
+ new Point(pointName, validSuffixObj.nodeX, validSuffixObj.nodeY);
40
+ return {
41
+ str: validSuffixObj.suffixFunc(wrongStr, pointName),
42
+ point,
43
+ isPointValid: point ? true : undefined,
44
+ };
45
+ }),
46
+ ...invalidSuffixObjs.flatMap((invalidSuffixObj) => primordialRightsAndWrongs.rights.map((rightStr) => (pointName) => {
47
+ const point = invalidSuffixObj.nodeX &&
48
+ invalidSuffixObj.nodeY &&
49
+ new Point(pointName, invalidSuffixObj.nodeX, invalidSuffixObj.nodeY);
50
+ return {
51
+ str: invalidSuffixObj.suffixFunc(rightStr, pointName),
52
+ point,
53
+ isPointValid: point ? false : undefined,
54
+ };
55
+ })),
27
56
  ],
28
57
  };
29
58
  };
59
+ const nodeBySubstitutingX = (node, strVar) => {
60
+ return parseAlgebraic(node.toTex().replaceAll("x", `({${strVar}})`));
61
+ };
62
+ const calculateWithNode = (f, nodeX) => {
63
+ return nodeBySubstitutingX(f.toTree(), nodeX.toTex()).simplify();
64
+ };
30
65
  const createArrayOfRightsAndWrongs = (f) => {
31
- function createRightAndWrongsCoords(f, x) {
32
- const yR = f.calculate(x);
33
- const yWs = [
34
- f.a,
35
- f.b,
36
- add(f.a, f.b).evaluate(),
37
- substract(f.a, f.b).evaluate(),
38
- ].filter((yW) => yW !== yR);
66
+ function createRightAndWrongsCoords(f, nodeX) {
67
+ const nodeYR = calculateWithNode(f, nodeX);
68
+ const nodeYWs = [
69
+ f.a.toTree(),
70
+ f.b.toTree(),
71
+ add(f.a, f.b),
72
+ substract(f.a, f.b),
73
+ ].filter((yW) => substract(yW, nodeYR).evaluate() !== 0);
39
74
  return {
40
- right: [x, yR],
41
- wrongs: yWs.map((yW) => [x, yW]),
75
+ right: [nodeX, nodeYR],
76
+ wrongs: nodeYWs.map((nodeYW) => [nodeX, nodeYW]),
42
77
  };
43
78
  }
44
- const coordObjects = [-1, 0, 1].map((x) => createRightAndWrongsCoords(f, x));
45
- const strFunc = (str, pointName, x, y) => `${str} qui passe par $${pointName}(${x.frenchify()};${y.frenchify()})$`;
79
+ const coordObjects = [-1, 0, 1]
80
+ .map((x) => x.toTree())
81
+ .map((nodeX) => createRightAndWrongsCoords(f, nodeX));
82
+ const strFunc = (str, pointName, nodeX, nodeY) => `${str} qui passe par $${pointName}(${nodeX.simplify().toTex()};${nodeY
83
+ .simplify()
84
+ .toTex()})$`;
46
85
  return [
47
- createRightsAndWrongs((str) => `${str}`, []),
48
- ...coordObjects.flatMap((coordObject) => {
49
- return createRightsAndWrongs((str, pointName) => strFunc(str, pointName, coordObject.right[0], coordObject.right[1]), coordObject.wrongs.map(([x, y]) => (str, pointName) => strFunc(str, pointName, x, y)));
50
- }),
86
+ createRightsAndWrongs({
87
+ suffixFunc: (str) => `${str}`,
88
+ }, []),
89
+ ...coordObjects.flatMap((coordObject) => createRightsAndWrongs({
90
+ suffixFunc: (str, pointName) => strFunc(str, pointName, coordObject.right[0], coordObject.right[1]),
91
+ nodeX: coordObject.right[0],
92
+ nodeY: coordObject.right[1],
93
+ }, coordObject.wrongs.map(([nodeX, nodeY]) => {
94
+ return {
95
+ suffixFunc: (str, pointName) => strFunc(str, pointName, nodeX, nodeY),
96
+ nodeX,
97
+ nodeY,
98
+ };
99
+ }))),
51
100
  ];
52
101
  };
53
102
  const getInstruction = (identifiers) => {
@@ -65,20 +114,60 @@ const getHint = () => {
65
114
  return `Les fonctions affines et linéaires sont représentées par des droites.`;
66
115
  };
67
116
  const getCorrection = (identifiers) => {
68
- const { fName } = identifiers;
117
+ const { fName, items, coeffs } = identifiers;
118
+ const affine = AffineConstructor.fromCoeffs(coeffs);
69
119
  const abstractFName = ["f", "g", "h"].find((letter) => letter !== fName);
70
- return `Une fonction affine $${abstractFName}$ est de la forme
71
-
120
+ return `Une fonction affine $${abstractFName}$ est de la forme
121
+
72
122
  $$
73
123
  ${abstractFName}(x)=mx+p
74
124
  $$
75
125
 
76
- Sa représentation graphique est donc une droite qui passe, entre autres, par le point de coordonnées $(1;m+p)$ car
126
+ Sa représentation graphique est une droite.
127
+
128
+ $\\ $
129
+
130
+ ${items
131
+ .filter((item) => item.isValid && item.point && item.isPointValid)
132
+ .map((item) => {
133
+ const point = PointConstructor.fromIdentifiers(item.point);
134
+ const applyNode = nodeBySubstitutingX(affine.toTree(), point.x.toTex());
135
+ const texRaw = applyNode.toTex();
136
+ const texSimplified = applyNode.simplify().toTex();
137
+ return `On a :
138
+
139
+ $$
140
+ ${fName}(${point.x.toTex()}) = ${texRaw} = ${texSimplified}
141
+ $$
142
+
143
+ Donc elle passe par le point $${point.name}(${point.x.toTex()},${point.y.toTex()})$.`;
144
+ }).join(`
145
+
146
+ $\\ $
147
+
148
+ `)}
149
+
150
+ $\\ $
151
+
152
+ ${items
153
+ .filter((item) => !item.isValid && item.point && !item.isPointValid)
154
+ .map((item) => {
155
+ const point = PointConstructor.fromIdentifiers(item.point);
156
+ const applyNode = nodeBySubstitutingX(affine.toTree(), point.x.toTex());
157
+ const texRaw = applyNode.toTex();
158
+ const texSimplified = applyNode.simplify().toTex();
159
+ return `On a :
77
160
 
78
161
  $$
79
- ${abstractFName}(1)=m+p
162
+ ${fName}(${point.x.toTex()}) = ${texRaw} = ${texSimplified} \\neq ${point.y.toTex()}
80
163
  $$
81
- `;
164
+
165
+ Donc le point $${point.name}(${point.x.toTex()},${point.y.toTex()})$ n'appartient pas à la droite représentant $${fName}$.`;
166
+ }).join(`
167
+
168
+ $\\ $
169
+
170
+ `)}`;
82
171
  };
83
172
  const getPropositions = (_, { answer, ...idenfitiers }) => {
84
173
  const { items } = idenfitiers;
@@ -112,7 +201,7 @@ const getRepresentationOfAffineQuestion = () => {
112
201
  const index = random(allIndexes.filter((index) => !previouslyPickedIndexes.includes(index)));
113
202
  if (rightsAndWrongs[index].rights.length > 0) {
114
203
  return {
115
- texFunc: random(rightsAndWrongs[index].rights),
204
+ objFunc: random(rightsAndWrongs[index].rights),
116
205
  index,
117
206
  };
118
207
  }
@@ -129,7 +218,7 @@ const getRepresentationOfAffineQuestion = () => {
129
218
  const index = random(indexArray);
130
219
  if (rightsAndWrongs[index].wrongs.length > 0) {
131
220
  return {
132
- texFunc: random(rightsAndWrongs[index].wrongs),
221
+ objFunc: random(rightsAndWrongs[index].wrongs),
133
222
  index,
134
223
  };
135
224
  }
@@ -146,11 +235,13 @@ const getRepresentationOfAffineQuestion = () => {
146
235
  ? getRightTexFunc(previouslyPickedIndexes)
147
236
  : getWrongTexFunc(previouslyPickedIndexes);
148
237
  } while (!pick);
149
- const tex = pick.texFunc(pointName);
238
+ const obj = pick.objFunc(pointName);
150
239
  previouslyPickedIndexes.push(pick.index);
151
240
  const item = {
152
- tex,
241
+ tex: obj.str,
153
242
  isValid,
243
+ point: obj.point?.toIdentifiers(),
244
+ isPointValid: obj.isPointValid,
154
245
  };
155
246
  return item;
156
247
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"coordsOfPointOnCurveFindY.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/coordsOfPointOnCurveFindY.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAc7C,KAAK,gBAAgB,GACjB,QAAQ,GACR,QAAQ,GACR,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,WAAW,GACX,iBAAiB,CAAC;AAEtB,KAAK,YAAY,GAAG;IAClB,IAAI,EAAE,gBAAgB,CAAC;IACvB,OAAO,EAAE,eAAe,CAAC;CAC1B,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,YAAY,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAsRF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAc3D,CAAC"}
1
+ {"version":3,"file":"coordsOfPointOnCurveFindY.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/coordsOfPointOnCurveFindY.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAe7C,KAAK,gBAAgB,GACjB,QAAQ,GACR,QAAQ,GACR,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,WAAW,GACX,iBAAiB,CAAC;AAEtB,KAAK,YAAY,GAAG;IAClB,IAAI,EAAE,gBAAgB,CAAC;IACvB,OAAO,EAAE,eAAe,CAAC;CAC1B,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,YAAY,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA0SF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAe3D,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { Point } from "../../../../math/geometry/point.js";
3
4
  import { Polynomial } from "../../../../math/polynomials/polynomial.js";
4
5
  import { randint } from "../../../../math/utils/random/randint.js";
5
6
  import { NodeConstructor, } from "../../../../tree/nodes/nodeConstructor.js";
@@ -10,6 +11,7 @@ import { isOperatorNode, OperatorIds, } from "../../../../tree/nodes/operators/o
10
11
  import { power } from "../../../../tree/nodes/operators/powerNode.js";
11
12
  import { substract } from "../../../../tree/nodes/operators/substractNode.js";
12
13
  import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
14
+ import { pointParser } from "../../../../tree/parsers/pointParser.js";
13
15
  import { coinFlip } from "../../../../utils/alea/coinFlip.js";
14
16
  import { random } from "../../../../utils/alea/random.js";
15
17
  const nodeByReplacingOperations = (node, replacementDict) => {
@@ -50,13 +52,15 @@ $$
50
52
 
51
53
  Quelles sont les coordonnées de $M$ ?`;
52
54
  };
53
- const getAnswer = (identifiers) => {
55
+ const getAnswerPoint = (identifiers) => {
54
56
  const { xValue, questionFunc } = identifiers;
55
57
  const node = NodeConstructor.fromIdentifiers(questionFunc.nodeIds);
56
58
  const nodeWithXValue = nodeBySubstitutingX(node, `(${xValue})`);
57
- const answer = `(${xValue.frenchify()};${nodeWithXValue
58
- .simplify({ calculatePowers: true })
59
- .toTex()})`;
59
+ return new Point("A", xValue.toTree(), nodeWithXValue.simplify({ calculatePowers: true }));
60
+ };
61
+ const getAnswer = (identifiers) => {
62
+ const answerPoint = getAnswerPoint(identifiers);
63
+ const answer = `(${answerPoint.x.toTex()};${answerPoint.y.toTex()})`;
60
64
  return answer;
61
65
  };
62
66
  const getHint = (identifiers) => {
@@ -138,6 +142,16 @@ const getPropositions = (n, { answer, questionFunc, xValue }) => {
138
142
  }
139
143
  return shuffleProps(propositions, n);
140
144
  };
145
+ const isAnswerValid = (ans, { answer, ...identifiers }) => {
146
+ const pointAns = pointParser(ans);
147
+ if (!pointAns)
148
+ return false;
149
+ const pointAnswer = getAnswerPoint(identifiers);
150
+ return [
151
+ [pointAns.x, pointAnswer.x],
152
+ [pointAns.y, pointAnswer.y],
153
+ ].every(([ansNode, answerNode]) => substract(ansNode, answerNode).simplify().evaluate() === 0);
154
+ };
141
155
  const getCoordsOfPointOnAffineFindYQuestion = () => {
142
156
  const xValue = randint(-9, 10);
143
157
  const questionFunc = random([
@@ -164,15 +178,15 @@ const getCoordsOfPointOnAffineFindYQuestion = () => {
164
178
  },
165
179
  {
166
180
  type: "(x-...)(x-...)",
167
- nodeIds: multiply(substract("x", randint(-3, 4, [xValue])), substract("x", randint(-3, 4, [0, xValue]))).toIdentifiers(),
181
+ nodeIds: multiply(substract("x", randint(-3, 4, [0, xValue])), substract("x", randint(-3, 4, [0, xValue]))).toIdentifiers(),
168
182
  },
169
183
  {
170
184
  type: "(x+...)(x-...)",
171
- nodeIds: multiply(add("x", randint(-3, 4, [-xValue])), substract("x", randint(-3, 4, [0, xValue]))).toIdentifiers(),
185
+ nodeIds: multiply(add("x", randint(-3, 4, [0, -xValue])), substract("x", randint(-3, 4, [0, xValue]))).toIdentifiers(),
172
186
  },
173
187
  {
174
188
  type: "(x+...)(x+...)",
175
- nodeIds: multiply(add("x", randint(-3, 4, [-xValue])), add("x", randint(-3, 4, [0, -xValue]))).toIdentifiers(),
189
+ nodeIds: multiply(add("x", randint(-3, 4, [0, -xValue])), add("x", randint(-3, 4, [0, -xValue]))).toIdentifiers(),
176
190
  },
177
191
  {
178
192
  type: "a/(x+...)",
@@ -180,7 +194,11 @@ const getCoordsOfPointOnAffineFindYQuestion = () => {
180
194
  },
181
195
  {
182
196
  type: "(x+...)/(x+...)",
183
- nodeIds: frac(add("x", randint(-3, 4)), add("x", randint(-3, 4, [0, -xValue]))).toIdentifiers(),
197
+ nodeIds: (() => {
198
+ const a = randint(-3, 4, [0]);
199
+ const b = randint(-3, 4, [0, -xValue, a]);
200
+ return frac(add("x", a), add("x", b)).toIdentifiers();
201
+ })(),
184
202
  },
185
203
  ]);
186
204
  const identifiers = {
@@ -193,7 +211,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
193
211
  const question = {
194
212
  instruction: getInstruction(identifiers),
195
213
  answer: getAnswer(identifiers),
196
- keys: [],
214
+ keys: ["semicolon"],
197
215
  answerFormat: "tex",
198
216
  identifiers,
199
217
  hint: getHint(identifiers),
@@ -203,10 +221,11 @@ const getQuestionFromIdentifiers = (identifiers) => {
203
221
  };
204
222
  export const coordsOfPointOnCurveFindY = {
205
223
  id: "coordsOfPointOnCurveFindY",
206
- getPropositions,
207
224
  label: "Déterminer les coordonnées d'un point appartenant à une courbe et dont on connaît l'abscisse",
208
225
  isSingleStep: true,
209
226
  generator: (nb) => getDistinctQuestions(getCoordsOfPointOnAffineFindYQuestion, nb),
227
+ getPropositions,
228
+ isAnswerValid,
210
229
  qcmTimer: 60,
211
230
  freeTimer: 60,
212
231
  subject: "Mathématiques",
@@ -1 +1 @@
1
- {"version":3,"file":"functionComposition.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/composition/functionComposition.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAQrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA+D7C,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B,CAAC;AA+NF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAiBrD,CAAC"}
1
+ {"version":3,"file":"functionComposition.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/composition/functionComposition.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA+D7C,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B,CAAC;AA8NF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAiBrD,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { realize } from "../../../../math/utils/latex/realize.js";
4
+ import { randint } from "../../../../math/utils/random/randint.js";
4
5
  import { isFunctionNode, } from "../../../../tree/nodes/functions/functionNode.js";
5
6
  import { NodeConstructor, } from "../../../../tree/nodes/nodeConstructor.js";
6
7
  // import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
@@ -186,9 +187,8 @@ const getFunctionCompositionQuestion = (_) => {
186
187
  function getRandomNode() {
187
188
  return random([
188
189
  ...[
189
- `x`,
190
190
  realize({ a: "I" })(`x+a`),
191
- realize({ a: "I" })(`ax`),
191
+ realize({ a: { custom: () => randint(2, 10).toTree() } })(`ax`),
192
192
  realize({ a: "I", b: "I" })(`ax+b`),
193
193
  realize({ a: "I", b: "I" })(`(ax+b)^2`),
194
194
  realize({ a: "RI", b: "RI" })(`(x+a)(x+b)`),
@@ -1 +1 @@
1
- {"version":3,"file":"possibleValuesForProba.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/basicProbas/possibleValuesForProba.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAUrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAW7C,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,eAAe,EAAE,CAAC;IAClC,qBAAqB,EAAE,OAAO,CAAC;CAChC,CAAC;AA2EF,KAAK,OAAO,GAAG;IACb,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAwMF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgBjE,CAAC"}
1
+ {"version":3,"file":"possibleValuesForProba.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/basicProbas/possibleValuesForProba.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAUrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAW7C,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,eAAe,EAAE,CAAC;IAClC,qBAAqB,EAAE,OAAO,CAAC;CAChC,CAAC;AA2EF,KAAK,OAAO,GAAG;IACb,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAuNF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgBjE,CAAC"}
@@ -19,10 +19,10 @@ import { random } from "../../../../utils/alea/random.js";
19
19
  import { shuffle } from "../../../../utils/alea/shuffle.js";
20
20
  const getInstruction = (identifiers) => {
21
21
  const { isFilterPossibleProba } = identifiers;
22
- return `Parmi les valeurs de la liste ci-dessous, donner celles qui sont des valeurs ${isFilterPossibleProba ? "possibles" : "impossibles"} pour une probabilité.`;
22
+ return `Parmi les valeurs de la liste ci-dessous, donner celles qui sont des valeurs ${isFilterPossibleProba ? "**possibles**" : "**impossibles**"} pour une probabilité.`;
23
23
  };
24
24
  const getHint = () => {
25
- return "Une probabilité est toujours comprise entre $0\\%$ et $100\\%$.";
25
+ return "Une probabilité est un nombre compris entre $0$ et $1$.";
26
26
  };
27
27
  const getCorrection = (identifiers) => {
28
28
  const { arrayOfNodeIds, isFilterPossibleProba } = identifiers;
@@ -69,7 +69,14 @@ const getPropositions = (_, { answer, ...identifiers }) => {
69
69
  return propositions;
70
70
  };
71
71
  const optsDefault = {
72
- numberTypes: ["Entier", "Décimal", "Fraction", "Puiss10", "Sci", "Réel"],
72
+ numberTypes: [
73
+ "Entier",
74
+ "Décimal",
75
+ "Fraction",
76
+ "Puissance de 10",
77
+ "Écriture scientifique",
78
+ "Réel",
79
+ ],
73
80
  };
74
81
  const options = [
75
82
  {
@@ -77,7 +84,14 @@ const options = [
77
84
  label: "Types de nombres",
78
85
  type: GeneratorOptionType.multiselect,
79
86
  target: GeneratorOptionTarget.generation,
80
- values: ["Entier", "Décimal", "Fraction", "Puiss10", "Sci", "Réel"],
87
+ values: [
88
+ "Entier",
89
+ "Décimal",
90
+ "Fraction",
91
+ "Puissance de 10",
92
+ "Écriture scientifique",
93
+ "Réel",
94
+ ],
81
95
  defaultValue: optsDefault.numberTypes,
82
96
  },
83
97
  ];
@@ -98,9 +112,9 @@ const createRandomNode = (numberType, isPossibleProba) => {
98
112
  return frac(num, den);
99
113
  }
100
114
  }
101
- case "Puiss10":
115
+ case "Puissance de 10":
102
116
  return power(10, randint(-15, 1));
103
- case "Sci":
117
+ case "Écriture scientifique":
104
118
  if (probaFlip(0.7)) {
105
119
  return multiply(randfloat(1, 10, randint(1, 5)), power(10, randint(-15, 0)));
106
120
  }
@@ -142,9 +156,9 @@ const createRandomNode = (numberType, isPossibleProba) => {
142
156
  return frac(num, den);
143
157
  }
144
158
  }
145
- case "Puiss10":
159
+ case "Puissance de 10":
146
160
  return power(10, randint(1, 15));
147
- case "Sci":
161
+ case "Écriture scientifique":
148
162
  if (probaFlip(0.7)) {
149
163
  return coinFlip()
150
164
  ? multiply(randfloat(1, 10, randint(1, 5), [1]), power(10, randint(0, 15)))
@@ -175,10 +189,11 @@ const getPossibleValuesForProbaQuestion = (optsIn) => {
175
189
  //create numberType list
176
190
  const dictNumberTypeToPriority = {
177
191
  Entier: 1,
178
- Puiss10: 2,
192
+ "Puissance de 10": 2,
179
193
  Décimal: 3,
180
194
  Fraction: 4,
181
195
  Réel: 5,
196
+ "Écriture scientifique": 6,
182
197
  };
183
198
  let arrNumberType = [...opts.numberTypes];
184
199
  //filler
@@ -1 +1 @@
1
- {"version":3,"file":"conditionalProbaWriteFromFrench.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/conditionalProbaWriteFromFrench.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAcT,MAAM,mBAAmB,CAAC;AAK3B,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AA0QF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAejE,CAAC"}
1
+ {"version":3,"file":"conditionalProbaWriteFromFrench.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/conditionalProbaWriteFromFrench.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAcT,MAAM,mBAAmB,CAAC;AAK3B,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AA8QF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAejE,CAAC"}
@@ -108,9 +108,13 @@ const getInstruction = (identifiers) => {
108
108
  let instruction = `${situation.context}`;
109
109
  instruction += `
110
110
 
111
- Soit A l'évenement : "${situation.strA}".
111
+ Soit $A$ l'évenement :
112
112
 
113
- Soit B l'évenement : "${situation.strB}".`;
113
+ > ${situation.strA}
114
+
115
+ Soit $B$ l'évenement :
116
+
117
+ > ${situation.strB}`;
114
118
  instruction += `
115
119
 
116
120
  Écris en langage mathématique :
@@ -179,9 +183,9 @@ const getQuestionFromIdentifiers = (identifiers) => {
179
183
  const getPropositions = (n, { answer }) => {
180
184
  const propositions = [];
181
185
  addValidProp(propositions, answer);
182
- tryToAddWrongProp(propositions, `P(A\\cap B)`, "tex");
183
- tryToAddWrongProp(propositions, `P_A(B)`, "tex");
184
- tryToAddWrongProp(propositions, `P_B(A)`, "tex");
186
+ tryToAddWrongProp(propositions, `P\\left(A\\cap B\\right)`, "tex");
187
+ tryToAddWrongProp(propositions, `P_A\\left(B\\right)`, "tex");
188
+ tryToAddWrongProp(propositions, `P_B\\left(A\\right)`, "tex");
185
189
  tryToAddWrongProp(propositions, `P(A)`, "tex");
186
190
  tryToAddWrongProp(propositions, `P(B)`, "tex");
187
191
  return shuffleProps(propositions, n);