math-exercises 3.0.132 → 3.0.134

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 (87) 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 +5 -5
  4. package/lib/exercises/math/calcul/ordering/compareA10N.d.ts.map +1 -1
  5. package/lib/exercises/math/calcul/ordering/compareA10N.js +12 -7
  6. package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.d.ts.map +1 -1
  7. package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.js +8 -6
  8. package/lib/exercises/math/calculLitteral/distributivity/doubleDistri.d.ts.map +1 -1
  9. package/lib/exercises/math/calculLitteral/distributivity/doubleDistri.js +4 -0
  10. package/lib/exercises/math/calculLitteral/equation/equationFromProblem.d.ts.map +1 -1
  11. package/lib/exercises/math/calculLitteral/equation/equationFromProblem.js +8 -9
  12. package/lib/exercises/math/calculLitteral/simplifying/compareATimes0.d.ts.map +1 -1
  13. package/lib/exercises/math/calculLitteral/simplifying/compareATimes0.js +4 -4
  14. package/lib/exercises/math/conversion/prefixToNumber.d.ts +0 -2
  15. package/lib/exercises/math/conversion/prefixToNumber.d.ts.map +1 -1
  16. package/lib/exercises/math/conversion/prefixToNumber.js +27 -22
  17. package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.d.ts.map +1 -1
  18. package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.js +1 -2
  19. package/lib/exercises/math/functions/trinoms/roots/rootsReading.d.ts +4 -1
  20. package/lib/exercises/math/functions/trinoms/roots/rootsReading.d.ts.map +1 -1
  21. package/lib/exercises/math/functions/trinoms/roots/rootsReading.js +29 -9
  22. package/lib/exercises/math/geometry/cartesian/index.d.ts +1 -0
  23. package/lib/exercises/math/geometry/cartesian/index.d.ts.map +1 -1
  24. package/lib/exercises/math/geometry/cartesian/index.js +1 -0
  25. package/lib/exercises/math/geometry/cartesian/midpoint.d.ts.map +1 -1
  26. package/lib/exercises/math/geometry/cartesian/midpoint.js +8 -1
  27. package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.d.ts +6 -9
  28. package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.d.ts.map +1 -1
  29. package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.js +60 -137
  30. package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLineV2.d.ts +16 -0
  31. package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLineV2.d.ts.map +1 -0
  32. package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLineV2.js +213 -0
  33. package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.js +2 -2
  34. package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.js +6 -6
  35. package/lib/exercises/math/probaStat/probaAsSumOfProbas.d.ts +0 -1
  36. package/lib/exercises/math/probaStat/probaAsSumOfProbas.d.ts.map +1 -1
  37. package/lib/exercises/math/probaStat/probaAsSumOfProbas.js +52 -59
  38. package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.d.ts.map +1 -1
  39. package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.js +70 -23
  40. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFirstRankOne.d.ts +8 -0
  41. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFirstRankOne.d.ts.map +1 -0
  42. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFirstRankOne.js +105 -0
  43. package/lib/exercises/math/sequences/arithmetic/arithmeticFindTermFirstRankOne.d.ts +9 -0
  44. package/lib/exercises/math/sequences/arithmetic/arithmeticFindTermFirstRankOne.d.ts.map +1 -0
  45. package/lib/exercises/math/sequences/arithmetic/arithmeticFindTermFirstRankOne.js +99 -0
  46. package/lib/exercises/math/sequences/arithmetic/arithmeticRecurrenceFormulaUsage.d.ts.map +1 -1
  47. package/lib/exercises/math/sequences/arithmetic/arithmeticRecurrenceFormulaUsage.js +9 -1
  48. package/lib/exercises/math/sequences/arithmetic/index.d.ts +2 -0
  49. package/lib/exercises/math/sequences/arithmetic/index.d.ts.map +1 -1
  50. package/lib/exercises/math/sequences/arithmetic/index.js +2 -0
  51. package/lib/exercises/math/sequences/genericSequenceVariations.d.ts.map +1 -1
  52. package/lib/exercises/math/sequences/genericSequenceVariations.js +5 -1
  53. package/lib/exercises/math/sequences/geometric/geometricExplicitFormulaUsage.d.ts.map +1 -1
  54. package/lib/exercises/math/sequences/geometric/geometricExplicitFormulaUsage.js +7 -1
  55. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormula.d.ts.map +1 -1
  56. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormula.js +1 -1
  57. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstRankOne.d.ts +8 -0
  58. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstRankOne.d.ts.map +1 -0
  59. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstRankOne.js +112 -0
  60. package/lib/exercises/math/sequences/geometric/geometricFindTermFirstRankOne.d.ts +9 -0
  61. package/lib/exercises/math/sequences/geometric/geometricFindTermFirstRankOne.d.ts.map +1 -0
  62. package/lib/exercises/math/sequences/geometric/geometricFindTermFirstRankOne.js +97 -0
  63. package/lib/exercises/math/sequences/geometric/geometricReasonUsage.d.ts.map +1 -1
  64. package/lib/exercises/math/sequences/geometric/geometricReasonUsage.js +3 -1
  65. package/lib/exercises/math/sequences/geometric/geometricRecurrenceFormulaUsage.d.ts.map +1 -1
  66. package/lib/exercises/math/sequences/geometric/geometricRecurrenceFormulaUsage.js +9 -1
  67. package/lib/exercises/math/sequences/geometric/index.d.ts +2 -0
  68. package/lib/exercises/math/sequences/geometric/index.d.ts.map +1 -1
  69. package/lib/exercises/math/sequences/geometric/index.js +2 -0
  70. package/lib/exercises/math/sequences/recurrenceFormulaUsage.d.ts.map +1 -1
  71. package/lib/exercises/math/sequences/recurrenceFormulaUsage.js +10 -3
  72. package/lib/exercises/pc/index.d.ts +0 -1
  73. package/lib/exercises/pc/index.d.ts.map +1 -1
  74. package/lib/exercises/pc/index.js +0 -1
  75. package/lib/exercises/pc/motion/averageSpeed.d.ts +0 -2
  76. package/lib/exercises/pc/motion/averageSpeed.d.ts.map +1 -1
  77. package/lib/exercises/pc/motion/averageSpeed.js +28 -36
  78. package/lib/exercises/pc/weight/calculateWeight.d.ts +0 -1
  79. package/lib/exercises/pc/weight/calculateWeight.d.ts.map +1 -1
  80. package/lib/exercises/pc/weight/calculateWeight.js +26 -19
  81. package/lib/index.d.ts +26 -39
  82. package/lib/index.d.ts.map +1 -1
  83. package/lib/playgroundUtils.d.ts +3 -0
  84. package/lib/playgroundUtils.d.ts.map +1 -0
  85. package/lib/playgroundUtils.js +13 -0
  86. package/lib/server.js +126 -0
  87. package/package.json +1 -1
@@ -6,7 +6,7 @@ type Identifiers = {
6
6
  progCalcIds: ProgCalcIdentifiers;
7
7
  };
8
8
  type Options = {
9
- numberType: "Integer" | "Decimal";
9
+ numberType: "Entier" | "Décimal";
10
10
  nbSteps: string;
11
11
  nbDigits: string;
12
12
  };
@@ -1 +1 @@
1
- {"version":3,"file":"mentalProgramSolve.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/mentalCaluls/mentalProgramSolve.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAI7C,OAAO,EAGL,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;AA4BzC,KAAK,WAAW,GAAG;IACjB,qBAAqB,EAAE,eAAe,CAAC;IACvC,WAAW,EAAE,mBAAmB,CAAC;CAClC,CAAC;AAqOF,KAAK,OAAO,GAAG;IACb,UAAU,EAAE,SAAS,GAAG,SAAS,CAAC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAiCF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAyB7D,CAAC"}
1
+ {"version":3,"file":"mentalProgramSolve.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/mentalCaluls/mentalProgramSolve.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAI7C,OAAO,EAGL,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;AA4BzC,KAAK,WAAW,GAAG;IACjB,qBAAqB,EAAE,eAAe,CAAC;IACvC,WAAW,EAAE,mBAAmB,CAAC;CAClC,CAAC;AAqOF,KAAK,OAAO,GAAG;IACb,UAAU,EAAE,QAAQ,GAAG,SAAS,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAiCF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAyB7D,CAAC"}
@@ -88,7 +88,7 @@ const getInstruction = (identifiers, opts) => {
88
88
 
89
89
  ${str}`);
90
90
  const strProgCalc = arrStrProgCalc.reduce((acc, str) => acc + str);
91
- const strFinalNumber = opts?.numberType == "Integer"
91
+ const strFinalNumber = opts?.numberType == "Entier"
92
92
  ? nodeFinalNumber.evaluate().frenchify()
93
93
  : nodeFinalNumber
94
94
  .evaluate()
@@ -159,10 +159,10 @@ const getMentalProgramSolveQuestion = (optsIn) => {
159
159
  const opts = optsIn ? Object.assign(optsDefault, optsIn) : optsDefault;
160
160
  let nbDigits = 0;
161
161
  switch (opts.numberType) {
162
- case "Integer":
162
+ case "Entier":
163
163
  nbDigits = 0;
164
164
  break;
165
- case "Decimal":
165
+ case "Décimal":
166
166
  nbDigits = Number(opts.nbDigits);
167
167
  break;
168
168
  }
@@ -189,7 +189,7 @@ const getQuestionFromIdentifiers = (identifiers, opts) => {
189
189
  };
190
190
  };
191
191
  const optsDefault = {
192
- numberType: "Integer",
192
+ numberType: "Entier",
193
193
  nbSteps: "4",
194
194
  nbDigits: "0",
195
195
  };
@@ -198,7 +198,7 @@ const options = [
198
198
  id: "numberType",
199
199
  label: "Type de nombres utilisés",
200
200
  defaultValue: optsDefault.numberType,
201
- values: ["Integer", "Decimal"],
201
+ values: ["Entier", "Décimal"],
202
202
  target: GeneratorOptionTarget.generation,
203
203
  type: GeneratorOptionType.select,
204
204
  },
@@ -1 +1 @@
1
- {"version":3,"file":"compareA10N.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/ordering/compareA10N.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAkBrC,KAAK,IAAI,GAAG;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,KAAK,IAAI,GAAG;IACV,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,KAAK,EAAE,IAAI,EAAE,CAAC;CACf,CAAC;AA2TF,KAAK,OAAO,GAAG;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAyCF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgBtD,CAAC"}
1
+ {"version":3,"file":"compareA10N.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/ordering/compareA10N.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAkBrC,KAAK,IAAI,GAAG;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,KAAK,IAAI,GAAG;IACV,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,KAAK,EAAE,IAAI,EAAE,CAAC;CACf,CAAC;AA+TF,KAAK,OAAO,GAAG;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAyCF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgBtD,CAAC"}
@@ -17,15 +17,20 @@ const getTexForA10N = (a10N) => {
17
17
  };
18
18
  const getSciMultNodeForA10N = (a10N) => {
19
19
  const { a, n } = a10N;
20
- const sign = Math.sign(a);
21
- const sciMultNodeA = getSciMultNodeForA(sign * a);
22
- const factor = sign * sciMultNodeA.leftChild.evaluate();
23
- const nodePower10 = sciMultNodeA.rightChild;
24
- const exponent = nodePower10.rightChild.evaluate() + n;
25
- return multiply(factor, power(10, exponent));
20
+ if (a !== 0) {
21
+ const sign = Math.sign(a);
22
+ const sciMultNodeA = getSciMultNodeForA(sign * a);
23
+ const factor = sign * sciMultNodeA.leftChild.evaluate();
24
+ const nodePower10 = sciMultNodeA.rightChild;
25
+ const exponent = nodePower10.rightChild.evaluate() + n;
26
+ return multiply(factor, power(10, exponent));
27
+ }
28
+ else {
29
+ return multiply(a, power(10, n));
30
+ }
26
31
  };
27
32
  const getSciMultNodeForA = (a) => {
28
- //a must be positive
33
+ //a must be strictly positive
29
34
  const exponent = Math.floor(Math.log10(a));
30
35
  const factor = round(frac(a, power(10, exponent)).evaluate(), 2);
31
36
  const sciMultNode = multiply(factor, power(10, exponent));
@@ -1 +1 @@
1
- {"version":3,"file":"estimatePow10NPlusPow10MinusN.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AA8EF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAmB/D,CAAC"}
1
+ {"version":3,"file":"estimatePow10NPlusPow10MinusN.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAiFF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAmB/D,CAAC"}
@@ -8,7 +8,7 @@ const getInstruction = (identifiers) => {
8
8
  const A = varName;
9
9
  return `On considère $${A}=10^{${n}}+10^{-${n}}$.
10
10
 
11
- À quoi $A$ est-il environ égal ?`;
11
+ À quoi $${A}$ est-il environ égal ?`;
12
12
  };
13
13
  const getHint = (identifiers) => {
14
14
  const { n } = identifiers;
@@ -36,11 +36,13 @@ const getPropositions = (nbProps, { answer, ...identifiers }) => {
36
36
  const { n } = identifiers;
37
37
  const propositions = [];
38
38
  addValidProp(propositions, `10^{${n}}`, "tex");
39
- tryToAddWrongProp(propositions, `${(0).frenchify()}`, "tex");
40
- tryToAddWrongProp(propositions, `10^0`, "tex");
41
- tryToAddWrongProp(propositions, `100^0`, "tex");
42
- tryToAddWrongProp(propositions, `20^{-{${n}^2}}`, "tex");
43
- tryToAddWrongProp(propositions, `20^{${n}}`, "tex");
39
+ [
40
+ `${(0).frenchify()}`,
41
+ `10^0`,
42
+ random([`100^0`, `20^{-{${n}^2}}`, `20^{${n}}`]),
43
+ ].forEach((wrongTex) => {
44
+ tryToAddWrongProp(propositions, wrongTex, "tex");
45
+ });
44
46
  return shuffleProps(propositions, nbProps);
45
47
  };
46
48
  const getEstimatePow10NPlusPow10MinusNQuestion = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"doubleDistri.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/doubleDistri.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAgKF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CActD,CAAC"}
1
+ {"version":3,"file":"doubleDistri.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/doubleDistri.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAuKF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CActD,CAAC"}
@@ -103,6 +103,10 @@ const getPropositions = (n, { answer, affine1Coeffs, affine2Coeffs }) => {
103
103
  new Affine(affine1Coeffs[1], affine1Coeffs[0]),
104
104
  new Affine(affine2Coeffs[1], affine2Coeffs[0]),
105
105
  ];
106
+ tryToAddWrongProp(propositions, affines[0]
107
+ .multiply(new Affine(affines[1].a, randint(-9, 10, [affines[1].b])))
108
+ .toTree()
109
+ .toTex());
106
110
  tryToAddWrongProp(propositions, affines[0]
107
111
  .multiply(new Affine(-affines[1].a, randint(-9, 10, [affines[1].b])))
108
112
  .toTree()
@@ -1 +1 @@
1
- {"version":3,"file":"equationFromProblem.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationFromProblem.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAKlE,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AActE,KAAK,WAAW,GAAG;IACjB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,yBAAyB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC;IACzE,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,YAAY,EAAE,eAAe,CAAC;CAC/B,CAAC;AAmrBF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAcrD,CAAC"}
1
+ {"version":3,"file":"equationFromProblem.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationFromProblem.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAKlE,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAatE,KAAK,WAAW,GAAG;IACjB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,yBAAyB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC;IACzE,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,YAAY,EAAE,eAAe,CAAC;CAC/B,CAAC;AAsrBF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAcrD,CAAC"}
@@ -10,7 +10,6 @@ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
10
10
  import { substract } from "../../../../tree/nodes/operators/substractNode.js";
11
11
  import { random, randomMany } from "../../../../utils/alea/random.js";
12
12
  import { isOperatorNode, OperatorIds, } from "../../../../tree/nodes/operators/operatorNode.js";
13
- import { alignTex } from "../../../../utils/latex/alignTex.js";
14
13
  class ProblemConstructor {
15
14
  static byHydratingSkeleton(skeleton, groupNameToVarNameToValue, mysteryVarPath, shuffleArrays) {
16
15
  const shuffleFuncs = shuffleArrays.map((shuffleArray) => {
@@ -71,14 +70,14 @@ class Problem {
71
70
  });
72
71
  }
73
72
  getExplanationString() {
74
- const arrArr = Object.values(this.groups).map((group) => [
75
- `\\text{${group.getScalarString(this.mysteryVar).replaceAll("$", "")}}`,
76
- `:`,
77
- `${group
78
- .getNode(this.mysteryVar, this.groups, this.shuffleFuncs)
79
- .toTex()}`,
80
- ]);
81
- return alignTex(arrArr, false);
73
+ const arrArr = Object.values(this.groups).map((group) => `\n - ${group.getScalarString(this.mysteryVar)}` +
74
+ ` : ` +
75
+ `\n
76
+ $$
77
+ ${group.getNode(this.mysteryVar, this.groups, this.shuffleFuncs).toTex()}
78
+ $$
79
+ \n `);
80
+ return arrArr.join("");
82
81
  }
83
82
  }
84
83
  class ProblemVarGroup {
@@ -1 +1 @@
1
- {"version":3,"file":"compareATimes0.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/simplifying/compareATimes0.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAKrC,KAAK,IAAI,GAAG;IACV,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,IAAI,EAAE,CAAC;CACf,CAAC;AAqGF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAehD,CAAC"}
1
+ {"version":3,"file":"compareATimes0.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/simplifying/compareATimes0.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAKrC,KAAK,IAAI,GAAG;IACV,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,IAAI,EAAE,CAAC;CACf,CAAC;AAwGF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAehD,CAAC"}
@@ -45,9 +45,9 @@ const getCompareATimes0Question = () => {
45
45
  const nbInvalid = nbTotal - nbValid;
46
46
  const validItems = [
47
47
  `0 \\times a`,
48
- `a \\times 0`,
49
48
  `\\frac{0}{a}`,
50
49
  `a + (-a)`,
50
+ `a \\times 0`,
51
51
  ].map((tex) => {
52
52
  return {
53
53
  tex,
@@ -55,8 +55,8 @@ const getCompareATimes0Question = () => {
55
55
  };
56
56
  });
57
57
  const invalidItems = [
58
+ `\\frac{a}{0}`,
58
59
  `a \\times (-a)`,
59
- `(-a) \\times a`,
60
60
  `\\frac{a}{a}`,
61
61
  `\\frac{a}{-a}`,
62
62
  `a - (-a)`,
@@ -68,8 +68,8 @@ const getCompareATimes0Question = () => {
68
68
  };
69
69
  });
70
70
  const items = shuffle([
71
- ...shuffle(validItems).slice(0, nbValid),
72
- ...shuffle(invalidItems).slice(0, nbInvalid),
71
+ ...shuffle(validItems.slice(0, Math.max(2, nbValid))).slice(0, nbValid),
72
+ ...shuffle([...invalidItems.slice(0, 1), ...invalidItems.slice(1)]).slice(0, nbInvalid),
73
73
  ]);
74
74
  return getQuestionFromIdentifiers({ items });
75
75
  };
@@ -2,8 +2,6 @@ import { Exercise } from "../../exercise.js";
2
2
  type Identifiers = {
3
3
  prefixIndexesPool: number[];
4
4
  prefixIndex: number;
5
- isToPow10: boolean;
6
- isFromSymbol: boolean;
7
5
  };
8
6
  type Options = {
9
7
  prefixPool: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"prefixToNumber.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/prefixToNumber.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,QAAQ,EAiBT,MAAM,mBAAmB,CAAC;AAG3B,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAoMF,KAAK,OAAO,GAAG;IACb,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AA+EF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkBzD,CAAC"}
1
+ {"version":3,"file":"prefixToNumber.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/prefixToNumber.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,QAAQ,EAiBT,MAAM,mBAAmB,CAAC;AAG3B,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAyNF,KAAK,OAAO,GAAG;IACb,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AA0EF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAuBzD,CAAC"}
@@ -105,8 +105,10 @@ const getMdTable = (prefixes, indexBold = -1) => {
105
105
  ].map((str) => (i === indexBold ? boldify(str) : str))),
106
106
  ]);
107
107
  };
108
- const getInstruction = (identifiers) => {
109
- const { prefixIndex, isFromSymbol, isToPow10 } = identifiers;
108
+ const getInstruction = (identifiers, optsIn) => {
109
+ const opts = optsIn ?? optsDefault;
110
+ const { prefixIndex } = identifiers;
111
+ const { isFromSymbol, isToPow10 } = opts;
110
112
  const prefix = prefixes[prefixIndex];
111
113
  return `Quelle est la valeur du préfixe ${isFromSymbol ? `$${prefix.symbol}$` : prefix.name} ?
112
114
 
@@ -117,8 +119,10 @@ const getHint = (identifiers) => {
117
119
  const prefixPool = prefixIndexesPool.map((i) => prefixes[i]);
118
120
  return getMdTable(prefixPool);
119
121
  };
120
- const getCorrection = (identifiers) => {
121
- const { prefixIndexesPool, prefixIndex, isToPow10 } = identifiers;
122
+ const getCorrection = (identifiers, optsIn) => {
123
+ const opts = optsIn ?? optsDefault;
124
+ const { prefixIndexesPool, prefixIndex } = identifiers;
125
+ const { isToPow10 } = opts;
122
126
  const prefix = prefixes[prefixIndex];
123
127
  const prefixPool = prefixIndexesPool.map((i) => prefixes[i]);
124
128
  const indexBold = (() => {
@@ -135,13 +139,17 @@ ${!isToPow10
135
139
  ? `$${prefix.texPow10}$ correspond à l'écriture décimale $${prefix.texValue}$.`
136
140
  : ``}`;
137
141
  };
138
- const getAnswer = (identifiers) => {
139
- const { prefixIndex, isToPow10 } = identifiers;
142
+ const getAnswer = (identifiers, optsIn) => {
143
+ const opts = optsIn ?? optsDefault;
144
+ const { prefixIndex } = identifiers;
145
+ const { isToPow10 } = opts;
140
146
  const prefix = prefixes[prefixIndex];
141
147
  return isToPow10 ? prefix.texPow10 : prefix.texValue;
142
148
  };
143
- const getPropositions = (n, { answer, ...identifiers }) => {
144
- const { prefixIndexesPool, prefixIndex, isToPow10 } = identifiers;
149
+ const getPropositions = (n, { answer, ...identifiers }, optsIn) => {
150
+ const opts = optsIn ?? optsDefault;
151
+ const { prefixIndexesPool, prefixIndex } = identifiers;
152
+ const { isToPow10 } = opts;
145
153
  const propositions = [];
146
154
  addValidProp(propositions, answer);
147
155
  const wrongIndexesPool = prefixIndexesPool.filter((i) => i !== prefixIndex);
@@ -162,7 +170,7 @@ const isAnswerValid = (ans, { answer }) => {
162
170
  const nodeAnswer = parseAlgebraic(answer);
163
171
  return substract(nodeAns, nodeAnswer).evaluate() === 0;
164
172
  };
165
- const optionsDefault = {
173
+ const optsDefault = {
166
174
  prefixPool: prefixes.map((prefix) => prefix.name),
167
175
  isToPow10: true,
168
176
  isFromSymbol: true,
@@ -174,25 +182,25 @@ const options = [
174
182
  type: GeneratorOptionType.multiselect,
175
183
  target: GeneratorOptionTarget.generation,
176
184
  values: prefixes.map((prefix) => prefix.name),
177
- defaultValue: optionsDefault.prefixPool,
185
+ defaultValue: optsDefault.prefixPool,
178
186
  },
179
187
  {
180
188
  id: "isToPow10",
181
189
  label: "Réponse sous forme de puissance de 10 ?",
182
190
  type: GeneratorOptionType.checkbox,
183
191
  target: GeneratorOptionTarget.generation,
184
- defaultValue: optionsDefault.isToPow10,
192
+ defaultValue: optsDefault.isToPow10,
185
193
  },
186
194
  {
187
- id: "units",
195
+ id: "isFromSymbol",
188
196
  label: "Utiliser le symbole pour la question ?",
189
197
  type: GeneratorOptionType.checkbox,
190
198
  target: GeneratorOptionTarget.generation,
191
- defaultValue: optionsDefault.isFromSymbol,
199
+ defaultValue: optsDefault.isFromSymbol,
192
200
  },
193
201
  ];
194
202
  const getPrefixToNumberQuestion = (optsIn) => {
195
- const opts = optsIn ? Object.assign(optionsDefault, optsIn) : optionsDefault;
203
+ const opts = optsIn ?? optsDefault;
196
204
  const prefixIndexesPool = opts.prefixPool.map((prefixName) => {
197
205
  const prefixIndex = (() => {
198
206
  for (let i = 0; i < prefixes.length; i++) {
@@ -201,15 +209,11 @@ const getPrefixToNumberQuestion = (optsIn) => {
201
209
  }
202
210
  })();
203
211
  return prefixIndex;
204
- }) ?? optionsDefault.prefixPool;
212
+ });
205
213
  const prefixIndex = random(prefixIndexesPool);
206
- const isFromSymbol = optsIn?.isFromSymbol ?? optionsDefault.isFromSymbol;
207
- const isToPow10 = optsIn?.isToPow10 ?? optionsDefault.isToPow10;
208
214
  const identifiers = {
209
215
  prefixIndexesPool,
210
216
  prefixIndex,
211
- isFromSymbol,
212
- isToPow10,
213
217
  };
214
218
  return getQuestionFromIdentifiers(identifiers, optsIn);
215
219
  };
@@ -220,8 +224,9 @@ const getQuestionFromIdentifiers = (identifiers, opts) => {
220
224
  keys: [],
221
225
  answerFormat: "tex",
222
226
  identifiers,
223
- hint: getHint(identifiers),
224
- correction: getCorrection(identifiers),
227
+ hint: getHint(identifiers, opts),
228
+ correction: getCorrection(identifiers, opts),
229
+ options: opts,
225
230
  };
226
231
  return question;
227
232
  };
@@ -230,7 +235,7 @@ export const prefixToNumber = {
230
235
  connector: "=",
231
236
  label: "Convertir un préfixe en nombre",
232
237
  isSingleStep: true,
233
- generator: (nb, opts) => getDistinctQuestions(() => getPrefixToNumberQuestion(opts), nb, 10),
238
+ generator: (nb, opts) => getDistinctQuestions(() => getPrefixToNumberQuestion(opts), nb, 10, () => false),
234
239
  maxAllowedQuestions: 10,
235
240
  qcmTimer: 60,
236
241
  freeTimer: 60,
@@ -1 +1 @@
1
- {"version":3,"file":"drawAffineFromPointAndLeadingCoeff.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAOtC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAI7C,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,YAAY,EAAE,eAAe,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAoJF,KAAK,OAAO,GAAG;IACb,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AA4FF,eAAO,MAAM,kCAAkC,EAAE,QAAQ,CACvD,WAAW,EACX,OAAO,CAqBR,CAAC"}
1
+ {"version":3,"file":"drawAffineFromPointAndLeadingCoeff.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAOtC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAI7C,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,YAAY,EAAE,eAAe,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAmJF,KAAK,OAAO,GAAG;IACb,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AA4FF,eAAO,MAAM,kCAAkC,EAAE,QAAQ,CACvD,WAAW,EACX,OAAO,CAqBR,CAAC"}
@@ -51,8 +51,7 @@ const getInstruction = (identifiers) => {
51
51
  const pointA = PointConstructor.fromIdentifiers(pointIdsA);
52
52
  const coeff = NodeConstructor.fromIdentifiers(leadingCoeff);
53
53
  const texCoeff = numberType === "Fraction" ? coeff.toTex() : coeff.evaluate().frenchify();
54
- return `La fonction $${funcName}$ est telle que $f(x)=${texCoeff}x+b$ avec $b$ un nombre réel et
55
- $ ${funcName}(${pointA.x.toTex()}) = ${pointA.y.toTex()} $.
54
+ return `La fonction affine $${funcName}$ a pour représentation graphique une droite de coefficient directeur $${texCoeff}$ et qui passe par le point de coordonnées $\\left(${pointA.x.toTex()}; ${pointA.y.toTex()}\\right)$.
56
55
 
57
56
  Dans le repère, tracer la représentation graphique de la fonction $${funcName}$.`;
58
57
  };
@@ -4,6 +4,9 @@ type Identifiers = {
4
4
  b: number;
5
5
  c: number;
6
6
  };
7
- export declare const rootsReading: Exercise<Identifiers>;
7
+ type Options = {
8
+ withNoCoeffB: boolean;
9
+ };
10
+ export declare const rootsReading: Exercise<Identifiers, Options>;
8
11
  export {};
9
12
  //# sourceMappingURL=rootsReading.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rootsReading.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/roots/rootsReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAoGF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAY9C,CAAC"}
1
+ {"version":3,"file":"rootsReading.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/roots/rootsReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAgHF,KAAK,OAAO,GAAG;IACb,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAUF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAcvD,CAAC"}
@@ -1,8 +1,9 @@
1
- import { addValidProp, propWhile, shuffleProps, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
1
+ import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, propWhile, shuffleProps, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { randomColor } from "../../../../../geogebra/colors.js";
4
4
  import { GeogebraConstructor } from "../../../../../geogebra/geogebraConstructor.js";
5
5
  import { Trinom, TrinomConstructor } from "../../../../../math/polynomials/trinom.js";
6
+ import { randfloat } from "../../../../../math/utils/random/randfloat.js";
6
7
  import { randint } from "../../../../../math/utils/random/randint.js";
7
8
  import { divide } from "../../../../../tree/nodes/operators/divideNode.js";
8
9
  import { multiply } from "../../../../../tree/nodes/operators/multiplyNode.js";
@@ -39,13 +40,22 @@ const getGGBOptions = (identifiers) => {
39
40
  });
40
41
  return ggb.getOptions({ coords: trinom.getCoords() });
41
42
  };
42
- const getRootsReadingQuestion = () => {
43
- const nbRoots = probaLawFlip([
44
- [0, 0.2],
45
- [1, 0.4],
46
- [2, 0.4],
47
- ]);
48
- const trinom = TrinomConstructor.randomNiceRoots(nbRoots);
43
+ const getRootsReadingQuestion = (opts) => {
44
+ let trinom;
45
+ if (opts?.withNoCoeffB) {
46
+ const x1 = randint(-10, 10);
47
+ const x2 = -x1;
48
+ const a = randfloat(-3, 3, 3, [0]);
49
+ trinom = TrinomConstructor.fromRoots([x1, x2], a);
50
+ }
51
+ else {
52
+ const nbRoots = probaLawFlip([
53
+ [0, 0.2],
54
+ [1, 0.4],
55
+ [2, 0.4],
56
+ ]);
57
+ trinom = TrinomConstructor.randomNiceRoots(nbRoots);
58
+ }
49
59
  const identifiers = { a: trinom.a, b: trinom.b, c: trinom.c };
50
60
  return getQuestionFromIdentifiers(identifiers);
51
61
  };
@@ -89,11 +99,20 @@ const isAnswerValid = (ans, { a, b, c }) => {
89
99
  return (!!studentNumbers.length &&
90
100
  studentNumbers.every((nb, index) => Math.abs(nb - roots[index]) < 0.2));
91
101
  };
102
+ const options = [
103
+ {
104
+ id: "withNoCoeffB",
105
+ label: "N'utiliser que des polynômes de la forme $ax^2 + b$",
106
+ target: GeneratorOptionTarget.generation,
107
+ type: GeneratorOptionType.checkbox,
108
+ defaultValue: false,
109
+ },
110
+ ];
92
111
  export const rootsReading = {
93
112
  id: "rootsReading",
94
113
  label: "Lire graphiquement les racines d'un trinôme",
95
114
  isSingleStep: true,
96
- generator: (nb) => getDistinctQuestions(getRootsReadingQuestion, nb),
115
+ generator: (nb, opts) => getDistinctQuestions(() => getRootsReadingQuestion(opts), nb),
97
116
  qcmTimer: 60,
98
117
  freeTimer: 60,
99
118
  getPropositions,
@@ -101,4 +120,5 @@ export const rootsReading = {
101
120
  hasGeogebra: true,
102
121
  subject: "Mathématiques",
103
122
  getQuestionFromIdentifiers,
123
+ options,
104
124
  };
@@ -11,6 +11,7 @@ export * from "./readAbscissOnLine.js";
11
11
  export * from "./readAbscissOnSemiLine.js";
12
12
  export * from "./placeAbscissOnLine.js";
13
13
  export * from "./placeAbscissOnSemiLine.js";
14
+ export * from "./placeAbscissOnSemiLineV2.js";
14
15
  export * from "./cartesianFromVectorAndPoint.js";
15
16
  export * from "./cartesianFromTwoPoints.js";
16
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oCAAoC,CAAC;AAEnD,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oCAAoC,CAAC;AAEnD,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC"}
@@ -12,5 +12,6 @@ export * from "./readAbscissOnLine.js";
12
12
  export * from "./readAbscissOnSemiLine.js";
13
13
  export * from "./placeAbscissOnLine.js";
14
14
  export * from "./placeAbscissOnSemiLine.js";
15
+ export * from "./placeAbscissOnSemiLineV2.js";
15
16
  export * from "./cartesianFromVectorAndPoint.js";
16
17
  export * from "./cartesianFromTwoPoints.js";
@@ -1 +1 @@
1
- {"version":3,"file":"midpoint.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/midpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AA+IF,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAa1C,CAAC"}
1
+ {"version":3,"file":"midpoint.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/midpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAsKF,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAa1C,CAAC"}
@@ -6,6 +6,7 @@ import { PointNode } from "../../../../tree/nodes/geometry/pointNode.js";
6
6
  import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
7
7
  import { add } from "../../../../tree/nodes/operators/addNode.js";
8
8
  import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
9
+ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
9
10
  import { shuffle } from "../../../../utils/alea/shuffle.js";
10
11
  import { alignTex } from "../../../../utils/latex/alignTex.js";
11
12
  const getPoints = (identifiers) => {
@@ -73,9 +74,15 @@ const getQuestionFromIdentifiers = (identifiers) => {
73
74
  };
74
75
  return question;
75
76
  };
76
- const getPropositions = (n, { answer }) => {
77
+ const getPropositions = (n, { answer, coordsA, coordsB }) => {
77
78
  const propositions = [];
78
79
  addValidProp(propositions, answer);
80
+ tryToAddWrongProp(propositions, new Point("I", frac(add(coordsA[0], coordsA[1]), 2), frac(add(coordsB[0], coordsB[1]), 2))
81
+ .simplify()
82
+ .toTexWithCoords());
83
+ tryToAddWrongProp(propositions, new Point("I", frac(substract(coordsA[0], coordsB[0]), 2), frac(substract(coordsB[0], coordsB[1]), 2))
84
+ .simplify()
85
+ .toTexWithCoords());
79
86
  propWhile(propositions, n, () => {
80
87
  const [tempCoords1, tempsCoords2] = distinctRandTupleInt(2, 2, {
81
88
  from: -9,
@@ -1,16 +1,13 @@
1
1
  import { Exercise } from "../../../../exercises/exercise.js";
2
2
  import { NumberType } from "../../../../math/numbers/nombre.js";
3
- import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
4
3
  type Identifiers = {
5
4
  abscissType: NumberType;
6
- axisUnit: NodeIdentifiers;
7
- absciss1: NodeIdentifiers;
8
- absciss2: NodeIdentifiers;
5
+ axisUnit: number;
6
+ oneUnitTex: string;
7
+ absciss: number;
8
+ abscissTex: string;
9
+ coeff: number;
9
10
  };
10
- type Options = {
11
- questionType: "standard" | "éviter le comptage";
12
- numberType: "Entiers" | "Rationnels" | "Décimaux";
13
- };
14
- export declare const placeAbscissOnSemiLine: Exercise<Identifiers, Options>;
11
+ export declare const placeAbscissOnSemiLine: Exercise<Identifiers>;
15
12
  export {};
16
13
  //# sourceMappingURL=placeAbscissOnSemiLine.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"placeAbscissOnSemiLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAQrC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAK1D,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAK7C,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,UAAU,CAAC;IACxB,QAAQ,EAAE,eAAe,CAAC;IAC1B,QAAQ,EAAE,eAAe,CAAC;IAC1B,QAAQ,EAAE,eAAe,CAAC;CAC3B,CAAC;AAkOF,KAAK,OAAO,GAAG;IACb,YAAY,EAAE,UAAU,GAAG,oBAAoB,CAAC;IAChD,UAAU,EAAE,SAAS,GAAG,YAAY,GAAG,UAAU,CAAC;CACnD,CAAC;AA6BF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAYjE,CAAC"}
1
+ {"version":3,"file":"placeAbscissOnSemiLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAQ1D,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,UAAU,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AA6IF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAWxD,CAAC"}