math-exercises 2.1.26-beta.8 → 2.2.0

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 (63) hide show
  1. package/lib/exercises/exercise.d.ts +2 -0
  2. package/lib/exercises/exercise.d.ts.map +1 -1
  3. package/lib/exercises/math/calcul/arithmetics/paritySumsAndProducts.js +1 -1
  4. package/lib/exercises/math/calcul/digitDecimalRank.d.ts +8 -0
  5. package/lib/exercises/math/calcul/digitDecimalRank.d.ts.map +1 -0
  6. package/lib/exercises/math/calcul/digitDecimalRank.js +58 -0
  7. package/lib/exercises/math/calcul/digitRank.d.ts +8 -0
  8. package/lib/exercises/math/calcul/digitRank.d.ts.map +1 -0
  9. package/lib/exercises/math/calcul/digitRank.js +58 -0
  10. package/lib/exercises/math/calcul/index.d.ts +2 -0
  11. package/lib/exercises/math/calcul/index.d.ts.map +1 -1
  12. package/lib/exercises/math/calcul/index.js +2 -0
  13. package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.js +1 -1
  14. package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.js +1 -1
  15. package/lib/exercises/math/derivation/derivative/convexityQuadrinomials.js +1 -1
  16. package/lib/exercises/math/derivation/derivative/convexityTrinomials.js +1 -1
  17. package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.js +1 -1
  18. package/lib/exercises/math/functions/affines/affineAdjustmentComplete.js +1 -1
  19. package/lib/exercises/math/functions/affines/affineExpressionReading.js +1 -1
  20. package/lib/exercises/math/functions/parity/parityFromAlgebra.js +1 -1
  21. package/lib/exercises/math/functions/parity/parityFromGraph.js +1 -1
  22. package/lib/exercises/math/functions/trinoms/extremumTypeFromAlgebricForm.js +1 -1
  23. package/lib/exercises/math/functions/trinoms/variationsFromAlgebricForm.js +1 -1
  24. package/lib/exercises/math/geometry/cartesian/drawAlineInGGB.d.ts.map +1 -1
  25. package/lib/exercises/math/geometry/cartesian/drawAlineInGGB.js +10 -6
  26. package/lib/exercises/math/geometry/cartesian/placeAPoint.d.ts.map +1 -1
  27. package/lib/exercises/math/geometry/cartesian/placeAPoint.js +1 -1
  28. package/lib/exercises/math/geometry/convexity/convexityTrinomialsGeo.js +1 -1
  29. package/lib/exercises/math/geometry/vectors/alignementViaColinearity.js +1 -1
  30. package/lib/exercises/math/geometry/vectors/colinearity.js +1 -1
  31. package/lib/exercises/math/geometry/vectors/drawAVectorInGGB.d.ts +4 -1
  32. package/lib/exercises/math/geometry/vectors/drawAVectorInGGB.d.ts.map +1 -1
  33. package/lib/exercises/math/geometry/vectors/drawAVectorInGGB.js +31 -4
  34. package/lib/exercises/math/geometry/vectors/equalCaracteristicFromGraph.js +1 -1
  35. package/lib/exercises/math/geometry/vectors/paralellismViaColinearity.js +1 -1
  36. package/lib/exercises/math/geometry/vectors/parallelogramViaEqualVectors.js +1 -1
  37. package/lib/exercises/math/matrices/matrixGeneralTerm.js +1 -1
  38. package/lib/exercises/math/percent/isTableProportional.js +1 -1
  39. package/lib/exercises/math/probaStat/independancy.js +1 -1
  40. package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.js +1 -1
  41. package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromFirstTerms.js +1 -1
  42. package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromGraph.js +1 -1
  43. package/lib/exercises/math/sequences/genericSequenceVariations.js +1 -1
  44. package/lib/exercises/pc/calibrationCurveOfSolution.d.ts.map +1 -1
  45. package/lib/exercises/pc/calibrationCurveOfSolution.js +3 -2
  46. package/lib/exercises/pc/chemicalElements/atomicStructureOfNucleus.js +1 -1
  47. package/lib/exercises/pc/chemicalElements/identifyRightElectronicConfiguration.js +1 -1
  48. package/lib/exercises/pc/chemicalReactions/identifyLimitingReagent.js +1 -1
  49. package/lib/exercises/pc/chemicalReactions/identifyStoichiometricMixture.js +1 -1
  50. package/lib/exercises/pc/mole/concentrationReading.js +1 -1
  51. package/lib/exercises/pc/moleculeNomenclature.js +1 -1
  52. package/lib/exercises/pc/sound/frequencyComparison.js +1 -1
  53. package/lib/exercises/utils/geogebra/isGGBLine.js +1 -1
  54. package/lib/index.d.ts +10 -1
  55. package/lib/index.d.ts.map +1 -1
  56. package/lib/math/numbers/decimals/decimal.d.ts +1 -0
  57. package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
  58. package/lib/math/numbers/decimals/decimal.js +2 -1
  59. package/lib/math/numbers/integer/integer.d.ts +1 -0
  60. package/lib/math/numbers/integer/integer.d.ts.map +1 -1
  61. package/lib/math/numbers/integer/integer.js +7 -1
  62. package/lib/server.js +6 -10
  63. package/package.json +1 -1
@@ -73,8 +73,10 @@ export interface Exercise<TIdentifiers = {}> {
73
73
  generator: (n: number) => Question<TIdentifiers>[];
74
74
  maxAllowedQuestions?: number;
75
75
  answerType?: "GGB" | "QCM" | "free" | "QCU";
76
+ isQCM?: boolean;
76
77
  qcmTimer: number;
77
78
  freeTimer: number;
79
+ ggbTimer?: number;
78
80
  getPropositions?: QCMGenerator<{
79
81
  answer: string;
80
82
  } & TIdentifiers>;
@@ -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;AAI3C,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,MAAM,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAElC,MAAM,MAAM,WAAW,GAAG;IACxB,EAA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AAqB,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,oBAAoB,GACpB,WAAW,CAAC"}
1
+ {"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAI3C,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,MAAM,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAElC,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;IACvB,MAAM,EAAE,KAAK,GAAG,KAAK,CAAC;CACvB,CAAC;AACF,MAAM,WAAW,QAAQ,CAAC,YA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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,oBAAoB,GACpB,WAAW,CAAC"}
@@ -109,7 +109,7 @@ exports.paritySumsAndProducts = {
109
109
  generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getParitySumsAndProductsQuestion, nb, 12),
110
110
  qcmTimer: 60,
111
111
  freeTimer: 60,
112
- answerType: "QCM",
112
+ answerType: "QCU",
113
113
  maxAllowedQuestions: 12,
114
114
  getPropositions,
115
115
  subject: "Mathématiques",
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../exercises/exercise";
2
+ type Identifiers = {
3
+ nb: string;
4
+ rankAsked: number;
5
+ };
6
+ export declare const digitDecimalRank: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=digitDecimalRank.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"digitDecimalRank.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/calcul/digitDecimalRank.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA0CF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAelD,CAAC"}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.digitDecimalRank = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
6
+ const decimal_1 = require("../../../math/numbers/decimals/decimal");
7
+ const randint_1 = require("../../../math/utils/random/randint");
8
+ const getDigitDecimalRankQuestion = () => {
9
+ const decimalPartSize = (0, randint_1.randint)(2, 5);
10
+ const nb = decimal_1.DecimalConstructor.random(0, 1000, decimalPartSize);
11
+ const rankAsked = (0, randint_1.randint)(0, Math.min(decimalPartSize, 3));
12
+ const rankAskedLabel = decimal_1.decimalDigitRanks[rankAsked];
13
+ const decimalPartString = nb.decimalPart;
14
+ const answer = decimalPartString[rankAsked];
15
+ const question = {
16
+ answer,
17
+ instruction: `Quel est le chiffre des ${rankAskedLabel} dans le nombre $${nb
18
+ .toTree()
19
+ .toTex()}$ ?`,
20
+ keys: [],
21
+ answerFormat: "tex",
22
+ identifiers: { nb: nb.tex, rankAsked },
23
+ };
24
+ return question;
25
+ };
26
+ const getPropositions = (n, { answer, nb }) => {
27
+ const propositions = [];
28
+ (0, exercise_1.addValidProp)(propositions, answer);
29
+ const decimal = new decimal_1.Decimal(Number(nb));
30
+ for (let i = 0; i < decimal.decimalPart.length; i++) {
31
+ (0, exercise_1.tryToAddWrongProp)(propositions, decimal.decimalPart[i]);
32
+ }
33
+ while (propositions.length < n) {
34
+ (0, exercise_1.tryToAddWrongProp)(propositions, (0, randint_1.randint)(0, 10) + "");
35
+ }
36
+ return (0, exercise_1.shuffleProps)(propositions, n);
37
+ };
38
+ const isAnswerValid = (ans, { answer }) => {
39
+ return ans === answer;
40
+ };
41
+ const isGGBAnswerValid = (ans, { ggbAnswer }) => {
42
+ throw Error("GGBVea not implemented");
43
+ };
44
+ exports.digitDecimalRank = {
45
+ id: "digitDecimalRank",
46
+ connector: "=",
47
+ label: "",
48
+ levels: [],
49
+ isSingleStep: true,
50
+ sections: [],
51
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getDigitDecimalRankQuestion, nb),
52
+ qcmTimer: 60,
53
+ freeTimer: 60,
54
+ getPropositions,
55
+ isAnswerValid,
56
+ isGGBAnswerValid,
57
+ subject: "Mathématiques",
58
+ };
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../exercises/exercise";
2
+ type Identifiers = {
3
+ nb: number;
4
+ rankAsked: number;
5
+ };
6
+ export declare const digitRank: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=digitRank.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"digitRank.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/calcul/digitRank.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA0CF,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,WAAW,CAc3C,CAAC"}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.digitRank = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
6
+ const integer_1 = require("../../../math/numbers/integer/integer");
7
+ const randint_1 = require("../../../math/utils/random/randint");
8
+ const getDigitRankQuestion = () => {
9
+ const size = (0, randint_1.randint)(3, 6);
10
+ const nb = integer_1.IntegerConstructor.random(size);
11
+ const rankAsked = (0, randint_1.randint)(0, Math.min(size, 4));
12
+ const rankAskedLabel = integer_1.integerDigitRanks[rankAsked];
13
+ const nbString = nb.toString();
14
+ const answer = nbString[nbString.length - rankAsked - 1];
15
+ const question = {
16
+ answer,
17
+ instruction: `Quel est le chiffre des ${rankAskedLabel} dans le nombre $${nb
18
+ .toTree()
19
+ .toTex()}$ ?`,
20
+ keys: [],
21
+ answerFormat: "tex",
22
+ identifiers: { nb, rankAsked },
23
+ };
24
+ return question;
25
+ };
26
+ const getPropositions = (n, { answer, nb }) => {
27
+ const propositions = [];
28
+ (0, exercise_1.addValidProp)(propositions, answer);
29
+ const nbString = nb.toString();
30
+ for (let i = 0; i < nbString.length; i++) {
31
+ (0, exercise_1.tryToAddWrongProp)(propositions, nbString[i]);
32
+ }
33
+ while (propositions.length < n) {
34
+ (0, exercise_1.tryToAddWrongProp)(propositions, (0, randint_1.randint)(0, 10) + "");
35
+ }
36
+ return (0, exercise_1.shuffleProps)(propositions, n);
37
+ };
38
+ const isAnswerValid = (ans, { answer }) => {
39
+ return ans === answer;
40
+ };
41
+ const isGGBAnswerValid = (ans, { ggbAnswer }) => {
42
+ throw Error("GGBVea not implemented");
43
+ };
44
+ exports.digitRank = {
45
+ id: "digitRank",
46
+ connector: "=",
47
+ label: "Déterminer le rang d'un chiffre dans un nombre entier",
48
+ levels: [],
49
+ isSingleStep: true,
50
+ sections: [],
51
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getDigitRankQuestion, nb),
52
+ qcmTimer: 60,
53
+ freeTimer: 60,
54
+ getPropositions,
55
+ isAnswerValid,
56
+ isGGBAnswerValid,
57
+ subject: "Mathématiques",
58
+ };
@@ -6,4 +6,6 @@ export * from "./mentalCaluls";
6
6
  export * from "./operations";
7
7
  export * from "./proportionality";
8
8
  export * from "./rounding";
9
+ export * from "./digitRank";
10
+ export * from "./digitDecimalRank";
9
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/calcul/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/calcul/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC"}
@@ -22,3 +22,5 @@ __exportStar(require("./mentalCaluls"), exports);
22
22
  __exportStar(require("./operations"), exports);
23
23
  __exportStar(require("./proportionality"), exports);
24
24
  __exportStar(require("./rounding"), exports);
25
+ __exportStar(require("./digitRank"), exports);
26
+ __exportStar(require("./digitDecimalRank"), exports);
@@ -69,7 +69,7 @@ exports.binomialsTrinomialsProposedSolutions = {
69
69
  isSingleStep: true,
70
70
  sections: ["Équations"],
71
71
  generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getBinomialsTrinomialsProposedSolutionsQuestion, nb),
72
- answerType: "QCM",
72
+ answerType: "QCU",
73
73
  qcmTimer: 60,
74
74
  freeTimer: 60,
75
75
  getPropositions,
@@ -59,5 +59,5 @@ exports.verifySystemSolution = {
59
59
  getPropositions,
60
60
  isAnswerValid,
61
61
  subject: "Mathématiques",
62
- answerType: "QCM",
62
+ answerType: "QCU",
63
63
  };
@@ -89,7 +89,7 @@ exports.convexityQuadrinomials = {
89
89
  generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getConvexityQuadrinomialsQuestion, nb),
90
90
  qcmTimer: 60,
91
91
  freeTimer: 60,
92
- answerType: "QCM",
92
+ answerType: "QCU",
93
93
  getPropositions,
94
94
  isAnswerValid,
95
95
  subject: "Mathématiques",
@@ -37,7 +37,7 @@ exports.convexityTrinomials = {
37
37
  generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getConvexityTrinomialsQuestion, nb),
38
38
  qcmTimer: 60,
39
39
  freeTimer: 60,
40
- answerType: "QCM",
40
+ answerType: "QCU",
41
41
  getPropositions,
42
42
  isAnswerValid,
43
43
  subject: "Mathématiques",
@@ -97,6 +97,6 @@ exports.equaDiffCheckSolutionFirstOrder = {
97
97
  freeTimer: 60,
98
98
  getPropositions,
99
99
  isAnswerValid,
100
- answerType: "QCM",
100
+ answerType: "QCU",
101
101
  subject: "Mathématiques",
102
102
  };
@@ -116,7 +116,7 @@ exports.affineAdjustmentCompleteExercise = {
116
116
  isSingleStep: true,
117
117
  sections: ["Statistiques"],
118
118
  generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getAffineAdjustmentCompleteQuestion, nb),
119
- answerType: "QCM",
119
+ answerType: "QCU",
120
120
  qcmTimer: 60,
121
121
  freeTimer: 60,
122
122
  getPropositions,
@@ -25,7 +25,7 @@ const getAffineExpressionReadingQuestion = () => {
25
25
  let yMin = Math.min(b, secondPoint[1]);
26
26
  let yMax = Math.max(b, secondPoint[1]);
27
27
  const commands = [
28
- `l = Line((0, ${b}), (${secondPoint[0]}, ${secondPoint[1]}))`,
28
+ `l = Line[(0, ${b}), (${secondPoint[0]}, ${secondPoint[1]})]`,
29
29
  `SetColor(l, "${(0, colors_1.randomColor)()}")`,
30
30
  "SetFixed(l, true)",
31
31
  ];
@@ -113,6 +113,6 @@ exports.parityFromAlgebra = {
113
113
  freeTimer: 60,
114
114
  getPropositions,
115
115
  isAnswerValid,
116
- answerType: "QCM",
116
+ answerType: "QCU",
117
117
  subject: "Mathématiques",
118
118
  };
@@ -123,7 +123,7 @@ exports.parityFromGraph = {
123
123
  freeTimer: 60,
124
124
  getPropositions,
125
125
  isAnswerValid,
126
- answerType: "QCM",
126
+ answerType: "QCU",
127
127
  hasGeogebra: true,
128
128
  subject: "Mathématiques",
129
129
  };
@@ -37,7 +37,7 @@ exports.extremumTypeFromAlgebricForm = {
37
37
  isSingleStep: true,
38
38
  sections: ["Second degré"],
39
39
  generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getExtremumTypeFromAlgebricFormQuestion, nb),
40
- answerType: "QCM",
40
+ answerType: "QCU",
41
41
  qcmTimer: 60,
42
42
  freeTimer: 60,
43
43
  getPropositions,
@@ -37,7 +37,7 @@ exports.variationsFromAlgebricForm = {
37
37
  isSingleStep: true,
38
38
  sections: ["Second degré"],
39
39
  generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getVariationsFromAlgebricFormQuestion, nb),
40
- answerType: "QCM",
40
+ answerType: "QCU",
41
41
  qcmTimer: 60,
42
42
  freeTimer: 60,
43
43
  getPropositions,
@@ -1 +1 @@
1
- {"version":3,"file":"drawAlineInGGB.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/drawAlineInGGB.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAIT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAmDF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAahD,CAAC"}
1
+ {"version":3,"file":"drawAlineInGGB.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/drawAlineInGGB.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAIT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAyDF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAahD,CAAC"}
@@ -15,7 +15,7 @@ const getDrawAlineInGgbQuestion = () => {
15
15
  const yMax = Math.max(yA, yB, 0);
16
16
  const yMin = Math.min(yA, yB, 0);
17
17
  const question = {
18
- ggbAnswer: [`(0,${yA})`, `(1,${yB})`, `Line(A, B)`],
18
+ ggbAnswer: [`(0,${yA})`, `(1,${yB})`, `Line[A, B]`],
19
19
  instruction: `Tracer la droite $d$ d'équation $y=${f.toTex()}$.`,
20
20
  keys: [],
21
21
  answerFormat: "tex",
@@ -33,14 +33,18 @@ const getDrawAlineInGgbQuestion = () => {
33
33
  return question;
34
34
  };
35
35
  const isGGBAnswerValid = (ans, { ggbAnswer, correctA, correctB }) => {
36
- if ((0, arrayEqual_1.arrayEqual)(ans, ggbAnswer))
36
+ const studentAnswer = ans.map((s) => s.split("=")[1]);
37
+ console.log(studentAnswer);
38
+ if ((0, arrayEqual_1.arrayEqual)(studentAnswer, ggbAnswer))
37
39
  return true;
38
- if (ans.length !== 3)
40
+ if (studentAnswer.length !== 3)
39
41
  return false;
40
- if (!(0, isGGBPoint_1.isGGBPoint)(ans[0]) || !(0, isGGBPoint_1.isGGBPoint)(ans[1]) || !(0, isGGBLine_1.isGGBLine)(ans[2]))
42
+ if (!(0, isGGBPoint_1.isGGBPoint)(studentAnswer[0]) ||
43
+ !(0, isGGBPoint_1.isGGBPoint)(studentAnswer[1]) ||
44
+ !(0, isGGBLine_1.isGGBLine)(studentAnswer[2]))
41
45
  return false;
42
- const A = getPoint(ans[0], "A");
43
- const B = getPoint(ans[1], "B");
46
+ const A = getPoint(studentAnswer[0], "A");
47
+ const B = getPoint(studentAnswer[1], "B");
44
48
  const a = (B.getYnumber() - A.getYnumber()) / (B.getXnumber() - A.getXnumber());
45
49
  const b = A.getYnumber() - a * A.getXnumber();
46
50
  return a === correctA && b === correctB;
@@ -1 +1 @@
1
- {"version":3,"file":"placeAPoint.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/placeAPoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAIT,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG,EAAE,CAAC;AAgCtB,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAY/C,CAAC"}
1
+ {"version":3,"file":"placeAPoint.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/placeAPoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAIT,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG,EAAE,CAAC;AAmCtB,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAY/C,CAAC"}
@@ -29,7 +29,7 @@ const getPlaceAPointQuestion = () => {
29
29
  return question;
30
30
  };
31
31
  const isGGBAnswerValid = (ans, { ggbAnswer }) => {
32
- return (0, arrayHasSameElement_1.arrayHasSameElements)(ans, ggbAnswer);
32
+ return (0, arrayHasSameElement_1.arrayHasSameElements)(ans.map((s) => s.split("=")[1]), ggbAnswer);
33
33
  };
34
34
  exports.testGGBAnswer = {
35
35
  id: "placeAPoint",
@@ -55,7 +55,7 @@ exports.convexityTrinomialsGeo = {
55
55
  generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getConvexityTrinomialsGeoQuestion, nb),
56
56
  qcmTimer: 60,
57
57
  freeTimer: 60,
58
- answerType: "QCM",
58
+ answerType: "QCU",
59
59
  getPropositions,
60
60
  isAnswerValid,
61
61
  hasGeogebra: true,
@@ -60,6 +60,6 @@ exports.alignementViaColinearity = {
60
60
  qcmTimer: 60,
61
61
  freeTimer: 60,
62
62
  getPropositions,
63
- answerType: "QCM",
63
+ answerType: "QCU",
64
64
  subject: "Mathématiques",
65
65
  };
@@ -55,6 +55,6 @@ exports.colinearity = {
55
55
  qcmTimer: 60,
56
56
  freeTimer: 60,
57
57
  getPropositions,
58
- answerType: "QCM",
58
+ answerType: "QCU",
59
59
  subject: "Mathématiques",
60
60
  };
@@ -1,5 +1,8 @@
1
1
  import { Exercise } from "../../../../exercises/exercise";
2
- type Identifiers = {};
2
+ type Identifiers = {
3
+ x: number;
4
+ y: number;
5
+ };
3
6
  export declare const drawAVectorInGGB: Exercise<Identifiers>;
4
7
  export {};
5
8
  //# sourceMappingURL=drawAVectorInGGB.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"drawAVectorInGGB.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/drawAVectorInGGB.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAIT,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG,EAAE,CAAC;AA8BtB,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAalD,CAAC"}
1
+ {"version":3,"file":"drawAVectorInGGB.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/drawAVectorInGGB.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAIT,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAuDF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAalD,CAAC"}
@@ -10,7 +10,7 @@ const getDrawAVectorInGgbQuestion = () => {
10
10
  const y = x === 0 ? (0, randint_1.randint)(-3, 3, [0]) : (0, randint_1.randint)(-3, 3);
11
11
  const vector = new vector_1.Vector("u", x.toTree(), y.toTree());
12
12
  const question = {
13
- ggbAnswer: [``, ``, `(${x},${y})`],
13
+ ggbAnswer: [`Vector((-2, -2), (${-2 + x}, ${-2 + y}))`],
14
14
  instruction: `Tracer le vecteur $${vector.toTex()}${vector.toInlineCoordsTex()}$`,
15
15
  keys: [],
16
16
  studentGgbOptions: {
@@ -22,12 +22,39 @@ const getDrawAVectorInGgbQuestion = () => {
22
22
  enableShiftDragZoom: true,
23
23
  },
24
24
  answerFormat: "tex",
25
- identifiers: {},
25
+ identifiers: { x, y },
26
26
  };
27
27
  return question;
28
28
  };
29
- const isGGBAnswerValid = (ans, { ggbAnswer }) => {
30
- return ans.length === 3 && ans.includes(ggbAnswer[2]);
29
+ const isGGBAnswerValid = (ans, { ggbAnswer, x, y }) => {
30
+ const vector = ans.find((s) => !!s.match(/[a-z]=/)?.length);
31
+ if (!vector)
32
+ return false;
33
+ const points = vector
34
+ .substring(vector.indexOf("["))
35
+ .replaceAll("[", "")
36
+ .replaceAll("]", "")
37
+ .replaceAll(" ", "")
38
+ .split(",");
39
+ const origin = ans.find((s) => s[0] === points[0]);
40
+ const end = ans.find((s) => s[0] === points[1]);
41
+ if (!origin || !end)
42
+ return false;
43
+ const originCoords = origin
44
+ .split("=")[1]
45
+ .replaceAll("(", "")
46
+ .replaceAll(")", "")
47
+ .split(",");
48
+ const endCoords = end
49
+ .split("=")[1]
50
+ .replaceAll("(", "")
51
+ .replaceAll(")", "")
52
+ .split(",");
53
+ const coords = [
54
+ Number(endCoords[0]) - Number(originCoords[0]),
55
+ Number(endCoords[1]) - Number(originCoords[1]),
56
+ ];
57
+ return Number(coords[0]) === x && Number(coords[1]) === y;
31
58
  };
32
59
  exports.drawAVectorInGGB = {
33
60
  id: "drawAVectorInGGB",
@@ -190,7 +190,7 @@ exports.equalCaracteristicFromGraph = {
190
190
  freeTimer: 60,
191
191
  getPropositions,
192
192
  isAnswerValid,
193
- answerType: "QCM",
193
+ answerType: "QCU",
194
194
  hasGeogebra: true,
195
195
  subject: "Mathématiques",
196
196
  };
@@ -71,6 +71,6 @@ exports.paralellismViaColinearity = {
71
71
  qcmTimer: 60,
72
72
  freeTimer: 60,
73
73
  getPropositions,
74
- answerType: "QCM",
74
+ answerType: "QCU",
75
75
  subject: "Mathématiques",
76
76
  };
@@ -63,6 +63,6 @@ exports.parallelogramViaEqualVectors = {
63
63
  qcmTimer: 60,
64
64
  freeTimer: 60,
65
65
  getPropositions,
66
- answerType: "QCM",
66
+ answerType: "QCU",
67
67
  subject: "Mathématiques",
68
68
  };
@@ -53,6 +53,6 @@ exports.matrixGeneralTerm = {
53
53
  freeTimer: 60,
54
54
  getPropositions,
55
55
  isAnswerValid,
56
- answerType: "QCM",
56
+ answerType: "QCU",
57
57
  subject: "Mathématiques",
58
58
  };
@@ -68,6 +68,6 @@ exports.isTableProportional = {
68
68
  freeTimer: 60,
69
69
  getPropositions,
70
70
  isAnswerValid,
71
- answerType: "QCM",
71
+ answerType: "QCU",
72
72
  subject: "Mathématiques",
73
73
  };
@@ -55,6 +55,6 @@ exports.independancy = {
55
55
  qcmTimer: 60,
56
56
  freeTimer: 60,
57
57
  getPropositions,
58
- answerType: "QCM",
58
+ answerType: "QCU",
59
59
  subject: "Mathématiques",
60
60
  };
@@ -97,7 +97,7 @@ exports.fineAdjustementExercise = {
97
97
  levels: ["TermSpé"],
98
98
  isSingleStep: true,
99
99
  hasGeogebra: true,
100
- answerType: "QCM",
100
+ answerType: "QCU",
101
101
  sections: ["Statistiques"],
102
102
  generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getFineAdjustementExerciseQuestion, nb),
103
103
  qcmTimer: 60,
@@ -67,6 +67,6 @@ exports.recognizeArithmeticFromFirstTerms = {
67
67
  freeTimer: 60,
68
68
  getPropositions,
69
69
  isAnswerValid,
70
- answerType: "QCM",
70
+ answerType: "QCU",
71
71
  subject: "Mathématiques",
72
72
  };
@@ -86,7 +86,7 @@ exports.recognizeArithmeticFromGraph = {
86
86
  freeTimer: 60,
87
87
  getPropositions,
88
88
  isAnswerValid,
89
- answerType: "QCM",
89
+ answerType: "QCU",
90
90
  hasGeogebra: true,
91
91
  subject: "Mathématiques",
92
92
  };
@@ -47,7 +47,7 @@ exports.genericSequenceVariations = {
47
47
  generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getGenericSequenceVariationsQuestion, nb),
48
48
  qcmTimer: 60,
49
49
  freeTimer: 60,
50
- answerType: "QCM",
50
+ answerType: "QCU",
51
51
  getPropositions,
52
52
  subject: "Mathématiques",
53
53
  };
@@ -1 +1 @@
1
- {"version":3,"file":"calibrationCurveOfSolution.d.ts","sourceRoot":"","sources":["../../../src/exercises/pc/calibrationCurveOfSolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAWlC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAqFF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAa5D,CAAC"}
1
+ {"version":3,"file":"calibrationCurveOfSolution.d.ts","sourceRoot":"","sources":["../../../src/exercises/pc/calibrationCurveOfSolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAWlC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAuFF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAa5D,CAAC"}
@@ -41,9 +41,10 @@ const getCalibrationCurveOfSolutionQuestion = () => {
41
41
  return question;
42
42
  };
43
43
  const isGGBAnswerValid = (ans, { ggbAnswer, epsilon, l }) => {
44
- if ((0, arrayEqual_1.arrayEqual)(ans, ggbAnswer))
44
+ const studentAnswer = ans.map((s) => s.split("=")[1]);
45
+ if ((0, arrayEqual_1.arrayEqual)(studentAnswer, ggbAnswer))
45
46
  return true;
46
- const points = ans
47
+ const points = studentAnswer
47
48
  .filter((command) => (0, isGGBPoint_1.isGGBPoint)(command))
48
49
  .map((value) => (0, getPointFromGGB_1.getPointFromGGB)(value, "", false));
49
50
  return (points.length !== 0 &&
@@ -54,5 +54,5 @@ exports.atomicStructureOfNucleus = {
54
54
  getPropositions,
55
55
  isAnswerValid,
56
56
  subject: "Chimie",
57
- answerType: "QCM",
57
+ answerType: "QCU",
58
58
  };
@@ -96,6 +96,6 @@ exports.identifyRightElectronicConfiguration = {
96
96
  getPropositions,
97
97
  isAnswerValid,
98
98
  subject: "Chimie",
99
- answerType: "QCM",
99
+ answerType: "QCU",
100
100
  maxAllowedQuestions: 16,
101
101
  };
@@ -55,5 +55,5 @@ exports.identifyLimitingReagent = {
55
55
  getPropositions,
56
56
  isAnswerValid,
57
57
  subject: "Chimie",
58
- answerType: "QCM",
58
+ answerType: "QCU",
59
59
  };
@@ -64,5 +64,5 @@ exports.identifyStoichiometricMixture = {
64
64
  getPropositions,
65
65
  isAnswerValid,
66
66
  subject: "Chimie",
67
- answerType: "QCM",
67
+ answerType: "QCU",
68
68
  };
@@ -10,7 +10,7 @@ const getConcentrationReadingQuestion = () => {
10
10
  const absorbtion = (0, randfloat_1.randfloat)(0.5, 5);
11
11
  const concentration = (0, randfloat_1.randfloat)(0.1, 2);
12
12
  const commands = [
13
- `L = Line((0,0), (${concentration}, ${absorbtion}))`,
13
+ `L = Line[(0,0), (${concentration}, ${absorbtion})]`,
14
14
  `SetFixed(L, true)`,
15
15
  `SetColor(L, "${(0, colors_1.randomColor)()}")`,
16
16
  ];
@@ -22,7 +22,7 @@ const getMoleculeNomenclature = () => {
22
22
  };
23
23
  const getPropositions = (n, { answer }) => {
24
24
  const propositions = [];
25
- (0, exercise_1.addValidProp)(propositions, answer);
25
+ (0, exercise_1.addValidProp)(propositions, answer, "raw");
26
26
  const organicMolecule = molecule_1.molecules.filter((molecule) => molecule.isOrganic && molecule.type);
27
27
  while (propositions.length < n) {
28
28
  const randomMoleculeIndex = Math.floor(Math.random() * organicMolecule.length);
@@ -47,5 +47,5 @@ exports.frequencyComparison = {
47
47
  getPropositions,
48
48
  isAnswerValid,
49
49
  subject: "Physique",
50
- answerType: "QCM",
50
+ answerType: "QCU",
51
51
  };
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isGGBLine = void 0;
4
4
  function isGGBLine(command) {
5
- const regex = /Line\([A-Z],\s[A-Z]\)/;
5
+ const regex = /Line\[[A-Z],\s[A-Z]\]/;
6
6
  return regex.test(command);
7
7
  }
8
8
  exports.isGGBLine = isGGBLine;
package/lib/index.d.ts CHANGED
@@ -128,6 +128,12 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
128
128
  precisionAsked: number;
129
129
  decimal: number;
130
130
  precision: number;
131
+ }> | import("./exercises/exercise").Exercise<{
132
+ nb: number;
133
+ rankAsked: number;
134
+ }> | import("./exercises/exercise").Exercise<{
135
+ nb: string;
136
+ rankAsked: number;
131
137
  }> | import("./exercises/exercise").Exercise<{
132
138
  a: number;
133
139
  b: number;
@@ -892,7 +898,10 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
892
898
  uY: number;
893
899
  aX: number;
894
900
  aY: number;
895
- }> | import("./exercises/exercise").Exercise<{}> | import("./exercises/exercise").Exercise<{
901
+ }> | import("./exercises/exercise").Exercise<{
902
+ x: number;
903
+ y: number;
904
+ }> | import("./exercises/exercise").Exercise<{
896
905
  trinom: number[];
897
906
  }> | import("./exercises/exercise").Exercise<{
898
907
  askConvex: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,EAAE,MAAM,aAAa,CAAC;QAC5B,SAAS,EAAE,MAAM,MAAM,CAAC;QACxB,YAAY,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,aAAa,CAAC;KACpD;CACF;AAcD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+BE;AAEF,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAjCnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA+BE;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEgD,CAAC;AACnD,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC"}
@@ -3,6 +3,7 @@ import { PercentNode } from "../../../tree/nodes/numbers/percentNode";
3
3
  import { MultiplyNode } from "../../../tree/nodes/operators/multiplyNode";
4
4
  import { Nombre, NumberType } from "../nombre";
5
5
  import { Rational } from "../rationals/rational";
6
+ export declare const decimalDigitRanks: string[];
6
7
  export declare abstract class DecimalConstructor {
7
8
  static randomFracPart(precision: number, leadingZeros?: number): string;
8
9
  static random(min: number, max: number, precision?: number): Decimal;
@@ -1 +1 @@
1
- {"version":3,"file":"decimal.d.ts","sourceRoot":"","sources":["../../../../src/math/numbers/decimals/decimal.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAEvE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,8BAAsB,kBAAkB;IACtC,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,GAAE,MAAU,GAAG,MAAM;IAY1E,MAAM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E,MAAU,GAAG,MAAM;IAY1E,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO;IAMpE,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO;IAK/D,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO;CAMrD;AAED,qBAAa,OAAQ,YAAW,MAAM;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,aAAsB;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;gBACR,KAAK,EAAE,MAAM,GAAG,MAAM;IASlC,MAAM,CAAC,CAAC,EAAE,MAAM;IAIhB;;;;OAIG;IACH,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAIhC,oBAAoB,CAAC,KAAK,EAAE,MAAM;IAkClC,gBAAgB;IA6BhB,oBAAoB,CAAC,QAAQ,CAAC,EAAE,MAAM;IAwCtC,UAAU;IAMV,MAAM;IAIN,aAAa;CAGd"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Decimal = exports.DecimalConstructor = void 0;
3
+ exports.Decimal = exports.DecimalConstructor = exports.decimalDigitRanks = void 0;
4
4
  const randint_1 = require("../../../math/utils/random/randint");
5
5
  const round_1 = require("../../../math/utils/round");
6
6
  const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
@@ -9,6 +9,7 @@ const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
9
9
  const powerNode_1 = require("../../../tree/nodes/operators/powerNode");
10
10
  const nombre_1 = require("../nombre");
11
11
  const rational_1 = require("../rationals/rational");
12
+ exports.decimalDigitRanks = ["dixièmes", "centièmes", "millièmes"];
12
13
  class DecimalConstructor {
13
14
  static randomFracPart(precision, leadingZeros = 0) {
14
15
  let decimals = "";
@@ -1,6 +1,7 @@
1
1
  import { NumberNode } from "../../../tree/nodes/numbers/numberNode";
2
2
  import { Nombre, NumberType } from "../nombre";
3
3
  import { Rational } from "../rationals/rational";
4
+ export declare const integerDigitRanks: string[];
4
5
  export declare abstract class IntegerConstructor {
5
6
  static random(nbOfDigits: number, excludes?: number[]): number;
6
7
  static randomPrime(max?: number): number;
@@ -1 +1 @@
1
- {"version":3,"file":"integer.d.ts","sourceRoot":"","sources":["../../../../src/math/numbers/integer/integer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAEjE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGjD,8BAAsB,kBAAkB;IACtC,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE;IAGrD,MAAM,CAAC,WAAW,CAAC,GAAG,GAAE,MAAW;IAGnC,MAAM,CAAC,gBAAgB,CACrB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,EAAE,EAAE,MAAM,EACV,QAAQ,CAAC,EAAE,MAAM,EAAE;CAYtB;AAED,qBAAa,OAAQ,YAAW,MAAM;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,UAAU,CAAC;gBAEL,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM;IAMvC,MAAM,CAAC,CAAC,EAAE,MAAM;IAGhB,MAAM;IAIN,KAAK,CAAC,SAAS,EAAE,MAAM;IAkCvB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAc1B,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO;IAYxC,QAAQ;IAGR,GAAG,CAAC,EAAE,EAAE,MAAM;CAYf"}
1
+ {"version":3,"file":"integer.d.ts","sourceRoot":"","sources":["../../../../src/math/numbers/integer/integer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAEjE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGjD,eAAO,MAAM,iBAAiB,UAK7B,CAAC;AACF,8BAAsB,kBAAkB;IACtC,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE;IAGrD,MAAM,CAAC,WAAW,CAAC,GAAG,GAAE,MAAW;IAGnC,MAAM,CAAC,gBAAgB,CACrB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,EAAE,EAAE,MAAM,EACV,QAAQ,CAAC,EAAE,MAAM,EAAE;CAYtB;AAED,qBAAa,OAAQ,YAAW,MAAM;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,UAAU,CAAC;gBAEL,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM;IAMvC,MAAM,CAAC,CAAC,EAAE,MAAM;IAGhB,MAAM;IAIN,KAAK,CAAC,SAAS,EAAE,MAAM;IAkCvB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAc1B,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO;IAYxC,QAAQ;IAGR,GAAG,CAAC,EAAE,EAAE,MAAM;CAYf"}
@@ -1,12 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Integer = exports.IntegerConstructor = void 0;
3
+ exports.Integer = exports.IntegerConstructor = exports.integerDigitRanks = void 0;
4
4
  const randint_1 = require("../../../math/utils/random/randint");
5
5
  const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
6
6
  const random_1 = require("../../../utils/random");
7
7
  const nombre_1 = require("../nombre");
8
8
  const rational_1 = require("../rationals/rational");
9
9
  const primes_1 = require("./primes");
10
+ exports.integerDigitRanks = [
11
+ "unités",
12
+ "dizaines",
13
+ "centaines",
14
+ "milliers",
15
+ ];
10
16
  class IntegerConstructor {
11
17
  static random(nbOfDigits, excludes) {
12
18
  return (0, randint_1.randint)(10 ** (nbOfDigits - 1), 10 ** nbOfDigits, excludes);
package/lib/server.js CHANGED
@@ -35,7 +35,9 @@ const dotenv_1 = __importDefault(require("dotenv"));
35
35
  const cors_1 = __importDefault(require("cors"));
36
36
  const numberNode_1 = require("./tree/nodes/numbers/numberNode");
37
37
  const infiniteNode_1 = require("./tree/nodes/numbers/infiniteNode");
38
+ const multiplyNode_1 = require("./tree/nodes/operators/multiplyNode");
38
39
  const toScientific_1 = require("./utils/numberPrototype/toScientific");
40
+ const variableNode_1 = require("./tree/nodes/variables/variableNode");
39
41
  const jsonParser = body_parser_1.default.json();
40
42
  const mathExercises = Object.values(MathExercises);
41
43
  const pcExercises = Object.values(PCExercises);
@@ -60,16 +62,10 @@ const runServer = () => {
60
62
  app.use((0, cors_1.default)());
61
63
  console.log("math exos", mathExercises.length);
62
64
  console.log("pc exos", pcExercises.length);
63
- // const node = new MultiplyNode(
64
- // (4).toTree(),
65
- // new CosNode(
66
- // new MultiplyNode(
67
- // new FractionNode(new MultiplyNode((2).toTree(), PiNode), (3).toTree()),
68
- // new VariableNode("x"),
69
- // ),
70
- // ),
71
- // ).simplify();
72
- // console.log(node);
65
+ const node = new multiplyNode_1.MultiplyNode(new variableNode_1.VariableNode("x"), new variableNode_1.VariableNode("x"))
66
+ .simplify()
67
+ .toTex();
68
+ console.log(node);
73
69
  app.get("/", (req, res) => {
74
70
  res.json(allExercises);
75
71
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "math-exercises",
3
- "version": "2.1.26-beta.8",
3
+ "version": "2.2.0",
4
4
  "description": "Math exercises generator for middle school and high school",
5
5
  "main": "lib/index.js",
6
6
  "files": [