math-exercises 2.2.48 → 2.2.49

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 (53) hide show
  1. package/lib/exercises/exercise.d.ts +5 -1
  2. package/lib/exercises/exercise.d.ts.map +1 -1
  3. package/lib/exercises/math/calcul/fractions/fractionsSum.d.ts +1 -1
  4. package/lib/exercises/math/calcul/fractions/fractionsSum.d.ts.map +1 -1
  5. package/lib/exercises/math/calcul/fractions/fractionsSum.js +12 -4
  6. package/lib/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.d.ts.map +1 -1
  7. package/lib/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.js +33 -5
  8. package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.d.ts.map +1 -1
  9. package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.js +39 -5
  10. package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.d.ts.map +1 -1
  11. package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.js +33 -8
  12. package/lib/exercises/math/geometry/index.d.ts +1 -0
  13. package/lib/exercises/math/geometry/index.d.ts.map +1 -1
  14. package/lib/exercises/math/geometry/index.js +1 -0
  15. package/lib/exercises/math/geometry/parametric/extractPointFromParametricLine.d.ts +8 -0
  16. package/lib/exercises/math/geometry/parametric/extractPointFromParametricLine.d.ts.map +1 -0
  17. package/lib/exercises/math/geometry/parametric/extractPointFromParametricLine.js +110 -0
  18. package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.d.ts +8 -0
  19. package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.d.ts.map +1 -0
  20. package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.js +108 -0
  21. package/lib/exercises/math/geometry/parametric/index.d.ts +4 -0
  22. package/lib/exercises/math/geometry/parametric/index.d.ts.map +1 -0
  23. package/lib/exercises/math/geometry/parametric/index.js +19 -0
  24. package/lib/exercises/math/geometry/parametric/pointFromParametricLine.d.ts +12 -0
  25. package/lib/exercises/math/geometry/parametric/pointFromParametricLine.d.ts.map +1 -0
  26. package/lib/exercises/math/geometry/parametric/pointFromParametricLine.js +95 -0
  27. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormula.d.ts.map +1 -1
  28. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormula.js +66 -24
  29. package/lib/index.d.ts +14 -1
  30. package/lib/index.d.ts.map +1 -1
  31. package/lib/math/geometry/parametricLine.d.ts +15 -0
  32. package/lib/math/geometry/parametricLine.d.ts.map +1 -0
  33. package/lib/math/geometry/parametricLine.js +47 -0
  34. package/lib/math/geometry/spacePoint.d.ts +3 -0
  35. package/lib/math/geometry/spacePoint.d.ts.map +1 -1
  36. package/lib/math/geometry/spacePoint.js +12 -0
  37. package/lib/math/geometry/spaceVector.d.ts +5 -0
  38. package/lib/math/geometry/spaceVector.d.ts.map +1 -1
  39. package/lib/math/geometry/spaceVector.js +20 -0
  40. package/lib/server.js +7 -3
  41. package/lib/tree/parsers/rationalParser.d.ts +2 -0
  42. package/lib/tree/parsers/rationalParser.d.ts.map +1 -1
  43. package/lib/tree/parsers/rationalParser.js +33 -8
  44. package/lib/tree/parsers/spacePointParser.d.ts +3 -0
  45. package/lib/tree/parsers/spacePointParser.d.ts.map +1 -0
  46. package/lib/tree/parsers/spacePointParser.js +18 -0
  47. package/lib/tree/parsers/spaceVectorParser.d.ts +3 -0
  48. package/lib/tree/parsers/spaceVectorParser.d.ts.map +1 -0
  49. package/lib/tree/parsers/spaceVectorParser.js +18 -0
  50. package/lib/tree/parsers/valueParser.d.ts +2 -0
  51. package/lib/tree/parsers/valueParser.d.ts.map +1 -0
  52. package/lib/tree/parsers/valueParser.js +10 -0
  53. package/package.json +1 -1
@@ -19,11 +19,14 @@ export declare enum GeneratorOptionType {
19
19
  checkbox = "checkbox",
20
20
  select = "select"
21
21
  }
22
- export type GeneratorOption = {
22
+ export type GeneratorOption<TValue = any> = {
23
23
  id: string;
24
24
  label: string;
25
25
  type: GeneratorOptionType;
26
26
  target: GeneratorOptionTarget;
27
+ tooltipText?: string;
28
+ defaultValue?: TValue;
29
+ values?: TValue[];
27
30
  };
28
31
  export type Proposition = {
29
32
  id: string;
@@ -63,6 +66,7 @@ export interface Question<TIdentifiers = {}, TOptions = {}> {
63
66
  correction?: string;
64
67
  startStatement?: string;
65
68
  answer?: string;
69
+ answers?: string[];
66
70
  answerFormat?: "tex" | "raw";
67
71
  ggbAnswer?: string[];
68
72
  keyboardOptions?: KeyboardOptions;
@@ -1 +1 @@
1
- {"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAIhD,eAAO,MAAM,YAAY,UAChB,WAAW,EAAE,aACT,MAAM,WACT,KAAK,GAAG,KAAK,SAQtB,CAAC;AACF,eAAO,MAAM,YAAY,UAChB,WAAW,EAAE,aACT,MAAM,WACT,KAAK,GAAG,KAAK,SAQtB,CAAC;AACF,eAAO,MAAM,iBAAiB,UACrB,WAAW,EAAE,aACT,MAAM,WACT,KAAK,GAAG,KAAK,SAUtB,CAAC;AAEF,eAAO,MAAM,YAAY,UAAW,WAAW,EAAE,KAAK,MAAM,kBAE3D,CAAC;AAEF,oBAAY,qBAAqB;IAC/B,UAAU,eAAe;IACzB,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,WAAW,gBAAgB;IAC3B,IAAI,SAAS;IACb,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,GAAG,QAAQ;IACX,IAAI,SAAS;CACd;AACD,oBAAY,mBAAmB;IAC7B,QAAQ,aAAa;IACrB,MAAM,WAAW;CAClB;AACD,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd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YAAY,EAAE,QAAQ,CAAC,CAAC;CACjD;AAED,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,UAAU,GACV,SAAS,GACT,UAAU,GACV,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,MAAM,WAAW,GACnB,OAAO,GACP,cAAc,GACd,iBAAiB,GACjB,SAAS,GACT,8BAA8B,GAC9B,aAAa,GACb,YAAY,GACZ,SAAS,GACT,0BAA0B,GAC1B,WAAW,GACX,2BAA2B,GAC3B,eAAe,GACf,eAAe,GACf,kBAAkB,GAClB,WAAW,GACX,mBAAmB,GACnB,wBAAwB,GACxB,WAAW,GACX,uBAAuB,GACvB,uBAAuB,GACvB,aAAa,GACb,aAAa,GACb,SAAS,GACT,qBAAqB,GACrB,oBAAoB,GACpB,UAAU,GACV,mBAAmB,GACnB,YAAY,GACZ,cAAc,GACd,YAAY,GACZ,cAAc,GACd,kBAAkB,GAClB,kBAAkB,GAClB,QAAQ,GACR,YAAY,GACZ,QAAQ,GACR,iBAAiB,GACjB,cAAc,GACd,cAAc,GACd,QAAQ,GACR,UAAU,GACV,uBAAuB,GACvB,oBAAoB,GACpB,eAAe,GACf,gBAAgB,GAChB,UAAU,CAAC;AAEf,MAAM,MAAM,SAAS,GACjB,mBAAmB,GACnB,sBAAsB,GACtB,QAAQ,GACR,kBAAkB,GAClB,WAAW,GACX,SAAS,GACT,cAAc,GACd,+CAA+C,GAC/C,OAAO,GACP,KAAK,GACL,wBAAwB,GACxB,SAAS,GACT,KAAK,GACL,aAAa,GACb,4BAA4B,GAC5B,oBAAoB,GACpB,WAAW,GACX,iBAAiB,GACjB,SAAS,CAAC"}
@@ -4,7 +4,7 @@ type Identifiers = {
4
4
  rational2: [number, number];
5
5
  };
6
6
  type Options = {
7
- allowNonIrreductible: boolean;
7
+ allowNonIrreductible?: boolean;
8
8
  };
9
9
  export declare const fractionsSum: Exercise<Identifiers, Options>;
10
10
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"fractionsSum.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsSum.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3B,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7B,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,oBAAoB,EAAE,OAAO,CAAC;CAC/B,CAAC;AAgFF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAevD,CAAC"}
1
+ {"version":3,"file":"fractionsSum.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsSum.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,0BAA0B,CAAC;AAWlC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3B,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7B,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAyFF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAevD,CAAC"}
@@ -5,7 +5,7 @@ const exercise_1 = require("../../../../exercises/exercise");
5
5
  const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
6
  const rational_1 = require("../../../../math/numbers/rationals/rational");
7
7
  const addNode_1 = require("../../../../tree/nodes/operators/addNode");
8
- const latexParser_1 = require("../../../../tree/parsers/latexParser");
8
+ const rationalParser_1 = require("../../../../tree/parsers/rationalParser");
9
9
  const shuffle_1 = require("../../../../utils/alea/shuffle");
10
10
  const getFractionsSum = (opts) => {
11
11
  const rational = rational_1.RationalConstructor.randomIrreductible();
@@ -14,7 +14,13 @@ const getFractionsSum = (opts) => {
14
14
  const answerTree = rational.add(rational2).toTree();
15
15
  const answer = answerTree.toTex();
16
16
  const question = {
17
- instruction: `Calculer et donner le résultat sous la forme d'une fraction irréductible : $${statementTree.toTex()}$`,
17
+ instruction: `Calculer ${opts?.allowNonIrreductible
18
+ ? ""
19
+ : "et donner le résultat sous la forme d'une fraction irréductible"} :
20
+
21
+ $$
22
+ ${statementTree.toTex()}
23
+ $$`,
18
24
  startStatement: statementTree.toTex(),
19
25
  answer,
20
26
  keys: [],
@@ -47,8 +53,10 @@ const isAnswerValid = (ans, { rational, rational2 }, opts) => {
47
53
  const texs = answerTree.toAllValidTexs();
48
54
  if (allow)
49
55
  try {
50
- const parsed = (0, latexParser_1.parseAlgebraic)(ans).simplify().toTex();
51
- return texs.includes(parsed);
56
+ const parsed = (0, rationalParser_1.rationalParser)(ans);
57
+ if (!parsed)
58
+ return false;
59
+ return texs.includes(parsed.simplify().toTex());
52
60
  }
53
61
  catch (err) {
54
62
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"fractionsSumsMultiplesDenominators.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA2DF,eAAO,MAAM,kCAAkC,EAAE,QAAQ,CAAC,WAAW,CAcpE,CAAC"}
1
+ {"version":3,"file":"fractionsSumsMultiplesDenominators.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA2FF,eAAO,MAAM,kCAAkC,EAAE,QAAQ,CAAC,WAAW,CAkBpE,CAAC"}
@@ -6,8 +6,9 @@ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQ
6
6
  const rational_1 = require("../../../../math/numbers/rationals/rational");
7
7
  const randint_1 = require("../../../../math/utils/random/randint");
8
8
  const addNode_1 = require("../../../../tree/nodes/operators/addNode");
9
+ const rationalParser_1 = require("../../../../tree/parsers/rationalParser");
9
10
  const coinFlip_1 = require("../../../../utils/alea/coinFlip");
10
- const getFractionsSumsMultiplesDenominatorsQuestion = () => {
11
+ const getFractionsSumsMultiplesDenominatorsQuestion = (opts) => {
11
12
  let denom1 = (0, randint_1.randint)(2, 10);
12
13
  let denom2 = denom1 * (0, randint_1.randint)(2, 10);
13
14
  if ((0, coinFlip_1.coinFlip)())
@@ -20,7 +21,13 @@ const getFractionsSumsMultiplesDenominatorsQuestion = () => {
20
21
  const answer = ratio1.add(ratio2).toTree().toTex();
21
22
  const question = {
22
23
  answer,
23
- instruction: `Calculer et donner le résultat sous forme de fraction irréductible : $${statement}$`,
24
+ instruction: `Calculer ${opts?.allowNonIrreductible
25
+ ? ""
26
+ : "et donner le résultat sous la forme d'une fraction irréductible"} :
27
+
28
+ $$
29
+ ${statement}
30
+ $$`,
24
31
  keys: [],
25
32
  answerFormat: "tex",
26
33
  identifiers: { num1, num2, denom1, denom2 },
@@ -36,15 +43,35 @@ const getPropositions = (n, { answer, num1, num2, denom1, denom2 }) => {
36
43
  }
37
44
  return (0, exercise_1.shuffleProps)(propositions, n);
38
45
  };
39
- const isAnswerValid = (ans, { answer, denom1, denom2, num1, num2 }) => {
46
+ const isAnswerValid = (ans, { answer, denom1, denom2, num1, num2 }, opts) => {
40
47
  const rationalA = new rational_1.Rational(num1, denom1);
41
48
  const rationalB = new rational_1.Rational(num2, denom2);
42
49
  const answerTree = rationalA
43
50
  .add(rationalB)
44
51
  .toTree({ allowFractionToDecimal: true });
45
52
  const texs = answerTree.toAllValidTexs();
46
- return texs.includes(ans);
53
+ if (opts?.allowNonIrreductible) {
54
+ try {
55
+ const parsed = (0, rationalParser_1.rationalParser)(ans);
56
+ if (!parsed)
57
+ return false;
58
+ return texs.includes(parsed.simplify().toTex());
59
+ }
60
+ catch (err) {
61
+ return false;
62
+ }
63
+ }
64
+ else
65
+ return texs.includes(ans);
47
66
  };
67
+ const options = [
68
+ {
69
+ id: "allowNonIrreductible",
70
+ label: "Autoriser les fractions non réduites",
71
+ target: exercise_1.GeneratorOptionTarget.vea,
72
+ type: exercise_1.GeneratorOptionType.checkbox,
73
+ },
74
+ ];
48
75
  exports.fractionsSumsMultiplesDenominators = {
49
76
  id: "fractionsSumsMultiplesDenominators",
50
77
  connector: "=",
@@ -52,10 +79,11 @@ exports.fractionsSumsMultiplesDenominators = {
52
79
  levels: [],
53
80
  isSingleStep: true,
54
81
  sections: [],
55
- generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getFractionsSumsMultiplesDenominatorsQuestion, nb),
82
+ generator: (nb, opts) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getFractionsSumsMultiplesDenominatorsQuestion(opts), nb),
56
83
  qcmTimer: 60,
57
84
  freeTimer: 60,
58
85
  getPropositions,
59
86
  isAnswerValid,
60
87
  subject: "Mathématiques",
88
+ options,
61
89
  };
@@ -1 +1 @@
1
- {"version":3,"file":"fractionsSumsPrimeDenominators.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAkDF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,CAchE,CAAC"}
1
+ {"version":3,"file":"fractionsSumsPrimeDenominators.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA6FF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,CAkBhE,CAAC"}
@@ -7,7 +7,8 @@ const rational_1 = require("../../../../math/numbers/rationals/rational");
7
7
  const gcd_1 = require("../../../../math/utils/arithmetic/gcd");
8
8
  const randint_1 = require("../../../../math/utils/random/randint");
9
9
  const addNode_1 = require("../../../../tree/nodes/operators/addNode");
10
- const getFractionsSumsPrimeDenominatorsQuestion = () => {
10
+ const rationalParser_1 = require("../../../../tree/parsers/rationalParser");
11
+ const getFractionsSumsPrimeDenominatorsQuestion = (opts) => {
11
12
  const denom1 = (0, randint_1.randint)(2, 13);
12
13
  let denom2 = 0;
13
14
  do {
@@ -21,7 +22,13 @@ const getFractionsSumsPrimeDenominatorsQuestion = () => {
21
22
  const answer = ratio1.add(ratio2).toTree().toTex();
22
23
  const question = {
23
24
  answer,
24
- instruction: `Calculer et donner le résultat sous forme de fraction irréductible : $${statement}$`,
25
+ instruction: `Calculer ${opts?.allowNonIrreductible
26
+ ? ""
27
+ : "et donner le résultat sous la forme d'une fraction irréductible"} :
28
+
29
+ $$
30
+ ${statement}
31
+ $$`,
25
32
  keys: [],
26
33
  answerFormat: "tex",
27
34
  identifiers: { num1, num2, denom1, denom2 },
@@ -37,9 +44,35 @@ const getPropositions = (n, { answer, num1, denom1, denom2, num2 }) => {
37
44
  }
38
45
  return (0, exercise_1.shuffleProps)(propositions, n);
39
46
  };
40
- const isAnswerValid = (ans, { answer }) => {
41
- return ans === answer;
47
+ const isAnswerValid = (ans, { answer, denom1, denom2, num1, num2 }, opts) => {
48
+ const rationalA = new rational_1.Rational(num1, denom1);
49
+ const rationalB = new rational_1.Rational(num2, denom2);
50
+ const answerTree = rationalA
51
+ .add(rationalB)
52
+ .toTree({ allowFractionToDecimal: true });
53
+ const texs = answerTree.toAllValidTexs();
54
+ if (opts?.allowNonIrreductible) {
55
+ try {
56
+ const parsed = (0, rationalParser_1.rationalParser)(ans);
57
+ if (!parsed)
58
+ return false;
59
+ return texs.includes(parsed.simplify().toTex());
60
+ }
61
+ catch (err) {
62
+ return false;
63
+ }
64
+ }
65
+ else
66
+ return texs.includes(ans);
42
67
  };
68
+ const options = [
69
+ {
70
+ id: "allowNonIrreductible",
71
+ label: "Autoriser les fractions non réduites",
72
+ target: exercise_1.GeneratorOptionTarget.vea,
73
+ type: exercise_1.GeneratorOptionType.checkbox,
74
+ },
75
+ ];
43
76
  exports.fractionsSumsPrimeDenominators = {
44
77
  id: "fractionsSumsPrimeDenominators",
45
78
  connector: "=",
@@ -47,10 +80,11 @@ exports.fractionsSumsPrimeDenominators = {
47
80
  levels: [],
48
81
  isSingleStep: true,
49
82
  sections: [],
50
- generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getFractionsSumsPrimeDenominatorsQuestion, nb),
83
+ generator: (nb, opts) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getFractionsSumsPrimeDenominatorsQuestion(opts), nb),
51
84
  qcmTimer: 60,
52
85
  freeTimer: 60,
53
86
  getPropositions,
54
87
  isAnswerValid,
55
88
  subject: "Mathématiques",
89
+ options,
56
90
  };
@@ -1 +1 @@
1
- {"version":3,"file":"fractionsSumsSameDenominators.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsSumsSameDenominators.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAclC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAqGF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAe/D,CAAC"}
1
+ {"version":3,"file":"fractionsSumsSameDenominators.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsSumsSameDenominators.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,0BAA0B,CAAC;AAiBlC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAgIF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAmB/D,CAAC"}
@@ -9,9 +9,10 @@ const randint_1 = require("../../../../math/utils/random/randint");
9
9
  const addNode_1 = require("../../../../tree/nodes/operators/addNode");
10
10
  const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
11
11
  const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
12
+ const rationalParser_1 = require("../../../../tree/parsers/rationalParser");
12
13
  const operatorComposition_1 = require("../../../../tree/utilities/operatorComposition");
13
14
  const alignTex_1 = require("../../../../utils/latex/alignTex");
14
- const getFractionsSumsSameDenominatorsQuestion = () => {
15
+ const getFractionsSumsSameDenominatorsQuestion = (opts) => {
15
16
  const denom = (0, randint_1.randint)(2, 15);
16
17
  const num1 = (0, randint_1.randint)(1, denom + 10);
17
18
  const num2 = (0, randint_1.randint)(1, denom + 10);
@@ -22,14 +23,16 @@ const getFractionsSumsSameDenominatorsQuestion = () => {
22
23
  const answer = answerRatio.simplify().toTree().toTex();
23
24
  const question = {
24
25
  answer,
25
- instruction: `Calculer et donner le résultat sous forme d'une fraction irréductible :
26
+ instruction: `Calculer ${opts?.allowNonIrreductible
27
+ ? ""
28
+ : "et donner le résultat sous la forme d'une fraction irréductible"} :
26
29
 
27
30
  $$
28
31
  ${statement}
29
32
  $$`,
30
33
  keys: [],
31
- hint: `Pour additionner deux fractions qui ont le même dénominateur, on peut additionner leurs numerateurs.`,
32
- correction: `Les deux fractions ont bien le même dénominateur donc on additionne leurs numérateurs :
34
+ hint: `Pour additionner deux fractions qui ont le même dénominateur, on peut additionner leurs numérateurs.`,
35
+ correction: `Les deux fractions ont bien le même dénominateur, donc on additionne leurs numérateurs :
33
36
 
34
37
  ${(0, alignTex_1.alignTex)([
35
38
  [
@@ -42,7 +45,7 @@ ${(0, alignTex_1.alignTex)([
42
45
 
43
46
  ${answerRatio.isSimplified && answerRatio.denum !== 1
44
47
  ? "Cette fraction est bien irréductible."
45
- : `Puis on simplifie la fraction :
48
+ : `Puis, on simplifie la fraction :
46
49
 
47
50
  ${(0, alignTex_1.alignTex)([
48
51
  [
@@ -67,15 +70,36 @@ const getPropositions = (n, { answer, denom, num1, num2 }) => {
67
70
  }
68
71
  return (0, exercise_1.shuffleProps)(propositions, n);
69
72
  };
70
- const isAnswerValid = (ans, { answer, denom, num1, num2 }) => {
73
+ const isAnswerValid = (ans, { answer, denom, num1, num2 }, opts) => {
71
74
  const rationalA = new rational_1.Rational(num1, denom);
72
75
  const rationalB = new rational_1.Rational(num2, denom);
73
76
  const answerTree = rationalA
74
77
  .add(rationalB)
75
78
  .toTree({ allowFractionToDecimal: true });
76
79
  const texs = answerTree.toAllValidTexs();
77
- return texs.includes(ans);
80
+ if (opts?.allowNonIrreductible) {
81
+ try {
82
+ const parsed = (0, rationalParser_1.rationalParser)(ans);
83
+ if (!parsed)
84
+ return false;
85
+ return texs.includes(parsed.simplify().toTex());
86
+ }
87
+ catch (err) {
88
+ return false;
89
+ }
90
+ }
91
+ else {
92
+ return texs.includes(ans);
93
+ }
78
94
  };
95
+ const options = [
96
+ {
97
+ id: "allowNonIrreductible",
98
+ label: "Autoriser les fractions non réduites",
99
+ target: exercise_1.GeneratorOptionTarget.vea,
100
+ type: exercise_1.GeneratorOptionType.checkbox,
101
+ },
102
+ ];
79
103
  exports.fractionsSumsSameDenominators = {
80
104
  id: "fractionsSumsSameDenominators",
81
105
  connector: "=",
@@ -83,11 +107,12 @@ exports.fractionsSumsSameDenominators = {
83
107
  levels: [],
84
108
  isSingleStep: true,
85
109
  sections: [],
86
- generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getFractionsSumsSameDenominatorsQuestion, nb),
110
+ generator: (nb, opts) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getFractionsSumsSameDenominatorsQuestion(opts), nb),
87
111
  qcmTimer: 60,
88
112
  freeTimer: 60,
89
113
  getPropositions,
90
114
  isAnswerValid,
91
115
  subject: "Mathématiques",
92
116
  hasHintAndCorrection: true,
117
+ options,
93
118
  };
@@ -8,4 +8,5 @@ export * from "./convexity";
8
8
  export * from "./volumes";
9
9
  export * from "./euclidianConstructions";
10
10
  export * from "./shapes";
11
+ export * from "./parametric";
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/geometry/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAE1B,cAAc,0BAA0B,CAAC;AACzC,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/geometry/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAE1B,cAAc,0BAA0B,CAAC;AACzC,cAAc,UAAU,CAAC;AAEzB,cAAc,cAAc,CAAC"}
@@ -26,3 +26,4 @@ __exportStar(require("./volumes"), exports);
26
26
  __exportStar(require("./euclidianConstructions"), exports);
27
27
  __exportStar(require("./shapes"), exports);
28
28
  // export * from "./euclidian";
29
+ __exportStar(require("./parametric"), exports);
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ startPoint: number[];
4
+ vector: number[];
5
+ };
6
+ export declare const extractPointFromParametricLine: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=extractPointFromParametricLine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractPointFromParametricLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/parametric/extractPointFromParametricLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAyHF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,CAiBhE,CAAC"}
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.extractPointFromParametricLine = void 0;
4
+ const exercise_1 = require("../../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const parametricLine_1 = require("../../../../math/geometry/parametricLine");
7
+ const spacePoint_1 = require("../../../../math/geometry/spacePoint");
8
+ const spaceVector_1 = require("../../../../math/geometry/spaceVector");
9
+ const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
10
+ const spacePointParser_1 = require("../../../../tree/parsers/spacePointParser");
11
+ const doWhile_1 = require("../../../../utils/doWhile");
12
+ const getPropositions = (n, { answer, startPoint, vector }) => {
13
+ const propositions = [];
14
+ (0, exercise_1.addValidProp)(propositions, answer);
15
+ const line = new parametricLine_1.ParametricLine(spacePoint_1.SpacePointConstructor.fromScalars(startPoint), spaceVector_1.SpaceVectorConstructor.fromScalars(vector));
16
+ while (propositions.length < n) {
17
+ const point = (0, doWhile_1.doWhile)(() => spacePoint_1.SpacePointConstructor.random("A"), (p) => line.hasPoint(p));
18
+ (0, exercise_1.tryToAddWrongProp)(propositions, point.toCoords());
19
+ }
20
+ return (0, exercise_1.shuffleProps)(propositions, n);
21
+ };
22
+ const getAnswer = (identifiers) => {
23
+ const line = new parametricLine_1.ParametricLine(spacePoint_1.SpacePointConstructor.fromScalars(identifiers.startPoint), spaceVector_1.SpaceVectorConstructor.fromScalars(identifiers.vector));
24
+ const point = line.getPoint(new numberNode_1.NumberNode(0));
25
+ return point.toCoords();
26
+ };
27
+ const getInstruction = (identifiers) => {
28
+ const line = new parametricLine_1.ParametricLine(spacePoint_1.SpacePointConstructor.fromScalars(identifiers.startPoint), spaceVector_1.SpaceVectorConstructor.fromScalars(identifiers.vector));
29
+ return `Soit $d$ la droite d'équation paramétrique :
30
+
31
+ $$
32
+ ${line.toTex()}
33
+ $$
34
+
35
+ où $t\\in \\mathbb{R}$.
36
+
37
+ Donner les coordonnées d'un point appartenant à $d$.
38
+ `;
39
+ };
40
+ const getHint = (identifiers) => {
41
+ return `Il suffit de remplacer $t$ par une valeur afin d'obtenir les coordonnées d'un point de la droite.`;
42
+ };
43
+ const getCorrection = (identifiers) => {
44
+ const line = new parametricLine_1.ParametricLine(spacePoint_1.SpacePointConstructor.fromScalars(identifiers.startPoint), spaceVector_1.SpaceVectorConstructor.fromScalars(identifiers.vector));
45
+ const detailedEquations = line.toDetailedEvaluation(new numberNode_1.NumberNode(0));
46
+ const point = line.getPointCoords(new numberNode_1.NumberNode(0));
47
+ return `Pour obtenir les coordonnées d'un point appartenant à la droite, il suffit de remplacer $t$ par n'importe quelle valeur dans les trois équations. Par simplicité, prenons $t = 0$. On obtient alors :
48
+
49
+ $$
50
+ \\left\\{\\begin{matrix}
51
+ x=${detailedEquations[0].toTex()} \\\\
52
+ y=${detailedEquations[1].toTex()} \\\\
53
+ z=${detailedEquations[2].toTex()}
54
+ \\end{matrix}
55
+ \\right.
56
+ $$
57
+
58
+ On en déduit que le point de coordonnées $\\left(${point
59
+ .map((e) => e.toTex())
60
+ .join(";")}\\right)$ appartient à la droite $d$.`;
61
+ };
62
+ const getKeys = (identifiers) => {
63
+ return ["semicolon"];
64
+ };
65
+ const isAnswerValid = (ans, { answer, startPoint, vector }) => {
66
+ try {
67
+ const line = new parametricLine_1.ParametricLine(spacePoint_1.SpacePointConstructor.fromScalars(startPoint), spaceVector_1.SpaceVectorConstructor.fromScalars(vector));
68
+ const point = (0, spacePointParser_1.spacePointParser)(ans);
69
+ if (!point)
70
+ return false;
71
+ return line.hasPoint(point);
72
+ }
73
+ catch (err) {
74
+ return false;
75
+ }
76
+ };
77
+ const getExtractPointFromParametricLineQuestion = () => {
78
+ const startPoint = spacePoint_1.SpacePointConstructor.random("A");
79
+ const vector = spaceVector_1.SpaceVectorConstructor.random("B");
80
+ const identifiers = {
81
+ startPoint: startPoint.getEvaluatedCoords(),
82
+ vector: vector.getEvaluatedCoords(),
83
+ };
84
+ const question = {
85
+ answer: getAnswer(identifiers),
86
+ instruction: getInstruction(identifiers),
87
+ keys: getKeys(identifiers),
88
+ answerFormat: "tex",
89
+ identifiers,
90
+ hint: getHint(identifiers),
91
+ correction: getCorrection(identifiers),
92
+ };
93
+ return question;
94
+ };
95
+ exports.extractPointFromParametricLine = {
96
+ id: "extractPointFromParametricLine",
97
+ connector: "=",
98
+ label: "Trouver un point appartenant à une droite à partir de sa représentation paramétrique",
99
+ isSingleStep: true,
100
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getExtractPointFromParametricLineQuestion, nb),
101
+ qcmTimer: 60,
102
+ freeTimer: 60,
103
+ getPropositions,
104
+ isAnswerValid,
105
+ subject: "Mathématiques",
106
+ getHint,
107
+ getCorrection,
108
+ getAnswer,
109
+ hasHintAndCorrection: true,
110
+ };
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ startPoint: number[];
4
+ vector: number[];
5
+ };
6
+ export declare const extractVectorFromParametricLine: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=extractVectorFromParametricLine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractVectorFromParametricLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/parametric/extractVectorFromParametricLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AA6GF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAgBjE,CAAC"}
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.extractVectorFromParametricLine = void 0;
4
+ const exercise_1 = require("../../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const parametricLine_1 = require("../../../../math/geometry/parametricLine");
7
+ const spacePoint_1 = require("../../../../math/geometry/spacePoint");
8
+ const spaceVector_1 = require("../../../../math/geometry/spaceVector");
9
+ const spaceVectorParser_1 = require("../../../../tree/parsers/spaceVectorParser");
10
+ const doWhile_1 = require("../../../../utils/doWhile");
11
+ const getPropositions = (n, { answer, startPoint, vector }) => {
12
+ const propositions = [];
13
+ (0, exercise_1.addValidProp)(propositions, answer);
14
+ const lineVector = spaceVector_1.SpaceVectorConstructor.fromScalars(vector);
15
+ while (propositions.length < n) {
16
+ const vector = (0, doWhile_1.doWhile)(() => spaceVector_1.SpaceVectorConstructor.random("A"), (v) => lineVector.isColinear(v));
17
+ (0, exercise_1.tryToAddWrongProp)(propositions, vector.toInlineCoordsTex());
18
+ }
19
+ return (0, exercise_1.shuffleProps)(propositions, n);
20
+ };
21
+ const getAnswer = (identifiers) => {
22
+ const vector = spaceVector_1.SpaceVectorConstructor.fromScalars(identifiers.vector);
23
+ return vector.toInlineCoordsTex();
24
+ };
25
+ const getInstruction = (identifiers) => {
26
+ const line = new parametricLine_1.ParametricLine(spacePoint_1.SpacePointConstructor.fromScalars(identifiers.startPoint), spaceVector_1.SpaceVectorConstructor.fromScalars(identifiers.vector));
27
+ return `Soit $d$ la droite d'équation paramétrique :
28
+
29
+ $$
30
+ ${line.toTex()}
31
+ $$
32
+
33
+ où $t\\in \\mathbb{R}$.
34
+
35
+ Donner les coordonnées d'un vecteur directeur de la droite $d$.
36
+ `;
37
+ };
38
+ // const getHint: GetHint<Identifiers> = (identifiers) => {
39
+ // return `Il suffit de remplacer $t$ par une valeur afin d'obtenir les coordonnées d'un point de la droite.`;
40
+ // };
41
+ // const getCorrection: GetCorrection<Identifiers> = (identifiers) => {
42
+ // const line = new ParametricLine(
43
+ // SpacePointConstructor.fromScalars(identifiers.startPoint),
44
+ // SpaceVectorConstructor.fromScalars(identifiers.vector),
45
+ // );
46
+ // const detailedEquations = line.toDetailedEvaluation(new NumberNode(0));
47
+ // const point = line.getPointCoords(new NumberNode(0));
48
+ // return `Pour obtenir les coordonnées d'un point appartenant à la droite, il suffit de remplacer $t$ par n'importe quelle valeur dans les trois équations. Par simplicité, prenons $t = 0$. On obtient alors :
49
+ // $$
50
+ // \\left\\{\\begin{matrix}
51
+ // x=${detailedEquations[0].toTex()} \\\\
52
+ // y=${detailedEquations[1].toTex()} \\\\
53
+ // z=${detailedEquations[2].toTex()}
54
+ // \\end{matrix}
55
+ // \\right.
56
+ // $$
57
+ // On en déduit que le point de coordonnées $\\left(${point
58
+ // .map((e) => e.toTex())
59
+ // .join(";")}\\right)$ appartient à la droite $d$.`;
60
+ // };
61
+ const getKeys = (identifiers) => {
62
+ return ["semicolon"];
63
+ };
64
+ const isAnswerValid = (ans, { answer, startPoint, vector }) => {
65
+ try {
66
+ const v = spaceVector_1.SpaceVectorConstructor.fromScalars(vector);
67
+ const vecAnswer = (0, spaceVectorParser_1.spaceVectorParser)(ans);
68
+ if (!vecAnswer)
69
+ return false;
70
+ return v.isColinear(vecAnswer);
71
+ }
72
+ catch (err) {
73
+ return false;
74
+ }
75
+ };
76
+ const getExtractVectorFromParametricLineQuestion = () => {
77
+ const startPoint = spacePoint_1.SpacePointConstructor.random("A");
78
+ const vector = spaceVector_1.SpaceVectorConstructor.random("B");
79
+ const identifiers = {
80
+ startPoint: startPoint.getEvaluatedCoords(),
81
+ vector: vector.getEvaluatedCoords(),
82
+ };
83
+ const question = {
84
+ answer: getAnswer(identifiers),
85
+ instruction: getInstruction(identifiers),
86
+ keys: getKeys(identifiers),
87
+ answerFormat: "tex",
88
+ identifiers,
89
+ // hint: getHint(identifiers),
90
+ // correction: getCorrection(identifiers),
91
+ };
92
+ return question;
93
+ };
94
+ exports.extractVectorFromParametricLine = {
95
+ id: "extractVectorFromParametricLine",
96
+ connector: "=",
97
+ label: "Trouver un vecteur directeur d'une droite à partir de son équation paramétrique",
98
+ isSingleStep: true,
99
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getExtractVectorFromParametricLineQuestion, nb),
100
+ qcmTimer: 60,
101
+ freeTimer: 60,
102
+ getPropositions,
103
+ isAnswerValid,
104
+ subject: "Mathématiques",
105
+ // getHint,
106
+ // getCorrection,
107
+ getAnswer,
108
+ };
@@ -0,0 +1,4 @@
1
+ export * from "./pointFromParametricLine";
2
+ export * from "./extractPointFromParametricLine";
3
+ export * from "./extractVectorFromParametricLine";
4
+ //# sourceMappingURL=index.d.ts.map