math-exercises 3.0.98 → 3.0.100

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 (143) hide show
  1. package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSub.d.ts.map +1 -1
  2. package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSub.js +10 -0
  3. package/lib/exercises/math/calculLitteral/equation/equationWithDistributivity.js +1 -1
  4. package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.js +1 -1
  5. package/lib/exercises/math/functions/sign/readSignTable.d.ts.map +1 -1
  6. package/lib/exercises/math/functions/variations/compareImagesInVarTable.js +1 -1
  7. package/lib/exercises/math/functions/variations/varTableExtremaReading.js +1 -1
  8. package/lib/exercises/math/functions/variations/varTableFromSentences.d.ts +1 -0
  9. package/lib/exercises/math/functions/variations/varTableFromSentences.d.ts.map +1 -1
  10. package/lib/exercises/math/functions/variations/varTableFromSentences.js +15 -0
  11. package/lib/exercises/math/geometry/areas/calculateAreaFromCodedShape.d.ts +9 -0
  12. package/lib/exercises/math/geometry/areas/calculateAreaFromCodedShape.d.ts.map +1 -0
  13. package/lib/exercises/math/geometry/areas/calculateAreaFromCodedShape.js +156 -0
  14. package/lib/exercises/math/geometry/areas/index.d.ts +1 -0
  15. package/lib/exercises/math/geometry/areas/index.d.ts.map +1 -1
  16. package/lib/exercises/math/geometry/areas/index.js +1 -0
  17. package/lib/exercises/math/geometry/euclidian/index.d.ts +1 -0
  18. package/lib/exercises/math/geometry/euclidian/index.d.ts.map +1 -1
  19. package/lib/exercises/math/geometry/euclidian/index.js +1 -0
  20. package/lib/exercises/math/geometry/euclidian/orthogonalProjectFromPicture.d.ts +8 -0
  21. package/lib/exercises/math/geometry/euclidian/orthogonalProjectFromPicture.d.ts.map +1 -0
  22. package/lib/exercises/math/geometry/euclidian/orthogonalProjectFromPicture.js +197 -0
  23. package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.d.ts.map +1 -1
  24. package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.js +9 -4
  25. package/lib/exercises/math/geometry/pythagore/calculateDiagonalFromSides.d.ts +9 -0
  26. package/lib/exercises/math/geometry/pythagore/calculateDiagonalFromSides.d.ts.map +1 -0
  27. package/lib/exercises/math/geometry/pythagore/calculateDiagonalFromSides.js +155 -0
  28. package/lib/exercises/math/geometry/pythagore/index.d.ts +1 -0
  29. package/lib/exercises/math/geometry/pythagore/index.d.ts.map +1 -1
  30. package/lib/exercises/math/geometry/pythagore/index.js +2 -0
  31. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.js +1 -1
  32. package/lib/exercises/math/geometry/pythagore/triangleHeight.d.ts +9 -0
  33. package/lib/exercises/math/geometry/pythagore/triangleHeight.d.ts.map +1 -0
  34. package/lib/exercises/math/geometry/pythagore/triangleHeight.js +105 -0
  35. package/lib/exercises/math/geometry/quadrilaterals/index.d.ts +2 -0
  36. package/lib/exercises/math/geometry/quadrilaterals/index.d.ts.map +1 -1
  37. package/lib/exercises/math/geometry/quadrilaterals/index.js +2 -0
  38. package/lib/exercises/math/geometry/quadrilaterals/parallelogramRectangle.d.ts +11 -0
  39. package/lib/exercises/math/geometry/quadrilaterals/parallelogramRectangle.d.ts.map +1 -0
  40. package/lib/exercises/math/geometry/quadrilaterals/parallelogramRectangle.js +140 -0
  41. package/lib/exercises/math/geometry/quadrilaterals/parallelogramRhombus.d.ts +11 -0
  42. package/lib/exercises/math/geometry/quadrilaterals/parallelogramRhombus.d.ts.map +1 -0
  43. package/lib/exercises/math/geometry/quadrilaterals/parallelogramRhombus.js +144 -0
  44. package/lib/exercises/math/geometry/vectors/chasles.d.ts.map +1 -1
  45. package/lib/exercises/math/geometry/vectors/chasles.js +83 -4
  46. package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromPicture.d.ts +9 -0
  47. package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromPicture.d.ts.map +1 -0
  48. package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromPicture.js +201 -0
  49. package/lib/exercises/math/geometry/vectors/colinearity/determinant.d.ts +8 -0
  50. package/lib/exercises/math/geometry/vectors/colinearity/determinant.d.ts.map +1 -0
  51. package/lib/exercises/math/geometry/vectors/colinearity/determinant.js +101 -0
  52. package/lib/exercises/math/geometry/vectors/colinearity/index.d.ts +2 -0
  53. package/lib/exercises/math/geometry/vectors/colinearity/index.d.ts.map +1 -1
  54. package/lib/exercises/math/geometry/vectors/colinearity/index.js +2 -0
  55. package/lib/exercises/math/geometry/vectors/constructions/drawAVectorInGGB.d.ts +8 -0
  56. package/lib/exercises/math/geometry/vectors/constructions/drawAVectorInGGB.d.ts.map +1 -0
  57. package/lib/exercises/math/geometry/vectors/constructions/drawAVectorInGGB.js +78 -0
  58. package/lib/exercises/math/geometry/vectors/constructions/index.d.ts +8 -0
  59. package/lib/exercises/math/geometry/vectors/constructions/index.d.ts.map +1 -0
  60. package/lib/exercises/math/geometry/vectors/constructions/index.js +7 -0
  61. package/lib/exercises/math/geometry/vectors/constructions/linearVectorCombinationFromGraph.d.ts +9 -0
  62. package/lib/exercises/math/geometry/vectors/constructions/linearVectorCombinationFromGraph.d.ts.map +1 -0
  63. package/lib/exercises/math/geometry/vectors/constructions/linearVectorCombinationFromGraph.js +179 -0
  64. package/lib/exercises/math/geometry/vectors/constructions/placePointFromPointAndVector.d.ts +12 -0
  65. package/lib/exercises/math/geometry/vectors/constructions/placePointFromPointAndVector.d.ts.map +1 -0
  66. package/lib/exercises/math/geometry/vectors/constructions/placePointFromPointAndVector.js +171 -0
  67. package/lib/exercises/math/geometry/vectors/constructions/traceOppositeVector.d.ts +10 -0
  68. package/lib/exercises/math/geometry/vectors/constructions/traceOppositeVector.d.ts.map +1 -0
  69. package/lib/exercises/math/geometry/vectors/constructions/traceOppositeVector.js +110 -0
  70. package/lib/exercises/math/geometry/vectors/constructions/traceVectorDifference.d.ts +11 -0
  71. package/lib/exercises/math/geometry/vectors/constructions/traceVectorDifference.d.ts.map +1 -0
  72. package/lib/exercises/math/geometry/vectors/constructions/traceVectorDifference.js +123 -0
  73. package/lib/exercises/math/geometry/vectors/constructions/traceVectorMultiple.d.ts +11 -0
  74. package/lib/exercises/math/geometry/vectors/constructions/traceVectorMultiple.d.ts.map +1 -0
  75. package/lib/exercises/math/geometry/vectors/constructions/traceVectorMultiple.js +115 -0
  76. package/lib/exercises/math/geometry/vectors/constructions/traceVectorSum.d.ts +11 -0
  77. package/lib/exercises/math/geometry/vectors/constructions/traceVectorSum.d.ts.map +1 -0
  78. package/lib/exercises/math/geometry/vectors/constructions/traceVectorSum.js +123 -0
  79. package/lib/exercises/math/geometry/vectors/coordinatesReading.d.ts.map +1 -1
  80. package/lib/exercises/math/geometry/vectors/coordinatesReading.js +63 -14
  81. package/lib/exercises/math/geometry/vectors/determinant.d.ts.map +1 -1
  82. package/lib/exercises/math/geometry/vectors/determinant.js +44 -9
  83. package/lib/exercises/math/geometry/vectors/equalCaracteristicFromGraph.d.ts +3 -0
  84. package/lib/exercises/math/geometry/vectors/equalCaracteristicFromGraph.d.ts.map +1 -1
  85. package/lib/exercises/math/geometry/vectors/equalCaracteristicFromGraph.js +63 -2
  86. package/lib/exercises/math/geometry/vectors/index.d.ts +4 -8
  87. package/lib/exercises/math/geometry/vectors/index.d.ts.map +1 -1
  88. package/lib/exercises/math/geometry/vectors/index.js +4 -8
  89. package/lib/exercises/math/geometry/vectors/parallelogram/fourthParallelogramPoint.d.ts +14 -0
  90. package/lib/exercises/math/geometry/vectors/parallelogram/fourthParallelogramPoint.d.ts.map +1 -0
  91. package/lib/exercises/math/geometry/vectors/parallelogram/fourthParallelogramPoint.js +78 -0
  92. package/lib/exercises/math/geometry/vectors/parallelogram/index.d.ts +4 -0
  93. package/lib/exercises/math/geometry/vectors/parallelogram/index.d.ts.map +1 -0
  94. package/lib/exercises/math/geometry/vectors/parallelogram/index.js +3 -0
  95. package/lib/exercises/math/geometry/vectors/parallelogram/parallelogramCriterion.d.ts +8 -0
  96. package/lib/exercises/math/geometry/vectors/parallelogram/parallelogramCriterion.d.ts.map +1 -0
  97. package/lib/exercises/math/geometry/vectors/parallelogram/parallelogramCriterion.js +193 -0
  98. package/lib/exercises/math/geometry/vectors/parallelogram/parallelogramViaEqualVectors.d.ts +14 -0
  99. package/lib/exercises/math/geometry/vectors/parallelogram/parallelogramViaEqualVectors.d.ts.map +1 -0
  100. package/lib/exercises/math/geometry/vectors/parallelogram/parallelogramViaEqualVectors.js +116 -0
  101. package/lib/exercises/math/geometry/vectors/translationFromPicture.d.ts +8 -0
  102. package/lib/exercises/math/geometry/vectors/translationFromPicture.d.ts.map +1 -0
  103. package/lib/exercises/math/geometry/vectors/translationFromPicture.js +104 -0
  104. package/lib/exercises/math/geometry/vectors/vectorRepresentative.d.ts +8 -0
  105. package/lib/exercises/math/geometry/vectors/vectorRepresentative.d.ts.map +1 -0
  106. package/lib/exercises/math/geometry/vectors/vectorRepresentative.js +161 -0
  107. package/lib/exercises/math/geometry/volumes/index.d.ts +1 -0
  108. package/lib/exercises/math/geometry/volumes/index.d.ts.map +1 -1
  109. package/lib/exercises/math/geometry/volumes/index.js +1 -0
  110. package/lib/exercises/math/geometry/volumes/variableVolume.d.ts +9 -0
  111. package/lib/exercises/math/geometry/volumes/variableVolume.d.ts.map +1 -0
  112. package/lib/exercises/math/geometry/volumes/variableVolume.js +203 -0
  113. package/lib/exercises/math/python/pyWhileLoop1Exercise.d.ts.map +1 -1
  114. package/lib/index.d.ts +90 -40
  115. package/lib/index.d.ts.map +1 -1
  116. package/lib/math/geometry/point.d.ts +1 -0
  117. package/lib/math/geometry/point.d.ts.map +1 -1
  118. package/lib/math/geometry/point.js +3 -0
  119. package/lib/math/geometry/vector.d.ts +1 -0
  120. package/lib/math/geometry/vector.d.ts.map +1 -1
  121. package/lib/math/geometry/vector.js +3 -0
  122. package/lib/playground.d.ts.map +1 -1
  123. package/lib/tests/pdfExo.test.d.ts.map +1 -1
  124. package/lib/tests/pdfExo.test.js +2 -2
  125. package/lib/tests/pdfs/buildPDFForExercise.d.ts.map +1 -1
  126. package/lib/tests/pdfs/buildPDFForExercise.js +59 -6
  127. package/lib/tests/pdfs/quizPdfPreambule.d.ts.map +1 -1
  128. package/lib/tests/pdfs/quizPdfPreambule.js +3 -2
  129. package/lib/tests/pdfs/signTableToLatex.d.ts +2 -0
  130. package/lib/tests/pdfs/signTableToLatex.d.ts.map +1 -0
  131. package/lib/tests/pdfs/signTableToLatex.js +32 -0
  132. package/lib/tests/pdfs/valueTableToLatex.d.ts +2 -0
  133. package/lib/tests/pdfs/valueTableToLatex.d.ts.map +1 -0
  134. package/lib/tests/pdfs/valueTableToLatex.js +18 -0
  135. package/lib/tests/pdfs/varTableToLatex.d.ts +2 -0
  136. package/lib/tests/pdfs/varTableToLatex.d.ts.map +1 -0
  137. package/lib/tests/pdfs/varTableToLatex.js +58 -0
  138. package/lib/tests/questionTest.d.ts.map +1 -1
  139. package/lib/tests/questionTest.js +12 -4
  140. package/lib/tree/nodes/functions/sqrtNode.d.ts +1 -1
  141. package/lib/tree/nodes/functions/sqrtNode.d.ts.map +1 -1
  142. package/lib/tree/nodes/functions/sqrtNode.js +8 -2
  143. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"mentalAddAndSub.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/mentalCaluls/mentalAddAndSub.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAoFF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAYjD,CAAC"}
1
+ {"version":3,"file":"mentalAddAndSub.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/mentalCaluls/mentalAddAndSub.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AA+FF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAYjD,CAAC"}
@@ -24,6 +24,16 @@ const getStartStatement = (identifiers) => {
24
24
  const getAnswer = (identifiers) => {
25
25
  return getStatementNode(identifiers).simplify().toTex();
26
26
  };
27
+ // const getHint: GetHint<Identifiers> = (identifiers)=>{
28
+ // return `Ajoute les nombres dans l'ordre.`
29
+ // }
30
+ // const getCorrection: GetCorrection<Identifiers> = (identifiers)=>{
31
+ // const {numbers} = identifiers
32
+ // return `On ajoute les nombres dans l'ordre :
33
+ // ${alignTex([
34
+ // [getStartStatement(identifiers), "=", add(numbers[])],
35
+ // ])}`
36
+ // }
27
37
  const getQuestionFromIdentifiers = (identifiers) => {
28
38
  const question = {
29
39
  instruction: getInstruction(identifiers),
@@ -50,7 +50,7 @@ $$`;
50
50
  };
51
51
  const getHint = (identifiers) => {
52
52
  const { type, a, b, c, d, e, f } = identifiers;
53
- return `Commence par développer ${type === 0 ? "le produit" : "les produits"} en utilisant la distributivité. Ensuite, résout l'équation en regroupant les termes en $x$ d'un côté de l'équation.`;
53
+ return `Commence par développer ${type === 0 ? "le produit" : "les produits"} en utilisant la distributivité. Ensuite, résous l'équation en regroupant les termes en $x$ d'un côté de l'équation.`;
54
54
  };
55
55
  const getCorrection = (identifiers) => {
56
56
  const { type, a, b, c, d, e, f } = identifiers;
@@ -115,7 +115,7 @@ const isAnswerValid = (ans, { answer, xA, xB, yA, yB }) => {
115
115
  export const affineExpressionFromTwoImages = {
116
116
  id: "affineExpressionFromTwoImages",
117
117
  connector: "=",
118
- label: "Expression algébrique d'une fonction affine via deux images",
118
+ label: "Déterminer l'expression algébrique d'une fonction affine via deux images",
119
119
  isSingleStep: true,
120
120
  generator: (nb) => getDistinctQuestions(getAffineExpressionFromTwoImagesQuestion, nb),
121
121
  qcmTimer: 60,
@@ -1 +1 @@
1
- {"version":3,"file":"readSignTable.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/sign/readSignTable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAO7C,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,EAAE,EAAE,eAAe,EAAE,CAAC;IACtB,CAAC,EAAE,eAAe,CAAC;CACpB,CAAC;AA4GF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAiB/C,CAAC"}
1
+ {"version":3,"file":"readSignTable.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/sign/readSignTable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAO7C,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,EAAE,EAAE,eAAe,EAAE,CAAC;IACtB,CAAC,EAAE,eAAe,CAAC;CACpB,CAAC;AA4GF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAiB/C,CAAC"}
@@ -51,7 +51,7 @@ const getInstruction = (identifiers) => {
51
51
  return `On donne le tableau de variations d'une fonction $f$ définie sur $\\mathbb{R}$ :
52
52
 
53
53
 
54
- <svg id='varTable'>${JSON.stringify(table)}</svg>
54
+ <svg id="varTable">${JSON.stringify(table)}</svg>
55
55
 
56
56
  Compléter par le bon symbole :
57
57
 
@@ -64,7 +64,7 @@ const getInstruction = (identifiers) => {
64
64
  const table = getTable(identifiers);
65
65
  let instruction = `On considère la fonction $f$ dont le tableau de variations est donné ci-dessous :
66
66
 
67
- <svg id='varTable'>${JSON.stringify(table)}</svg>
67
+ <svg id="varTable">${JSON.stringify(table)}</svg>
68
68
 
69
69
  ${identifiers.isAskingX
70
70
  ? `Sur l'intervalle $${interval.toTex()}$, en quelle valeur le ${type} de la fonction $f$ est-il atteint ?`
@@ -3,6 +3,7 @@ import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
3
3
  type Identifiers = {
4
4
  vars: string[];
5
5
  xs: NodeIdentifiers[];
6
+ initTable: string[][];
6
7
  };
7
8
  export declare const varTableFromSentences: Exercise<Identifiers>;
8
9
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"varTableFromSentences.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/variations/varTableFromSentences.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAK7C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,EAAE,EAAE,eAAe,EAAE,CAAC;CACvB,CAAC;AAyKF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAkBvD,CAAC"}
1
+ {"version":3,"file":"varTableFromSentences.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/variations/varTableFromSentences.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAK7C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,EAAE,EAAE,eAAe,EAAE,CAAC;IACtB,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;CACvB,CAAC;AAwLF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAkBvD,CAAC"}
@@ -134,9 +134,21 @@ const getVarTableFromSentencesQuestion = (ops) => {
134
134
  const identifiers = {
135
135
  xs: xs.map((e) => e.toTree().toIdentifiers()),
136
136
  vars,
137
+ initTable: getInitTable(),
137
138
  };
138
139
  return getQuestionFromIdentifiers(identifiers);
139
140
  };
141
+ const getInitTable = () => {
142
+ const stringed = ["", "\\ ", "", "\\ ", "", "\\ ", ""];
143
+ const emptyLine = ["\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ "];
144
+ const inputLine = ["", "", "", "", "", "", ""];
145
+ return [
146
+ ["$x$", ...stringed],
147
+ ["$\\ $", ...emptyLine],
148
+ ["$f(x)$", ...inputLine],
149
+ ["$\\ $", ...emptyLine],
150
+ ];
151
+ };
140
152
  const getQuestionFromIdentifiers = (identifiers) => {
141
153
  return {
142
154
  answerTable: getAnswerTable(identifiers),
@@ -146,6 +158,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
146
158
  identifiers,
147
159
  hint: getHint(identifiers),
148
160
  correction: getCorrection(identifiers),
161
+ initTable: identifiers.initTable,
149
162
  };
150
163
  };
151
164
  export const varTableFromSentences = {
@@ -165,3 +178,5 @@ export const varTableFromSentences = {
165
178
  hasHintAndCorrection: true,
166
179
  answerType: "varTable",
167
180
  };
181
+ // caca
182
+ // /pas d'init table ?
@@ -0,0 +1,9 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ shape: number;
4
+ height: number;
5
+ width: number;
6
+ };
7
+ export declare const calculateAreaFromCodedShape: Exercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=calculateAreaFromCodedShape.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calculateAreaFromCodedShape.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/areas/calculateAreaFromCodedShape.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AA8KF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAsB7D,CAAC"}
@@ -0,0 +1,156 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { numberVEA } from "../../../../exercises/vea/numberVEA.js";
4
+ import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
5
+ import { randint } from "../../../../math/utils/random/randint.js";
6
+ import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
7
+ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
8
+ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
9
+ const getPropositions = (n, { answer, height, shape, width }) => {
10
+ const propositions = [];
11
+ addValidProp(propositions, answer);
12
+ tryToAddWrongProp(propositions, (height * width).frenchify());
13
+ tryToAddWrongProp(propositions, ((height * width) / 2).frenchify());
14
+ while (propositions.length < n) {
15
+ tryToAddWrongProp(propositions, ((3 / 4) * height * width + randint(-3, 3, [0])).frenchify());
16
+ }
17
+ return shuffleProps(propositions, n);
18
+ };
19
+ const getAnswer = (identifiers) => {
20
+ return multiply(0.75, identifiers.height * identifiers.width)
21
+ .simplify()
22
+ .toTex();
23
+ };
24
+ const getInstruction = (identifiers) => {
25
+ return `On considère la figure ci-dessous.
26
+
27
+ Quelle est l'aire de la surface colorée ?`;
28
+ };
29
+ const getHint = (identifiers) => {
30
+ return `L'aire de la surface colorée est égale à l'aire du rectangle $ABCD$ moins l'aire du triangle $CED$.`;
31
+ };
32
+ const getCorrection = (identifiers) => {
33
+ //rectangle - triangle
34
+ //moitié rectangle + triangle
35
+ //moitié reactangle + moitié moitié reactalge
36
+ const { height, shape, width } = identifiers;
37
+ return `Pour calculer l'aire de la surface colorée, on remarque qu'elle est égale à l'aire du rectangle $ABCD$ moins l'aire du triangle $CED$.
38
+
39
+ L'aire du rectangle $ABCD$ est égale à :
40
+
41
+ $$
42
+ ${multiply(height, width).toTex({ forceNoSimplification: true })}=${(height * width).frenchify()}
43
+ $$
44
+
45
+ On calcule ensuite l'aire du triangle $CED$. Puisqu'il est rectangle en $D$, son aire vaut :
46
+
47
+ $$
48
+ ${frac(multiply("CD", "DE"), 2).toTex({ forceTimesSign: true })}
49
+ $$
50
+
51
+ Or $CD = ${height.frenchify()}$ et $DE = ${(width / 2).frenchify()}$. L'aire de $CED$ vaut donc :
52
+
53
+ $$
54
+ ${frac(multiply(height, width / 2), 2).toTex()}=${((height * width) /
55
+ 4).frenchify()}
56
+ $$
57
+
58
+ L'aire de la surface colorée vaut donc :
59
+
60
+ $$
61
+ ${substract(height * width, (height * width) / 4).toTex()} = ${getAnswer(identifiers)}
62
+ $$
63
+
64
+
65
+
66
+ `;
67
+ };
68
+ const getGGBOptions = (identifiers) => {
69
+ const { height, shape, width } = identifiers;
70
+ const ggb = new GeogebraConstructor({
71
+ commands: [
72
+ `B = (0,0)`,
73
+ `C = (${width},0)`,
74
+ `D = (${width},${height})`,
75
+ `A = (0,${height})`,
76
+ `E = (${width / 2},${height})`,
77
+ ...["A", "B", "C", "D", "E"].flatMap((e) => [
78
+ `SetVisibleInView(${e},1, false)`,
79
+ `SetFixed(${e}, true)`,
80
+ ]),
81
+ `Segment(E, C)`,
82
+ `Segment(D, C)`,
83
+ `se1 = Segment(A, E)`,
84
+ `se2 = Segment(E,D)`,
85
+ `SetDecoration(se1, 2)`,
86
+ `SetDecoration(se2, 2)`,
87
+ `a = Angle(C,B,A)`,
88
+ `ShowLabel(a, false)`,
89
+ `b = Angle(B,A,D)`,
90
+ `ShowLabel(b, false)`,
91
+ `c = Angle(A,D,C)`,
92
+ `ShowLabel(c, false)`,
93
+ `P = Polygon(B,A,E,C)`,
94
+ `SetFixed(P, true)`,
95
+ `Text("$\\scriptsize B$", (0, -0.1*${height}), true, true, 0, 0)`,
96
+ `Text("$\\scriptsize C$", (${width}, -0.1*${height}), true, true, 0, 0)`,
97
+ `Text("$\\scriptsize D$", (${width}, ${height}+0.3+${Math.min(1, 0.1 * height)}), true, true, 0, 0)`,
98
+ `Text("$\\scriptsize E$", (${width / 2}, ${height}+0.3+${Math.min(1, 0.1 * height)}), true, true, 0, 0)`,
99
+ `Text("$\\scriptsize A$", (0, ${height}+0.3+${Math.min(1, 0.1 * height)}), true, true, 0, 0)`,
100
+ `Text("$\\scriptsize ${height}$", (-0.4, ${height / 2}), true, true, 0, 0)`,
101
+ `Text("$\\scriptsize ${width}$", (${width / 2}, -0.1*${height}), true, true, 0, 0)`,
102
+ ],
103
+ hideAxes: true,
104
+ hideGrid: true,
105
+ });
106
+ return ggb.getOptions({
107
+ coords: [-1, width + 1, -1.5, height + 1.5],
108
+ });
109
+ };
110
+ const getKeys = (identifiers) => {
111
+ return [];
112
+ };
113
+ const isAnswerValid = (ans, { answer }) => {
114
+ return numberVEA(ans, answer);
115
+ };
116
+ const getCalculateAreaFromCodedShapeQuestion = (opts) => {
117
+ const width = randint(3, 11);
118
+ const height = randint(1, width);
119
+ const identifiers = {
120
+ shape: 1,
121
+ height,
122
+ width,
123
+ };
124
+ return getQuestionFromIdentifiers(identifiers);
125
+ };
126
+ const getQuestionFromIdentifiers = (identifiers) => {
127
+ return {
128
+ answer: getAnswer(identifiers),
129
+ instruction: getInstruction(identifiers),
130
+ keys: getKeys(identifiers),
131
+ answerFormat: "tex",
132
+ identifiers,
133
+ hint: getHint(identifiers),
134
+ correction: getCorrection(identifiers),
135
+ ggbOptions: getGGBOptions(identifiers),
136
+ };
137
+ };
138
+ export const calculateAreaFromCodedShape = {
139
+ id: "calculateAreaFromCodedShape",
140
+ label: "Calculer l'aire d'une figure codée",
141
+ isSingleStep: true,
142
+ generator: (nb, opts) => getDistinctQuestions(() => getCalculateAreaFromCodedShapeQuestion(opts), nb),
143
+ qcmTimer: 60,
144
+ freeTimer: 60,
145
+ getPropositions,
146
+ isAnswerValid,
147
+ subject: "Mathématiques",
148
+ getHint,
149
+ getCorrection,
150
+ getInstruction,
151
+ getAnswer,
152
+ getGGBOptions,
153
+ hasGeogebra: true,
154
+ getQuestionFromIdentifiers,
155
+ hasHintAndCorrection: true,
156
+ };
@@ -7,4 +7,5 @@ export * from "./triangleAreaV2.js";
7
7
  export * from "./squareSideFromArea.js";
8
8
  export * from "./rectangleSideFromArea.js";
9
9
  export * from "./circleRadiusFromArea.js";
10
+ export * from "./calculateAreaFromCodedShape.js";
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/areas/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/areas/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kCAAkC,CAAC"}
@@ -7,3 +7,4 @@ export * from "./triangleAreaV2.js";
7
7
  export * from "./squareSideFromArea.js";
8
8
  export * from "./rectangleSideFromArea.js";
9
9
  export * from "./circleRadiusFromArea.js";
10
+ export * from "./calculateAreaFromCodedShape.js";
@@ -1,2 +1,3 @@
1
1
  export * from "./pythagoreOrThales.js";
2
+ export * from "./orthogonalProjectFromPicture.js";
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidian/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidian/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,mCAAmC,CAAC"}
@@ -1 +1,2 @@
1
1
  export * from "./pythagoreOrThales.js";
2
+ export * from "./orthogonalProjectFromPicture.js";
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ point: string;
4
+ line: string;
5
+ };
6
+ export declare const orthogonalProjectFromPicture: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=orthogonalProjectFromPicture.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orthogonalProjectFromPicture.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidian/orthogonalProjectFromPicture.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAkMF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAoB9D,CAAC"}
@@ -0,0 +1,197 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { Point } from "../../../../math/geometry/point.js";
4
+ import { random } from "../../../../utils/alea/random.js";
5
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
6
+ const getPoints = () => {
7
+ const points = [
8
+ new Point("A", 0, 0),
9
+ new Point("B", 4, 0),
10
+ new Point("C", 4, 4),
11
+ new Point("D", 0, 4),
12
+ new Point("E", 0, 2),
13
+ new Point("F", 4, 2),
14
+ new Point("G", 2, 4),
15
+ new Point("H", 2, 0),
16
+ new Point("I", 1, 3),
17
+ new Point("J", 3, 1),
18
+ new Point("K", 1, 1),
19
+ new Point("L", 3, 3),
20
+ new Point("P", 2, 2),
21
+ ];
22
+ return points;
23
+ };
24
+ const getNames = () => {
25
+ const names = [
26
+ "A",
27
+ "B",
28
+ "C",
29
+ "D",
30
+ "E",
31
+ "F",
32
+ "G",
33
+ "H",
34
+ "I",
35
+ "J",
36
+ "K",
37
+ "L",
38
+ "P",
39
+ ];
40
+ return names;
41
+ };
42
+ const getPropositions = (n, { answer }) => {
43
+ const propositions = [];
44
+ addValidProp(propositions, answer);
45
+ const names = getNames();
46
+ while (propositions.length < n) {
47
+ tryToAddWrongProp(propositions, random(names));
48
+ }
49
+ return shuffleProps(propositions, n);
50
+ };
51
+ const getAnswer = (identifiers) => {
52
+ const projs = [
53
+ { line: "AB", A: ["A", "E", "D"], H: ["G", "P", "H"], B: ["C", "F", "B"] },
54
+ { line: "EF", E: ["A", "E", "D"], P: ["G", "P", "H"], F: ["C", "F", "B"] },
55
+ { line: "DC", D: ["A", "E", "D"], G: ["G", "P", "H"], C: ["C", "F", "B"] },
56
+ { line: "DA", A: ["A", "H", "B"], E: ["E", "P", "F"], D: ["D", "G", "C"] },
57
+ { line: "GH", H: ["A", "H", "B"], P: ["E", "P", "F"], G: ["D", "G", "C"] },
58
+ { line: "CB", B: ["A", "H", "B"], F: ["E", "P", "F"], C: ["D", "G", "C"] },
59
+ {
60
+ line: "DB",
61
+ D: ["D"],
62
+ I: ["E", "I", "G"],
63
+ P: ["A", "K", "P", "L", "C"],
64
+ J: ["H", "J", "F"],
65
+ B: ["B"],
66
+ },
67
+ {
68
+ line: "AC",
69
+ C: ["C"],
70
+ K: ["E", "K", "H"],
71
+ P: ["D", "I", "P", "J", "B"],
72
+ L: ["G", "L", "F"],
73
+ A: ["A"],
74
+ },
75
+ {
76
+ line: "EH",
77
+ E: ["E", "I", "G"],
78
+ H: ["H", "J", "F"],
79
+ K: ["A", "K", "P", "L", "C"],
80
+ },
81
+ {
82
+ line: "GF",
83
+ G: ["E", "I", "G"],
84
+ F: ["H", "J", "F"],
85
+ L: ["A", "K", "P", "L", "C"],
86
+ },
87
+ {
88
+ line: "EG",
89
+ E: ["E", "K", "H"],
90
+ G: ["G", "L", "F"],
91
+ I: ["D", "I", "P", "J", "B"],
92
+ },
93
+ {
94
+ line: "HF",
95
+ H: ["E", "K", "H"],
96
+ F: ["G", "L", "F"],
97
+ J: ["D", "I", "P", "J", "B"],
98
+ },
99
+ ];
100
+ const dataSet = projs.find((e) => e.line === identifiers.line);
101
+ for (const [key, value] of Object.entries(dataSet)) {
102
+ if (key === "line")
103
+ continue;
104
+ if (value.includes(identifiers.point)) {
105
+ return key;
106
+ }
107
+ }
108
+ return "";
109
+ };
110
+ const getInstruction = (identifiers) => {
111
+ const { line, point } = identifiers;
112
+ return `On considère le carré $ABCD$ ci-dessous :
113
+
114
+ ![](https://heureuxhasarddocsbucket.s3.eu-west-3.amazonaws.com/mathliveV2/activities/quizzes/generator/pointsOnSquare.png)
115
+
116
+ Quel est le projeté orthogonal de $${point}$ sur la droite $\\left(${line}\\right)$ ?
117
+ `;
118
+ };
119
+ const getHint = (identifiers) => {
120
+ return `- Si $A$ est un point sur une droite $d$, alors le projeté orthogonal de $A$ sur $d$ est $A$.
121
+
122
+ - Si $A$ n'appartient pas à la droite $d$, alors le projeté orthogonal de $A$ sur $d$ est le point $H$ sur $d$ tel que la droite $(AH)$ est perpendiculaire à $d$.`;
123
+ };
124
+ const getCorrection = (identifiers) => {
125
+ const { line, point } = identifiers;
126
+ //si point sur droite
127
+ //sinon
128
+ const points = getPoints();
129
+ const pointAnswer = getAnswer(identifiers);
130
+ const pointObj = points.find((e) => e.name === point);
131
+ const linePoints = points.filter((e) => line.includes(e.name));
132
+ const isOnLine = pointObj.isAligned(linePoints[0], linePoints[1]);
133
+ if (isOnLine) {
134
+ return `Puisque $${point}$ appartient à la droite $\\left(${line}\\right)$, le projeté orthogonal de $${point}$ sur $\\left(${line}\\right)$ est $${point}$.`;
135
+ }
136
+ else {
137
+ return `Les droites $\\left(${line}\\right)$ et $\\left(${point}${pointAnswer}\\right)$ sont perpendiculaires. De plus, le point $${pointAnswer}$ appartient à la droite $${line}$. Le projeté orthogonal de $${point}$ sur $\\left(${line}\\right)$ est donc $${pointAnswer}$.`;
138
+ }
139
+ };
140
+ const getKeys = (identifiers) => {
141
+ const names = getNames();
142
+ return names;
143
+ };
144
+ const isAnswerValid = (ans, { answer }) => {
145
+ try {
146
+ return ans === answer;
147
+ }
148
+ catch (err) {
149
+ return handleVEAError(err);
150
+ }
151
+ };
152
+ const getOrthogonalProjectFromPictureQuestion = (ops) => {
153
+ const data = [
154
+ { lines: ["AB", "EF", "DC"], excludes: ["I", "J", "K", "L"] },
155
+ { lines: ["DA", "GH", "CB"], excludes: ["I", "J", "K", "L"] },
156
+ { lines: ["DB", "AC"], excludes: [] },
157
+ { lines: ["EH", "GF"], excludes: ["B", "D"] },
158
+ { lines: ["EG", "HF"], excludes: ["A", "C"] },
159
+ ];
160
+ const names = getNames();
161
+ const dataSet = random(data);
162
+ const line = random(dataSet.lines);
163
+ const point = random(names, dataSet.excludes);
164
+ const identifiers = {
165
+ line,
166
+ point,
167
+ };
168
+ return getQuestionFromIdentifiers(identifiers);
169
+ };
170
+ const getQuestionFromIdentifiers = (identifiers) => {
171
+ return {
172
+ answer: getAnswer(identifiers),
173
+ instruction: getInstruction(identifiers),
174
+ keys: getKeys(identifiers),
175
+ answerFormat: "tex",
176
+ identifiers,
177
+ hint: getHint(identifiers),
178
+ correction: getCorrection(identifiers),
179
+ };
180
+ };
181
+ export const orthogonalProjectFromPicture = {
182
+ id: "orthogonalProjectFromPicture",
183
+ label: "Identifier le projeté orthogonal d'un point sur une figure codée",
184
+ isSingleStep: true,
185
+ generator: (nb, opts) => getDistinctQuestions(() => getOrthogonalProjectFromPictureQuestion(opts), nb),
186
+ qcmTimer: 60,
187
+ freeTimer: 60,
188
+ getPropositions,
189
+ isAnswerValid,
190
+ subject: "Mathématiques",
191
+ getInstruction,
192
+ getHint,
193
+ getCorrection,
194
+ getAnswer,
195
+ getQuestionFromIdentifiers,
196
+ hasHintAndCorrection: true,
197
+ };
@@ -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;AAOrC,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;AA0IF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgBpE,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;AAOrC,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;AA8IF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAiBpE,CAAC"}
@@ -23,8 +23,12 @@ const getEndPoint = (identifiers) => {
23
23
  const end = vector.getEndPoint(startPoint, identifiers.startPoint + "'");
24
24
  return end;
25
25
  };
26
- // const getHint: GetHint<Identifiers> = (identifiers) => {};
27
- // const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
26
+ const getHint = (identifiers) => {
27
+ return ``;
28
+ };
29
+ const getCorrection = (identifiers) => {
30
+ return ``;
31
+ };
28
32
  const getGGBAnswer = (identifiers) => {
29
33
  return getEndPoint(identifiers).toGGBCommand();
30
34
  };
@@ -108,11 +112,12 @@ export const pointImageFromTranslation = {
108
112
  ggbTimer: 60,
109
113
  isGGBAnswerValid,
110
114
  subject: "Mathématiques",
111
- // getHint,
112
- // getCorrection,
115
+ getHint,
116
+ getCorrection,
113
117
  getGGBAnswer,
114
118
  getStudentGGBOptions,
115
119
  answerType: "GGB",
116
120
  options,
117
121
  getQuestionFromIdentifiers,
122
+ // hasHintAndCorrection: true,
118
123
  };
@@ -0,0 +1,9 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ shape: "square" | "rectangle";
4
+ side: number;
5
+ side2?: number;
6
+ };
7
+ export declare const calculateDiagonalFromSides: Exercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=calculateDiagonalFromSides.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calculateDiagonalFromSides.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/pythagore/calculateDiagonalFromSides.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,QAAQ,GAAG,WAAW,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAqJF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAkB5D,CAAC"}