math-exercises 3.0.78 → 3.0.79
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.
- package/lib/exercises/exercise.d.ts +6 -0
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/index.d.ts +1 -0
- package/lib/exercises/math/calcul/fractions/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/index.js +1 -0
- package/lib/exercises/math/calcul/fractions/simplifyFractionWithPrimeFactorization.d.ts +8 -0
- package/lib/exercises/math/calcul/fractions/simplifyFractionWithPrimeFactorization.d.ts.map +1 -0
- package/lib/exercises/math/calcul/fractions/simplifyFractionWithPrimeFactorization.js +104 -0
- package/lib/exercises/math/functions/basics/index.d.ts +1 -0
- package/lib/exercises/math/functions/basics/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/index.js +1 -1
- package/lib/exercises/math/functions/basics/valueTableCompletion.d.ts +2 -1
- package/lib/exercises/math/functions/basics/valueTableCompletion.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/valueTableCompletion.js +103 -29
- package/lib/exercises/math/probaStat/describeEvent.d.ts +15 -0
- package/lib/exercises/math/probaStat/describeEvent.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/describeEvent.js +182 -0
- package/lib/exercises/math/probaStat/getSampleCountAndSize.d.ts +9 -0
- package/lib/exercises/math/probaStat/getSampleCountAndSize.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/getSampleCountAndSize.js +95 -0
- package/lib/exercises/math/probaStat/index.d.ts +2 -0
- package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/index.js +2 -0
- package/lib/index.d.ts +20 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/tests/exoTest.d.ts.map +1 -1
- package/lib/tests/exoTest.js +9 -2
- package/lib/tests/questionTest.d.ts.map +1 -1
- package/lib/tests/questionTest.js +21 -2
- package/lib/tree/nodes/numbers/numberNode.d.ts +2 -0
- package/lib/tree/nodes/numbers/numberNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/numberNode.js +32 -0
- package/lib/utils/markdown/mdTable.d.ts +1 -1
- package/lib/utils/markdown/mdTable.d.ts.map +1 -1
- package/lib/utils/markdown/mdTable.js +10 -5
- package/package.json +1 -1
|
@@ -97,6 +97,9 @@ export type QCMGenerator<TIdentifiers, TOptions = {}> = (n: number, args: {
|
|
|
97
97
|
export type VEA<TIdentifiers, TOptions = {}> = (studentAnswer: string, args: {
|
|
98
98
|
answer: string;
|
|
99
99
|
} & TIdentifiers, options?: TOptions) => boolean;
|
|
100
|
+
export type TableVEA<TIdentifiers, TOptions = {}> = (studentAnswer: string[][], args: {
|
|
101
|
+
answerTable: string[][];
|
|
102
|
+
} & TIdentifiers, options?: TOptions) => boolean;
|
|
100
103
|
export type GGBVEA<TIdentifiers, TOptions = {}> = (studentAnswer: string[], args: {
|
|
101
104
|
ggbAnswer: string[];
|
|
102
105
|
} & TIdentifiers, options?: TOptions) => boolean;
|
|
@@ -106,6 +109,7 @@ export type GetCorrection<TIdentifiers, TOptions = {}> = (args: TIdentifiers, op
|
|
|
106
109
|
export type GetInstruction<TIdentifiers, TOptions = {}> = (args: TIdentifiers, options?: TOptions) => string;
|
|
107
110
|
export type GetStartStatement<TIdentifiers, TOptions = {}> = (args: TIdentifiers, options?: TOptions) => string;
|
|
108
111
|
export type GetAnswer<TIdentifiers, TOptions = {}> = (args: TIdentifiers, options?: TOptions) => string;
|
|
112
|
+
export type GetAnswerTable<TIdentifiers, TOptions = {}> = (args: TIdentifiers, options?: TOptions) => string[][];
|
|
109
113
|
export type GetKeys<TIdentifiers, TOptions = {}> = (args: TIdentifiers, options?: TOptions) => (KeyId | KeyProps)[];
|
|
110
114
|
export type GetGGBAnswer<TIdentifiers, TOptions = {}> = (args: TIdentifiers, options?: TOptions) => string[];
|
|
111
115
|
export type GetGGBOptions<TIdentifiers, TOptions = {}> = (args: TIdentifiers, options?: TOptions) => GeogebraOptions;
|
|
@@ -148,6 +152,7 @@ export interface Exercise<TIdentifiers = {}, TOptions = {}> {
|
|
|
148
152
|
answer: string;
|
|
149
153
|
} & TIdentifiers, TOptions>;
|
|
150
154
|
isAnswerValid?: VEA<TIdentifiers, TOptions>;
|
|
155
|
+
isAnswerTableValid?: TableVEA<TIdentifiers, TOptions>;
|
|
151
156
|
isGGBAnswerValid?: GGBVEA<TIdentifiers, TOptions>;
|
|
152
157
|
hasGeogebra?: boolean;
|
|
153
158
|
subject: "Mathématiques" | "Chimie" | "Physique";
|
|
@@ -158,6 +163,7 @@ export interface Exercise<TIdentifiers = {}, TOptions = {}> {
|
|
|
158
163
|
getCorrection?: GetCorrection<TIdentifiers, TOptions>;
|
|
159
164
|
getKeys?: GetKeys<TIdentifiers, TOptions>;
|
|
160
165
|
getAnswer?: GetAnswer<TIdentifiers, TOptions>;
|
|
166
|
+
getAnswerTable?: GetAnswerTable<TIdentifiers, TOptions>;
|
|
161
167
|
getGGBAnswer?: GetGGBAnswer<TIdentifiers, TOptions>;
|
|
162
168
|
getGGBOptions?: GetGGBOptions<TIdentifiers, TOptions>;
|
|
163
169
|
getStudentGGBOptions?: GetStudentGGBOptions<TIdentifiers, TOptions>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAInD,eAAO,MAAM,SAAS,iBACN,WAAW,EAAE,KACxB,MAAM,WACA,MAAM,IAAI,SAQpB,CAAC;AACF,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,CA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AEd,MAAM,MAAM,WAAW,GACnB,OAAO,GACP,cAAc,GACd,iBAAiB,GACjB,SAAS,GACT,8BAA8B,GAC9B,aAAa,GACb,YAAY,GACZ,SAAS,GACT,0BAA0B,GAC1B,WAAW,GACX,2BAA2B,GAC3B,eAAe,GACf,eAAe,GACf,kBAAkB,GAClB,WAAW,GACX,mBAAmB,GACnB,wBAAwB,GACxB,WAAW,GACX,uBAAuB,GACvB,uBAAuB,GACvB,aAAa,GACb,aAAa,GACb,SAAS,GACT,qBAAqB,GACrB,oBAAoB,GACpB,UAAU,GACV,mBAAmB,GACnB,YAAY,GACZ,cAAc,GACd,YAAY,GACZ,cAAc,GACd,kBAAkB,GAClB,kBAAkB,GAClB,QAAQ,GACR,YAAY,GACZ,QAAQ,GACR,iBAAiB,GACjB,cAAc,GACd,cAAc,GACd,QAAQ,GACR,UAAU,GACV,uBAAuB,GACvB,oBAAoB,GACpB,eAAe,GACf,gBAAgB,GAChB,UAAU,CAAC;AAEf,MAAM,MAAM,SAAS,GACjB,mBAAmB,GACnB,sBAAsB,GACtB,QAAQ,GACR,kBAAkB,GAClB,WAAW,GACX,SAAS,GACT,cAAc,GACd,+CAA+C,GAC/C,OAAO,GACP,KAAK,GACL,wBAAwB,GACxB,SAAS,GACT,KAAK,GACL,aAAa,GACb,4BAA4B,GAC5B,oBAAoB,GACpB,WAAW,GACX,iBAAiB,GACjB,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAInD,eAAO,MAAM,SAAS,iBACN,WAAW,EAAE,KACxB,MAAM,WACA,MAAM,IAAI,SAQpB,CAAC;AACF,eAAO,MAAM,YAAY,UAChB,WAAW,EAAE,aACT,MAAM,WACT,KAAK,GAAG,KAAK,SAQtB,CA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AAS,GACjB,mBAAmB,GACnB,sBAAsB,GACtB,QAAQ,GACR,kBAAkB,GAClB,WAAW,GACX,SAAS,GACT,cAAc,GACd,+CAA+C,GAC/C,OAAO,GACP,KAAK,GACL,wBAAwB,GACxB,SAAS,GACT,KAAK,GACL,aAAa,GACb,4BAA4B,GAC5B,oBAAoB,GACpB,WAAW,GACX,iBAAiB,GACjB,SAAS,CAAC"}
|
|
@@ -6,6 +6,7 @@ export * from "./fractionsDivision.js";
|
|
|
6
6
|
export * from "./fractionsProduct.js";
|
|
7
7
|
export * from "./fractionsSum.js";
|
|
8
8
|
export * from "./simplifyFraction.js";
|
|
9
|
+
export * from "./simplifyFractionWithPrimeFactorization.js";
|
|
9
10
|
export * from "./periodicWritingToFraction.js";
|
|
10
11
|
export * from "./fractionsSumsSameDenominators.js";
|
|
11
12
|
export * from "./fractionsSumsMultiplesDenominators.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,6CAA6C,CAAC;AAC5D,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC"}
|
|
@@ -6,6 +6,7 @@ export * from "./fractionsDivision.js";
|
|
|
6
6
|
export * from "./fractionsProduct.js";
|
|
7
7
|
export * from "./fractionsSum.js";
|
|
8
8
|
export * from "./simplifyFraction.js";
|
|
9
|
+
export * from "./simplifyFractionWithPrimeFactorization.js";
|
|
9
10
|
export * from "./periodicWritingToFraction.js";
|
|
10
11
|
export * from "./fractionsSumsSameDenominators.js";
|
|
11
12
|
export * from "./fractionsSumsMultiplesDenominators.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
num: number;
|
|
4
|
+
denum: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const simplifyFractionWithPrimeFactorization: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=simplifyFractionWithPrimeFactorization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simplifyFractionWithPrimeFactorization.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/simplifyFractionWithPrimeFactorization.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAcrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AA2GF,eAAO,MAAM,sCAAsC,EAAE,QAAQ,CAAC,WAAW,CAqBxE,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { RationalConstructor } from "../../../../math/numbers/rationals/rational.js";
|
|
4
|
+
import { gcd } from "../../../../math/utils/arithmetic/gcd.js";
|
|
5
|
+
import { isPrime } from "../../../../math/utils/arithmetic/isPrime.js";
|
|
6
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
7
|
+
import { round } from "../../../../math/utils/round.js";
|
|
8
|
+
import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
|
|
9
|
+
import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
10
|
+
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
11
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
12
|
+
const { num, denum } = identifiers;
|
|
13
|
+
const propositions = [];
|
|
14
|
+
addValidProp(propositions, answer);
|
|
15
|
+
while (propositions.length < n) {
|
|
16
|
+
tryToAddWrongProp(propositions, RationalConstructor.randomIrreductible().toTex());
|
|
17
|
+
}
|
|
18
|
+
return shuffleProps(propositions, n);
|
|
19
|
+
};
|
|
20
|
+
const getAnswer = (identifiers) => {
|
|
21
|
+
const { num, denum } = identifiers;
|
|
22
|
+
return frac(num, denum).simplify().toTex();
|
|
23
|
+
};
|
|
24
|
+
const getInstruction = (identifiers) => {
|
|
25
|
+
const { num, denum } = identifiers;
|
|
26
|
+
return `On donne la décomposition en produit de facteurs premiers des nombres suivants:
|
|
27
|
+
|
|
28
|
+
- $${num} = ${new NumberNode(num).toPrimeDecomposition().toTex()}$
|
|
29
|
+
- $${denum} = ${new NumberNode(denum).toPrimeDecomposition().toTex()}$
|
|
30
|
+
|
|
31
|
+
Simplifiez la fraction $${frac(num, denum).toTex()}$.
|
|
32
|
+
`;
|
|
33
|
+
};
|
|
34
|
+
const getHint = (identifiers) => {
|
|
35
|
+
return `Utilise la propriété :
|
|
36
|
+
|
|
37
|
+
$$
|
|
38
|
+
\\frac{k\\times a}{k\\times b} = \\frac{a}{b}
|
|
39
|
+
$$`;
|
|
40
|
+
};
|
|
41
|
+
const getCorrection = (identifiers) => {
|
|
42
|
+
const { num, denum } = identifiers;
|
|
43
|
+
const simpNum = round(num / gcd(num, denum), 3);
|
|
44
|
+
const simpDenum = round(denum / gcd(num, denum), 3);
|
|
45
|
+
return `On a :
|
|
46
|
+
|
|
47
|
+
$$
|
|
48
|
+
${frac(num, denum).toTex()} = ${frac(new NumberNode(num).toPrimeDecomposition(), new NumberNode(denum).toPrimeDecomposition()).toTex()}
|
|
49
|
+
$$
|
|
50
|
+
|
|
51
|
+
On simplifie alors par les facteurs apparaissant à la fois au numérateur et au dénominateur :
|
|
52
|
+
|
|
53
|
+
${alignTex([
|
|
54
|
+
[
|
|
55
|
+
frac(num, denum).toTex(),
|
|
56
|
+
"=",
|
|
57
|
+
frac(new NumberNode(simpNum).toPrimeDecomposition(), new NumberNode(simpDenum).toPrimeDecomposition()).toTex(),
|
|
58
|
+
],
|
|
59
|
+
["", "=", frac(num, denum).simplify().toTex()],
|
|
60
|
+
])}`;
|
|
61
|
+
};
|
|
62
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
63
|
+
return ans === answer;
|
|
64
|
+
};
|
|
65
|
+
const getSimplifyFractionWithPrimeFactorizationQuestion = (ops) => {
|
|
66
|
+
let num = 0;
|
|
67
|
+
let denum = 0;
|
|
68
|
+
do {
|
|
69
|
+
num = randint(2, 100);
|
|
70
|
+
denum = randint(2, 100);
|
|
71
|
+
} while (isPrime(num) ||
|
|
72
|
+
isPrime(denum) ||
|
|
73
|
+
[1, denum].includes(gcd(num, denum)));
|
|
74
|
+
const identifiers = { num, denum };
|
|
75
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
76
|
+
};
|
|
77
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
78
|
+
return {
|
|
79
|
+
answer: getAnswer(identifiers),
|
|
80
|
+
instruction: getInstruction(identifiers),
|
|
81
|
+
keys: [],
|
|
82
|
+
answerFormat: "tex",
|
|
83
|
+
identifiers,
|
|
84
|
+
hint: getHint(identifiers),
|
|
85
|
+
correction: getCorrection(identifiers),
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
export const simplifyFractionWithPrimeFactorization = {
|
|
89
|
+
id: "simplifyFractionWithPrimeFactorization",
|
|
90
|
+
label: "Simplifier une fraction en utilisant la décomposition en nombres premiers",
|
|
91
|
+
isSingleStep: true,
|
|
92
|
+
generator: (nb, opts) => getDistinctQuestions(() => getSimplifyFractionWithPrimeFactorizationQuestion(opts), nb),
|
|
93
|
+
qcmTimer: 60,
|
|
94
|
+
freeTimer: 60,
|
|
95
|
+
getPropositions,
|
|
96
|
+
isAnswerValid,
|
|
97
|
+
subject: "Mathématiques",
|
|
98
|
+
getInstruction,
|
|
99
|
+
getHint,
|
|
100
|
+
getCorrection,
|
|
101
|
+
getAnswer,
|
|
102
|
+
getQuestionFromIdentifiers,
|
|
103
|
+
hasHintAndCorrection: true,
|
|
104
|
+
};
|
|
@@ -9,4 +9,5 @@ export * from "./twoFunctionsInequation.js";
|
|
|
9
9
|
export * from "./inverseImageFunctionTable.js";
|
|
10
10
|
export * from "./imageAntecedentFromSentence.js";
|
|
11
11
|
export * from "./graphicInequationAffine.js";
|
|
12
|
+
export * from "./valueTableCompletion.js";
|
|
12
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC"}
|
|
@@ -9,4 +9,4 @@ export * from "./twoFunctionsInequation.js";
|
|
|
9
9
|
export * from "./inverseImageFunctionTable.js";
|
|
10
10
|
export * from "./imageAntecedentFromSentence.js";
|
|
11
11
|
export * from "./graphicInequationAffine.js";
|
|
12
|
-
|
|
12
|
+
export * from "./valueTableCompletion.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"valueTableCompletion.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/valueTableCompletion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"valueTableCompletion.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/valueTableCompletion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;CACvB,CAAC;AAyIF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAkBtD,CAAC"}
|
|
@@ -1,78 +1,152 @@
|
|
|
1
|
-
import { addValidProp, shuffleProps, } from "../../../../exercises/exercise.js";
|
|
2
1
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
2
|
+
import { numberVEA } from "../../../../exercises/vea/numberVEA.js";
|
|
3
|
+
import { AffineConstructor } from "../../../../math/polynomials/affine.js";
|
|
4
|
+
import { randTupleInt } from "../../../../math/utils/random/randTupleInt.js";
|
|
5
|
+
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
3
6
|
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
8
|
+
import { mdTable } from "../../../../utils/markdown/mdTable.js";
|
|
9
|
+
const getAnswerTable = (identifiers) => {
|
|
10
|
+
const { coeffs, initTable } = identifiers;
|
|
11
|
+
const affine = AffineConstructor.fromCoeffs(identifiers.coeffs);
|
|
12
|
+
const answerTable = [[], []];
|
|
13
|
+
console.log(initTable);
|
|
14
|
+
for (let j = 1; j < initTable[0].length; j++) {
|
|
15
|
+
if (initTable[0][j] === "") {
|
|
16
|
+
answerTable[0].push(affine.solve(initTable[1][j].unfrenchify()).toTex());
|
|
17
|
+
answerTable[1].push(initTable[1][j]);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
answerTable[1].push(affine.calculate(initTable[0][j].unfrenchify()).toTree().toTex());
|
|
21
|
+
answerTable[0].push(initTable[0][j]);
|
|
22
|
+
}
|
|
9
23
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
24
|
+
console.log(answerTable);
|
|
25
|
+
return [
|
|
26
|
+
["x", ...answerTable[0]],
|
|
27
|
+
["f(x)", ...answerTable[1]],
|
|
28
|
+
];
|
|
14
29
|
};
|
|
15
30
|
const getInstruction = (identifiers) => {
|
|
16
|
-
|
|
31
|
+
const affine = AffineConstructor.fromCoeffs(identifiers.coeffs);
|
|
32
|
+
return `Soit $f(x) = ${affine.toTree().toTex()}$.
|
|
33
|
+
|
|
34
|
+
Compléter le tableau de valeurs de $f$ : `;
|
|
17
35
|
};
|
|
18
36
|
const getHint = (identifiers) => {
|
|
19
|
-
return "";
|
|
37
|
+
return "Dans un tableau de valeurs, la deuxième ligne contient les images de la première ligne par la fonction $f$. Pour trouver une case de la deuxième ligne, il faut donc calculer l'image de la case de la premiere ligne par la fonction $f$. Pour trouver une case de la premièr eligne, il faut déterminer un antécédent de la case de la deuxième ligne par $f$.";
|
|
20
38
|
};
|
|
21
39
|
const getCorrection = (identifiers) => {
|
|
22
|
-
|
|
40
|
+
const initTable = identifiers.initTable;
|
|
41
|
+
const affine = AffineConstructor.fromCoeffs(identifiers.coeffs);
|
|
42
|
+
const elmts = [];
|
|
43
|
+
console.log(getAnswerTable(identifiers));
|
|
44
|
+
for (let i = 0; i < initTable.length; i++) {
|
|
45
|
+
for (let j = 1; j < initTable[0].length; j++) {
|
|
46
|
+
const cell = initTable[i][j];
|
|
47
|
+
if (cell === "") {
|
|
48
|
+
if (i === 0) {
|
|
49
|
+
const y = initTable[1][j];
|
|
50
|
+
elmts.push(`- On calcule l'antécédent de $${y}$ par $f$ :
|
|
51
|
+
|
|
52
|
+
${alignTex([
|
|
53
|
+
["", `f(x)=${y}`],
|
|
54
|
+
["\\iff", `${affine.toTree().toTex()} = ${y}`],
|
|
55
|
+
["\\iff", `x=${affine.solve(y.unfrenchify()).toTex()}`],
|
|
56
|
+
])}
|
|
57
|
+
`);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
const x = initTable[0][j];
|
|
61
|
+
elmts.push(`- On calcule l'image de $${x}$ par $f$ :
|
|
62
|
+
|
|
63
|
+
$$
|
|
64
|
+
f(${x}) = ${affine
|
|
65
|
+
.toTree()
|
|
66
|
+
.toDetailedEvaluation({ x: x.unfrenchify().toTree() })
|
|
67
|
+
.toTex()} = ${affine.calculate(x.unfrenchify()).toTree().toTex()}
|
|
68
|
+
$$`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return `${elmts.join("\n")}
|
|
74
|
+
|
|
75
|
+
Le tableau de valeurs complété est donc :
|
|
76
|
+
|
|
77
|
+
${mdTable(getAnswerTable(identifiers), true)}
|
|
78
|
+
`;
|
|
23
79
|
};
|
|
24
80
|
const getKeys = (identifiers) => {
|
|
25
81
|
return [];
|
|
26
82
|
};
|
|
27
|
-
const
|
|
83
|
+
const isAnswerTableValid = (ans, { answerTable }) => {
|
|
28
84
|
try {
|
|
29
|
-
|
|
85
|
+
for (let i = 0; i < 2; i++) {
|
|
86
|
+
for (let j = 1; j < ans[i].length; j++) {
|
|
87
|
+
const vea = numberVEA(ans[i][j], answerTable[i][j]);
|
|
88
|
+
if (!vea)
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return true;
|
|
30
93
|
}
|
|
31
94
|
catch (err) {
|
|
32
95
|
return handleVEAError(err);
|
|
33
96
|
}
|
|
34
97
|
};
|
|
35
98
|
const getValueTableCompletionQuestion = (ops) => {
|
|
99
|
+
const affine = AffineConstructor.random();
|
|
100
|
+
const xs = randTupleInt(4, { allDifferent: true, from: -10, to: 10 }).sort((a, b) => a - b);
|
|
101
|
+
let stringXs = xs.map((e) => e.toString());
|
|
102
|
+
const ys = [];
|
|
103
|
+
for (let i = 0; i < xs.length; i++) {
|
|
104
|
+
const hideX = coinFlip();
|
|
105
|
+
if (hideX) {
|
|
106
|
+
stringXs[i] = "";
|
|
107
|
+
ys.push(affine.calculate(xs[i]).toTree().toTex());
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
ys.push("");
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
const initTable = [
|
|
114
|
+
["x", ...stringXs],
|
|
115
|
+
["f(x)", ...ys],
|
|
116
|
+
];
|
|
36
117
|
const identifiers = {
|
|
37
|
-
|
|
118
|
+
coeffs: affine.coefficients,
|
|
119
|
+
initTable,
|
|
38
120
|
};
|
|
39
121
|
return getQuestionFromIdentifiers(identifiers);
|
|
40
122
|
};
|
|
41
123
|
const getQuestionFromIdentifiers = (identifiers) => {
|
|
42
124
|
return {
|
|
43
|
-
|
|
125
|
+
answerTable: getAnswerTable(identifiers),
|
|
44
126
|
instruction: getInstruction(identifiers),
|
|
45
127
|
keys: getKeys(identifiers),
|
|
46
128
|
answerFormat: "tex",
|
|
47
129
|
identifiers,
|
|
48
130
|
hint: getHint(identifiers),
|
|
49
131
|
correction: getCorrection(identifiers),
|
|
50
|
-
initTable:
|
|
51
|
-
["x", "1", "", "3", ""],
|
|
52
|
-
["f(x)", "3", "", "", "12"],
|
|
53
|
-
],
|
|
54
|
-
answerTable: [
|
|
55
|
-
["x", "1", "2", "3", "4"],
|
|
56
|
-
["f(x)", "3", "6", "9", "12"],
|
|
57
|
-
],
|
|
132
|
+
initTable: identifiers.initTable,
|
|
58
133
|
};
|
|
59
134
|
};
|
|
60
135
|
export const valueTableCompletion = {
|
|
61
136
|
id: "valueTableCompletion",
|
|
62
137
|
connector: "=",
|
|
63
|
-
label: "
|
|
138
|
+
label: "Compléter un tableau de valeurs d'une fonction par le calcul",
|
|
64
139
|
isSingleStep: true,
|
|
65
140
|
generator: (nb, opts) => getDistinctQuestions(() => getValueTableCompletionQuestion(opts), nb),
|
|
66
141
|
qcmTimer: 60,
|
|
67
142
|
freeTimer: 60,
|
|
68
|
-
getPropositions,
|
|
69
|
-
isAnswerValid,
|
|
70
143
|
subject: "Mathématiques",
|
|
71
144
|
getInstruction,
|
|
72
145
|
getHint,
|
|
73
146
|
getCorrection,
|
|
74
|
-
|
|
147
|
+
getAnswerTable,
|
|
75
148
|
getQuestionFromIdentifiers,
|
|
76
149
|
hasHintAndCorrection: true,
|
|
77
150
|
answerType: "valueTable",
|
|
151
|
+
isAnswerTableValid,
|
|
78
152
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
eventA: {
|
|
4
|
+
desc: string;
|
|
5
|
+
isComplementary: boolean;
|
|
6
|
+
};
|
|
7
|
+
eventB: {
|
|
8
|
+
desc: string;
|
|
9
|
+
isComplementary: boolean;
|
|
10
|
+
};
|
|
11
|
+
question: "union" | "intersection" | "comp";
|
|
12
|
+
};
|
|
13
|
+
export declare const describeEvent: Exercise<Identifiers>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=describeEvent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"describeEvent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/describeEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,eAAe,EAAE,OAAO,CAAC;KAC1B,CAAC;IACF,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,eAAe,EAAE,OAAO,CAAC;KAC1B,CAAC;IACF,QAAQ,EAAE,OAAO,GAAG,cAAc,GAAG,MAAM,CAAC;CAC7C,CAAC;AA0LF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAkB/C,CAAC"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { coinFlip } from "../../../utils/alea/coinFlip.js";
|
|
4
|
+
import { random } from "../../../utils/alea/random.js";
|
|
5
|
+
import { handleVEAError } from "../../../utils/errors/handleVEAError.js";
|
|
6
|
+
const getPropositions = (n, { answer, eventA, eventB, question }) => {
|
|
7
|
+
const propositions = [];
|
|
8
|
+
addValidProp(propositions, answer, "raw");
|
|
9
|
+
const flipComplement = (event) => ({
|
|
10
|
+
desc: event.desc,
|
|
11
|
+
isComplementary: !event.isComplementary,
|
|
12
|
+
});
|
|
13
|
+
const generateWrongAnswer = () => {
|
|
14
|
+
const templates = [
|
|
15
|
+
() => {
|
|
16
|
+
const descA = flipComplement(eventA).isComplementary
|
|
17
|
+
? `ne pas ${eventA.desc}`
|
|
18
|
+
: eventA.desc;
|
|
19
|
+
const descB = eventB.isComplementary
|
|
20
|
+
? `ne pas ${eventB.desc}`
|
|
21
|
+
: eventB.desc;
|
|
22
|
+
return `${descA} et ${descB}`;
|
|
23
|
+
},
|
|
24
|
+
() => {
|
|
25
|
+
const descA = eventA.isComplementary
|
|
26
|
+
? `ne pas ${eventA.desc}`
|
|
27
|
+
: eventA.desc;
|
|
28
|
+
const descB = flipComplement(eventB).isComplementary
|
|
29
|
+
? `ne pas ${eventB.desc}`
|
|
30
|
+
: eventB.desc;
|
|
31
|
+
return `${descA} ou ${descB}`;
|
|
32
|
+
},
|
|
33
|
+
() => {
|
|
34
|
+
const descA = flipComplement(eventA).isComplementary
|
|
35
|
+
? `ne pas ${eventA.desc}`
|
|
36
|
+
: eventA.desc;
|
|
37
|
+
const descB = flipComplement(eventB).isComplementary
|
|
38
|
+
? `ne pas ${eventB.desc}`
|
|
39
|
+
: eventB.desc;
|
|
40
|
+
const op = coinFlip() ? "et" : "ou";
|
|
41
|
+
return `${descA} ${op} ${descB}`;
|
|
42
|
+
},
|
|
43
|
+
() => {
|
|
44
|
+
const descA1 = eventA.isComplementary
|
|
45
|
+
? `ne pas ${eventA.desc}`
|
|
46
|
+
: eventA.desc;
|
|
47
|
+
const descA2 = flipComplement(eventA).isComplementary
|
|
48
|
+
? `ne pas ${eventA.desc}`
|
|
49
|
+
: eventA.desc;
|
|
50
|
+
const op = coinFlip() ? "et" : "ou";
|
|
51
|
+
return `${descA1} ${op} ${descA2}`;
|
|
52
|
+
},
|
|
53
|
+
() => {
|
|
54
|
+
return `ne pas ne pas ${eventA.desc}`.replace("ne pas ne pas", eventA.desc);
|
|
55
|
+
},
|
|
56
|
+
];
|
|
57
|
+
return random(templates)();
|
|
58
|
+
};
|
|
59
|
+
while (propositions.length < n) {
|
|
60
|
+
const wrong = generateWrongAnswer();
|
|
61
|
+
tryToAddWrongProp(propositions, wrong, "raw");
|
|
62
|
+
}
|
|
63
|
+
return shuffleProps(propositions, n);
|
|
64
|
+
};
|
|
65
|
+
const getAnswer = ({ eventA, eventB, question }) => {
|
|
66
|
+
const describe = (e) => e.isComplementary ? `ne pas ${e.desc}` : `${e.desc}`;
|
|
67
|
+
if (question === "comp") {
|
|
68
|
+
return `ne pas ${eventA.desc}`;
|
|
69
|
+
}
|
|
70
|
+
else if (question === "union") {
|
|
71
|
+
return `${describe(eventA)} ou ${describe(eventB)}`;
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
return `${describe(eventA)} et ${describe(eventB)}`;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const getInstruction = (identifiers) => {
|
|
78
|
+
const { eventA, eventB, question } = identifiers;
|
|
79
|
+
let instruction = `$A$ est l'évènement "${eventA.desc}" et $B$ est l'évènement "${eventB.desc}".\n\n`;
|
|
80
|
+
if (question === "comp") {
|
|
81
|
+
return instruction + `Décrire par une phrase l'évènement $\\overline{A}$.`;
|
|
82
|
+
}
|
|
83
|
+
const overlineA = eventA.isComplementary ? "\\overline{A}" : "A";
|
|
84
|
+
const overlineB = eventB.isComplementary ? "\\overline{B}" : "B";
|
|
85
|
+
const operator = question === "union" ? "\\cup" : "\\cap";
|
|
86
|
+
return (instruction +
|
|
87
|
+
`Décrire par une phrase l'évènement $${overlineA} ${operator} ${overlineB}$.`);
|
|
88
|
+
};
|
|
89
|
+
const getHint = ({ question }) => {
|
|
90
|
+
switch (question) {
|
|
91
|
+
case "comp":
|
|
92
|
+
return `Le contraire ($\\overline{A})$ d'un évènement $A$ signifie que l'évènement ne se réalise pas.`;
|
|
93
|
+
case "union":
|
|
94
|
+
return `L'union ($\\cup$) de deux événements signifie que l'un ou l'autre des évènements (ou les deux) se réalisent.`;
|
|
95
|
+
case "intersection":
|
|
96
|
+
return `L'intersection ($\\cap$) de deux événements signifie que les deux évènements se réalisent en même temps.`;
|
|
97
|
+
default:
|
|
98
|
+
return "";
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
const getCorrection = (identifiers) => {
|
|
102
|
+
const { eventA, eventB, question } = identifiers;
|
|
103
|
+
const answer = getAnswer(identifiers);
|
|
104
|
+
if (question === "comp") {
|
|
105
|
+
return `Le contraire de l'évènement "${eventA.desc}" est l'évènement "${answer}".`;
|
|
106
|
+
}
|
|
107
|
+
else if (question === "union") {
|
|
108
|
+
return `L'union signifie que l'un ou l'autre (ou les deux) évènement(s) se produit : "${answer}".`;
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
return `L'intersection signifie que les deux évènements se produisent en même temps : "${answer}".`;
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
const getKeys = (identifiers) => {
|
|
115
|
+
return [];
|
|
116
|
+
};
|
|
117
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
118
|
+
try {
|
|
119
|
+
throw Error("VEA not implemented");
|
|
120
|
+
}
|
|
121
|
+
catch (err) {
|
|
122
|
+
return handleVEAError(err);
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
const getDescribeEventQuestion = (ops) => {
|
|
126
|
+
const allEvents = [
|
|
127
|
+
"trouver des mures",
|
|
128
|
+
"trouver des fraises",
|
|
129
|
+
"trouver des pommes",
|
|
130
|
+
"perdre son parapluie",
|
|
131
|
+
"rater le bus",
|
|
132
|
+
"avoir un bonbon",
|
|
133
|
+
"avoir un bonbon au chocolat",
|
|
134
|
+
"avoir un bonbon à la menthe",
|
|
135
|
+
"avoir un bonbon à la fraise",
|
|
136
|
+
];
|
|
137
|
+
const eventA = {
|
|
138
|
+
desc: random(allEvents),
|
|
139
|
+
isComplementary: coinFlip(),
|
|
140
|
+
};
|
|
141
|
+
const eventB = {
|
|
142
|
+
desc: random(allEvents.filter((e) => e !== eventA.desc)),
|
|
143
|
+
isComplementary: coinFlip(),
|
|
144
|
+
};
|
|
145
|
+
const questionTypes = [
|
|
146
|
+
"union",
|
|
147
|
+
"intersection",
|
|
148
|
+
"comp",
|
|
149
|
+
];
|
|
150
|
+
const question = random(questionTypes);
|
|
151
|
+
const identifiers = { eventA, eventB, question };
|
|
152
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
153
|
+
};
|
|
154
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
155
|
+
return {
|
|
156
|
+
answer: getAnswer(identifiers),
|
|
157
|
+
instruction: getInstruction(identifiers),
|
|
158
|
+
keys: getKeys(identifiers),
|
|
159
|
+
answerFormat: "raw",
|
|
160
|
+
identifiers,
|
|
161
|
+
hint: getHint(identifiers),
|
|
162
|
+
correction: getCorrection(identifiers),
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
export const describeEvent = {
|
|
166
|
+
id: "describeEvent",
|
|
167
|
+
label: "Décrire un évènement en une phrase à partir de sa notation",
|
|
168
|
+
isSingleStep: true,
|
|
169
|
+
generator: (nb, opts) => getDistinctQuestions(() => getDescribeEventQuestion(opts), nb),
|
|
170
|
+
qcmTimer: 60,
|
|
171
|
+
freeTimer: 60,
|
|
172
|
+
getPropositions,
|
|
173
|
+
isAnswerValid,
|
|
174
|
+
subject: "Mathématiques",
|
|
175
|
+
getInstruction,
|
|
176
|
+
getHint,
|
|
177
|
+
getCorrection,
|
|
178
|
+
getAnswer,
|
|
179
|
+
getQuestionFromIdentifiers,
|
|
180
|
+
hasHintAndCorrection: true,
|
|
181
|
+
answerType: "QCU",
|
|
182
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
expCount: number;
|
|
4
|
+
repCount: number;
|
|
5
|
+
isSize: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const getSampleCountAndSize: Exercise<Identifiers>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=getSampleCountAndSize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSampleCountAndSize.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/getSampleCountAndSize.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AA4FF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAiBvD,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { randint } from "../../../math/utils/random/randint.js";
|
|
4
|
+
import { parseAlgebraic } from "../../../tree/parsers/latexParser.js";
|
|
5
|
+
import { coinFlip } from "../../../utils/alea/coinFlip.js";
|
|
6
|
+
import { handleVEAError } from "../../../utils/errors/handleVEAError.js";
|
|
7
|
+
const getPropositions = (n, { answer, expCount, isSize, repCount }) => {
|
|
8
|
+
const propositions = [];
|
|
9
|
+
addValidProp(propositions, answer);
|
|
10
|
+
tryToAddWrongProp(propositions, expCount.frenchify());
|
|
11
|
+
tryToAddWrongProp(propositions, repCount.frenchify());
|
|
12
|
+
while (propositions.length < n) {
|
|
13
|
+
let wrongValue;
|
|
14
|
+
wrongValue = randint(1, 200);
|
|
15
|
+
tryToAddWrongProp(propositions, wrongValue.frenchify());
|
|
16
|
+
}
|
|
17
|
+
return shuffleProps(propositions, n);
|
|
18
|
+
};
|
|
19
|
+
const getAnswer = (identifiers) => {
|
|
20
|
+
const { expCount, repCount, isSize } = identifiers;
|
|
21
|
+
const answer = isSize ? expCount.frenchify() : repCount.frenchify();
|
|
22
|
+
return answer;
|
|
23
|
+
};
|
|
24
|
+
const getInstruction = (identifiers) => {
|
|
25
|
+
const { expCount, repCount, isSize } = identifiers;
|
|
26
|
+
const qst = isSize
|
|
27
|
+
? "Quelle est la taille de chaque échantillon ?"
|
|
28
|
+
: "Quel est le nombre d'échantillons obtenus?";
|
|
29
|
+
return `On lance $${expCount}$ fois trois pièces simultanément.\n\n
|
|
30
|
+
On répète l'expérience $${repCount}$ fois.\n\n
|
|
31
|
+
${qst}`;
|
|
32
|
+
};
|
|
33
|
+
const getHint = ({ isSize }) => {
|
|
34
|
+
return isSize
|
|
35
|
+
? `La taille d'un échantillon correspond au nombre de répétitions à l'intérieur d'une même expérience.`
|
|
36
|
+
: `Le nombre d'échantillons correspond au nombre de fois qu'on répète l'expérience entière.`;
|
|
37
|
+
};
|
|
38
|
+
const getCorrection = ({ expCount, repCount, isSize, }) => {
|
|
39
|
+
if (isSize) {
|
|
40
|
+
return `Chaque fois qu'on répète l'expérience, on lance $${expCount}$ fois trois pièces.
|
|
41
|
+
La taille de chaque échantillon est donc $${expCount}$.`;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
return `On répète l'expérience complète $${repCount}$ fois.
|
|
45
|
+
On obtient donc $${repCount}$ échantillons.`;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const getKeys = (identifiers) => {
|
|
49
|
+
return [];
|
|
50
|
+
};
|
|
51
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
52
|
+
try {
|
|
53
|
+
const ansNode = parseAlgebraic(ans);
|
|
54
|
+
const answerNode = parseAlgebraic(answer);
|
|
55
|
+
return answerNode.simplify().equals(ansNode.simplify());
|
|
56
|
+
}
|
|
57
|
+
catch (err) {
|
|
58
|
+
return handleVEAError(err);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const getGetSampleCountAndSizeQuestion = (ops) => {
|
|
62
|
+
const expCount = randint(1, 301);
|
|
63
|
+
const repCount = randint(1, 51);
|
|
64
|
+
const isSize = coinFlip();
|
|
65
|
+
const identifiers = { expCount, repCount, isSize };
|
|
66
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
67
|
+
};
|
|
68
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
69
|
+
return {
|
|
70
|
+
answer: getAnswer(identifiers),
|
|
71
|
+
instruction: getInstruction(identifiers),
|
|
72
|
+
keys: getKeys(identifiers),
|
|
73
|
+
answerFormat: "tex",
|
|
74
|
+
identifiers,
|
|
75
|
+
hint: getHint(identifiers),
|
|
76
|
+
correction: getCorrection(identifiers),
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
export const getSampleCountAndSize = {
|
|
80
|
+
id: "getSampleCountAndSize",
|
|
81
|
+
label: "Distinguer taille et nombre d'échantillons",
|
|
82
|
+
isSingleStep: true,
|
|
83
|
+
generator: (nb, opts) => getDistinctQuestions(() => getGetSampleCountAndSizeQuestion(opts), nb),
|
|
84
|
+
qcmTimer: 60,
|
|
85
|
+
freeTimer: 60,
|
|
86
|
+
getPropositions,
|
|
87
|
+
isAnswerValid,
|
|
88
|
+
subject: "Mathématiques",
|
|
89
|
+
getInstruction,
|
|
90
|
+
getHint,
|
|
91
|
+
getCorrection,
|
|
92
|
+
getAnswer,
|
|
93
|
+
getQuestionFromIdentifiers,
|
|
94
|
+
hasHintAndCorrection: true,
|
|
95
|
+
};
|
|
@@ -18,4 +18,6 @@ export * from "./unionIntersectionProba.js";
|
|
|
18
18
|
export * from "./calculateMeanFromFrequencies.js";
|
|
19
19
|
export * from "./mostLeastProbable.js";
|
|
20
20
|
export * from "./checkEquiprobability.js";
|
|
21
|
+
export * from "./getSampleCountAndSize.js";
|
|
22
|
+
export * from "./describeEvent.js";
|
|
21
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC"}
|
|
@@ -18,3 +18,5 @@ export * from "./unionIntersectionProba.js";
|
|
|
18
18
|
export * from "./calculateMeanFromFrequencies.js";
|
|
19
19
|
export * from "./mostLeastProbable.js";
|
|
20
20
|
export * from "./checkEquiprobability.js";
|
|
21
|
+
export * from "./getSampleCountAndSize.js";
|
|
22
|
+
export * from "./describeEvent.js";
|
package/lib/index.d.ts
CHANGED
|
@@ -133,6 +133,9 @@ declare const mathExercises: (Exercise<{
|
|
|
133
133
|
}> | Exercise<{
|
|
134
134
|
num: number;
|
|
135
135
|
denum: number;
|
|
136
|
+
}, {}> | Exercise<{
|
|
137
|
+
num: number;
|
|
138
|
+
denum: number;
|
|
136
139
|
}, {}> | Exercise<{
|
|
137
140
|
num: number;
|
|
138
141
|
denum: number;
|
|
@@ -876,6 +879,9 @@ declare const mathExercises: (Exercise<{
|
|
|
876
879
|
inegalitySymbol: import("./math/inequations/inequation.js").InegalitySymbols;
|
|
877
880
|
a: number;
|
|
878
881
|
b: number;
|
|
882
|
+
}, {}> | Exercise<{
|
|
883
|
+
coeffs: number[];
|
|
884
|
+
initTable: string[][];
|
|
879
885
|
}, {}> | Exercise<{
|
|
880
886
|
k: number;
|
|
881
887
|
}, {}> | Exercise<{
|
|
@@ -1909,6 +1915,20 @@ declare const mathExercises: (Exercise<{
|
|
|
1909
1915
|
total: number;
|
|
1910
1916
|
distribution: number[];
|
|
1911
1917
|
observe: boolean;
|
|
1918
|
+
}, {}> | Exercise<{
|
|
1919
|
+
expCount: number;
|
|
1920
|
+
repCount: number;
|
|
1921
|
+
isSize: boolean;
|
|
1922
|
+
}, {}> | Exercise<{
|
|
1923
|
+
eventA: {
|
|
1924
|
+
desc: string;
|
|
1925
|
+
isComplementary: boolean;
|
|
1926
|
+
};
|
|
1927
|
+
eventB: {
|
|
1928
|
+
desc: string;
|
|
1929
|
+
isComplementary: boolean;
|
|
1930
|
+
};
|
|
1931
|
+
question: "union" | "intersection" | "comp";
|
|
1912
1932
|
}, {}> | Exercise<{
|
|
1913
1933
|
firstValue: number;
|
|
1914
1934
|
askedRank: number;
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAE3D,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,QAAA,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAE3D,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exoTest.d.ts","sourceRoot":"","sources":["../../src/tests/exoTest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAIvD,eAAO,MAAM,OAAO,QAAS,QAAQ;;;;
|
|
1
|
+
{"version":3,"file":"exoTest.d.ts","sourceRoot":"","sources":["../../src/tests/exoTest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAIvD,eAAO,MAAM,OAAO,QAAS,QAAQ;;;;CAuFpC,CAAC"}
|
package/lib/tests/exoTest.js
CHANGED
|
@@ -19,13 +19,16 @@ export const exoTest = (exo) => {
|
|
|
19
19
|
const questions = exo.generator(30);
|
|
20
20
|
let after = Date.now();
|
|
21
21
|
generatorTime = after - before;
|
|
22
|
-
if (exo.answerType !== "free" &&
|
|
22
|
+
if (exo.answerType !== "free" &&
|
|
23
|
+
exo.answerType !== "GGB" &&
|
|
24
|
+
exo.answerType !== "valueTable") {
|
|
23
25
|
if (!exo.getPropositions)
|
|
24
26
|
throw new Error(`exo ${exo.id} has no getPropositions`);
|
|
25
27
|
}
|
|
26
28
|
if (exo.answerType !== "QCM" &&
|
|
27
29
|
exo.answerType !== "QCU" &&
|
|
28
|
-
exo.answerType !== "GGB"
|
|
30
|
+
exo.answerType !== "GGB" &&
|
|
31
|
+
exo.answerType !== "valueTable") {
|
|
29
32
|
if (!exo.isAnswerValid)
|
|
30
33
|
throw new Error(`exo ${exo.id} has no isAnswerValid`);
|
|
31
34
|
}
|
|
@@ -33,6 +36,10 @@ export const exoTest = (exo) => {
|
|
|
33
36
|
if (!exo.isGGBAnswerValid)
|
|
34
37
|
throw new Error(`exo ${exo.id} has no isGGBAnswerValid`);
|
|
35
38
|
}
|
|
39
|
+
if (exo.answerType === "valueTable") {
|
|
40
|
+
if (!exo.isAnswerTableValid)
|
|
41
|
+
throw new Error(`exo ${exo.id} has no isAnswerTableValid`);
|
|
42
|
+
}
|
|
36
43
|
questions.forEach((question) => {
|
|
37
44
|
const times = questionTest(exo, question);
|
|
38
45
|
qcmTime = times.qcmTime;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"questionTest.d.ts","sourceRoot":"","sources":["../../src/tests/questionTest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAIjE,eAAO,MAAM,YAAY,QAAS,QAAQ,YAAY,QAAQ;;;
|
|
1
|
+
{"version":3,"file":"questionTest.d.ts","sourceRoot":"","sources":["../../src/tests/questionTest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAIjE,eAAO,MAAM,YAAY,QAAS,QAAQ,YAAY,QAAQ;;;CAuM7D,CAAC"}
|
|
@@ -43,6 +43,10 @@ export const questionTest = (exo, question) => {
|
|
|
43
43
|
if (!question.studentGgbOptions?.coords?.length)
|
|
44
44
|
throw new Error(`exo ${exo.id} has no studentGgbOptions Coords`);
|
|
45
45
|
}
|
|
46
|
+
else if (exo.answerType === "valueTable") {
|
|
47
|
+
if (!question.answerTable?.length)
|
|
48
|
+
throw new Error(`exo ${exo.id} has no answerTable`);
|
|
49
|
+
}
|
|
46
50
|
else if (exo.answerType !== "QCU" && exo.answerType !== "QCM") {
|
|
47
51
|
if (!question.answer)
|
|
48
52
|
throw new Error(`exo ${exo.id} has no answer`);
|
|
@@ -57,6 +61,18 @@ export const questionTest = (exo, question) => {
|
|
|
57
61
|
throw new Error(`exo ${exo.id} has invalid answer`);
|
|
58
62
|
}
|
|
59
63
|
}
|
|
64
|
+
if (question.answerTable) {
|
|
65
|
+
for (const cell of question.answerTable.flat()) {
|
|
66
|
+
if (cell.match(dotDecimalPattern))
|
|
67
|
+
throw new Error(`exo ${exo.id} has invalid number format`);
|
|
68
|
+
if (cell.includes("[object Object]"))
|
|
69
|
+
throw new Error(`exo ${exo.id} has invalid answer`);
|
|
70
|
+
if (question.answerFormat !== "raw") {
|
|
71
|
+
if (!latexTester(cell, true))
|
|
72
|
+
throw new Error(`exo ${exo.id} has invalid answer`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
60
76
|
if (!question.instruction.length) {
|
|
61
77
|
throw new Error(`exo ${exo.id} has no instruction`);
|
|
62
78
|
}
|
|
@@ -103,7 +119,8 @@ export const questionTest = (exo, question) => {
|
|
|
103
119
|
// }
|
|
104
120
|
if (exo.answerType !== "QCM" &&
|
|
105
121
|
exo.answerType !== "QCU" &&
|
|
106
|
-
exo.answerType !== "GGB"
|
|
122
|
+
exo.answerType !== "GGB" &&
|
|
123
|
+
exo.answerType !== "valueTable") {
|
|
107
124
|
if (!question.keys)
|
|
108
125
|
throw new Error(`exo ${exo.id} has no keys`);
|
|
109
126
|
const answer = question.answer;
|
|
@@ -115,7 +132,9 @@ export const questionTest = (exo, question) => {
|
|
|
115
132
|
let after = Date.now();
|
|
116
133
|
veaTime = after - before;
|
|
117
134
|
}
|
|
118
|
-
if (exo.answerType !== "free" &&
|
|
135
|
+
if (exo.answerType !== "free" &&
|
|
136
|
+
exo.answerType !== "GGB" &&
|
|
137
|
+
exo.answerType !== "valueTable") {
|
|
119
138
|
let before = Date.now();
|
|
120
139
|
console.log("will generate props : ", exo.id, "ids :", question.identifiers);
|
|
121
140
|
const props = exo.getPropositions(4, {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Node, NodeIds, NodeOptions, NodeType, ToTexOptions } from "../node.js";
|
|
2
2
|
import { AlgebraicNode, SimplifyOptions } from "../algebraicNode.js";
|
|
3
3
|
import { OppositeNode } from "../functions/oppositeNode.js";
|
|
4
|
+
import { MultiplyNode } from "../operators/multiplyNode.js";
|
|
4
5
|
export declare function isNumberNode(a: Node): a is NumberNode;
|
|
5
6
|
export declare function isNumberOrOppositeNumberNode(a: Node): a is NumberNode | OppositeNode<NumberNode>;
|
|
6
7
|
export declare abstract class NumberNodeConstructor {
|
|
@@ -29,5 +30,6 @@ export declare class NumberNode implements AlgebraicNode {
|
|
|
29
30
|
toDetailedEvaluation(vars: Record<string, AlgebraicNode>): this;
|
|
30
31
|
derivative(varName?: string | undefined): AlgebraicNode;
|
|
31
32
|
toFrac(): AlgebraicNode | NumberNode;
|
|
33
|
+
toPrimeDecomposition(usePowers?: boolean): AlgebraicNode | this | MultiplyNode;
|
|
32
34
|
}
|
|
33
35
|
//# sourceMappingURL=numberNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numberNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/numbers/numberNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAA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,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAGtC,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,aAAa;IAQ/C,MAAM,CAAC,IAAI,EAAE,aAAa;IAG1B,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;IAGxD,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GACd,aAAa;IAGtC,MAAM;IAIN,oBAAoB,CAAC,SAAS,CAAC,EAAE,OAAO;CAsBzC"}
|
|
@@ -4,6 +4,11 @@ import { colorize } from "../../../utils/latex/colorize.js";
|
|
|
4
4
|
import { isOppositeNode } from "../functions/oppositeNode.js";
|
|
5
5
|
import { Decimal } from "../../../math/numbers/decimals/decimal.js";
|
|
6
6
|
import { round } from "../../../math/utils/round.js";
|
|
7
|
+
import { isInt } from "../../../utils/isInt.js";
|
|
8
|
+
import { power } from "../operators/powerNode.js";
|
|
9
|
+
import { operatorComposition } from "../../../tree/utilities/operatorComposition.js";
|
|
10
|
+
import { MultiplyNode } from "../operators/multiplyNode.js";
|
|
11
|
+
import { primeDecomposition } from "../../../math/utils/arithmetic/primeDecomposition.js";
|
|
7
12
|
export function isNumberNode(a) {
|
|
8
13
|
return a.type === NodeType.number;
|
|
9
14
|
}
|
|
@@ -86,4 +91,31 @@ export class NumberNode {
|
|
|
86
91
|
toFrac() {
|
|
87
92
|
return new Decimal(this.value).toRational(true).toTree();
|
|
88
93
|
}
|
|
94
|
+
toPrimeDecomposition(usePowers) {
|
|
95
|
+
if (!isInt(this.value)) {
|
|
96
|
+
throw new Error("Can't get the prime decomposition of a decimal");
|
|
97
|
+
}
|
|
98
|
+
const decomp = primeDecomposition(this.value);
|
|
99
|
+
if (!decomp.length)
|
|
100
|
+
return this;
|
|
101
|
+
let nodes = [];
|
|
102
|
+
if (usePowers) {
|
|
103
|
+
for (const d of decomp) {
|
|
104
|
+
if (d.power === 1)
|
|
105
|
+
nodes.push(d.value.toTree());
|
|
106
|
+
else
|
|
107
|
+
nodes.push(power(d.value, d.power));
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
for (const d of decomp) {
|
|
112
|
+
for (let i = 0; i < d.power; i++) {
|
|
113
|
+
nodes.push(d.value.toTree());
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (nodes.length === 1)
|
|
118
|
+
return nodes[0];
|
|
119
|
+
return operatorComposition(MultiplyNode, nodes);
|
|
120
|
+
}
|
|
89
121
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const mdTable: (rows: (string | number)[][]) => string;
|
|
1
|
+
export declare const mdTable: (rows: (string | number)[][], shouldDollarize?: boolean) => string;
|
|
2
2
|
//# sourceMappingURL=mdTable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mdTable.d.ts","sourceRoot":"","sources":["../../../src/utils/markdown/mdTable.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mdTable.d.ts","sourceRoot":"","sources":["../../../src/utils/markdown/mdTable.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,OAAO,SACZ,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,EAAE,oBACT,OAAO,WAa1B,CAAC"}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { dollarize } from "../latex/dollarize.js";
|
|
2
|
+
const rowBuilder = (row, shouldDollarize) => {
|
|
3
|
+
const rowFormated = shouldDollarize ? row.map((e) => dollarize(e)) : row;
|
|
4
|
+
return "|" + rowFormated.join("|") + "|";
|
|
3
5
|
};
|
|
4
|
-
export const mdTable = (rows) => {
|
|
6
|
+
export const mdTable = (rows, shouldDollarize) => {
|
|
5
7
|
const width = rows[0].length;
|
|
6
8
|
return `
|
|
7
9
|
<!-- table -->
|
|
8
|
-
${rowBuilder(rows[0])}
|
|
10
|
+
${rowBuilder(rows[0], shouldDollarize)}
|
|
9
11
|
${rowBuilder(new Array(width).fill("-"))}
|
|
10
|
-
${rows
|
|
12
|
+
${rows
|
|
13
|
+
.slice(1)
|
|
14
|
+
.map((e) => rowBuilder(e, shouldDollarize))
|
|
15
|
+
.join("\n")}
|
|
11
16
|
<!-- !table -->
|
|
12
17
|
`;
|
|
13
18
|
};
|