math-exercises 2.1.26 → 2.2.1

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 (108) hide show
  1. package/lib/exercises/exercise.d.ts +27 -4
  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 +8 -0
  25. package/lib/exercises/math/geometry/cartesian/drawAlineInGGB.d.ts.map +1 -0
  26. package/lib/exercises/math/geometry/cartesian/drawAlineInGGB.js +70 -0
  27. package/lib/exercises/math/geometry/cartesian/index.d.ts +2 -0
  28. package/lib/exercises/math/geometry/cartesian/index.d.ts.map +1 -1
  29. package/lib/exercises/math/geometry/cartesian/index.js +2 -0
  30. package/lib/exercises/math/geometry/cartesian/placeAPoint.d.ts +5 -0
  31. package/lib/exercises/math/geometry/cartesian/placeAPoint.d.ts.map +1 -0
  32. package/lib/exercises/math/geometry/cartesian/placeAPoint.js +45 -0
  33. package/lib/exercises/math/geometry/convexity/convexityTrinomialsGeo.js +1 -1
  34. package/lib/exercises/math/geometry/vectors/alignementViaColinearity.js +1 -1
  35. package/lib/exercises/math/geometry/vectors/colinearity.js +1 -1
  36. package/lib/exercises/math/geometry/vectors/drawAVectorInGGB.d.ts +8 -0
  37. package/lib/exercises/math/geometry/vectors/drawAVectorInGGB.d.ts.map +1 -0
  38. package/lib/exercises/math/geometry/vectors/drawAVectorInGGB.js +71 -0
  39. package/lib/exercises/math/geometry/vectors/equalCaracteristicFromGraph.js +1 -1
  40. package/lib/exercises/math/geometry/vectors/index.d.ts +1 -0
  41. package/lib/exercises/math/geometry/vectors/index.d.ts.map +1 -1
  42. package/lib/exercises/math/geometry/vectors/index.js +1 -0
  43. package/lib/exercises/math/geometry/vectors/paralellismViaColinearity.js +1 -1
  44. package/lib/exercises/math/geometry/vectors/parallelogramViaEqualVectors.js +1 -1
  45. package/lib/exercises/math/matrices/matrixGeneralTerm.js +1 -1
  46. package/lib/exercises/math/percent/isTableProportional.js +1 -1
  47. package/lib/exercises/math/probaStat/independancy.js +1 -1
  48. package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.js +1 -1
  49. package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromFirstTerms.js +1 -1
  50. package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromGraph.js +1 -1
  51. package/lib/exercises/math/sequences/genericSequenceVariations.js +1 -1
  52. package/lib/exercises/pc/calibrationCurveOfSolution.d.ts +8 -0
  53. package/lib/exercises/pc/calibrationCurveOfSolution.d.ts.map +1 -0
  54. package/lib/exercises/pc/calibrationCurveOfSolution.js +92 -0
  55. package/lib/exercises/pc/chemicalElements/atomicStructureOfNucleus.js +1 -1
  56. package/lib/exercises/pc/chemicalElements/identifyRightElectronicConfiguration.js +1 -1
  57. package/lib/exercises/pc/chemicalReactions/identifyLimitingReagent.js +1 -1
  58. package/lib/exercises/pc/chemicalReactions/identifyStoichiometricMixture.js +1 -1
  59. package/lib/exercises/pc/dosage/beerLambertRandomValue.d.ts +12 -0
  60. package/lib/exercises/pc/dosage/beerLambertRandomValue.d.ts.map +1 -0
  61. package/lib/exercises/pc/dosage/beerLambertRandomValue.js +163 -0
  62. package/lib/exercises/pc/dosage/index.d.ts +2 -0
  63. package/lib/exercises/pc/dosage/index.d.ts.map +1 -0
  64. package/lib/exercises/pc/dosage/index.js +17 -0
  65. package/lib/exercises/pc/index.d.ts +3 -0
  66. package/lib/exercises/pc/index.d.ts.map +1 -1
  67. package/lib/exercises/pc/index.js +3 -0
  68. package/lib/exercises/pc/mole/concentrationReading.js +2 -2
  69. package/lib/exercises/pc/moleculeNomenclature.js +1 -1
  70. package/lib/exercises/pc/sound/frequencyComparison.js +1 -1
  71. package/lib/exercises/pc/spectral/index.d.ts +2 -0
  72. package/lib/exercises/pc/spectral/index.d.ts.map +1 -0
  73. package/lib/exercises/pc/spectral/index.js +17 -0
  74. package/lib/exercises/pc/spectral/spectralEnergy.d.ts +10 -0
  75. package/lib/exercises/pc/spectral/spectralEnergy.d.ts.map +1 -0
  76. package/lib/exercises/pc/spectral/spectralEnergy.js +129 -0
  77. package/lib/exercises/utils/geogebra/getPointFromGGB.d.ts +3 -0
  78. package/lib/exercises/utils/geogebra/getPointFromGGB.d.ts.map +1 -0
  79. package/lib/exercises/utils/geogebra/getPointFromGGB.js +15 -0
  80. package/lib/exercises/utils/geogebra/getVectorFromGGB.d.ts +3 -0
  81. package/lib/exercises/utils/geogebra/getVectorFromGGB.d.ts.map +1 -0
  82. package/lib/exercises/utils/geogebra/getVectorFromGGB.js +11 -0
  83. package/lib/exercises/utils/geogebra/isGGBLine.d.ts +2 -0
  84. package/lib/exercises/utils/geogebra/isGGBLine.d.ts.map +1 -0
  85. package/lib/exercises/utils/geogebra/isGGBLine.js +8 -0
  86. package/lib/exercises/utils/geogebra/isGGBPoint.d.ts +2 -0
  87. package/lib/exercises/utils/geogebra/isGGBPoint.d.ts.map +1 -0
  88. package/lib/exercises/utils/geogebra/isGGBPoint.js +8 -0
  89. package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts +9 -0
  90. package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts.map +1 -0
  91. package/lib/exercises/utils/geogebra/toolBarConstructor.js +20 -0
  92. package/lib/index.d.ts +26 -0
  93. package/lib/index.d.ts.map +1 -1
  94. package/lib/math/numbers/decimals/decimal.d.ts +1 -0
  95. package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
  96. package/lib/math/numbers/decimals/decimal.js +2 -1
  97. package/lib/math/numbers/integer/integer.d.ts +1 -0
  98. package/lib/math/numbers/integer/integer.d.ts.map +1 -1
  99. package/lib/math/numbers/integer/integer.js +7 -1
  100. package/lib/pc/constants/quantic.d.ts +9 -0
  101. package/lib/pc/constants/quantic.d.ts.map +1 -0
  102. package/lib/pc/constants/quantic.js +14 -0
  103. package/lib/server.js +24 -10
  104. package/lib/utils/arrayEqual.d.ts.map +1 -1
  105. package/lib/utils/arrayHasSameElement.d.ts +2 -0
  106. package/lib/utils/arrayHasSameElement.d.ts.map +1 -0
  107. package/lib/utils/arrayHasSameElement.js +8 -0
  108. package/package.json +1 -1
@@ -15,8 +15,9 @@ export interface Question<TIdentifiers = {}> {
15
15
  hint?: string;
16
16
  correction?: string;
17
17
  startStatement?: string;
18
- answer: string;
19
- answerFormat: "tex" | "raw";
18
+ answer?: string;
19
+ answerFormat?: "tex" | "raw";
20
+ ggbAnswer?: string[];
20
21
  keys?: KeyId[];
21
22
  commands?: string[];
22
23
  coords?: number[];
@@ -30,6 +31,22 @@ export interface Question<TIdentifiers = {}> {
30
31
  isXAxesNatural?: boolean;
31
32
  is3D?: boolean;
32
33
  };
34
+ studentGgbOptions?: {
35
+ customToolBar?: string;
36
+ gridDistance?: [number, number];
37
+ hideGrid?: boolean;
38
+ hideAxes?: boolean;
39
+ isGridBold?: boolean;
40
+ isGridSimple?: boolean;
41
+ isAxesRatioFixed?: boolean;
42
+ isXAxesNatural?: boolean;
43
+ xAxisSteps?: number;
44
+ yAxisSteps?: number;
45
+ enableShiftDragZoom?: boolean;
46
+ coords?: number[];
47
+ initialCommands?: string[];
48
+ axisLabels?: string[];
49
+ };
33
50
  style?: {
34
51
  tableHasNoHeader?: boolean;
35
52
  };
@@ -42,6 +59,9 @@ export type QCMGenerator<TIdentifiers> = (n: number, args: {
42
59
  export type VEA<TIdentifiers> = (studentAnswer: string, args: {
43
60
  answer: string;
44
61
  } & TIdentifiers) => boolean;
62
+ export type GGBVEA<TIdentifiers> = (studentAnswer: string[], args: {
63
+ ggbAnswer: string[];
64
+ } & TIdentifiers) => boolean;
45
65
  export type QuestionGenerator<TIdentifiers = {}, TOptions = {}> = (opts?: TOptions) => Question<TIdentifiers>;
46
66
  export interface Exercise<TIdentifiers = {}> {
47
67
  id: string;
@@ -52,17 +72,20 @@ export interface Exercise<TIdentifiers = {}> {
52
72
  connector?: "=" | "\\iff" | "\\approx";
53
73
  generator: (n: number) => Question<TIdentifiers>[];
54
74
  maxAllowedQuestions?: number;
55
- answerType?: "QCM" | "free" | "QCU";
75
+ answerType?: "GGB" | "QCM" | "free" | "QCU";
76
+ isQCM?: boolean;
56
77
  qcmTimer: number;
57
78
  freeTimer: number;
79
+ ggbTimer?: number;
58
80
  getPropositions?: QCMGenerator<{
59
81
  answer: string;
60
82
  } & TIdentifiers>;
61
83
  isAnswerValid?: VEA<TIdentifiers>;
84
+ isGGBAnswerValid?: GGBVEA<TIdentifiers>;
62
85
  hasGeogebra?: boolean;
63
86
  subject: "Mathématiques" | "Chimie" | "Physique";
64
87
  }
65
88
  export type MathLevel = "6ème" | "5ème" | "4ème" | "3ème" | "2nde" | "1reTech" | "1reESM" | "1reSpé" | "TermSpé" | "TermTech" | "MathExp" | "MathComp" | "CAP" | "2ndPro" | "1rePro" | "TermPro";
66
89
  export type MathSection = "Aires" | "Arithmétique" | "Calcul littéral" | "Calculs" | "Combinatoire et dénombrement" | "Conversions" | "Dérivation" | "Droites" | "Ensembles et intervalles" | "Équations" | "Équations différentielles" | "Exponentielle" | "Fonction cube" | "Fonction inverse" | "Fonctions" | "Fonctions affines" | "Fonctions de référence" | "Fractions" | "Géométrie cartésienne" | "Géométrie euclidienne" | "Inéquations" | "Intégration" | "Limites" | "Logarithme népérien" | "Logarithme décimal" | "Matrices" | "Nombres complexes" | "Périmètres" | "Pourcentages" | "Primitives" | "Probabilités" | "Produit scalaire" | "Proportionnalité" | "Python" | "Puissances" | "Python" | "Racines carrées" | "Second degré" | "Statistiques" | "Suites" | "Systèmes" | "Théorème de Pythagore" | "Théorème de Thalès" | "Trigonométrie" | "Valeur absolue" | "Vecteurs";
67
- export type PCSection = "Réaction chimique" | "Chimie des solutions" | "Forces" | "Chimie organique" | "Mécanique" | "Lumière" | "Acide / Base" | "Constitution et transformations de la matière" | "Ondes" | "Son" | "Corps purs et mélanges" | "Fluides" | "Mol" | "Électricité";
90
+ export type PCSection = "Réaction chimique" | "Chimie des solutions" | "Forces" | "Chimie organique" | "Mécanique" | "Lumière" | "Acide / Base" | "Constitution et transformations de la matière" | "Ondes" | "Son" | "Corps purs et mélanges" | "Fluides" | "Mol" | "Électricité" | "Spectrophotométrie" | "Quantique";
68
91
  //# sourceMappingURL=exercise.d.ts.map
@@ -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,eA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,YAAY,CAAC,CAAC;IACxC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,eAAe,GAAG,QAAQ,GAAG,UAAU,CAAC;CAClD;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,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,
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ correctA: number;
4
+ correctB: number;
5
+ };
6
+ export declare const drawAlineInGGB: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=drawAlineInGGB.d.ts.map
@@ -0,0 +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;AAyDF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAahD,CAAC"}
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.drawAlineInGGB = void 0;
4
+ const isGGBLine_1 = require("../../../../exercises/utils/geogebra/isGGBLine");
5
+ const isGGBPoint_1 = require("../../../../exercises/utils/geogebra/isGGBPoint");
6
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
7
+ const toolBarConstructor_1 = require("../../../../exercises/utils/geogebra/toolBarConstructor");
8
+ const point_1 = require("../../../../math/geometry/point");
9
+ const affine_1 = require("../../../../math/polynomials/affine");
10
+ const arrayEqual_1 = require("../../../../utils/arrayEqual");
11
+ const getDrawAlineInGgbQuestion = () => {
12
+ const f = affine_1.AffineConstructor.random({ min: -3, max: 3 });
13
+ const yA = f.b;
14
+ const yB = f.a + f.b;
15
+ const yMax = Math.max(yA, yB, 0);
16
+ const yMin = Math.min(yA, yB, 0);
17
+ const question = {
18
+ ggbAnswer: [`(0,${yA})`, `(1,${yB})`, `Line[A, B]`],
19
+ instruction: `Tracer la droite $d$ d'équation $y=${f.toTex()}$.`,
20
+ keys: [],
21
+ answerFormat: "tex",
22
+ studentGgbOptions: {
23
+ customToolBar: (0, toolBarConstructor_1.toolBarConstructor)({
24
+ join: true,
25
+ }),
26
+ xAxisSteps: 1,
27
+ yAxisSteps: 1,
28
+ coords: [-6, 6, yMin - 5, yMax + 5],
29
+ isGridSimple: true,
30
+ },
31
+ identifiers: { correctA: f.a, correctB: f.b },
32
+ };
33
+ return question;
34
+ };
35
+ const isGGBAnswerValid = (ans, { ggbAnswer, correctA, correctB }) => {
36
+ const studentAnswer = ans.map((s) => s.split("=")[1]);
37
+ console.log(studentAnswer);
38
+ if ((0, arrayEqual_1.arrayEqual)(studentAnswer, ggbAnswer))
39
+ return true;
40
+ if (studentAnswer.length !== 3)
41
+ return false;
42
+ if (!(0, isGGBPoint_1.isGGBPoint)(studentAnswer[0]) ||
43
+ !(0, isGGBPoint_1.isGGBPoint)(studentAnswer[1]) ||
44
+ !(0, isGGBLine_1.isGGBLine)(studentAnswer[2]))
45
+ return false;
46
+ const A = getPoint(studentAnswer[0], "A");
47
+ const B = getPoint(studentAnswer[1], "B");
48
+ const a = (B.getYnumber() - A.getYnumber()) / (B.getXnumber() - A.getXnumber());
49
+ const b = A.getYnumber() - a * A.getXnumber();
50
+ return a === correctA && b === correctB;
51
+ };
52
+ const getPoint = (command, pointName) => {
53
+ const splitted = command.split(",");
54
+ const x = +splitted[0].replace("(", "");
55
+ const y = +splitted[1].replace(")", "");
56
+ return new point_1.Point(pointName, x.toTree(), y.toTree());
57
+ };
58
+ exports.drawAlineInGGB = {
59
+ id: "drawAlineInGGB",
60
+ label: "Tracer une droite à partir de son équation réduite",
61
+ levels: ["2nde"],
62
+ isSingleStep: true,
63
+ answerType: "GGB",
64
+ sections: ["Géométrie cartésienne"],
65
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getDrawAlineInGgbQuestion, nb),
66
+ qcmTimer: 60,
67
+ freeTimer: 60,
68
+ isGGBAnswerValid,
69
+ subject: "Mathématiques",
70
+ };
@@ -4,4 +4,6 @@ export * from "./cartesianEquationOfLine";
4
4
  export * from "./pointCoordinates";
5
5
  export * from "./directionVector";
6
6
  export * from "./directionVectorEquation";
7
+ export * from "./drawAlineInGGB";
8
+ export * from "./placeAPoint";
7
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,YAAY,CAAC;AAC3B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,YAAY,CAAC;AAC3B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
@@ -20,3 +20,5 @@ __exportStar(require("./cartesianEquationOfLine"), exports);
20
20
  __exportStar(require("./pointCoordinates"), exports);
21
21
  __exportStar(require("./directionVector"), exports);
22
22
  __exportStar(require("./directionVectorEquation"), exports);
23
+ __exportStar(require("./drawAlineInGGB"), exports);
24
+ __exportStar(require("./placeAPoint"), exports);
@@ -0,0 +1,5 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {};
3
+ export declare const testGGBAnswer: Exercise<Identifiers>;
4
+ export {};
5
+ //# sourceMappingURL=placeAPoint.d.ts.map
@@ -0,0 +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;AAkCtB,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAY/C,CAAC"}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.testGGBAnswer = void 0;
4
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
5
+ const toolBarConstructor_1 = require("../../../../exercises/utils/geogebra/toolBarConstructor");
6
+ const point_1 = require("../../../../math/geometry/point");
7
+ const arrayHasSameElement_1 = require("../../../../utils/arrayHasSameElement");
8
+ const getPlaceAPointQuestion = () => {
9
+ const point = point_1.PointConstructor.random("A");
10
+ const xMax = point.getXnumber() + 2;
11
+ const xMin = point.getXnumber() - 2;
12
+ const yMin = point.getYnumber() - 2;
13
+ const yMax = point.getYnumber() + 2;
14
+ const question = {
15
+ ggbAnswer: [`(${point.getXnumber()},${point.getYnumber()})`],
16
+ instruction: `Placer le point $A$ de coordonnées $${point.toTexWithCoords()}$.`,
17
+ keys: [],
18
+ studentGgbOptions: {
19
+ customToolBar: (0, toolBarConstructor_1.toolBarConstructor)({
20
+ point: true,
21
+ }),
22
+ coords: [-11, 11, -11, 11],
23
+ isGridSimple: true,
24
+ enableShiftDragZoom: true,
25
+ },
26
+ identifiers: {},
27
+ };
28
+ return question;
29
+ };
30
+ const isGGBAnswerValid = (ans, { ggbAnswer }) => {
31
+ return (0, arrayHasSameElement_1.arrayHasSameElements)(ans.map((s) => s.split("=")[1]), ggbAnswer);
32
+ };
33
+ exports.testGGBAnswer = {
34
+ id: "placeAPoint",
35
+ label: "Placer un point dans un repère orthonormé",
36
+ levels: ["2nde"],
37
+ isSingleStep: true,
38
+ sections: ["Géométrie euclidienne"],
39
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getPlaceAPointQuestion, nb),
40
+ answerType: "GGB",
41
+ qcmTimer: 60,
42
+ freeTimer: 60,
43
+ isGGBAnswerValid,
44
+ subject: "Mathématiques",
45
+ };
@@ -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
  };
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ x: number;
4
+ y: number;
5
+ };
6
+ export declare const drawAVectorInGGB: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=drawAVectorInGGB.d.ts.map
@@ -0,0 +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;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAuDF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAalD,CAAC"}