math-exercises 3.0.175 → 3.0.177

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 (97) hide show
  1. package/lib/exercises/exercise.d.ts +9 -0
  2. package/lib/exercises/exercise.d.ts.map +1 -1
  3. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.d.ts.map +1 -1
  4. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.js +58 -1
  5. package/lib/exercises/math/probaStat/index.d.ts +1 -1
  6. package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
  7. package/lib/exercises/math/probaStat/index.js +1 -2
  8. package/lib/exercises/math/probaStat/randomVariable/decideWhichGameIsLessRisky.d.ts.map +1 -1
  9. package/lib/exercises/math/probaStat/randomVariable/decideWhichGameIsLessRisky.js +0 -1
  10. package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.d.ts +0 -7
  11. package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.d.ts.map +1 -1
  12. package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.js +154 -125
  13. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationAverage.d.ts +2 -2
  14. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationAverage.d.ts.map +1 -1
  15. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationComputeProbability.d.ts +2 -2
  16. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationComputeProbability.d.ts.map +1 -1
  17. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationIsGameFavorable.d.ts +2 -2
  18. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationIsGameFavorable.d.ts.map +1 -1
  19. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.d.ts +2 -2
  20. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.d.ts.map +1 -1
  21. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.js +1 -1
  22. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationStandardDeviation.d.ts +2 -2
  23. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationStandardDeviation.d.ts.map +1 -1
  24. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationValues.d.ts +2 -2
  25. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationValues.d.ts.map +1 -1
  26. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationVariance.d.ts +2 -2
  27. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationVariance.d.ts.map +1 -1
  28. package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.d.ts +3 -3
  29. package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.d.ts.map +1 -1
  30. package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.js +1 -1
  31. package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.d.ts +6 -0
  32. package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.d.ts.map +1 -1
  33. package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.js +199 -68
  34. package/lib/exercises/math/probaStat/trees/fillProbaTreeWithComplementaryProbabilities.js +12 -12
  35. package/lib/exercises/math/probaStat/trees/index.d.ts +1 -1
  36. package/lib/exercises/math/probaStat/trees/index.d.ts.map +1 -1
  37. package/lib/exercises/math/probaStat/trees/index.js +10 -1
  38. package/lib/exercises/math/probaStat/trees/probaTreeSituationTotalProbaFormula.d.ts +2 -0
  39. package/lib/exercises/math/probaStat/trees/probaTreeSituationTotalProbaFormula.d.ts.map +1 -0
  40. package/lib/exercises/math/probaStat/trees/probaTreeSituationTotalProbaFormula.js +80 -0
  41. package/lib/exercises/math/probaStat/trees/probaTreeSituations.d.ts +60 -0
  42. package/lib/exercises/math/probaStat/trees/probaTreeSituations.d.ts.map +1 -1
  43. package/lib/exercises/math/probaStat/trees/probaTreeSituations.js +344 -108
  44. package/lib/exercises/math/probaStat/trees/probabilityTree.d.ts +3 -9
  45. package/lib/exercises/math/probaStat/trees/probabilityTree.d.ts.map +1 -1
  46. package/lib/exercises/math/probaStat/trees/probabilityTree.js +45 -419
  47. package/lib/exercises/math/probaStat/trees/probabilityTreeV2.d.ts +25 -0
  48. package/lib/exercises/math/probaStat/trees/probabilityTreeV2.d.ts.map +1 -0
  49. package/lib/exercises/math/probaStat/trees/probabilityTreeV2.js +625 -0
  50. package/lib/exercises/math/probaStat/trees/treeInInstruction.js +10 -10
  51. package/lib/exercises/math/sequences/limits/index.d.ts +1 -1
  52. package/lib/exercises/math/sequences/limits/index.d.ts.map +1 -1
  53. package/lib/exercises/math/sequences/limits/index.js +2 -1
  54. package/lib/exercises/math/trigonometry/circle/findAngleFromCosAndSin.d.ts.map +1 -1
  55. package/lib/exercises/math/trigonometry/circle/findAngleFromCosAndSin.js +17 -8
  56. package/lib/exercises/math/trigonometry/circle/index.d.ts +2 -0
  57. package/lib/exercises/math/trigonometry/circle/index.d.ts.map +1 -1
  58. package/lib/exercises/math/trigonometry/circle/index.js +2 -1
  59. package/lib/exercises/math/trigonometry/circle/mainRemarkableValues.d.ts.map +1 -1
  60. package/lib/exercises/math/trigonometry/circle/mainRemarkableValues.js +57 -0
  61. package/lib/exercises/math/trigonometry/circle/remarkableValues.d.ts.map +1 -1
  62. package/lib/exercises/math/trigonometry/circle/remarkableValues.js +88 -0
  63. package/lib/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.d.ts +5 -0
  64. package/lib/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.d.ts.map +1 -1
  65. package/lib/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.js +92 -94
  66. package/lib/exercises/math/trigonometry/functions/associateAngleSimplification.d.ts +11 -0
  67. package/lib/exercises/math/trigonometry/functions/associateAngleSimplification.d.ts.map +1 -0
  68. package/lib/exercises/math/trigonometry/functions/associateAngleSimplification.js +166 -0
  69. package/lib/exercises/math/trigonometry/functions/basicEquationCos.d.ts.map +1 -1
  70. package/lib/exercises/math/trigonometry/functions/basicEquationCos.js +54 -9
  71. package/lib/exercises/math/trigonometry/functions/basicEquationSin.d.ts.map +1 -1
  72. package/lib/exercises/math/trigonometry/functions/basicEquationSin.js +54 -8
  73. package/lib/exercises/math/trigonometry/functions/cosInequationMainInterval.js +2 -2
  74. package/lib/exercises/math/trigonometry/functions/equationSinOnRandomInterval.js +1 -2
  75. package/lib/exercises/math/trigonometry/functions/index.d.ts +1 -0
  76. package/lib/exercises/math/trigonometry/functions/index.d.ts.map +1 -1
  77. package/lib/exercises/math/trigonometry/functions/index.js +1 -0
  78. package/lib/exercises/vea/percentVEA.d.ts +2 -0
  79. package/lib/exercises/vea/percentVEA.d.ts.map +1 -0
  80. package/lib/exercises/vea/percentVEA.js +1 -0
  81. package/lib/index.d.ts +29 -19
  82. package/lib/index.d.ts.map +1 -1
  83. package/lib/math/utils/random/randTupleInt.d.ts +1 -0
  84. package/lib/math/utils/random/randTupleInt.d.ts.map +1 -1
  85. package/lib/math/utils/random/randTupleInt.js +1 -1
  86. package/lib/server.js +22 -0
  87. package/lib/tests/exoTest.d.ts.map +1 -1
  88. package/lib/tests/exoTest.js +2 -0
  89. package/lib/tests/questionTest.d.ts.map +1 -1
  90. package/lib/tests/questionTest.js +14 -2
  91. package/lib/tree/nodes/algebraicNode.d.ts +1 -0
  92. package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
  93. package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
  94. package/lib/tree/nodes/operators/addNode.js +4 -2
  95. package/lib/types/keyIds.d.ts +1 -1
  96. package/lib/types/keyIds.d.ts.map +1 -1
  97. package/package.json +1 -1
@@ -30,14 +30,13 @@ const getHint = (identifiers) => {
30
30
  const isSinPos = value.sin.evaluate() > 0;
31
31
  return `Puisque $\\cos(a)$ est ${isCosPos ? "positif" : "négatif"}, le point image de $a$ sur le cercle trigonométrique se trouve ${isCosPos ? "à droite" : "à gauche"} de l'axe des ordonnées.
32
32
 
33
- De plus, puisque $\\sin(a)$ est ${isSinPos ? "positif" : "négatif"}, le point image de $a$ sur le cercle trigonométrique se trouve ${isSinPos ? "au-dessus" : "en-dessous"} de l'axe des abscisses.`;
33
+ De plus, puisque $\\sin(a)$ est ${isSinPos ? "positif" : "négatif"}, le point image de $a$ sur le cercle trigonométrique se trouve ${isSinPos ? "au-dessus" : "en-dessous"} de l'axe des abscisses.
34
+
35
+ Sers-toi ensuite du cercle trigonométrique ci-dessous pour trouver la valeur de $a$ :
36
+
37
+ ![](https://heureuxhasarddocsbucket.s3.eu-west-3.amazonaws.com/mathliveV2/activities/quizzes/generator/piCercle_nombres.jpg)`;
34
38
  };
35
39
  const getCorrection = (identifiers) => {
36
- const { point } = identifiers;
37
- const value = mainTrigoValues.find((e) => e.point === point);
38
- const isCosPos = value.cos.evaluate() > 0;
39
- const isSinPos = value.sin.evaluate() > 0;
40
- const answer = getAnswer(identifiers);
41
40
  return `On rappelle les valeurs remarquables des fonctions cosinus et sinus :
42
41
 
43
42
  ${mdTable([
@@ -67,7 +66,16 @@ ${mdTable([
67
66
  ],
68
67
  ])}
69
68
 
70
- ${isCosPos && isSinPos ? `L'angle recherché est donc $${answer}$.` : ``}`;
69
+ Puis, on se sers du cercle trigonométrique ci-dessous :
70
+
71
+ ![](https://heureuxhasarddocsbucket.s3.eu-west-3.amazonaws.com/mathliveV2/activities/quizzes/generator/piCercle_nombres.jpg)
72
+
73
+ On en déduit donc que :
74
+
75
+ $$
76
+ a = ${getAnswer(identifiers)}
77
+ $$
78
+ `;
71
79
  };
72
80
  const getKeys = () => {
73
81
  return ["pi"];
@@ -105,7 +113,7 @@ export const findAngleFromCosAndSin = {
105
113
  connector: "=",
106
114
  label: "Déterminer $a$ en connaissant $\\cos(a)$ et $\\sin(a)$",
107
115
  isSingleStep: true,
108
- generator: (nb, opts) => getDistinctQuestions(() => getFindAngleFromCosAndSinQuestion(opts), nb),
116
+ generator: (nb, opts) => getDistinctQuestions(() => getFindAngleFromCosAndSinQuestion(opts), nb, 15),
109
117
  qcmTimer: 60,
110
118
  freeTimer: 60,
111
119
  getPropositions,
@@ -117,4 +125,5 @@ export const findAngleFromCosAndSin = {
117
125
  getAnswer,
118
126
  getQuestionFromIdentifiers,
119
127
  hasHintAndCorrection: true,
128
+ maxAllowedQuestions: 15,
120
129
  };
@@ -4,7 +4,9 @@ export * from "./mainRemarkableValues.js";
4
4
  export * from "./remarkableValues.js";
5
5
  export * from "./areReelsOnTheSameTrigoCirclePoint.js";
6
6
  export * from "./associateReelToTrigoCirclePoint.js";
7
+ export * from "./findAngleFromCosAndSin.js";
7
8
  export * from "./placeAssociateAngleOnCircle.js";
8
9
  export * from "./findAssociateAnglePointOnTrigoCircle.js";
9
10
  export * from "./trigoFunctionsFundamentalEquation.js";
11
+ export * from "./selectQuadrantOnTrigoCircle.js";
10
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/circle/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wCAAwC,CAAC;AACvD,cAAc,sCAAsC,CAAC;AAErD,cAAc,kCAAkC,CAAC;AACjD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,wCAAwC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/circle/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wCAAwC,CAAC;AACvD,cAAc,sCAAsC,CAAC;AACrD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,wCAAwC,CAAC;AACvD,cAAc,kCAAkC,CAAC"}
@@ -4,7 +4,8 @@ export * from "./mainRemarkableValues.js";
4
4
  export * from "./remarkableValues.js";
5
5
  export * from "./areReelsOnTheSameTrigoCirclePoint.js";
6
6
  export * from "./associateReelToTrigoCirclePoint.js";
7
- // export * from "./findAngleFromCosAndSin.js";
7
+ export * from "./findAngleFromCosAndSin.js";
8
8
  export * from "./placeAssociateAngleOnCircle.js";
9
9
  export * from "./findAssociateAnglePointOnTrigoCircle.js";
10
10
  export * from "./trigoFunctionsFundamentalEquation.js";
11
+ export * from "./selectQuadrantOnTrigoCircle.js";
@@ -1 +1 @@
1
- {"version":3,"file":"mainRemarkableValues.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/circle/mainRemarkableValues.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,QAAQ,EAaT,MAAM,sBAAsB,CAAC;AAE9B,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAuFF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAc9D,CAAC"}
1
+ {"version":3,"file":"mainRemarkableValues.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/circle/mainRemarkableValues.ts"],"names":[],"mappings":"AASA,OAAO,EACL,QAAQ,EAeT,MAAM,sBAAsB,CAAC;AAE9B,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAiJF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAe9D,CAAC"}
@@ -6,6 +6,7 @@ import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
6
6
  import { coinFlip } from "../../../../utils/alea/coinFlip.js";
7
7
  import { shuffle } from "../../../../utils/alea/shuffle.js";
8
8
  import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
9
+ import { mdTable } from "../../../../utils/markdown/mdTable.js";
9
10
  import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../exercise.js";
10
11
  import { getDistinctQuestions } from "../../../utils/getDistinctQuestions.js";
11
12
  const getStatementNode = (identifiers) => {
@@ -31,6 +32,59 @@ const getAnswer = (identifiers) => {
31
32
  const remarkableValue = mainTrigoValues[valueIndex];
32
33
  return isCos ? remarkableValue.cos.toTex() : remarkableValue.sin.toTex();
33
34
  };
35
+ const getHint = (identifiers) => {
36
+ const { valueIndex } = identifiers;
37
+ const remarkableValue = mainTrigoValues[valueIndex];
38
+ const angle = remarkableValue.angle;
39
+ return `Repère le point-image de $${angle.toTex()}$ sur le cercle trigonométrique ci-dessous :
40
+
41
+ ![](https://heureuxhasarddocsbucket.s3.eu-west-3.amazonaws.com/mathliveV2/activities/quizzes/generator/piCercle_nombres.jpg)
42
+
43
+ Le cosinus de $${angle.toTex()}$ est l'abscisse de ce point, et son sinus est son ordonnée.`;
44
+ };
45
+ const getCorrection = (identifiers) => {
46
+ const { valueIndex } = identifiers;
47
+ const remarkableValue = mainTrigoValues[valueIndex];
48
+ const angle = remarkableValue.angle;
49
+ return `On repère le point-image de $${angle.toTex()}$ sur le cercle trigonométrique ci-dessous :
50
+
51
+ ![](https://heureuxhasarddocsbucket.s3.eu-west-3.amazonaws.com/mathliveV2/activities/quizzes/generator/piCercle_nombres.jpg)
52
+
53
+ Puis, on utilise les valeurs remarquables ci-dessous :
54
+
55
+ ${mdTable([
56
+ [
57
+ "$x$",
58
+ "$0$",
59
+ "$\\frac{\\pi}{6}$",
60
+ "$\\frac{\\pi}{4}$",
61
+ "$\\frac{\\pi}{3}$",
62
+ "$\\frac{\\pi}{2}$",
63
+ ],
64
+ [
65
+ "$\\cos(x)$",
66
+ "$1$",
67
+ "$\\frac{\\sqrt{3}}{2}$",
68
+ "$\\frac{\\sqrt{2}}{2}$",
69
+ "$\\frac{1}{2}$",
70
+ "$0$",
71
+ ],
72
+ [
73
+ "$\\sin(x)$",
74
+ "$0$",
75
+ "$\\frac{1}{2}$",
76
+ "$\\frac{\\sqrt{2}}{2}$",
77
+ "$\\frac{\\sqrt{3}}{2}$",
78
+ "$1$",
79
+ ],
80
+ ])}
81
+
82
+ On a donc :
83
+
84
+ $$
85
+ ${getStartStatement(identifiers)} = ${getAnswer(identifiers)}
86
+ $$`;
87
+ };
34
88
  const getMainRemarkableValues = () => {
35
89
  const isCos = coinFlip();
36
90
  const valueIndex = randint(0, mainTrigoValues.length);
@@ -45,6 +99,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
45
99
  keys: ["pi", "cos", "sin"],
46
100
  answerFormat: "tex",
47
101
  identifiers,
102
+ hint: getHint(identifiers),
103
+ correction: getCorrection(identifiers),
48
104
  };
49
105
  return question;
50
106
  };
@@ -94,4 +150,5 @@ export const mainRemarkableValuesExercise = {
94
150
  isAnswerValid,
95
151
  subject: "Mathématiques",
96
152
  getQuestionFromIdentifiers,
153
+ hasHintAndCorrection: true,
97
154
  };
@@ -1 +1 @@
1
- {"version":3,"file":"remarkableValues.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/circle/remarkableValues.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAM7C,OAAO,EACL,QAAQ,EAaT,MAAM,sBAAsB,CAAC;AAmD9B,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IAEf,gBAAgB,EAAE,eAAe,CAAC;CACnC,CAAC;AAkDF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAc1D,CAAC"}
1
+ {"version":3,"file":"remarkableValues.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/circle/remarkableValues.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAU7C,OAAO,EACL,QAAQ,EAeT,MAAM,sBAAsB,CAAC;AAmD9B,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IAEf,gBAAgB,EAAE,eAAe,CAAC;CACnC,CAAC;AAsIF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAe1D,CAAC"}
@@ -2,11 +2,15 @@ import { RemarkableValueConstructor } from "../../../../math/trigonometry/remark
2
2
  import { cos, CosNode } from "../../../../tree/nodes/functions/cosNode.js";
3
3
  import { sin, SinNode } from "../../../../tree/nodes/functions/sinNode.js";
4
4
  import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
5
+ import { PiNode } from "../../../../tree/nodes/numbers/piNode.js";
6
+ import { add } from "../../../../tree/nodes/operators/addNode.js";
7
+ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
5
8
  import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
6
9
  import { coinFlip } from "../../../../utils/alea/coinFlip.js";
7
10
  import { random } from "../../../../utils/alea/random.js";
8
11
  import { shuffle } from "../../../../utils/alea/shuffle.js";
9
12
  import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
13
+ import { mdTable } from "../../../../utils/markdown/mdTable.js";
10
14
  import { addValidProp, propWhile, tryToAddWrongProp, } from "../../../exercise.js";
11
15
  import { getDistinctQuestions } from "../../../utils/getDistinctQuestions.js";
12
16
  const values = [
@@ -70,9 +74,92 @@ const getQuestionFromIdentifiers = (identifiers) => {
70
74
  keys: ["pi", "cos", "sin"],
71
75
  answerFormat: "tex",
72
76
  identifiers,
77
+ hint: getHint(identifiers),
78
+ correction: getCorrection(identifiers),
73
79
  };
74
80
  return question;
75
81
  };
82
+ const getHint = (identifiers) => {
83
+ const { angleIdentifiers } = identifiers;
84
+ const angle = reifyAlgebraic(angleIdentifiers);
85
+ return `Commence par te ramener à l'intervalle $]-\\pi; \\pi]$, en ajoutant ou en retirant un multiple de $2\\pi$ à $${angle.toTex()}$.
86
+
87
+ Puis, repère le point-image de l'angle ainsi obtenu sur le cercle trigonométrique ci-dessous :
88
+
89
+ ![](https://heureuxhasarddocsbucket.s3.eu-west-3.amazonaws.com/mathliveV2/activities/quizzes/generator/piCercle_nombres.jpg)
90
+
91
+ Le cosinus de $${angle.toTex()}$ est l'abscisse de ce point, et son sinus est son ordonnée.`;
92
+ };
93
+ const getCorrection = (identifiers) => {
94
+ const { isCos, angleIdentifiers } = identifiers;
95
+ const angle = reifyAlgebraic(angleIdentifiers);
96
+ let toAdd = 0;
97
+ let newAngle = angle;
98
+ let counter = 0;
99
+ while (newAngle.evaluate() > Math.PI || newAngle.evaluate() <= -Math.PI) {
100
+ counter++;
101
+ if (counter > 1000)
102
+ throw new Error("too many iterations in remarkable values");
103
+ if (newAngle.evaluate() > 0)
104
+ toAdd--;
105
+ else
106
+ toAdd++;
107
+ console.log(newAngle.evaluate(), toAdd);
108
+ newAngle = add(newAngle, multiply(toAdd > 0 ? 2 : -2, PiNode)).simplify();
109
+ }
110
+ // const raw = frac(angle, PiNode).simplify();
111
+ return `On se ramène à l'intervalle $]-\\pi; \\pi]$ :
112
+
113
+ $$
114
+ ${add(angle, multiply(2 * toAdd, PiNode)).toTex()} = ${newAngle.toTex()}
115
+ $$
116
+
117
+ On a donc :
118
+
119
+ $$
120
+ ${(isCos ? cos : sin)(angle).toTex()} = ${(isCos ? cos : sin)(newAngle).toTex()}
121
+ $$
122
+
123
+
124
+ On repère le point-image de $${newAngle.toTex()}$ sur le cercle trigonométrique ci-dessous :
125
+
126
+ ![](https://heureuxhasarddocsbucket.s3.eu-west-3.amazonaws.com/mathliveV2/activities/quizzes/generator/piCercle_nombres.jpg)
127
+
128
+ Puis, on utilise les valeurs remarquables ci-dessous :
129
+
130
+ ${mdTable([
131
+ [
132
+ "$x$",
133
+ "$0$",
134
+ "$\\frac{\\pi}{6}$",
135
+ "$\\frac{\\pi}{4}$",
136
+ "$\\frac{\\pi}{3}$",
137
+ "$\\frac{\\pi}{2}$",
138
+ ],
139
+ [
140
+ "$\\cos(x)$",
141
+ "$1$",
142
+ "$\\frac{\\sqrt{3}}{2}$",
143
+ "$\\frac{\\sqrt{2}}{2}$",
144
+ "$\\frac{1}{2}$",
145
+ "$0$",
146
+ ],
147
+ [
148
+ "$\\sin(x)$",
149
+ "$0$",
150
+ "$\\frac{1}{2}$",
151
+ "$\\frac{\\sqrt{2}}{2}$",
152
+ "$\\frac{\\sqrt{3}}{2}$",
153
+ "$1$",
154
+ ],
155
+ ])}
156
+
157
+ On a donc :
158
+
159
+ $$
160
+ ${getStartStatement(identifiers)} = ${getAnswer(identifiers)}
161
+ $$`;
162
+ };
76
163
  const getPropositions = (n, { answer }) => {
77
164
  const propositions = [];
78
165
  addValidProp(propositions, answer);
@@ -109,4 +196,5 @@ export const remarkableValuesExercise = {
109
196
  getInstruction,
110
197
  getAnswer,
111
198
  getQuestionFromIdentifiers,
199
+ hasHintAndCorrection: true,
112
200
  };
@@ -1,2 +1,7 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ quartant: number;
4
+ };
5
+ export declare const selectQuadrantOnTrigoCircle: Exercise<Identifiers>;
1
6
  export {};
2
7
  //# sourceMappingURL=selectQuadrantOnTrigoCircle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"selectQuadrantOnTrigoCircle.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"selectQuadrantOnTrigoCircle.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAIrC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AA2FF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAuB7D,CAAC"}
@@ -1,94 +1,92 @@
1
- // import {
2
- // Exercise,
3
- // Proposition,
4
- // QCMGenerator,
5
- // Question,
6
- // QuestionGenerator,
7
- // VEA,
8
- // addValidProp,
9
- // shuffleProps,
10
- // GetAnswer,
11
- // GetHint,
12
- // GetCorrection,
13
- // GetInstruction,
14
- // GetKeys,
15
- // GetQuestionFromIdentifiers,
16
- // propWhile,
17
- // } from "../../../../exercises/exercise.js";
18
- // import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
19
- // import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
20
- // import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
21
- export {};
22
- // //angle donné genre Pi/6, donner la couleur
23
- // //donner couleur pour signe cos et sin
24
- // //une couleur est donnée, donner signe sin&cos
25
- // type Identifiers = {
26
- // angle?: NodeIdentifiers;
27
- // };
28
- // const getPropositions: QCMGenerator<Identifiers> = (n, { answer }) => {
29
- // const propositions: Proposition[] = [];
30
- // addValidProp(propositions, answer);
31
- // propWhile(propositions, n, () => {
32
- // throw Error("QCM not implemented");
33
- // });
34
- // return shuffleProps(propositions, n);
35
- // };
36
- // const getAnswer: GetAnswer<Identifiers> = (identifiers) => {};
37
- // const getInstruction: GetInstruction<Identifiers> = (identifiers) => {
38
- // return `On considère le cercle trigonométrique ci-dessous.
39
- // https://heureuxhasarddocsbucket.s3.eu-west-3.amazonaws.com/mathliveV2/activities/quizzes/generator/piCercle_couleur.jpg`;
40
- // };
41
- // const getHint: GetHint<Identifiers> = (identifiers) => {};
42
- // const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
43
- // const getKeys: GetKeys<Identifiers> = (identifiers) => {
44
- // return [];
45
- // };
46
- // const isAnswerValid: VEA<Identifiers> = (ans, { answer }) => {
47
- // try {
48
- // throw Error("VEA not implemented");
49
- // } catch (err) {
50
- // return handleVEAError(err);
51
- // }
52
- // };
53
- // const getSelectQuadrantOnTrigoCircleQuestion: QuestionGenerator<Identifiers> = (
54
- // ops,
55
- // ) => {
56
- // const identifiers: Identifiers = {};
57
- // return getQuestionFromIdentifiers(identifiers);
58
- // };
59
- // const getQuestionFromIdentifiers: GetQuestionFromIdentifiers<Identifiers> = (
60
- // identifiers,
61
- // ) => {
62
- // return {
63
- // answer: getAnswer(identifiers),
64
- // instruction: getInstruction(identifiers),
65
- // keys: getKeys(identifiers),
66
- // answerFormat: "tex",
67
- // identifiers,
68
- // hint: getHint(identifiers),
69
- // correction: getCorrection(identifiers),
70
- // };
71
- // };
72
- // export const selectQuadrantOnTrigoCircle: Exercise<Identifiers> = {
73
- // id: "selectQuadrantOnTrigoCircle",
74
- // label:
75
- // "Donner le quadrant du cercle trigonométrique auquel un angle appartient",
76
- // isSingleStep: true,
77
- // generator: (nb, opts) =>
78
- // getDistinctQuestions(
79
- // () => getSelectQuadrantOnTrigoCircleQuestion(opts),
80
- // nb,
81
- // ),
82
- // qcmTimer: 60,
83
- // freeTimer: 60,
84
- // getPropositions,
85
- // isAnswerValid,
86
- // subject: "Mathématiques",
87
- // getInstruction,
88
- // getHint,
89
- // getCorrection,
90
- // getAnswer,
91
- // getQuestionFromIdentifiers,
92
- // hasHintAndCorrection: true,
93
- // answerType: "QCU",
94
- // };
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { randint } from "../../../../math/utils/random/randint.js";
4
+ const getPropositions = (n, { answer }) => {
5
+ const propositions = [];
6
+ addValidProp(propositions, answer, "raw");
7
+ ["Bleu", "Rouge", "Vert", "Jaune"].forEach((color) => {
8
+ tryToAddWrongProp(propositions, color, "raw");
9
+ });
10
+ return shuffleProps(propositions, n);
11
+ };
12
+ const getAnswer = (identifiers) => {
13
+ return ["Bleu", "Rouge", "Vert", "Jaune"][identifiers.quartant];
14
+ };
15
+ const getInstruction = (identifiers) => {
16
+ const { quartant } = identifiers;
17
+ const isSinPos = quartant === 0 || quartant === 1;
18
+ const isCosPos = quartant === 0 || quartant === 3;
19
+ return `On considère le cercle trigonométrique ci-dessous.
20
+
21
+ ![](https://heureuxhasarddocsbucket.s3.eu-west-3.amazonaws.com/mathliveV2/activities/quizzes/generator/piCercle_couleur.jpg)
22
+
23
+ Soit un réel $a$ tel que :
24
+
25
+ $$
26
+ \\sin(a)${isSinPos ? ">0" : "<0"}
27
+ $$
28
+
29
+ et
30
+
31
+ $$
32
+ \\cos(a)${isCosPos ? ">0" : "<0"}
33
+ $$
34
+
35
+ De quelle couleur est le point-image de $a$ sur le cercle trigonométrique?
36
+ `;
37
+ };
38
+ const getHint = () => {
39
+ return `Le cosinus d'un nombre $a$ est l'abscisse de son point-image sur le cercle trigonométrique, et le sinus son ordonnée.`;
40
+ };
41
+ const getCorrection = (identifiers) => {
42
+ const { quartant } = identifiers;
43
+ const isSinPos = quartant === 0 || quartant === 1;
44
+ const isCosPos = quartant === 0 || quartant === 3;
45
+ return `Le cosinus d'un nombre $a$ est l'abscisse de son point-image sur le cercle trigonométrique, et le sinus son ordonnée.
46
+
47
+ Puisque $\\cos(a)${isCosPos ? ">0" : "<0"}$, le point-image de $a$ sur le cercle trigonométrique se trouve ${isCosPos ? "à droite" : "à gauche"} de l'axe des ordonnées.
48
+
49
+ Puisque $\\sin(a)${isSinPos ? ">0" : "<0"}$, le point-image de $a$ sur le cercle trigonométrique se trouve ${isSinPos ? "au-dessus" : "en-dessous"} de l'axe des abscisses.
50
+
51
+ Le point-image de $a$ sur le cercle trigonométrique se trouve donc sur le quartant de couleur ${[
52
+ "Bleu",
53
+ "Rouge",
54
+ "Vert",
55
+ "Jaune",
56
+ ][quartant].toLocaleLowerCase()}.`;
57
+ };
58
+ const getSelectQuadrantOnTrigoCircleQuestion = () => {
59
+ const identifiers = {
60
+ quartant: randint(0, 4),
61
+ };
62
+ return getQuestionFromIdentifiers(identifiers);
63
+ };
64
+ const getQuestionFromIdentifiers = (identifiers) => {
65
+ return {
66
+ answer: getAnswer(identifiers),
67
+ instruction: getInstruction(identifiers),
68
+ keys: [],
69
+ answerFormat: "tex",
70
+ identifiers,
71
+ hint: getHint(identifiers),
72
+ correction: getCorrection(identifiers),
73
+ };
74
+ };
75
+ export const selectQuadrantOnTrigoCircle = {
76
+ id: "selectQuadrantOnTrigoCircle",
77
+ label: "Donner le quadrant du cercle trigonométrique auquel un angle appartient en fonction du signe de son cosinus et son sinus",
78
+ isSingleStep: true,
79
+ generator: (nb, opts) => getDistinctQuestions(() => getSelectQuadrantOnTrigoCircleQuestion(opts), nb, 4),
80
+ qcmTimer: 60,
81
+ freeTimer: 60,
82
+ getPropositions,
83
+ subject: "Mathématiques",
84
+ getInstruction,
85
+ getHint,
86
+ getCorrection,
87
+ getAnswer,
88
+ getQuestionFromIdentifiers,
89
+ hasHintAndCorrection: true,
90
+ answerType: "QCU",
91
+ maxAllowedQuestions: 4,
92
+ };
@@ -0,0 +1,11 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ isCos: boolean;
4
+ a: number;
5
+ b: number;
6
+ c: number;
7
+ d: number;
8
+ };
9
+ export declare const associateAngleSimplification: Exercise<Identifiers>;
10
+ export {};
11
+ //# sourceMappingURL=associateAngleSimplification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"associateAngleSimplification.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/functions/associateAngleSimplification.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAgKF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAsB9D,CAAC"}