math-exercises 2.1.5 → 2.1.6

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 (44) hide show
  1. package/lib/exercises/math/calculLitteral/systems/index.d.ts +1 -0
  2. package/lib/exercises/math/calculLitteral/systems/index.d.ts.map +1 -1
  3. package/lib/exercises/math/calculLitteral/systems/index.js +1 -0
  4. package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.d.ts +9 -0
  5. package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.d.ts.map +1 -0
  6. package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.js +63 -0
  7. package/lib/exercises/math/derivation/derivative/expDerivativeFour.d.ts +8 -0
  8. package/lib/exercises/math/derivation/derivative/expDerivativeFour.d.ts.map +1 -0
  9. package/lib/exercises/math/derivation/derivative/expDerivativeFour.js +57 -0
  10. package/lib/exercises/math/derivation/derivative/index.d.ts +1 -0
  11. package/lib/exercises/math/derivation/derivative/index.d.ts.map +1 -1
  12. package/lib/exercises/math/derivation/derivative/index.js +1 -0
  13. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormula.d.ts.map +1 -1
  14. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormula.js +4 -3
  15. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplictFormulaFirstTermRandom.d.ts +9 -0
  16. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplictFormulaFirstTermRandom.d.ts.map +1 -0
  17. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplictFormulaFirstTermRandom.js +59 -0
  18. package/lib/exercises/math/sequences/arithmetic/arithmeticFindReasonRandomRange.d.ts +10 -0
  19. package/lib/exercises/math/sequences/arithmetic/arithmeticFindReasonRandomRange.d.ts.map +1 -0
  20. package/lib/exercises/math/sequences/arithmetic/arithmeticFindReasonRandomRange.js +49 -0
  21. package/lib/exercises/math/sequences/arithmetic/index.d.ts +2 -0
  22. package/lib/exercises/math/sequences/arithmetic/index.d.ts.map +1 -1
  23. package/lib/exercises/math/sequences/arithmetic/index.js +2 -0
  24. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstTermRandom.d.ts +9 -0
  25. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstTermRandom.d.ts.map +1 -0
  26. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstTermRandom.js +62 -0
  27. package/lib/exercises/math/sequences/geometric/index.d.ts +1 -0
  28. package/lib/exercises/math/sequences/geometric/index.d.ts.map +1 -1
  29. package/lib/exercises/math/sequences/geometric/index.js +1 -0
  30. package/lib/exercises/pc/chemicalReactions/calculateCombustionEnergy.js +1 -1
  31. package/lib/exercises/pc/chemicalReactions/calculateSynthesisEfficiency.js +1 -1
  32. package/lib/exercises/pc/chemicalReactions/identifyLimitingReagent.js +1 -1
  33. package/lib/exercises/pc/chemicalReactions/identifyStoichiometricMixture.js +1 -1
  34. package/lib/exercises/pc/electricity/electricChargeFromIntensity.d.ts.map +1 -1
  35. package/lib/exercises/pc/electricity/electricChargeFromIntensity.js +4 -1
  36. package/lib/exercises/pc/electricity/electricEnergyFromPower.js +1 -1
  37. package/lib/exercises/pc/forces/forceWork.js +1 -1
  38. package/lib/exercises/pc/math/proportionnalityCoeffFromLine.js +1 -1
  39. package/lib/exercises/pc/mecanicalWaves/elongationReading.d.ts.map +1 -1
  40. package/lib/exercises/pc/mecanicalWaves/elongationReading.js +3 -2
  41. package/lib/index.d.ts +20 -0
  42. package/lib/index.d.ts.map +1 -1
  43. package/lib/pc/molecularChemistry/molecule.js +2 -2
  44. package/package.json +1 -1
@@ -1,3 +1,4 @@
1
1
  export * from "./basicSystemResolution";
2
2
  export * from "./basicNiceValuesSystemResolution";
3
+ export * from "./verifySystemSolution";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/systems/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,mCAAmC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/systems/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,mCAAmC,CAAC;AAClD,cAAc,wBAAwB,CAAC"}
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./basicSystemResolution"), exports);
18
18
  __exportStar(require("./basicNiceValuesSystemResolution"), exports);
19
+ __exportStar(require("./verifySystemSolution"), exports);
@@ -0,0 +1,9 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ sysCoeffs: number[][];
4
+ x: number;
5
+ y: number;
6
+ };
7
+ export declare const verifySystemSolution: Exercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=verifySystemSolution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verifySystemSolution.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/systems/verifySystemSolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;IACtB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA8CF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CActD,CAAC"}
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.verifySystemSolution = void 0;
4
+ const exercise_1 = require("../../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const system_1 = require("../../../../math/systems/system");
7
+ const randint_1 = require("../../../../math/utils/random/randint");
8
+ const coinFlip_1 = require("../../../../utils/coinFlip");
9
+ const getVerifySystemSolutionQuestion = () => {
10
+ let x;
11
+ let y;
12
+ const isSolution = (0, coinFlip_1.coinFlip)();
13
+ let sys;
14
+ if (isSolution) {
15
+ sys = system_1.SystemConstructor.niceValues();
16
+ const sol = sys.solve();
17
+ x = sol.x.evaluate({});
18
+ y = sol.y.evaluate({});
19
+ }
20
+ else {
21
+ sys = system_1.SystemConstructor.niceValues();
22
+ const sol = sys.solve();
23
+ x = sol.x.evaluate({}) + (0, randint_1.randint)(-5, 5);
24
+ y = sol.y.evaluate({}) + (0, randint_1.randint)(-5, 5, [0]);
25
+ }
26
+ const question = {
27
+ answer: isSolution ? "Oui" : "Non",
28
+ instruction: `Soit le système d'équations suivant :
29
+
30
+ $${sys.toTex()}$
31
+
32
+ Le couple $(${x};${y})$ est-il une solution de ce système ?`,
33
+ keys: [],
34
+ answerFormat: "raw",
35
+ identifiers: { sysCoeffs: sys.coeffs, x, y },
36
+ };
37
+ return question;
38
+ };
39
+ const getPropositions = (n, { answer }) => {
40
+ const propositions = [];
41
+ (0, exercise_1.addValidProp)(propositions, answer, "raw");
42
+ (0, exercise_1.tryToAddWrongProp)(propositions, "Oui", "raw");
43
+ (0, exercise_1.tryToAddWrongProp)(propositions, "Non", "raw");
44
+ (0, exercise_1.tryToAddWrongProp)(propositions, "On ne peut pas savoir", "raw");
45
+ return (0, exercise_1.shuffleProps)(propositions, n);
46
+ };
47
+ const isAnswerValid = (ans, { answer }) => {
48
+ return ans === answer;
49
+ };
50
+ exports.verifySystemSolution = {
51
+ id: "verifySystemSolution",
52
+ label: "Vérifier si un couple est solution d'un système",
53
+ levels: ["2nde", "1reSpé"],
54
+ isSingleStep: true,
55
+ sections: ["Systèmes"],
56
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getVerifySystemSolutionQuestion, nb),
57
+ qcmTimer: 60,
58
+ freeTimer: 60,
59
+ getPropositions,
60
+ isAnswerValid,
61
+ subject: "Mathématiques",
62
+ answerType: "QCM",
63
+ };
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ affine1Coeffs: number[];
4
+ affine2Coeffs: number[];
5
+ };
6
+ export declare const expDerivativeFour: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=expDerivativeFour.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expDerivativeFour.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/expDerivativeFour.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AA8DF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAcnD,CAAC"}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.expDerivativeFour = void 0;
4
+ const exercise_1 = require("../../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const affine_1 = require("../../../../math/polynomials/affine");
7
+ const expNode_1 = require("../../../../tree/nodes/functions/expNode");
8
+ const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
9
+ const getExpDerivativeFourQuestion = () => {
10
+ const affine1 = affine_1.AffineConstructor.random();
11
+ const affine2 = affine_1.AffineConstructor.random();
12
+ const exp = new expNode_1.ExpNode(affine2.toTree());
13
+ const fct = new multiplyNode_1.MultiplyNode(affine1.toTree(), exp);
14
+ const deriv = new multiplyNode_1.MultiplyNode(new affine_1.Affine(affine2.a * affine1.a, affine1.a + affine2.a * affine1.b).toTree(), exp);
15
+ //ae^cx+d + c(ax+b)e^cx+d = (a+c(ax+b))e^cx+d = (cax + a +cb) e^cx+d
16
+ const question = {
17
+ answer: deriv.toTex(),
18
+ instruction: `Déterminer la dérivée de la fonction $f(x) = ${fct.toTex()}$`,
19
+ keys: ["x", "exp"],
20
+ answerFormat: "tex",
21
+ identifiers: {
22
+ affine1Coeffs: affine1.coefficients,
23
+ affine2Coeffs: affine2.coefficients,
24
+ },
25
+ };
26
+ return question;
27
+ };
28
+ const getPropositions = (n, { answer }) => {
29
+ const propositions = [];
30
+ (0, exercise_1.addValidProp)(propositions, answer);
31
+ while (propositions.length < n) {
32
+ (0, exercise_1.tryToAddWrongProp)(propositions, new multiplyNode_1.MultiplyNode(affine_1.AffineConstructor.random().toTree(), new expNode_1.ExpNode(affine_1.AffineConstructor.random().toTree())).toTex());
33
+ }
34
+ return (0, exercise_1.shuffleProps)(propositions, n);
35
+ };
36
+ const isAnswerValid = (ans, { answer, affine1Coeffs, affine2Coeffs }) => {
37
+ const affine1 = new affine_1.Affine(affine1Coeffs[1], affine1Coeffs[0]);
38
+ const affine2 = new affine_1.Affine(affine2Coeffs[1], affine2Coeffs[0]);
39
+ const exp = new expNode_1.ExpNode(affine2.toTree());
40
+ const deriv = new multiplyNode_1.MultiplyNode(new affine_1.Affine(affine2.a * affine1.a, affine1.a + affine2.a * affine1.b).toTree(), exp);
41
+ const texs = deriv.toAllValidTexs();
42
+ return texs.includes(ans);
43
+ };
44
+ exports.expDerivativeFour = {
45
+ id: "expDerivativeFour",
46
+ connector: "=",
47
+ label: "Dérivée de $(ax+b)e^{cx+d}$",
48
+ levels: ["1reSpé", "TermSpé", "MathComp"],
49
+ isSingleStep: true,
50
+ sections: ["Dérivation", "Exponentielle"],
51
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getExpDerivativeFourQuestion, nb),
52
+ qcmTimer: 60,
53
+ freeTimer: 60,
54
+ getPropositions,
55
+ isAnswerValid,
56
+ subject: "Mathématiques",
57
+ };
@@ -2,6 +2,7 @@ export { constanteDerivative } from "./constanteDerivative";
2
2
  export * from "./expDerivativeOne";
3
3
  export * from "./expDerivativeThree";
4
4
  export * from "./expDerivativeTwo";
5
+ export * from "./expDerivativeFour";
5
6
  export { firstDegreeDerivative } from "./firstDegreeDerivative";
6
7
  export * from "./inverseFunctionDerivative";
7
8
  export * from "./lnDerivativeOne";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AAEpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC"}
@@ -20,6 +20,7 @@ Object.defineProperty(exports, "constanteDerivative", { enumerable: true, get: f
20
20
  __exportStar(require("./expDerivativeOne"), exports);
21
21
  __exportStar(require("./expDerivativeThree"), exports);
22
22
  __exportStar(require("./expDerivativeTwo"), exports);
23
+ __exportStar(require("./expDerivativeFour"), exports);
23
24
  var firstDegreeDerivative_1 = require("./firstDegreeDerivative");
24
25
  Object.defineProperty(exports, "firstDegreeDerivative", { enumerable: true, get: function () { return firstDegreeDerivative_1.firstDegreeDerivative; } });
25
26
  __exportStar(require("./inverseFunctionDerivative"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"arithmeticFindExplicitFormula.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormula.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAqDF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAc/D,CAAC"}
1
+ {"version":3,"file":"arithmeticFindExplicitFormula.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormula.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAsDF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAc/D,CAAC"}
@@ -27,9 +27,10 @@ const getPropositions = (n, { answer, firstValue, reason }) => {
27
27
  const propositions = [];
28
28
  (0, exercise_1.addValidProp)(propositions, answer);
29
29
  while (propositions.length < n) {
30
- (0, exercise_1.tryToAddWrongProp)(propositions, new polynomial_1.Polynomial([firstValue + (0, randint_1.randint)(-3, 4), reason + (0, randint_1.randint)(-3, 4, [-reason])], "n")
31
- .toTree()
32
- .toTex());
30
+ (0, exercise_1.tryToAddWrongProp)(propositions, "u_n=" +
31
+ new polynomial_1.Polynomial([firstValue + (0, randint_1.randint)(-3, 4), reason + (0, randint_1.randint)(-3, 4, [-reason])], "n")
32
+ .toTree()
33
+ .toTex());
33
34
  }
34
35
  return (0, shuffle_1.shuffle)(propositions);
35
36
  };
@@ -0,0 +1,9 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ firstValue: number;
4
+ reason: number;
5
+ firstRank: number;
6
+ };
7
+ export declare const arithmeticFindExplicitFormulaFirstTermRandom: Exercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=arithmeticFindExplictFormulaFirstTermRandom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arithmeticFindExplictFormulaFirstTermRandom.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticFindExplictFormulaFirstTermRandom.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAiEF,eAAO,MAAM,4CAA4C,EAAE,QAAQ,CAAC,WAAW,CAgB5E,CAAC"}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.arithmeticFindExplicitFormulaFirstTermRandom = void 0;
4
+ const exercise_1 = require("../../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const polynomial_1 = require("../../../../math/polynomials/polynomial");
7
+ const randint_1 = require("../../../../math/utils/random/randint");
8
+ const equalNode_1 = require("../../../../tree/nodes/equations/equalNode");
9
+ const variableNode_1 = require("../../../../tree/nodes/variables/variableNode");
10
+ const shuffle_1 = require("../../../../utils/shuffle");
11
+ const getArithmeticFindExplicitFormulaFirstTermRandom = () => {
12
+ const firstRank = (0, randint_1.randint)(0, 8);
13
+ const firstValue = (0, randint_1.randint)(-10, 10);
14
+ const reason = (0, randint_1.randint)(-10, 10, [0]);
15
+ const formula = new polynomial_1.Polynomial([firstValue - firstRank * reason, reason], "n");
16
+ const answer = "u_n=" + formula.toTex();
17
+ const question = {
18
+ instruction: `$(u_n)$ est une suite arithmétique de premier terme $u_{${firstRank}} = ${firstValue}$ et de raison $r = ${reason}$. $\\\\$ Donner l'expression de $u_n$ en fonction de $n$.`,
19
+ answer,
20
+ keys: ["un", "equal", "n"],
21
+ answerFormat: "tex",
22
+ identifiers: { firstValue, reason, firstRank },
23
+ };
24
+ return question;
25
+ };
26
+ const getPropositions = (n, { answer, firstValue, reason }) => {
27
+ const propositions = [];
28
+ (0, exercise_1.addValidProp)(propositions, answer);
29
+ while (propositions.length < n) {
30
+ (0, exercise_1.tryToAddWrongProp)(propositions, "u_n=" +
31
+ new polynomial_1.Polynomial([firstValue + (0, randint_1.randint)(-3, 4), reason + (0, randint_1.randint)(-3, 4, [-reason])], "n")
32
+ .toTree()
33
+ .toTex());
34
+ }
35
+ return (0, shuffle_1.shuffle)(propositions);
36
+ };
37
+ const isAnswerValid = (ans, { reason, firstValue, firstRank }) => {
38
+ const formula = new polynomial_1.Polynomial([firstValue - firstRank * reason, reason], "n");
39
+ const equal = new equalNode_1.EqualNode(new variableNode_1.VariableNode("u_n"), formula.toTree(), {
40
+ allowRawRightChildAsSolution: true,
41
+ });
42
+ const texs = equal.toAllValidTexs();
43
+ console.log(texs);
44
+ return texs.includes(ans);
45
+ };
46
+ exports.arithmeticFindExplicitFormulaFirstTermRandom = {
47
+ id: "arithmeticFindExplicitFormulaFirstTermRandom",
48
+ connector: "=",
49
+ label: "Déterminer la formule générale d'une suite arithmétique (premier rang aléatoire)",
50
+ levels: ["1reESM", "1reSpé", "1reTech", "1rePro", "TermTech", "TermPro"],
51
+ sections: ["Suites"],
52
+ isSingleStep: false,
53
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getArithmeticFindExplicitFormulaFirstTermRandom, nb),
54
+ qcmTimer: 60,
55
+ freeTimer: 60,
56
+ getPropositions,
57
+ isAnswerValid,
58
+ subject: "Mathématiques",
59
+ };
@@ -0,0 +1,10 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ rank1: number;
4
+ rank2: number;
5
+ reason: number;
6
+ value1: number;
7
+ };
8
+ export declare const arithmeticFindReasonRandomRange: Exercise<Identifiers>;
9
+ export {};
10
+ //# sourceMappingURL=arithmeticFindReasonRandomRange.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arithmeticFindReasonRandomRange.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticFindReasonRandomRange.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAKlC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAmCF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAcjE,CAAC"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.arithmeticFindReasonRandomRange = void 0;
4
+ const exercise_1 = require("../../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const randint_1 = require("../../../../math/utils/random/randint");
7
+ const shuffle_1 = require("../../../../utils/shuffle");
8
+ const getArithmeticFindReasonRandomRange = () => {
9
+ const rank1 = (0, randint_1.randint)(0, 10);
10
+ const rank2 = rank1 + (0, randint_1.randint)(2, 6);
11
+ const reason = (0, randint_1.randint)(-10, 10, [0]);
12
+ const value1 = (0, randint_1.randint)(-10, 10);
13
+ const value2 = reason * (rank2 - rank1) + value1;
14
+ const answer = reason + "";
15
+ const question = {
16
+ instruction: `$(u_n)$ est une suite arithmétique. On sait que $u_{${rank1}} = ${value1}$ et $u_{${rank2}} = ${value2}$. Quelle est la raison de la suite $(u_n)$ ?`,
17
+ startStatement: "r",
18
+ answer,
19
+ keys: [],
20
+ answerFormat: "tex",
21
+ identifiers: { rank1, reason, value1, rank2 },
22
+ };
23
+ return question;
24
+ };
25
+ const getPropositions = (n, { answer }) => {
26
+ const propositions = [];
27
+ (0, exercise_1.addValidProp)(propositions, answer);
28
+ while (propositions.length < n) {
29
+ (0, exercise_1.tryToAddWrongProp)(propositions, Number(answer) + (0, randint_1.randint)(-5, 6, [0]) + "");
30
+ }
31
+ return (0, shuffle_1.shuffle)(propositions);
32
+ };
33
+ const isAnswerValid = (ans, { answer }) => {
34
+ return ans === answer;
35
+ };
36
+ exports.arithmeticFindReasonRandomRange = {
37
+ id: "arithmeticFindReasonRandomRange",
38
+ connector: "=",
39
+ label: "Déterminer la raison d'une suite arithmétique (écart aléatoire)",
40
+ levels: ["1reESM", "1reSpé", "1reTech", "1rePro", "TermTech", "TermPro"],
41
+ sections: ["Suites"],
42
+ isSingleStep: false,
43
+ getPropositions,
44
+ isAnswerValid,
45
+ qcmTimer: 60,
46
+ freeTimer: 60,
47
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getArithmeticFindReasonRandomRange, nb),
48
+ subject: "Mathématiques",
49
+ };
@@ -10,4 +10,6 @@ export * from "./recognizeReasonFromFirstTerms";
10
10
  export * from "./recognizeReasonFromGraph";
11
11
  export * from "./recognizeArithmeticFromGraph";
12
12
  export * from "./arithmeticFirstTermsSum";
13
+ export * from "./arithmeticFindExplictFormulaFirstTermRandom";
14
+ export * from "./arithmeticFindReasonRandomRange";
13
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oCAAoC,CAAC;AACnD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,qCAAqC,CAAC;AACpD,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oCAAoC,CAAC;AACnD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,qCAAqC,CAAC;AACpD,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+CAA+C,CAAC;AAC9D,cAAc,mCAAmC,CAAC"}
@@ -26,3 +26,5 @@ __exportStar(require("./recognizeReasonFromFirstTerms"), exports);
26
26
  __exportStar(require("./recognizeReasonFromGraph"), exports);
27
27
  __exportStar(require("./recognizeArithmeticFromGraph"), exports);
28
28
  __exportStar(require("./arithmeticFirstTermsSum"), exports);
29
+ __exportStar(require("./arithmeticFindExplictFormulaFirstTermRandom"), exports);
30
+ __exportStar(require("./arithmeticFindReasonRandomRange"), exports);
@@ -0,0 +1,9 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ reason: number;
4
+ firstValue: number;
5
+ firstRank: number;
6
+ };
7
+ export declare const geometricFindExplicitFormulaFirstTermRandom: Exercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=geometricFindExplicitFormulaFirstTermRandom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometricFindExplicitFormulaFirstTermRandom.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstTermRandom.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAgFF,eAAO,MAAM,2CAA2C,EAAE,QAAQ,CAAC,WAAW,CAgB3E,CAAC"}
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.geometricFindExplicitFormulaFirstTermRandom = void 0;
4
+ const exercise_1 = require("../../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const randint_1 = require("../../../../math/utils/random/randint");
7
+ const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
8
+ const equalNode_1 = require("../../../../tree/nodes/equations/equalNode");
9
+ const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
10
+ const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
11
+ const variableNode_1 = require("../../../../tree/nodes/variables/variableNode");
12
+ const shuffle_1 = require("../../../../utils/shuffle");
13
+ const substractNode_1 = require("../../../../tree/nodes/operators/substractNode");
14
+ const getGeometricFindExplicitFormulaFirstTermRandom = () => {
15
+ const firstRank = (0, randint_1.randint)(0, 9);
16
+ const firstValue = (0, randint_1.randint)(1, 10);
17
+ const reason = (0, randint_1.randint)(2, 10);
18
+ const formula = new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(firstValue), new powerNode_1.PowerNode(new numberNode_1.NumberNode(reason), new substractNode_1.SubstractNode(new variableNode_1.VariableNode("n"), firstRank.toTree())));
19
+ const answer = "u_n=" + formula.toTex();
20
+ const question = {
21
+ instruction: `$(u_n)$ est une suite géométrique de premier terme $u_{${firstRank}} = ${firstValue}$ et de raison $q = ${reason}$. $\\\\$ Donner l'expression de $u_n$ en fonction de $n$.`,
22
+ answer,
23
+ keys: ["un", "equal", "n"],
24
+ answerFormat: "tex",
25
+ identifiers: { reason, firstValue, firstRank },
26
+ };
27
+ return question;
28
+ };
29
+ const getPropositions = (n, { answer, reason, firstValue }) => {
30
+ const propositions = [];
31
+ (0, exercise_1.addValidProp)(propositions, answer);
32
+ (0, exercise_1.tryToAddWrongProp)(propositions, "u_n=" +
33
+ new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(reason), new powerNode_1.PowerNode(new numberNode_1.NumberNode(firstValue), new variableNode_1.VariableNode("n"))).toTex());
34
+ while (propositions.length < n) {
35
+ const wrongAnswer = new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(firstValue + (0, randint_1.randint)(-firstValue, 2 * firstValue + 1, [-firstValue])), new powerNode_1.PowerNode(new numberNode_1.NumberNode(reason + +(0, randint_1.randint)(-reason + 1, 2 * reason + 1)), new variableNode_1.VariableNode("n")));
36
+ (0, exercise_1.tryToAddWrongProp)(propositions, "u_n=" + wrongAnswer.toTex());
37
+ }
38
+ return (0, shuffle_1.shuffle)(propositions);
39
+ };
40
+ const isAnswerValid = (ans, { reason, firstValue, firstRank }) => {
41
+ const formula = new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(firstValue), new powerNode_1.PowerNode(new numberNode_1.NumberNode(reason), new substractNode_1.SubstractNode(new variableNode_1.VariableNode("n"), firstRank.toTree())));
42
+ const equal = new equalNode_1.EqualNode(new variableNode_1.VariableNode("u_n"), formula, {
43
+ allowRawRightChildAsSolution: true,
44
+ });
45
+ const texs = equal.toAllValidTexs();
46
+ console.log(ans, texs);
47
+ return texs.includes(ans);
48
+ };
49
+ exports.geometricFindExplicitFormulaFirstTermRandom = {
50
+ id: "geometricFindExplicitFormulaFirstTermRandom",
51
+ connector: "=",
52
+ label: "Déterminer la formule générale d'une suite géométrique (premier rang aléatoire)",
53
+ levels: ["1reESM", "1reSpé", "1reTech", "1rePro", "TermTech", "TermPro"],
54
+ sections: ["Suites"],
55
+ isSingleStep: false,
56
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getGeometricFindExplicitFormulaFirstTermRandom, nb),
57
+ qcmTimer: 60,
58
+ freeTimer: 60,
59
+ getPropositions,
60
+ isAnswerValid,
61
+ subject: "Mathématiques",
62
+ };
@@ -4,4 +4,5 @@ export * from "./geometricFindReason";
4
4
  export * from "./geometricFirstTermsSum";
5
5
  export * from "./geometricReasonUsage";
6
6
  export * from "./geometricRecurrenceFormulaUsage";
7
+ export * from "./geometricFindExplicitFormulaFirstTermRandom";
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/geometric/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mCAAmC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/geometric/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mCAAmC,CAAC;AAClD,cAAc,+CAA+C,CAAC"}
@@ -20,3 +20,4 @@ __exportStar(require("./geometricFindReason"), exports);
20
20
  __exportStar(require("./geometricFirstTermsSum"), exports);
21
21
  __exportStar(require("./geometricReasonUsage"), exports);
22
22
  __exportStar(require("./geometricRecurrenceFormulaUsage"), exports);
23
+ __exportStar(require("./geometricFindExplicitFormulaFirstTermRandom"), exports);
@@ -52,7 +52,7 @@ const isAnswerValid = (ans, { answer }) => {
52
52
  exports.calculateCombustionEnergy = {
53
53
  id: "calculateCombustionEnergy",
54
54
  label: "Calculer l'énergie libérée par combustion",
55
- levels: ["1reESM"],
55
+ levels: ["1reSpé"],
56
56
  isSingleStep: true,
57
57
  sections: ["Chimie des solutions"],
58
58
  generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getCalculateCombustionEnergyQuestion, nb),
@@ -40,7 +40,7 @@ const isAnswerValid = (ans, { answer }) => {
40
40
  exports.calculateSynthesisEfficiency = {
41
41
  id: "calculateSynthesisEfficiency",
42
42
  label: "Calculer un rendement",
43
- levels: ["1reESM"],
43
+ levels: ["1reSpé"],
44
44
  isSingleStep: true,
45
45
  sections: ["Chimie des solutions"],
46
46
  generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getCalculateSynthesisEfficiencyQuestion, nb),
@@ -48,7 +48,7 @@ const isAnswerValid = (ans, { answer }) => {
48
48
  exports.identifyLimitingReagent = {
49
49
  id: "identifyLimitingReagent",
50
50
  label: "Identifier un réactif limitant",
51
- levels: ["1reESM"],
51
+ levels: ["1reSpé"],
52
52
  isSingleStep: true,
53
53
  sections: ["Chimie des solutions"],
54
54
  generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getIdentifyLimitingReagentQuestion, nb),
@@ -55,7 +55,7 @@ const isAnswerValid = (ans, { answer }) => {
55
55
  exports.identifyStoichiometricMixture = {
56
56
  id: "identifyStoichiometricMixture",
57
57
  label: "Identifier un mélange stoechiométrique",
58
- levels: ["1reESM"],
58
+ levels: ["1reSpé"],
59
59
  isSingleStep: true,
60
60
  sections: ["Chimie des solutions"],
61
61
  generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getIdentifyStoichiometricMixtureQuestion, nb),
@@ -1 +1 @@
1
- {"version":3,"file":"electricChargeFromIntensity.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/electricity/electricChargeFromIntensity.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAKlC,KAAK,WAAW,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AA+C1D,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAa7D,CAAC"}
1
+ {"version":3,"file":"electricChargeFromIntensity.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/electricity/electricChargeFromIntensity.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAKlC,KAAK,WAAW,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAqD1D,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAa7D,CAAC"}
@@ -28,6 +28,9 @@ const getPropositions = (n, { answer, intensity, seconds }) => {
28
28
  (0, exercise_1.tryToAddWrongProp)(propositions, `${(0, round_1.roundSignificant)(firstDivision, 1)}`);
29
29
  (0, exercise_1.tryToAddWrongProp)(propositions, `${(0, round_1.roundSignificant)(secondDivision, 1)}`);
30
30
  (0, exercise_1.tryToAddWrongProp)(propositions, `${(0, round_1.roundSignificant)(electricCharge * 0.1, 1)}`);
31
+ while (propositions.length < n) {
32
+ (0, exercise_1.tryToAddWrongProp)(propositions, `${(0, randfloat_1.randfloat)(0, electricCharge, 1).frenchify()}`);
33
+ }
31
34
  return (0, exercise_1.shuffleProps)(propositions, n);
32
35
  };
33
36
  const isAnswerValid = (ans, { answer }) => {
@@ -36,7 +39,7 @@ const isAnswerValid = (ans, { answer }) => {
36
39
  exports.electricChargeFromIntensity = {
37
40
  id: "electricChargeFromIntensity",
38
41
  label: "Calculer une charge électrique",
39
- levels: ["1reESM"],
42
+ levels: ["1reSpé"],
40
43
  isSingleStep: true,
41
44
  sections: ["Électricité"],
42
45
  generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getElectricChargeFromIntensityQuestion, nb),
@@ -58,7 +58,7 @@ const isAnswerValid = (ans, { answer }) => {
58
58
  exports.electricEnergyFromPower = {
59
59
  id: "electricEnergyFromPower",
60
60
  label: "Calculer une énergie électrique",
61
- levels: ["1reESM"],
61
+ levels: ["1reSpé"],
62
62
  isSingleStep: true,
63
63
  sections: ["Électricité"],
64
64
  generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getElectricEnergyFromPowerQuestion, nb),
@@ -17,7 +17,7 @@ const getForceWorkQuestion = () => {
17
17
  const rounded = (0, round_1.roundSignificant)(answer, 1);
18
18
  const question = {
19
19
  answer: rounded + "J",
20
- instruction: `Soit une force $\\overrightarrow F$ constante dont le point d'application se déplace d'une position $A$ à une position $B$ telle que $F = ${(0, round_1.roundSignificant)(forceValue, 1)} \\text{N}$, $AB = ${(0, round_1.roundSignificant)(length, 1)} \\text{m}$ et $\\widehat{\\left(\\overrightarrow F ; \\overrightarrow{AB}\\right)} = ${angle.degree}^°$. Calculer le travail de la force $\\overrightarrow F$ lors du déplacement de $A$ vers $B$.`,
20
+ instruction: `Soit une force $\\overrightarrow F$ constante dont le point d'application se déplace d'une position $A$ à une position $B$ telle que $F = ${(0, round_1.roundSignificant)(forceValue, 1)}\\ \\text{N}$, $AB = ${(0, round_1.roundSignificant)(length, 1)}\\ \\text{m}$ et $\\widehat{\\left(\\overrightarrow F ; \\overrightarrow{AB}\\right)} = ${angle.degree}^°$. Calculer le travail de la force $\\overrightarrow F$ lors du déplacement de $A$ vers $B$.`,
21
21
  keys: ["J", "timesTenPower"],
22
22
  answerFormat: "tex",
23
23
  identifiers: { length, forceValue, angleDegree: angle.degree },
@@ -68,7 +68,7 @@ exports.proportionnalityCoeffFromLine = {
68
68
  id: "proportionnalityCoeffFromLine",
69
69
  connector: "=",
70
70
  label: "Déterminer le coefficient de proportionnalité à l'aide d'une droite",
71
- levels: ["3ème", "2nde", "1reESM", "2ndPro", "1rePro", "1reTech"],
71
+ levels: ["3ème", "2nde", "1reESM", "2ndPro", "1rePro", "1reTech", "1reSpé"],
72
72
  isSingleStep: false,
73
73
  sections: ["Droites", "Fonctions affines"],
74
74
  generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getProportionnalityCoeffFromLineQuestion, nb),
@@ -1 +1 @@
1
- {"version":3,"file":"elongationReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/mecanicalWaves/elongationReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA4FF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAanD,CAAC"}
1
+ {"version":3,"file":"elongationReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/mecanicalWaves/elongationReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA6FF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAanD,CAAC"}
@@ -42,9 +42,10 @@ const getPropositions = (n, { answer, amplitude, period }) => {
42
42
  (0, exercise_1.addValidProp)(propositions, answer);
43
43
  const frac = new fractionNode_1.FractionNode(new multiplyNode_1.MultiplyNode((2).toTree(), piNode_1.PiNode), amplitude.toTree()).simplify();
44
44
  const node = new multiplyNode_1.MultiplyNode(period.toTree(), new cosNode_1.CosNode(new multiplyNode_1.MultiplyNode(frac, new variableNode_1.VariableNode("t"))));
45
- (0, exercise_1.tryToAddWrongProp)(propositions, node.toTex());
45
+ (0, exercise_1.tryToAddWrongProp)(propositions, "y\\left(t\\right)=" + node.toTex());
46
46
  while (propositions.length < n) {
47
- (0, exercise_1.tryToAddWrongProp)(propositions, new multiplyNode_1.MultiplyNode((0, randint_1.randint)(1, 10).toTree(), new cosNode_1.CosNode(new multiplyNode_1.MultiplyNode(new fractionNode_1.FractionNode(new multiplyNode_1.MultiplyNode((2).toTree(), piNode_1.PiNode), (0, randint_1.randint)(1, 10).toTree()), new variableNode_1.VariableNode("t")))).toTex());
47
+ (0, exercise_1.tryToAddWrongProp)(propositions, "y\\left(t\\right)=" +
48
+ new multiplyNode_1.MultiplyNode((0, randint_1.randint)(1, 10).toTree(), new cosNode_1.CosNode(new multiplyNode_1.MultiplyNode(new fractionNode_1.FractionNode(new multiplyNode_1.MultiplyNode((2).toTree(), piNode_1.PiNode), (0, randint_1.randint)(1, 10).toTree()), new variableNode_1.VariableNode("t")))).toTex());
48
49
  }
49
50
  return (0, exercise_1.shuffleProps)(propositions, n);
50
51
  };
package/lib/index.d.ts CHANGED
@@ -268,6 +268,10 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
268
268
  }> | import("./exercises/exercise").Exercise<{
269
269
  coeffs: number[][];
270
270
  isXAsked: boolean;
271
+ }> | import("./exercises/exercise").Exercise<{
272
+ sysCoeffs: number[][];
273
+ x: number;
274
+ y: number;
271
275
  }> | import("./exercises/exercise").Exercise<{
272
276
  word: string;
273
277
  }> | import("./exercises/exercise").Exercise<{
@@ -357,6 +361,9 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
357
361
  }> | import("./exercises/exercise").Exercise<{
358
362
  a: number;
359
363
  b: number;
364
+ }> | import("./exercises/exercise").Exercise<{
365
+ affine1Coeffs: number[];
366
+ affine2Coeffs: number[];
360
367
  }> | import("./exercises/exercise").Exercise<{
361
368
  a: number;
362
369
  b: number;
@@ -948,6 +955,15 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
948
955
  firstValue: number;
949
956
  reason: number;
950
957
  nbTerms: number;
958
+ }> | import("./exercises/exercise").Exercise<{
959
+ firstValue: number;
960
+ reason: number;
961
+ firstRank: number;
962
+ }> | import("./exercises/exercise").Exercise<{
963
+ rank1: number;
964
+ rank2: number;
965
+ reason: number;
966
+ value1: number;
951
967
  }> | import("./exercises/exercise").Exercise<{
952
968
  firstValue: number;
953
969
  reason: number;
@@ -970,6 +986,10 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
970
986
  firstValue: number;
971
987
  reason: number;
972
988
  firstRank: number;
989
+ }> | import("./exercises/exercise").Exercise<{
990
+ reason: number;
991
+ firstValue: number;
992
+ firstRank: number;
973
993
  }> | import("./exercises/exercise").Exercise<{
974
994
  rank: number;
975
995
  coeffs: number[];
@@ -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,EA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC"}
@@ -173,7 +173,7 @@ exports.molecules = [
173
173
  { name: "Mg", count: 1 },
174
174
  { name: "O", count: 1 },
175
175
  ], false, "solid"),
176
- // new Molecule("Fer", "Fe", 55.845, [{ name: "Fe", count: 4 }], false, "solid"),
176
+ new Molecule("Fer", "Fe", 55.845, [{ name: "Fe", count: 4 }], false, "solid"),
177
177
  new Molecule("Oxyde de fer(III)", "Fe_2O_3", 159.6882, [
178
178
  { name: "Fe", count: 2 },
179
179
  { name: "O", count: 3 },
@@ -305,7 +305,7 @@ exports.molecules = [
305
305
  { name: "S", count: 1 },
306
306
  { name: "O", count: 4 },
307
307
  ], false, "solid"),
308
- // new Molecule("Zinc", "Zn", 65.38, [{ name: "Zn", count: 1 }], false, "solid"),
308
+ new Molecule("Zinc", "Zn", 65.38, [{ name: "Zn", count: 1 }], false, "solid"),
309
309
  new Molecule("Chlorure de zinc", "ZnCl_2", 136.315, [
310
310
  { name: "Zn", count: 1 },
311
311
  { name: "Cl", count: 2 },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "math-exercises",
3
- "version": "2.1.5",
3
+ "version": "2.1.6",
4
4
  "description": "Math exercises generator for middle school and high school",
5
5
  "main": "lib/index.js",
6
6
  "files": [