math-exercises 3.0.71 → 3.0.73
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 +3 -1
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/getParityBetweenTwoNumbers.d.ts +9 -0
- package/lib/exercises/math/calcul/arithmetics/getParityBetweenTwoNumbers.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/getParityBetweenTwoNumbers.js +114 -0
- package/lib/exercises/math/calcul/arithmetics/imageOfSquareFunction.d.ts +8 -0
- package/lib/exercises/math/calcul/arithmetics/imageOfSquareFunction.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/imageOfSquareFunction.js +152 -0
- package/lib/exercises/math/calcul/arithmetics/index.d.ts +9 -0
- package/lib/exercises/math/calcul/arithmetics/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/index.js +9 -0
- package/lib/exercises/math/calcul/arithmetics/isInequalityTrue.d.ts +15 -0
- package/lib/exercises/math/calcul/arithmetics/isInequalityTrue.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/isInequalityTrue.js +143 -0
- package/lib/exercises/math/calcul/arithmetics/isPointOnCubicFunction.d.ts +9 -0
- package/lib/exercises/math/calcul/arithmetics/isPointOnCubicFunction.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/isPointOnCubicFunction.js +111 -0
- package/lib/exercises/math/calcul/arithmetics/isPointOnFunction.d.ts +10 -0
- package/lib/exercises/math/calcul/arithmetics/isPointOnFunction.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/isPointOnFunction.js +133 -0
- package/lib/exercises/math/calcul/arithmetics/isPointOnReciprocalFunction.d.ts +9 -0
- package/lib/exercises/math/calcul/arithmetics/isPointOnReciprocalFunction.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/isPointOnReciprocalFunction.js +117 -0
- package/lib/exercises/math/calcul/arithmetics/minNumberInequality.d.ts +13 -0
- package/lib/exercises/math/calcul/arithmetics/minNumberInequality.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/minNumberInequality.js +192 -0
- package/lib/exercises/math/calcul/arithmetics/primeNumberIdentification.d.ts +7 -0
- package/lib/exercises/math/calcul/arithmetics/primeNumberIdentification.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/primeNumberIdentification.js +84 -0
- package/lib/exercises/math/calcul/arithmetics/squareRootCalculation.d.ts +8 -0
- package/lib/exercises/math/calcul/arithmetics/squareRootCalculation.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/squareRootCalculation.js +107 -0
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerSum.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerSum.js +37 -0
- package/lib/exercises/math/calcul/fractions/fractionToPercentToDecimal.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionToPercentToDecimal.js +57 -6
- package/lib/exercises/math/calcul/fractions/fractionsOperations.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsOperations.js +64 -22
- package/lib/exercises/math/calcul/fractions/fractionsSubstraction.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSubstraction.js +143 -4
- package/lib/exercises/math/calcul/fractions/fractionsSum.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSum.js +141 -3
- 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/periodicWritingToFraction.js +3 -3
- package/lib/exercises/math/calcul/fractions/powerNotation.d.ts +9 -0
- package/lib/exercises/math/calcul/fractions/powerNotation.d.ts.map +1 -0
- package/lib/exercises/math/calcul/fractions/powerNotation.js +125 -0
- package/lib/exercises/math/calcul/proportionality/proportionalityTable.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/proportionalityTable.js +29 -5
- package/lib/exercises/math/calcul/sign/absoluteNumber.d.ts +7 -0
- package/lib/exercises/math/calcul/sign/absoluteNumber.d.ts.map +1 -0
- package/lib/exercises/math/calcul/sign/absoluteNumber.js +80 -0
- package/lib/exercises/math/calcul/sign/index.d.ts +1 -0
- package/lib/exercises/math/calcul/sign/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/sign/index.js +1 -0
- package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.js +67 -21
- package/lib/exercises/math/calculLitteral/equation/equa3.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equa3.js +0 -2
- package/lib/exercises/math/calculLitteral/equation/equationWithDistributivity.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationWithDistributivity.js +53 -9
- package/lib/exercises/math/calculLitteral/equation/factorizeEquation.d.ts +9 -0
- package/lib/exercises/math/calculLitteral/equation/factorizeEquation.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/equation/factorizeEquation.js +145 -0
- package/lib/exercises/math/calculLitteral/equation/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/equation/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/index.js +1 -0
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType2.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType2.js +32 -4
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.js +30 -2
- package/lib/exercises/math/calculLitteral/inequations/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/inequations/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/inequations/index.js +1 -0
- package/lib/exercises/math/calculLitteral/inequations/inequationsSign.d.ts +9 -0
- package/lib/exercises/math/calculLitteral/inequations/inequationsSign.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/inequations/inequationsSign.js +75 -0
- package/lib/exercises/math/calculLitteral/inequations/inverseInequality.d.ts +9 -0
- package/lib/exercises/math/calculLitteral/inequations/inverseInequality.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/inequations/inverseInequality.js +120 -0
- package/lib/exercises/math/calculLitteral/simplifying/distributeAndSimplify.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/simplifying/distributeAndSimplify.js +43 -1
- package/lib/exercises/math/curve/index.d.ts +3 -0
- package/lib/exercises/math/curve/index.d.ts.map +1 -0
- package/lib/exercises/math/curve/index.js +2 -0
- package/lib/exercises/math/curve/sqrtCurvePoint.d.ts +8 -0
- package/lib/exercises/math/curve/sqrtCurvePoint.d.ts.map +1 -0
- package/lib/exercises/math/curve/sqrtCurvePoint.js +132 -0
- package/lib/exercises/math/curve/squareCurvePoint.d.ts +8 -0
- package/lib/exercises/math/curve/squareCurvePoint.d.ts.map +1 -0
- package/lib/exercises/math/curve/squareCurvePoint.js +133 -0
- package/lib/exercises/math/functions/absolute/index.d.ts +2 -0
- package/lib/exercises/math/functions/absolute/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/absolute/index.js +2 -0
- package/lib/exercises/math/functions/absolute/removeAbsNotation.d.ts +8 -0
- package/lib/exercises/math/functions/absolute/removeAbsNotation.d.ts.map +1 -0
- package/lib/exercises/math/functions/absolute/removeAbsNotation.js +105 -0
- package/lib/exercises/math/functions/absolute/removeAbsNotationSign.d.ts +8 -0
- package/lib/exercises/math/functions/absolute/removeAbsNotationSign.d.ts.map +1 -0
- package/lib/exercises/math/functions/absolute/removeAbsNotationSign.js +108 -0
- package/lib/exercises/math/functions/affines/affineExpressionReading.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineExpressionReading.js +36 -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 -0
- package/lib/exercises/math/functions/basics/valueTableCompletion.d.ts +7 -0
- package/lib/exercises/math/functions/basics/valueTableCompletion.d.ts.map +1 -0
- package/lib/exercises/math/functions/basics/valueTableCompletion.js +78 -0
- package/lib/exercises/math/functions/cube/imageOfCubeFunction.d.ts +8 -0
- package/lib/exercises/math/functions/cube/imageOfCubeFunction.d.ts.map +1 -0
- package/lib/exercises/math/functions/cube/imageOfCubeFunction.js +142 -0
- package/lib/exercises/math/functions/cube/index.d.ts +1 -0
- package/lib/exercises/math/functions/cube/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/cube/index.js +1 -0
- package/lib/exercises/math/functions/square/getImageOfSquareRootFunction.d.ts +8 -0
- package/lib/exercises/math/functions/square/getImageOfSquareRootFunction.d.ts.map +1 -0
- package/lib/exercises/math/functions/square/getImageOfSquareRootFunction.js +128 -0
- package/lib/exercises/math/functions/square/index.d.ts +1 -0
- package/lib/exercises/math/functions/square/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/square/index.js +1 -0
- package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.js +32 -2
- package/lib/exercises/math/index.d.ts +1 -0
- package/lib/exercises/math/index.d.ts.map +1 -1
- package/lib/exercises/math/index.js +1 -0
- package/lib/exercises/math/powers/decimalToScientific.d.ts.map +1 -1
- package/lib/exercises/math/powers/decimalToScientific.js +0 -1
- package/lib/exercises/math/powers/powersMixOperations.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersMixOperations.js +0 -1
- package/lib/exercises/math/probaStat/ballsBasicProbas.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/ballsBasicProbas.js +1 -3
- package/lib/exercises/math/probaStat/stats1var/median.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/median.js +2 -11
- package/lib/exercises/math/probaStat/stats1var/medianList.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/medianList.js +2 -10
- package/lib/exercises/math/probaStat/stats1var/quartilesList.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/quartilesList.js +3 -9
- package/lib/exercises/math/python/index.d.ts +2 -0
- package/lib/exercises/math/python/index.d.ts.map +1 -1
- package/lib/exercises/math/python/index.js +2 -0
- package/lib/exercises/math/python/pyIfElseCondition.d.ts +8 -0
- package/lib/exercises/math/python/pyIfElseCondition.d.ts.map +1 -0
- package/lib/exercises/math/python/pyIfElseCondition.js +133 -0
- package/lib/exercises/math/python/variableType.d.ts +8 -0
- package/lib/exercises/math/python/variableType.d.ts.map +1 -0
- package/lib/exercises/math/python/variableType.js +118 -0
- package/lib/exercises/math/python/whileLoop.js +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticExplicitFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticExplicitFormulaUsage.js +1 -0
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindReason.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindReason.js +2 -1
- package/lib/exercises/math/sets/intervals/inequalityToInterval.d.ts.map +1 -1
- package/lib/exercises/math/sets/intervals/inequalityToInterval.js +21 -0
- package/lib/exercises/math/sets/intervals/intervalToInequality.d.ts.map +1 -1
- package/lib/exercises/math/sets/intervals/intervalToInequality.js +20 -0
- package/lib/exercises/math/sets/intervals/intervalsUnion.d.ts.map +1 -1
- package/lib/exercises/math/sets/intervals/intervalsUnion.js +19 -0
- package/lib/exercises/math/sets/setBelonging.d.ts.map +1 -1
- package/lib/exercises/math/sets/setBelonging.js +24 -0
- package/lib/exercises/pc/chemicalElements/weightPercent.d.ts.map +1 -1
- package/lib/exercises/pc/chemicalElements/weightPercent.js +0 -1
- package/lib/exercises/utils/getDistinctQuestions.d.ts.map +1 -1
- package/lib/exercises/utils/getDistinctQuestions.js +6 -0
- package/lib/index.d.ts +71 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/latexTester.d.ts.map +1 -1
- package/lib/latexTester.js +5 -2
- package/lib/math/numbers/decimals/decimal.d.ts +1 -1
- package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
- package/lib/math/numbers/decimals/decimal.js +5 -2
- package/lib/math/utils/stats/median.d.ts +2 -0
- package/lib/math/utils/stats/median.d.ts.map +1 -0
- package/lib/math/utils/stats/median.js +39 -0
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +5 -6
- package/lib/tests/pdfExo.test.d.ts.map +1 -1
- package/lib/tests/pdfExo.test.js +2 -2
- package/lib/tests/pdfs/mdCodeToLatex.d.ts.map +1 -1
- package/lib/tests/pdfs/mdCodeToLatex.js +10 -0
- package/lib/tests/pdfs/quizPdfPreambule.js +1 -1
- package/lib/tree/nodes/algebraicNode.d.ts +2 -0
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/nodeConstructor.js +1 -1
- package/lib/tree/nodes/numbers/numberNode.js +2 -2
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +10 -4
- package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/powerNode.js +4 -0
- package/package.json +1 -1
|
@@ -88,6 +88,8 @@ export interface Question<TIdentifiers = {}, TOptions = {}> {
|
|
|
88
88
|
divisionFormat?: "fraction" | "obelus";
|
|
89
89
|
identifiers: TIdentifiers;
|
|
90
90
|
options?: TOptions;
|
|
91
|
+
answerTable?: string[][];
|
|
92
|
+
initTable?: string[][];
|
|
91
93
|
}
|
|
92
94
|
export type QCMGenerator<TIdentifiers, TOptions = {}> = (n: number, args: {
|
|
93
95
|
answer: string;
|
|
@@ -136,7 +138,7 @@ export interface Exercise<TIdentifiers = {}, TOptions = {}> {
|
|
|
136
138
|
connector?: "=" | "\\iff" | "\\approx";
|
|
137
139
|
generator: (n: number, opts?: TOptions) => Question<TIdentifiers, TOptions>[];
|
|
138
140
|
maxAllowedQuestions?: number;
|
|
139
|
-
answerType?: "GGB" | "QCM" | "free" | "QCU";
|
|
141
|
+
answerType?: "GGB" | "QCM" | "free" | "QCU" | "valueTable";
|
|
140
142
|
isQCM?: boolean;
|
|
141
143
|
shouldHaveCalculator?: boolean;
|
|
142
144
|
qcmTimer?: number;
|
|
@@ -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,CAAC;AACF,eAAO,MAAM,iBAAiB,UACrB,WAAW,EAAE,aACT,MAAM,WACT,KAAK,GAAG,KAAK,SAUtB,CAAC;AAEF,eAAO,MAAM,YAAY,UAChB,WAAW,EAAE,KACjB,MAAM,sBACW,MAAM,kBAQ3B,CAAC;AAEF,oBAAY,qBAAqB;IAC/B,UAAU,eAAe;IACzB,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,WAAW,gBAAgB;IAC3B,IAAI,SAAS;IACb,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,GAAG,QAAQ;IACX,IAAI,SAAS;CACd;AACD,oBAAY,mBAAmB;IAC7B,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,WAAW,gBAAgB;CAC5B;AACD,MAAM,MAAM,eAAe,CAAC,MAAM,GAAG,GAAG,IAAI;IAC1C,EAAE,EAAE,MAAM,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
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
a: number;
|
|
4
|
+
b: number;
|
|
5
|
+
isAskingParity: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const getParityBetweenTwoNumbers: Exercise<Identifiers>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=getParityBetweenTwoNumbers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getParityBetweenTwoNumbers.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/arithmetics/getParityBetweenTwoNumbers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AA0HF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAiB5D,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
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 { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
5
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
6
|
+
const getPropositions = (n, { answer }) => {
|
|
7
|
+
const propositions = [];
|
|
8
|
+
addValidProp(propositions, answer);
|
|
9
|
+
while (propositions.length < n) {
|
|
10
|
+
const randomNumber = randint(0, 100);
|
|
11
|
+
tryToAddWrongProp(propositions, randomNumber.frenchify());
|
|
12
|
+
}
|
|
13
|
+
return shuffleProps(propositions, n);
|
|
14
|
+
};
|
|
15
|
+
const getAnswer = (identifiers) => {
|
|
16
|
+
let { a, b, isAskingParity } = identifiers;
|
|
17
|
+
const start = a + 1;
|
|
18
|
+
const end = b - 1;
|
|
19
|
+
const totalNumbers = end - start + 1;
|
|
20
|
+
const evensUpToEnd = Math.floor(end / 2);
|
|
21
|
+
const evensBeforeStart = Math.floor((start - 1) / 2);
|
|
22
|
+
const totalEvenNumbers = evensUpToEnd - evensBeforeStart;
|
|
23
|
+
const count = isAskingParity
|
|
24
|
+
? totalEvenNumbers
|
|
25
|
+
: totalNumbers - totalEvenNumbers;
|
|
26
|
+
return count.frenchify();
|
|
27
|
+
};
|
|
28
|
+
const getInstruction = (identifiers) => {
|
|
29
|
+
const { a, b, isAskingParity } = identifiers;
|
|
30
|
+
return `Combien y a-t-il de nombres ${isAskingParity ? "pairs" : "impairs"} entre $${a}$ et $${b}$ ?`;
|
|
31
|
+
};
|
|
32
|
+
const getHint = (identifiers) => {
|
|
33
|
+
return `Rappel sur la parité :
|
|
34
|
+
|
|
35
|
+
- Un nombre est pair s'il est divisible par $2$ (il finit par $0$, $2$, $4$, $6$ ou $8$) ;
|
|
36
|
+
- Un nombre est impair s'il n'est **pas** divisible par $2$ (il finit par $1$, $3$, $5$, $7$ ou $9$) ;
|
|
37
|
+
- Pensez que seuls les nombres **strictement entre** les deux bornes sont à prendre en compte.`;
|
|
38
|
+
};
|
|
39
|
+
const getCorrection = (identifiers) => {
|
|
40
|
+
let { a, b, isAskingParity } = identifiers;
|
|
41
|
+
if (a > b) {
|
|
42
|
+
[a, b] = [b, a];
|
|
43
|
+
}
|
|
44
|
+
const start = a + 1;
|
|
45
|
+
const end = b - 1;
|
|
46
|
+
const totalNumbers = end - start + 1;
|
|
47
|
+
const evensUpToEnd = Math.floor(end / 2);
|
|
48
|
+
const evensBeforeStart = Math.floor((start - 1) / 2);
|
|
49
|
+
const totalEvenNumbers = evensUpToEnd - evensBeforeStart;
|
|
50
|
+
const totalOddNumbers = totalNumbers - totalEvenNumbers;
|
|
51
|
+
const number = isAskingParity ? totalEvenNumbers : totalOddNumbers;
|
|
52
|
+
return `
|
|
53
|
+
|
|
54
|
+
Il y a $${totalNumbers}$ nombres entre $${a}$ et $${b}$.
|
|
55
|
+
|
|
56
|
+
Pour trouver combien il y a de nombres pairs :
|
|
57
|
+
- On compte combien il y a de nombres pairs entre $0$ et $${end}$ : c'est $${evensUpToEnd}$ (car un nombre pair apparaît tous les deux nombres, donc on divise par $2$ et on prend la partie entière).
|
|
58
|
+
- On compte combien il y a de nombres pairs entre $0$ et $${start - 1}$ : c'est $${evensBeforeStart}$.
|
|
59
|
+
|
|
60
|
+
- Le nombre de nombres pairs strictement entre $${start}$ et $${end}$ est donc $${evensUpToEnd} - ${evensBeforeStart} = ${totalEvenNumbers}$.
|
|
61
|
+
|
|
62
|
+
Ensuite, comme il y a $${totalNumbers}$ nombres au total, le nombre d'impairs est $${totalNumbers} - ${totalEvenNumbers} = ${totalOddNumbers}$.
|
|
63
|
+
|
|
64
|
+
On cherche les nombres ${isAskingParity ? "pairs" : "impairs"}, donc la réponse finale est $${number}$.`;
|
|
65
|
+
};
|
|
66
|
+
const getKeys = (identifiers) => {
|
|
67
|
+
return [];
|
|
68
|
+
};
|
|
69
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
70
|
+
try {
|
|
71
|
+
return ans === answer;
|
|
72
|
+
}
|
|
73
|
+
catch (err) {
|
|
74
|
+
return handleVEAError(err);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const getGetParityBetweenTwoNumbersQuestion = (ops) => {
|
|
78
|
+
let a = randint(1, 100);
|
|
79
|
+
let b = randint(1, 100, [a, a - 1, a + 1, a - 2, a + 2]);
|
|
80
|
+
if (a > b) {
|
|
81
|
+
[a, b] = [b, a];
|
|
82
|
+
}
|
|
83
|
+
const isAskingParity = coinFlip();
|
|
84
|
+
const identifiers = { a, b, isAskingParity };
|
|
85
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
86
|
+
};
|
|
87
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
88
|
+
return {
|
|
89
|
+
answer: getAnswer(identifiers),
|
|
90
|
+
instruction: getInstruction(identifiers),
|
|
91
|
+
keys: getKeys(identifiers),
|
|
92
|
+
answerFormat: "tex",
|
|
93
|
+
identifiers,
|
|
94
|
+
hint: getHint(identifiers),
|
|
95
|
+
correction: getCorrection(identifiers),
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
export const getParityBetweenTwoNumbers = {
|
|
99
|
+
id: "getParityBetweenTwoNumbers",
|
|
100
|
+
label: "Le nombre de valeurs paires/impaires entre a et b",
|
|
101
|
+
isSingleStep: true,
|
|
102
|
+
generator: (nb, opts) => getDistinctQuestions(() => getGetParityBetweenTwoNumbersQuestion(opts), nb),
|
|
103
|
+
qcmTimer: 60,
|
|
104
|
+
freeTimer: 60,
|
|
105
|
+
getPropositions,
|
|
106
|
+
isAnswerValid,
|
|
107
|
+
subject: "Mathématiques",
|
|
108
|
+
getInstruction,
|
|
109
|
+
getHint,
|
|
110
|
+
getCorrection,
|
|
111
|
+
getAnswer,
|
|
112
|
+
getQuestionFromIdentifiers,
|
|
113
|
+
hasHintAndCorrection: true,
|
|
114
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
a: NodeIdentifiers;
|
|
5
|
+
};
|
|
6
|
+
export declare const imageOfSquareFunction: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=imageOfSquareFunction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imageOfSquareFunction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/arithmetics/imageOfSquareFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAW7C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,eAAe,CAAC;CACpB,CAAC;AAwJF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAiBvD,CAAC"}
|
|
@@ -0,0 +1,152 @@
|
|
|
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 { randint } from "../../../../math/utils/random/randint.js";
|
|
5
|
+
import { sqrt, SqrtNode } from "../../../../tree/nodes/functions/sqrtNode.js";
|
|
6
|
+
import { NodeIds } from "../../../../tree/nodes/node.js";
|
|
7
|
+
import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
8
|
+
import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
|
|
9
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
10
|
+
import { divide } from "../../../../tree/nodes/operators/divideNode.js";
|
|
11
|
+
import { FractionNode } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
12
|
+
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
13
|
+
import { square } from "../../../../tree/nodes/operators/powerNode.js";
|
|
14
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
15
|
+
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
16
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
17
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
18
|
+
const propositions = [];
|
|
19
|
+
addValidProp(propositions, answer);
|
|
20
|
+
const { a } = identifiers;
|
|
21
|
+
if (a.id === NodeIds.fraction) {
|
|
22
|
+
const frac = reifyAlgebraic(a);
|
|
23
|
+
// Erreurs potentielles pour les fractions:
|
|
24
|
+
// - l'élève ne fait le carré que sur le nominateur et dénominateur
|
|
25
|
+
// - l'élève multiplie par 2 à la place de faire un carré
|
|
26
|
+
tryToAddWrongProp(propositions, new FractionNode(frac.leftChild, square(frac.rightChild))
|
|
27
|
+
.simplify()
|
|
28
|
+
.toTex());
|
|
29
|
+
tryToAddWrongProp(propositions, new FractionNode(square(frac.leftChild), frac.rightChild)
|
|
30
|
+
.simplify()
|
|
31
|
+
.toTex());
|
|
32
|
+
tryToAddWrongProp(propositions, new FractionNode(frac.leftChild, multiply(frac.rightChild, 2))
|
|
33
|
+
.simplify()
|
|
34
|
+
.toTex());
|
|
35
|
+
tryToAddWrongProp(propositions, new FractionNode(multiply(frac.leftChild, 2), frac.rightChild)
|
|
36
|
+
.simplify()
|
|
37
|
+
.toTex());
|
|
38
|
+
tryToAddWrongProp(propositions, multiply(frac, 2).simplify().toTex());
|
|
39
|
+
}
|
|
40
|
+
else if (a.id === NodeIds.number) {
|
|
41
|
+
const N = reifyAlgebraic(a);
|
|
42
|
+
// Erreurs potentielles pour les nombres:
|
|
43
|
+
// - Division par 2
|
|
44
|
+
// - Multiplication par 2 (sauf pour le cas N = 2)
|
|
45
|
+
// - Carre de N+1
|
|
46
|
+
// - Carre de N-1
|
|
47
|
+
if (N.value != 2)
|
|
48
|
+
tryToAddWrongProp(propositions, multiply(N, 2).simplify().toTex());
|
|
49
|
+
tryToAddWrongProp(propositions, divide(N, 2).simplify().toTex());
|
|
50
|
+
tryToAddWrongProp(propositions, square(substract(N, 1)).simplify().toTex());
|
|
51
|
+
tryToAddWrongProp(propositions, square(add(N, 1)).simplify().toTex());
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
// Cas racine carre
|
|
55
|
+
// Multiplication de 2 dans la racine
|
|
56
|
+
// Multiplication de 2 en dehors de la racine
|
|
57
|
+
// N^2 pour sqrt(N) (carre effectue deux fois)
|
|
58
|
+
const N = reifyAlgebraic(a);
|
|
59
|
+
tryToAddWrongProp(propositions, sqrt(multiply(N.child, 2)).simplify().toTex());
|
|
60
|
+
tryToAddWrongProp(propositions, multiply(N, 2).simplify().toTex());
|
|
61
|
+
tryToAddWrongProp(propositions, square(N.child).simplify().toTex());
|
|
62
|
+
}
|
|
63
|
+
return shuffleProps(propositions, n);
|
|
64
|
+
};
|
|
65
|
+
const getAnswer = (identifiers) => {
|
|
66
|
+
const { a } = identifiers;
|
|
67
|
+
const correctAnswer = square(reifyAlgebraic(a));
|
|
68
|
+
return correctAnswer.simplify().toTex();
|
|
69
|
+
};
|
|
70
|
+
const getInstruction = (identifiers) => {
|
|
71
|
+
const { a } = identifiers;
|
|
72
|
+
const nNode = reifyAlgebraic(a);
|
|
73
|
+
return `Calculer l'image de $${nNode.toTex()}$ par la fonction carré.`;
|
|
74
|
+
};
|
|
75
|
+
const getHint = (identifiers) => {
|
|
76
|
+
return `La fonction carré est la fonction définie par:
|
|
77
|
+
|
|
78
|
+
$$
|
|
79
|
+
f(x) = x^2
|
|
80
|
+
$$`;
|
|
81
|
+
};
|
|
82
|
+
const getCorrection = (identifiers) => {
|
|
83
|
+
const { a } = identifiers;
|
|
84
|
+
const aNode = reifyAlgebraic(a);
|
|
85
|
+
return `L'image de $${aNode.toTex()}$ par $f(x) = x^2$ est :
|
|
86
|
+
|
|
87
|
+
$$
|
|
88
|
+
f\\left(${aNode.toTex()}\\right) = ${square(aNode).toTex()} = ${getAnswer(identifiers)}
|
|
89
|
+
$$`;
|
|
90
|
+
};
|
|
91
|
+
const getKeys = (identifiers) => {
|
|
92
|
+
return [];
|
|
93
|
+
};
|
|
94
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
95
|
+
try {
|
|
96
|
+
const studentAnswer = parseAlgebraic(ans);
|
|
97
|
+
const correctAnswer = parseAlgebraic(answer);
|
|
98
|
+
return studentAnswer
|
|
99
|
+
.simplify({ decimalToFractions: true })
|
|
100
|
+
.equals(correctAnswer.simplify());
|
|
101
|
+
}
|
|
102
|
+
catch (err) {
|
|
103
|
+
return handleVEAError(err);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
const getImageOfSquareFunctionQuestion = (ops) => {
|
|
107
|
+
let a = null;
|
|
108
|
+
// Soit un nombre, soit une fraction, soit une racine carre
|
|
109
|
+
const choice = randint(1, 4);
|
|
110
|
+
switch (choice) {
|
|
111
|
+
case 1:
|
|
112
|
+
a = new NumberNode(randint(-10, 10));
|
|
113
|
+
break;
|
|
114
|
+
case 2:
|
|
115
|
+
a = RationalConstructor.randomIrreductible().toTree();
|
|
116
|
+
break;
|
|
117
|
+
case 3:
|
|
118
|
+
default:
|
|
119
|
+
a = new SqrtNode(new NumberNode(randint(2, 100)));
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
const identifiers = { a: a.toIdentifiers() };
|
|
123
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
124
|
+
};
|
|
125
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
126
|
+
return {
|
|
127
|
+
answer: getAnswer(identifiers),
|
|
128
|
+
instruction: getInstruction(identifiers),
|
|
129
|
+
keys: getKeys(identifiers),
|
|
130
|
+
answerFormat: "tex",
|
|
131
|
+
identifiers,
|
|
132
|
+
hint: getHint(identifiers),
|
|
133
|
+
correction: getCorrection(identifiers),
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
export const imageOfSquareFunction = {
|
|
137
|
+
id: "imageOfSquareFunction",
|
|
138
|
+
label: "Calcul d'image par la fonction carré",
|
|
139
|
+
isSingleStep: true,
|
|
140
|
+
generator: (nb, opts) => getDistinctQuestions(() => getImageOfSquareFunctionQuestion(opts), nb),
|
|
141
|
+
qcmTimer: 60,
|
|
142
|
+
freeTimer: 60,
|
|
143
|
+
getPropositions,
|
|
144
|
+
isAnswerValid,
|
|
145
|
+
subject: "Mathématiques",
|
|
146
|
+
getInstruction,
|
|
147
|
+
getHint,
|
|
148
|
+
getCorrection,
|
|
149
|
+
getAnswer,
|
|
150
|
+
getQuestionFromIdentifiers,
|
|
151
|
+
hasHintAndCorrection: true,
|
|
152
|
+
};
|
|
@@ -6,4 +6,13 @@ export * from "./divisorsList.js";
|
|
|
6
6
|
export * from "./commonDivisorsList.js";
|
|
7
7
|
export * from "./divisibiltyCriteria.js";
|
|
8
8
|
export * from "./ppcmCalcul.js";
|
|
9
|
+
export * from "./getParityBetweenTwoNumbers.js";
|
|
10
|
+
export * from "./primeNumberIdentification.js";
|
|
11
|
+
export * from "./imageOfSquareFunction.js";
|
|
12
|
+
export * from "./isInequalityTrue.js";
|
|
13
|
+
export * from "./minNumberInequality.js";
|
|
14
|
+
export * from "./squareRootCalculation.js";
|
|
15
|
+
export * from "./isPointOnCubicFunction.js";
|
|
16
|
+
export * from "./isPointOnReciprocalFunction.js";
|
|
17
|
+
export * from "./isPointOnFunction.js";
|
|
9
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/arithmetics/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/arithmetics/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,wBAAwB,CAAC"}
|
|
@@ -6,3 +6,12 @@ export * from "./divisorsList.js";
|
|
|
6
6
|
export * from "./commonDivisorsList.js";
|
|
7
7
|
export * from "./divisibiltyCriteria.js";
|
|
8
8
|
export * from "./ppcmCalcul.js";
|
|
9
|
+
export * from "./getParityBetweenTwoNumbers.js";
|
|
10
|
+
export * from "./primeNumberIdentification.js";
|
|
11
|
+
export * from "./imageOfSquareFunction.js";
|
|
12
|
+
export * from "./isInequalityTrue.js";
|
|
13
|
+
export * from "./minNumberInequality.js";
|
|
14
|
+
export * from "./squareRootCalculation.js";
|
|
15
|
+
export * from "./isPointOnCubicFunction.js";
|
|
16
|
+
export * from "./isPointOnReciprocalFunction.js";
|
|
17
|
+
export * from "./isPointOnFunction.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
a: number;
|
|
5
|
+
b: number;
|
|
6
|
+
c: number;
|
|
7
|
+
d: number;
|
|
8
|
+
x: number;
|
|
9
|
+
left: NodeIdentifiers;
|
|
10
|
+
right: NodeIdentifiers;
|
|
11
|
+
inequalitySign: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const isInequalityTrue: Exercise<Identifiers>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=isInequalityTrue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isInequalityTrue.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/arithmetics/isInequalityTrue.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAE7C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,eAAe,CAAC;IACtB,KAAK,EAAE,eAAe,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAyIF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAkBlD,CAAC"}
|
|
@@ -0,0 +1,143 @@
|
|
|
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 { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
5
|
+
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
6
|
+
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
7
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
8
|
+
import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
9
|
+
const getPropositions = (n, { answer }) => {
|
|
10
|
+
const propositions = [];
|
|
11
|
+
addValidProp(propositions, answer, "raw");
|
|
12
|
+
tryToAddWrongProp(propositions, "Non", "raw");
|
|
13
|
+
tryToAddWrongProp(propositions, "On ne peut pas savoir", "raw");
|
|
14
|
+
tryToAddWrongProp(propositions, "Oui", "raw");
|
|
15
|
+
return shuffleProps(propositions, n);
|
|
16
|
+
};
|
|
17
|
+
const getAnswer = (identifiers) => {
|
|
18
|
+
const { x, inequalitySign, left, right } = identifiers;
|
|
19
|
+
const leftValue = reifyAlgebraic(left)
|
|
20
|
+
.toDetailedEvaluation({ x: x.toTree() })
|
|
21
|
+
.evaluate();
|
|
22
|
+
const rightValue = reifyAlgebraic(right)
|
|
23
|
+
.toDetailedEvaluation({ x: x.toTree() })
|
|
24
|
+
.evaluate();
|
|
25
|
+
const isTrue = inequalitySign
|
|
26
|
+
? leftValue < rightValue
|
|
27
|
+
: leftValue > rightValue;
|
|
28
|
+
return isTrue ? "Oui" : "Non";
|
|
29
|
+
};
|
|
30
|
+
const getInstruction = (identifiers) => {
|
|
31
|
+
const { x, inequalitySign, left, right } = identifiers;
|
|
32
|
+
const leftNode = reifyAlgebraic(left);
|
|
33
|
+
const rightNode = reifyAlgebraic(right);
|
|
34
|
+
return `On considère l'inéquation suivante :
|
|
35
|
+
|
|
36
|
+
$$
|
|
37
|
+
${leftNode.toTex()} ${inequalitySign ? "<" : ">"} ${rightNode.toTex()}
|
|
38
|
+
$$
|
|
39
|
+
|
|
40
|
+
Cette inéquation est-elle vraie pour pour $x = ${x}$ ?`;
|
|
41
|
+
};
|
|
42
|
+
const getHint = (identifiers) => {
|
|
43
|
+
return `Remplacer $x$ par $${identifiers.x}$ dans les deux membres. Ensuite, vérifie si l'inégalité est vraie ou non.`;
|
|
44
|
+
};
|
|
45
|
+
const reverseSign = (sign) => {
|
|
46
|
+
let x = "";
|
|
47
|
+
if (sign === "<") {
|
|
48
|
+
x = ">";
|
|
49
|
+
}
|
|
50
|
+
else if (sign === ">") {
|
|
51
|
+
x = "<";
|
|
52
|
+
}
|
|
53
|
+
return x;
|
|
54
|
+
};
|
|
55
|
+
const getCorrection = (identifiers) => {
|
|
56
|
+
const { x, inequalitySign, left, right } = identifiers;
|
|
57
|
+
const leftNode = reifyAlgebraic(left);
|
|
58
|
+
const rightNode = reifyAlgebraic(right);
|
|
59
|
+
const detailedLeft = leftNode.toDetailedEvaluation({ x: x.toTree() });
|
|
60
|
+
const simplifiedLeft = detailedLeft.simplify();
|
|
61
|
+
const detailedRight = rightNode.toDetailedEvaluation({ x: x.toTree() });
|
|
62
|
+
const simplifiedRight = detailedRight.simplify();
|
|
63
|
+
const leftDetTex = detailedLeft.toTex();
|
|
64
|
+
const leftSimTex = simplifiedLeft.toTex();
|
|
65
|
+
const rightDetTex = detailedRight.toTex();
|
|
66
|
+
const rightSimTex = simplifiedRight.toTex();
|
|
67
|
+
const isTrue = getAnswer(identifiers) === "Oui";
|
|
68
|
+
const sign = inequalitySign ? "<" : ">";
|
|
69
|
+
return `Pour $x = ${x}$, le membre de gauche vaut :
|
|
70
|
+
|
|
71
|
+
$$
|
|
72
|
+
${leftDetTex} = ${leftSimTex}
|
|
73
|
+
$$
|
|
74
|
+
|
|
75
|
+
Le membre de droite vaut :
|
|
76
|
+
|
|
77
|
+
$$
|
|
78
|
+
${rightDetTex} = ${rightSimTex}
|
|
79
|
+
$$
|
|
80
|
+
|
|
81
|
+
Puisque $${leftSimTex} ${isTrue ? sign : reverseSign(sign)} ${rightSimTex}$, l'inéquation ${isTrue ? "est bien verifiée" : "n'est pas vérifiée"} pour $x = ${x}$.`;
|
|
82
|
+
};
|
|
83
|
+
const getKeys = (identifiers) => {
|
|
84
|
+
return [];
|
|
85
|
+
};
|
|
86
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
87
|
+
try {
|
|
88
|
+
return ans === answer;
|
|
89
|
+
}
|
|
90
|
+
catch (err) {
|
|
91
|
+
return handleVEAError(err);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
const getIsInequalityTrueQuestion = (ops) => {
|
|
95
|
+
const a = randint(-10, 10, [0]);
|
|
96
|
+
const b = randint(-10, 10, [0]);
|
|
97
|
+
const c = randint(-10, 10, [0]);
|
|
98
|
+
const d = randint(-10, 10, [0]);
|
|
99
|
+
const x = randint(-10, 10);
|
|
100
|
+
const inequalitySign = coinFlip();
|
|
101
|
+
const left = add(multiply(a, "x"), b).toIdentifiers();
|
|
102
|
+
const right = add(multiply(c, "x"), -d).toIdentifiers();
|
|
103
|
+
const identifiers = {
|
|
104
|
+
a,
|
|
105
|
+
b,
|
|
106
|
+
c,
|
|
107
|
+
d,
|
|
108
|
+
x,
|
|
109
|
+
inequalitySign,
|
|
110
|
+
left,
|
|
111
|
+
right,
|
|
112
|
+
};
|
|
113
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
114
|
+
};
|
|
115
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
116
|
+
return {
|
|
117
|
+
answer: getAnswer(identifiers),
|
|
118
|
+
instruction: getInstruction(identifiers),
|
|
119
|
+
keys: getKeys(identifiers),
|
|
120
|
+
answerFormat: "tex",
|
|
121
|
+
identifiers,
|
|
122
|
+
hint: getHint(identifiers),
|
|
123
|
+
correction: getCorrection(identifiers),
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
export const isInequalityTrue = {
|
|
127
|
+
id: "isInequalityTrue",
|
|
128
|
+
label: "Vérifier si une inégalité est vraie",
|
|
129
|
+
isSingleStep: true,
|
|
130
|
+
generator: (nb, opts) => getDistinctQuestions(() => getIsInequalityTrueQuestion(opts), nb),
|
|
131
|
+
qcmTimer: 60,
|
|
132
|
+
freeTimer: 60,
|
|
133
|
+
getPropositions,
|
|
134
|
+
isAnswerValid,
|
|
135
|
+
subject: "Mathématiques",
|
|
136
|
+
getInstruction,
|
|
137
|
+
getHint,
|
|
138
|
+
getCorrection,
|
|
139
|
+
getAnswer,
|
|
140
|
+
getQuestionFromIdentifiers,
|
|
141
|
+
hasHintAndCorrection: true,
|
|
142
|
+
answerType: "QCU",
|
|
143
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
x: NodeIdentifiers;
|
|
5
|
+
y: NodeIdentifiers;
|
|
6
|
+
};
|
|
7
|
+
export declare const isPointOnCubicFunction: Exercise<Identifiers>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=isPointOnCubicFunction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isPointOnCubicFunction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/arithmetics/isPointOnCubicFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAM7C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,eAAe,CAAC;IACnB,CAAC,EAAE,eAAe,CAAC;CACpB,CAAC;AAiGF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAkBxD,CAAC"}
|