math-exercises 3.0.84 → 3.0.85
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 +0 -7
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/decimalBoundingOnLine.d.ts +9 -0
- package/lib/exercises/math/calcul/arithmetics/decimalBoundingOnLine.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/decimalBoundingOnLine.js +171 -0
- package/lib/exercises/math/calcul/arithmetics/evalFractionExpression.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/evalFractionExpression.js +2 -3
- package/lib/exercises/math/calcul/arithmetics/index.d.ts +2 -0
- package/lib/exercises/math/calcul/arithmetics/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/index.js +2 -0
- package/lib/exercises/math/calcul/arithmetics/simplifyToFraction.d.ts +9 -0
- package/lib/exercises/math/calcul/arithmetics/simplifyToFraction.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/simplifyToFraction.js +168 -0
- package/lib/exercises/math/calcul/fractions/fractionForbiddenValue.d.ts +10 -0
- package/lib/exercises/math/calcul/fractions/fractionForbiddenValue.d.ts.map +1 -0
- package/lib/exercises/math/calcul/fractions/fractionForbiddenValue.js +100 -0
- 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/ordering/framing.d.ts.map +1 -1
- package/lib/exercises/math/calcul/ordering/framing.js +38 -8
- package/lib/exercises/math/functions/absolute/absoluteValueInequations.d.ts.map +1 -1
- package/lib/exercises/math/functions/absolute/absoluteValueInequations.js +34 -1
- package/lib/exercises/math/functions/basics/index.d.ts +0 -1
- 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 +1 -2
- package/lib/exercises/math/functions/basics/valueTableCompletion.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/valueTableCompletion.js +31 -104
- package/lib/exercises/math/functions/rationalFraction/rationalFractionForbiddenValue.d.ts.map +1 -1
- package/lib/exercises/math/functions/rationalFraction/rationalFractionForbiddenValue.js +26 -1
- package/lib/exercises/math/geometry/index.d.ts +1 -0
- package/lib/exercises/math/geometry/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/index.js +1 -0
- package/lib/exercises/math/geometry/intervals/index.d.ts +2 -0
- package/lib/exercises/math/geometry/intervals/index.d.ts.map +1 -0
- package/lib/exercises/math/geometry/intervals/index.js +1 -0
- package/lib/exercises/math/geometry/intervals/intervalOnGraph.d.ts +8 -0
- package/lib/exercises/math/geometry/intervals/intervalOnGraph.d.ts.map +1 -0
- package/lib/exercises/math/geometry/intervals/intervalOnGraph.js +156 -0
- package/lib/exercises/math/probaStat/basicStats/index.d.ts +1 -0
- package/lib/exercises/math/probaStat/basicStats/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/basicStats/index.js +1 -0
- package/lib/exercises/math/probaStat/basicStats/samplingFrequency.d.ts +7 -0
- package/lib/exercises/math/probaStat/basicStats/samplingFrequency.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/basicStats/samplingFrequency.js +106 -0
- package/lib/exercises/math/probaStat/getQuartileProportionQuestion.d.ts +12 -0
- package/lib/exercises/math/probaStat/getQuartileProportionQuestion.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/getQuartileProportionQuestion.js +178 -0
- package/lib/exercises/math/probaStat/index.d.ts +1 -0
- package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/index.js +1 -0
- package/lib/exercises/math/probaStat/stats1var/choseReasoningForIndicator.d.ts +4 -1
- package/lib/exercises/math/probaStat/stats1var/choseReasoningForIndicator.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/choseReasoningForIndicator.js +23 -9
- package/lib/index.d.ts +25 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/point.d.ts +1 -1
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +4 -1
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +1 -11
- package/lib/tests/exoTest.d.ts.map +1 -1
- package/lib/tests/exoTest.js +2 -9
- package/lib/tests/questionTest.d.ts.map +1 -1
- package/lib/tests/questionTest.js +2 -21
- package/lib/tree/nodes/functions/absNode.d.ts +2 -2
- package/lib/tree/nodes/functions/absNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/absNode.js +2 -2
- package/lib/tree/nodes/functions/sqrtNode.d.ts +1 -1
- package/lib/tree/nodes/functions/sqrtNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sqrtNode.js +2 -1
- package/lib/tree/nodes/numbers/constantNode.d.ts +1 -1
- package/lib/tree/nodes/numbers/constantNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/constantNode.js +2 -1
- package/lib/tree/nodes/operators/fractionNode.js +44 -9
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +14 -4
- 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 +5 -10
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"samplingFrequency.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/basicStats/samplingFrequency.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAwGF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAoBnD,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
4
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
5
|
+
import { round } from "../../../../math/utils/round.js";
|
|
6
|
+
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
7
|
+
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
8
|
+
import { average } from "../../../../utils/average.js";
|
|
9
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
10
|
+
const propositions = [];
|
|
11
|
+
addValidProp(propositions, answer);
|
|
12
|
+
const samples = identifiers.samples;
|
|
13
|
+
const avg = average(samples);
|
|
14
|
+
while (propositions.length < n) {
|
|
15
|
+
tryToAddWrongProp(propositions, round(avg + (coinFlip() ? randint(10, 30) / 100 : randint(-30, -10) / 100), 2).frenchify());
|
|
16
|
+
}
|
|
17
|
+
return shuffleProps(propositions, n);
|
|
18
|
+
};
|
|
19
|
+
const getAnswer = (identifiers) => {
|
|
20
|
+
const avg = average(identifiers.samples);
|
|
21
|
+
return round(avg, 1).frenchify();
|
|
22
|
+
};
|
|
23
|
+
const getInstruction = (identifiers) => {
|
|
24
|
+
const length = identifiers.samples.length;
|
|
25
|
+
return `Ce graphique donne les fréquences $${length}$ échantillons d'une expérience aléatoire. Estimer la probabilité de l'évènement $A$.`;
|
|
26
|
+
};
|
|
27
|
+
const getHint = (identifiers) => {
|
|
28
|
+
return `Chaque échantillon donne une valeur approximative proche de la probabilité réelle.
|
|
29
|
+
|
|
30
|
+
Tu peux estimer cette probabilité en déterminant graphiquement la moyenne des fréquences des échantillons.`;
|
|
31
|
+
};
|
|
32
|
+
const getCorrection = (identifiers) => {
|
|
33
|
+
const { samples } = identifiers;
|
|
34
|
+
const avg = getAnswer(identifiers);
|
|
35
|
+
return `On lit graphiquement que la moyenne des fréquences est environ $${avg}$. Puisque le nombre d'échantillons est suffisant, on peut donc estimer que la probabilité de l'évènement $A$ vaut environ $${avg}$.`;
|
|
36
|
+
};
|
|
37
|
+
const getGGBOptions = (identifiers) => {
|
|
38
|
+
const commands = identifiers.samples.map((y, idx) => `(${idx}, ${y})`);
|
|
39
|
+
const yMax = Math.max(...identifiers.samples);
|
|
40
|
+
const ggb = new GeogebraConstructor({
|
|
41
|
+
commands,
|
|
42
|
+
lockedAxesRatio: 5,
|
|
43
|
+
gridDistance: [1, 0.1],
|
|
44
|
+
xAxis: {
|
|
45
|
+
showPositive: true,
|
|
46
|
+
label: "N° d'échantillon",
|
|
47
|
+
},
|
|
48
|
+
yAxis: {
|
|
49
|
+
label: "Fréquence de l'évènement A",
|
|
50
|
+
},
|
|
51
|
+
fontSize: 16,
|
|
52
|
+
});
|
|
53
|
+
return ggb.getOptions({
|
|
54
|
+
coords: [-1, identifiers.samples.length + 1, -0.1, yMax + 0.3],
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
const getKeys = (identifiers) => {
|
|
58
|
+
return [];
|
|
59
|
+
};
|
|
60
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
61
|
+
// On autorise une erreur de +/- 5% sur la frequence moyenne
|
|
62
|
+
const ev = parseAlgebraic(ans).evaluate();
|
|
63
|
+
const ansEv = parseAlgebraic(answer).evaluate();
|
|
64
|
+
return Math.abs(ev - ansEv) < 5 / 100;
|
|
65
|
+
};
|
|
66
|
+
const getSamplingFrequencyQuestion = (opts) => {
|
|
67
|
+
const freq = randint(2, 10) * 10; // multiple de 10 pour simplifier l'estimation pour l'utilisateur
|
|
68
|
+
let samples = [];
|
|
69
|
+
const length = randint(9, 14);
|
|
70
|
+
for (let i = 0; i < length; i++) {
|
|
71
|
+
samples.push(round((freq + randint(-10, 10)) / 100, 2));
|
|
72
|
+
}
|
|
73
|
+
const identifiers = { samples };
|
|
74
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
75
|
+
};
|
|
76
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
77
|
+
return {
|
|
78
|
+
answer: getAnswer(identifiers),
|
|
79
|
+
instruction: getInstruction(identifiers),
|
|
80
|
+
keys: getKeys(identifiers),
|
|
81
|
+
answerFormat: "tex",
|
|
82
|
+
identifiers,
|
|
83
|
+
hint: getHint(identifiers),
|
|
84
|
+
correction: getCorrection(identifiers),
|
|
85
|
+
ggbOptions: getGGBOptions(identifiers),
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
export const samplingFrequency = {
|
|
89
|
+
id: "samplingFrequency",
|
|
90
|
+
label: "Estimer une probabilité à partir d'un graphique de fréquences pour un nombre suffisant d'échantillons",
|
|
91
|
+
isSingleStep: true,
|
|
92
|
+
generator: (nb, opts) => getDistinctQuestions(() => getSamplingFrequencyQuestion(opts), nb),
|
|
93
|
+
qcmTimer: 60,
|
|
94
|
+
freeTimer: 60,
|
|
95
|
+
getPropositions,
|
|
96
|
+
isAnswerValid,
|
|
97
|
+
subject: "Mathématiques",
|
|
98
|
+
getHint,
|
|
99
|
+
getCorrection,
|
|
100
|
+
getInstruction,
|
|
101
|
+
getAnswer,
|
|
102
|
+
getGGBOptions,
|
|
103
|
+
hasGeogebra: true,
|
|
104
|
+
hasHintAndCorrection: true,
|
|
105
|
+
getQuestionFromIdentifiers,
|
|
106
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
labels: string[];
|
|
4
|
+
serie1: number[];
|
|
5
|
+
serie2: number[];
|
|
6
|
+
a: number;
|
|
7
|
+
b: number;
|
|
8
|
+
isBetween: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const getQuartileProportionQuestion: Exercise<Identifiers>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=getQuartileProportionQuestion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getQuartileProportionQuestion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/getQuartileProportionQuestion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAwMF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAqB/D,CAAC"}
|
|
@@ -0,0 +1,178 @@
|
|
|
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
|
+
import { dollarize } from "../../../utils/latex/dollarize.js";
|
|
7
|
+
import { mdTable } from "../../../utils/markdown/mdTable.js";
|
|
8
|
+
const getPropositions = (n, { answer }) => {
|
|
9
|
+
const propositions = [];
|
|
10
|
+
addValidProp(propositions, answer, "raw");
|
|
11
|
+
tryToAddWrongProp(propositions, "Série $1$", "raw");
|
|
12
|
+
tryToAddWrongProp(propositions, "Série $2$", "raw");
|
|
13
|
+
return shuffleProps(propositions, n);
|
|
14
|
+
};
|
|
15
|
+
const getAnswer = ({ serie1, serie2, a, b, isBetween, }) => {
|
|
16
|
+
const mainSeries = serie1.includes(b) ? serie1 : serie2;
|
|
17
|
+
const otherSeries = mainSeries === serie1 ? serie2 : serie1;
|
|
18
|
+
const indexOfB = mainSeries.indexOf(b);
|
|
19
|
+
const indexOfA = mainSeries.indexOf(a);
|
|
20
|
+
const diff = indexOfB - indexOfA + 1;
|
|
21
|
+
let count = 0;
|
|
22
|
+
for (let idx = 0; idx < otherSeries.length; idx++) {
|
|
23
|
+
const val = otherSeries[idx];
|
|
24
|
+
if (isBetween) {
|
|
25
|
+
if ((val >= a || otherSeries[idx + 1] > a) &&
|
|
26
|
+
(val <= b || otherSeries[idx - 1] < b)) {
|
|
27
|
+
count++;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
if (val < b) {
|
|
32
|
+
count++;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const mainSeriesText = mainSeries === serie1 ? "Série $1$" : "Série $2$";
|
|
37
|
+
const otherSeriesText = mainSeries === serie1 ? "Série $2$" : "Série $1$";
|
|
38
|
+
const condition = isBetween ? diff >= count : indexOfB < count;
|
|
39
|
+
return condition ? mainSeriesText : otherSeriesText;
|
|
40
|
+
};
|
|
41
|
+
const getInstruction = ({ labels, serie1, serie2, a, b, isBetween, }) => {
|
|
42
|
+
const question = isBetween
|
|
43
|
+
? `Quelle série a la plus grande proportion de valeurs entre $${a}$ et $${b}$ ?`
|
|
44
|
+
: `Quelle série a la plus grande proportion de valeurs supérieures à $${b}$ ?`;
|
|
45
|
+
return (`${question}\n\n` +
|
|
46
|
+
mdTable([
|
|
47
|
+
["", ...labels.map((l, i) => (i === 1 || i === 3 ? dollarize(l) : l))],
|
|
48
|
+
["Série $1$", ...serie1.map((l) => dollarize(l))],
|
|
49
|
+
["Série $2$", ...serie2.map((l) => dollarize(l))],
|
|
50
|
+
]));
|
|
51
|
+
};
|
|
52
|
+
const getHint = (identifiers) => {
|
|
53
|
+
return `
|
|
54
|
+
Les quartiles permettent de découper une série en quatre parties égales :
|
|
55
|
+
|
|
56
|
+
- $Q_1$ (premier quartile) : au moins $25 \\%$ des valeurs sont inférieures ou égales à cette valeur.
|
|
57
|
+
- Médiane : au moins $50 \\%$ des valeurs sont inférieures ou égales à cette valeur.
|
|
58
|
+
- $Q_3$ (troisième quartile) : au moins $75 \\%$ des valeurs sont inférieures ou égales à cette valeur.
|
|
59
|
+
`;
|
|
60
|
+
};
|
|
61
|
+
const getCorrection = (identifiers) => {
|
|
62
|
+
const { labels, serie1, serie2, a, b, isBetween } = identifiers;
|
|
63
|
+
const isBInSerie1 = serie1.includes(b);
|
|
64
|
+
const mainSeries = isBInSerie1 ? serie1 : serie2;
|
|
65
|
+
const otherSeries = isBInSerie1 ? serie2 : serie1;
|
|
66
|
+
const mainSeriesLabel = isBInSerie1 ? "série $1$" : "série $2$";
|
|
67
|
+
const otherSeriesLabel = isBInSerie1 ? "série $2$" : "série $1$";
|
|
68
|
+
const indexOfA = mainSeries.indexOf(a);
|
|
69
|
+
const indexOfB = mainSeries.indexOf(b);
|
|
70
|
+
let i = 0;
|
|
71
|
+
for (let idx = 0; idx < otherSeries.length; idx++) {
|
|
72
|
+
const val = otherSeries[idx];
|
|
73
|
+
if (isBetween) {
|
|
74
|
+
if ((val >= a || otherSeries[idx + 1] > a) &&
|
|
75
|
+
(val <= b || otherSeries[idx - 1] < b)) {
|
|
76
|
+
i++;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
if (val < b) {
|
|
81
|
+
i++;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
const quartilePercentages = [0, 25, 50, 75, 100];
|
|
86
|
+
const labelA = labels[indexOfA];
|
|
87
|
+
const labelB = labels[indexOfB];
|
|
88
|
+
const valueA = a;
|
|
89
|
+
const valueB = b;
|
|
90
|
+
const diff = indexOfB - indexOfA + 1;
|
|
91
|
+
const percentageBetween = quartilePercentages[diff - 1];
|
|
92
|
+
const percentageAbove = 100 - quartilePercentages[indexOfB];
|
|
93
|
+
const answer = getAnswer(identifiers);
|
|
94
|
+
const answerFormatted = answer === "Série $1$" ? "série $1$" : "série $2$";
|
|
95
|
+
const decideWord = answerFormatted === mainSeriesLabel ? "moins" : "plus";
|
|
96
|
+
const proportionB = isBetween
|
|
97
|
+
? `$${percentageBetween}\\%$ des valeurs sont entre $${valueA}$ et $${valueB}$.\n\n`
|
|
98
|
+
: `$${percentageAbove}\\%$ des valeurs sont supérieures à $${valueB}$.\n\n`;
|
|
99
|
+
const proportionOther = i === 0
|
|
100
|
+
? `Il n'y a aucune valeur dans l'intervalle $[${valueA}; ${valueB}]$.\n\n`
|
|
101
|
+
: isBetween
|
|
102
|
+
? `${decideWord} $${percentageBetween}\\%$ des valeurs sont entre $${valueA}$ et $${valueB}$.\n\n`
|
|
103
|
+
: `${otherSeries[indexOfB] > valueB ? "plus" : "moins"} de $${100 - quartilePercentages[i - 1]}\\%$ des valeurs sont supérieures à $${valueB}$.\n\n`;
|
|
104
|
+
const comparison = isBetween
|
|
105
|
+
? `La ${answer} a donc une proportion plus grande de valeurs dans l'intervalle.`
|
|
106
|
+
: `La ${answer} a donc une proportion plus grande de valeurs supérieures à $${valueB}$.`;
|
|
107
|
+
return isBetween
|
|
108
|
+
? `On peut estimer cette proportion en observant la position des valeurs $${valueA}$ et $${valueB}$ dans chaque série :
|
|
109
|
+
|
|
110
|
+
- Dans la ${mainSeriesLabel}, on a $${labelA} = ${valueA}$ et $${labelB} = ${valueB}$, donc ${proportionB}
|
|
111
|
+
- Dans la ${otherSeriesLabel}, on a $${labelA} = ${otherSeries[indexOfA]}$ et $${labelB} = ${otherSeries[indexOfB]}$, donc ${proportionOther}
|
|
112
|
+
|
|
113
|
+
${comparison}`
|
|
114
|
+
: `On peut estimer cette proportion en observant la position de la valeur $${valueB}$ dans chaque série :
|
|
115
|
+
|
|
116
|
+
- Dans la ${mainSeriesLabel}, on a $${labelB} = ${valueB}$, donc ${proportionB}
|
|
117
|
+
- Dans la ${otherSeriesLabel}, on a $${labelB} = ${otherSeries[indexOfB]}$, ${proportionOther}
|
|
118
|
+
|
|
119
|
+
${comparison}`;
|
|
120
|
+
};
|
|
121
|
+
const getKeys = () => [];
|
|
122
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
123
|
+
try {
|
|
124
|
+
throw Error("VEA not implemented");
|
|
125
|
+
}
|
|
126
|
+
catch (err) {
|
|
127
|
+
return handleVEAError(err);
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
const makeQuartileSeries = (min, exclude) => {
|
|
131
|
+
const serie = [min];
|
|
132
|
+
for (let i = 0; i < 4; i++) {
|
|
133
|
+
const prev = serie[serie.length - 1];
|
|
134
|
+
serie.push(randint(prev + 1, prev + 6, exclude));
|
|
135
|
+
}
|
|
136
|
+
return serie;
|
|
137
|
+
};
|
|
138
|
+
const getGetQuartileProportionQuestionQuestion = () => {
|
|
139
|
+
const labels = ["Min", "Q_1", "Méd", "Q_3", "Max"];
|
|
140
|
+
const min = randint(0, 10);
|
|
141
|
+
const serie1 = makeQuartileSeries(min);
|
|
142
|
+
const serie2 = makeQuartileSeries(min, serie1);
|
|
143
|
+
const isBetween = coinFlip();
|
|
144
|
+
const chosenSerie = coinFlip() ? serie1 : serie2;
|
|
145
|
+
const indexOfA = randint(0, serie1.length - (isBetween ? 1 : 2));
|
|
146
|
+
const a = chosenSerie[indexOfA];
|
|
147
|
+
const indexOfB = randint(indexOfA + 1, isBetween ? chosenSerie.length : chosenSerie.length - 1);
|
|
148
|
+
const b = chosenSerie[indexOfB];
|
|
149
|
+
const identifiers = { labels, serie1, serie2, a, b, isBetween };
|
|
150
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
151
|
+
};
|
|
152
|
+
const getQuestionFromIdentifiers = (identifiers) => ({
|
|
153
|
+
answer: getAnswer(identifiers),
|
|
154
|
+
instruction: getInstruction(identifiers),
|
|
155
|
+
keys: getKeys(identifiers),
|
|
156
|
+
answerFormat: "raw",
|
|
157
|
+
identifiers,
|
|
158
|
+
hint: getHint(identifiers),
|
|
159
|
+
correction: getCorrection(identifiers),
|
|
160
|
+
});
|
|
161
|
+
export const getQuartileProportionQuestion = {
|
|
162
|
+
id: "getQuartileProportionQuestion",
|
|
163
|
+
label: "Comparer et interpréter les indicateurs de deux séries statistiques",
|
|
164
|
+
isSingleStep: true,
|
|
165
|
+
generator: (nb, opts) => getDistinctQuestions(() => getGetQuartileProportionQuestionQuestion(opts), nb),
|
|
166
|
+
qcmTimer: 60,
|
|
167
|
+
freeTimer: 60,
|
|
168
|
+
getPropositions,
|
|
169
|
+
isAnswerValid,
|
|
170
|
+
subject: "Mathématiques",
|
|
171
|
+
getInstruction,
|
|
172
|
+
getHint,
|
|
173
|
+
getCorrection,
|
|
174
|
+
getAnswer,
|
|
175
|
+
getQuestionFromIdentifiers,
|
|
176
|
+
hasHintAndCorrection: true,
|
|
177
|
+
answerType: "QCU",
|
|
178
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,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,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,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,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oCAAoC,CAAC"}
|
|
@@ -3,6 +3,9 @@ type Identifiers = {
|
|
|
3
3
|
indicatorAsked: string;
|
|
4
4
|
values: number[];
|
|
5
5
|
};
|
|
6
|
-
|
|
6
|
+
type Options = {
|
|
7
|
+
indicators: string[];
|
|
8
|
+
};
|
|
9
|
+
export declare const choseReasoningForIndicator: Exercise<Identifiers, Options>;
|
|
7
10
|
export {};
|
|
8
11
|
//# sourceMappingURL=choseReasoningForIndicator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"choseReasoningForIndicator.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/choseReasoningForIndicator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"choseReasoningForIndicator.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/choseReasoningForIndicator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AA2IF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAiBrE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, GeneratorOptionTarget, GeneratorOptionType, } from "../../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
4
4
|
import { AddNode } from "../../../../tree/nodes/operators/addNode.js";
|
|
@@ -6,6 +6,16 @@ import { operatorComposition } from "../../../../tree/utilities/operatorComposit
|
|
|
6
6
|
import { random } from "../../../../utils/alea/random.js";
|
|
7
7
|
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
8
8
|
import { average } from "../../../../utils/average.js";
|
|
9
|
+
const options = [
|
|
10
|
+
{
|
|
11
|
+
id: "indicators",
|
|
12
|
+
label: "Indicateurs",
|
|
13
|
+
target: GeneratorOptionTarget.generation,
|
|
14
|
+
type: GeneratorOptionType.multiselect,
|
|
15
|
+
defaultValue: ["Moyenne", "Médiane"],
|
|
16
|
+
values: ["Moyenne", "Médiane"],
|
|
17
|
+
},
|
|
18
|
+
];
|
|
9
19
|
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
10
20
|
const propositions = [];
|
|
11
21
|
addValidProp(propositions, answer, "raw");
|
|
@@ -52,7 +62,7 @@ const getCorrection = (identifiers) => {
|
|
|
52
62
|
: `La médiane est la valeur centrale de la série : c'est à dire qu'il y a autant de valeurs inférieures à elle que de valeurs supérieures. Ici, ${getAnswer(identifiers).toLocaleLowerCase()}.
|
|
53
63
|
`;
|
|
54
64
|
};
|
|
55
|
-
const getChoseReasoningForIndicatorQuestion = (
|
|
65
|
+
const getChoseReasoningForIndicatorQuestion = (opts) => {
|
|
56
66
|
const max = 2 * randint(5, 20);
|
|
57
67
|
const x = max / 2;
|
|
58
68
|
let otherValues = [];
|
|
@@ -74,18 +84,18 @@ const getChoseReasoningForIndicatorQuestion = (ops) => {
|
|
|
74
84
|
shuffled.splice(3, 0, x);
|
|
75
85
|
const identifiers = {
|
|
76
86
|
values: shuffled,
|
|
77
|
-
indicatorAsked: random(["moyenne", "médiane"]),
|
|
87
|
+
indicatorAsked: random(opts?.indicators ?? ["moyenne", "médiane"]),
|
|
78
88
|
};
|
|
79
|
-
return getQuestionFromIdentifiers(identifiers);
|
|
89
|
+
return getQuestionFromIdentifiers(identifiers, opts);
|
|
80
90
|
};
|
|
81
|
-
const getQuestionFromIdentifiers = (identifiers) => {
|
|
91
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
82
92
|
const question = {
|
|
83
|
-
answer: getAnswer(identifiers),
|
|
84
|
-
instruction: getInstruction(identifiers),
|
|
93
|
+
answer: getAnswer(identifiers, opts),
|
|
94
|
+
instruction: getInstruction(identifiers, opts),
|
|
85
95
|
answerFormat: "raw",
|
|
86
96
|
identifiers,
|
|
87
|
-
hint: getHint(identifiers),
|
|
88
|
-
correction: getCorrection(identifiers),
|
|
97
|
+
hint: getHint(identifiers, opts),
|
|
98
|
+
correction: getCorrection(identifiers, opts),
|
|
89
99
|
};
|
|
90
100
|
return question;
|
|
91
101
|
};
|
|
@@ -101,4 +111,8 @@ export const choseReasoningForIndicator = {
|
|
|
101
111
|
answerType: "QCU",
|
|
102
112
|
getQuestionFromIdentifiers,
|
|
103
113
|
hasHintAndCorrection: true,
|
|
114
|
+
options,
|
|
115
|
+
pdfOptions: {
|
|
116
|
+
shouldSpreadPropositions: true,
|
|
117
|
+
},
|
|
104
118
|
};
|
package/lib/index.d.ts
CHANGED
|
@@ -106,6 +106,12 @@ declare const mathExercises: (Exercise<{
|
|
|
106
106
|
}, {}> | Exercise<{
|
|
107
107
|
expr: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
108
108
|
x: number;
|
|
109
|
+
}, {}> | Exercise<{
|
|
110
|
+
type: number;
|
|
111
|
+
expr: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
112
|
+
}, {}> | Exercise<{
|
|
113
|
+
point: import("./math/geometry/point.js").PointIdentifiers;
|
|
114
|
+
bounding: number;
|
|
109
115
|
}, {}> | Exercise<{
|
|
110
116
|
integerFirst: boolean;
|
|
111
117
|
integer: number;
|
|
@@ -182,6 +188,11 @@ declare const mathExercises: (Exercise<{
|
|
|
182
188
|
a: number;
|
|
183
189
|
n: number;
|
|
184
190
|
isSimplified: boolean;
|
|
191
|
+
}, {}> | Exercise<{
|
|
192
|
+
a: number;
|
|
193
|
+
b: number;
|
|
194
|
+
c: number;
|
|
195
|
+
d: number;
|
|
185
196
|
}, {}> | Exercise<{
|
|
186
197
|
numbers: number[];
|
|
187
198
|
}, {}> | Exercise<{
|
|
@@ -895,9 +906,6 @@ declare const mathExercises: (Exercise<{
|
|
|
895
906
|
inegalitySymbol: import("./math/inequations/inequation.js").InegalitySymbols;
|
|
896
907
|
a: number;
|
|
897
908
|
b: number;
|
|
898
|
-
}, {}> | Exercise<{
|
|
899
|
-
coeffs: number[];
|
|
900
|
-
initTable: string[][];
|
|
901
909
|
}, {}> | Exercise<{
|
|
902
910
|
k: number;
|
|
903
911
|
}, {}> | Exercise<{
|
|
@@ -1565,6 +1573,8 @@ declare const mathExercises: (Exercise<{
|
|
|
1565
1573
|
}, {}> | Exercise<{
|
|
1566
1574
|
triangleIdentifiers: import("./math/geometry/triangles/triangle.js").TriangleIdentifiers;
|
|
1567
1575
|
angleAsked: number;
|
|
1576
|
+
}, {}> | Exercise<{
|
|
1577
|
+
intervalNodeIdentifiers: import("./tree/nodes/sets/intervalNode.js").IntervalNodeIdentifiers;
|
|
1568
1578
|
}, {}> | Exercise<{
|
|
1569
1579
|
coeffs: number[];
|
|
1570
1580
|
to: "+\\infty" | "-\\infty";
|
|
@@ -1822,7 +1832,9 @@ declare const mathExercises: (Exercise<{
|
|
|
1822
1832
|
}, {}> | Exercise<{
|
|
1823
1833
|
indicatorAsked: string;
|
|
1824
1834
|
values: number[];
|
|
1825
|
-
}, {
|
|
1835
|
+
}, {
|
|
1836
|
+
indicators: string[];
|
|
1837
|
+
}> | Exercise<{
|
|
1826
1838
|
labels: number[];
|
|
1827
1839
|
serie1: number[];
|
|
1828
1840
|
serie2: number[];
|
|
@@ -1908,6 +1920,8 @@ declare const mathExercises: (Exercise<{
|
|
|
1908
1920
|
}> | Exercise<{
|
|
1909
1921
|
values: number[];
|
|
1910
1922
|
target: number;
|
|
1923
|
+
}, {}> | Exercise<{
|
|
1924
|
+
samples: number[];
|
|
1911
1925
|
}, {}> | Exercise<{
|
|
1912
1926
|
xValuesIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers[];
|
|
1913
1927
|
yValuesIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers[];
|
|
@@ -1976,6 +1990,13 @@ declare const mathExercises: (Exercise<{
|
|
|
1976
1990
|
}, {}> | Exercise<MathExercises.Identifiers, {}> | Exercise<{
|
|
1977
1991
|
a: number;
|
|
1978
1992
|
type: number;
|
|
1993
|
+
}, {}> | Exercise<{
|
|
1994
|
+
labels: string[];
|
|
1995
|
+
serie1: number[];
|
|
1996
|
+
serie2: number[];
|
|
1997
|
+
a: number;
|
|
1998
|
+
b: number;
|
|
1999
|
+
isBetween: boolean;
|
|
1979
2000
|
}, {}> | Exercise<{
|
|
1980
2001
|
firstValue: number;
|
|
1981
2002
|
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":"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,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -44,7 +44,7 @@ export declare class Point {
|
|
|
44
44
|
equals(B: Point): boolean;
|
|
45
45
|
isAligned(B: Point, C: Point): boolean;
|
|
46
46
|
toMathString(): string;
|
|
47
|
-
toGGBCommand({ isFixed, showLabel, style, size, color, }?: ToGGBCommandsProps): string[];
|
|
47
|
+
toGGBCommand({ isFixed, showLabel, style, size, color, label, }?: ToGGBCommandsProps): string[];
|
|
48
48
|
rotate(angle: number, center: Point): Point;
|
|
49
49
|
centralSymetric(center: Point, name?: string): Point;
|
|
50
50
|
project(line: Line, name?: string): Point;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"point.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/point.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,aAAa,EACb,eAAe,EAChB,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sDAAsD,CAAC;AAC1F,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAM7C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAIvC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,eAAe,CAAC;IACnB,CAAC,EAAE,eAAe,CAAC;CACpB,CAAC;AACF,8BAAsB,gBAAgB;IACpC,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE;IAGrC,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM;IAKhC,MAAM,CAAC,MAAM,CAAC,IAAI,SAAM;IAGxB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,SAAM,EAAE,GAAG,SAAK,GAAG,KAAK;I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B;IAKhD,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe;CAGhC"}
|
|
@@ -123,12 +123,15 @@ export class Point {
|
|
|
123
123
|
toMathString() {
|
|
124
124
|
return `(${this.x.toMathString()}, ${this.y.toMathString()})`;
|
|
125
125
|
}
|
|
126
|
-
toGGBCommand({ isFixed = true, showLabel = true, style, size, color, } = {}) {
|
|
126
|
+
toGGBCommand({ isFixed = true, showLabel = true, style, size, color, label, } = {}) {
|
|
127
127
|
const commands = [
|
|
128
128
|
`${this.name} = (${this.x.toMathString()}, ${this.y.toMathString()})`,
|
|
129
129
|
`SetFixed(${this.name},${isFixed ? "true" : "false"})`,
|
|
130
130
|
`ShowLabel(${this.name},${showLabel ? "true" : "false"})`,
|
|
131
131
|
];
|
|
132
|
+
if (label !== undefined) {
|
|
133
|
+
commands.push(`SetCaption(${this.name}, "${label}")`);
|
|
134
|
+
}
|
|
132
135
|
if (style !== undefined) {
|
|
133
136
|
commands.push(`SetPointStyle(${this.name}, ${style})`);
|
|
134
137
|
}
|
package/lib/playground.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../src/playground.ts"],"names":[],"mappings":"AAmCA,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../src/playground.ts"],"names":[],"mappings":"AAmCA,eAAO,MAAM,UAAU,YAAW,CAAC"}
|
package/lib/playground.js
CHANGED
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { multiply } from "./tree/nodes/operators/multiplyNode.js";
|
|
3
|
-
export const playground = () => {
|
|
4
|
-
console.log(multiply(frac(1, 3), frac(-1, 3))
|
|
5
|
-
.simplify({
|
|
6
|
-
towardsDistribute: true,
|
|
7
|
-
forbidFactorize: true,
|
|
8
|
-
forceDistributeFractions: true,
|
|
9
|
-
})
|
|
10
|
-
.toTex());
|
|
11
|
-
};
|
|
1
|
+
export const playground = () => { };
|
|
@@ -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;;;;CA8EpC,CAAC"}
|
package/lib/tests/exoTest.js
CHANGED
|
@@ -19,16 +19,13 @@ 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" &&
|
|
23
|
-
exo.answerType !== "GGB" &&
|
|
24
|
-
exo.answerType !== "valueTable") {
|
|
22
|
+
if (exo.answerType !== "free" && exo.answerType !== "GGB") {
|
|
25
23
|
if (!exo.getPropositions)
|
|
26
24
|
throw new Error(`exo ${exo.id} has no getPropositions`);
|
|
27
25
|
}
|
|
28
26
|
if (exo.answerType !== "QCM" &&
|
|
29
27
|
exo.answerType !== "QCU" &&
|
|
30
|
-
exo.answerType !== "GGB"
|
|
31
|
-
exo.answerType !== "valueTable") {
|
|
28
|
+
exo.answerType !== "GGB") {
|
|
32
29
|
if (!exo.isAnswerValid)
|
|
33
30
|
throw new Error(`exo ${exo.id} has no isAnswerValid`);
|
|
34
31
|
}
|
|
@@ -36,10 +33,6 @@ export const exoTest = (exo) => {
|
|
|
36
33
|
if (!exo.isGGBAnswerValid)
|
|
37
34
|
throw new Error(`exo ${exo.id} has no isGGBAnswerValid`);
|
|
38
35
|
}
|
|
39
|
-
if (exo.answerType === "valueTable") {
|
|
40
|
-
if (!exo.isAnswerTableValid)
|
|
41
|
-
throw new Error(`exo ${exo.id} has no isAnswerTableValid`);
|
|
42
|
-
}
|
|
43
36
|
questions.forEach((question) => {
|
|
44
37
|
const times = questionTest(exo, question);
|
|
45
38
|
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;;;CAoL7D,CAAC"}
|