math-exercises 3.0.122 → 3.0.123
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.
|
@@ -193,7 +193,7 @@ const isAnswerValid = (ans, { answer, points, yValue }) => {
|
|
|
193
193
|
sorted.sort((a, b) => a - b);
|
|
194
194
|
for (let i = 0; i < sorted.length; i++) {
|
|
195
195
|
const validPointX = validPoints[i][0];
|
|
196
|
-
if (Math.abs(sorted[i] - validPointX) > 0.
|
|
196
|
+
if (Math.abs(sorted[i] - validPointX) > 0.4)
|
|
197
197
|
return false;
|
|
198
198
|
}
|
|
199
199
|
return true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"valuePercent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/valuePercent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"valuePercent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/valuePercent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AA+DF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAc9C,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { addValidProp, propWhile, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { numberVEA } from "../../../exercises/vea/numberVEA.js";
|
|
3
4
|
import { DecimalConstructor } from "../../../math/numbers/decimals/decimal.js";
|
|
4
5
|
import { randint } from "../../../math/utils/random/randint.js";
|
|
5
6
|
import { round } from "../../../math/utils/round.js";
|
|
@@ -50,7 +51,7 @@ const getPropositions = (n, { answer }) => {
|
|
|
50
51
|
return shuffleProps(propositions, n);
|
|
51
52
|
};
|
|
52
53
|
const isAnswerValid = (ans, { answer }) => {
|
|
53
|
-
return ans
|
|
54
|
+
return numberVEA(ans, answer);
|
|
54
55
|
};
|
|
55
56
|
export const valuePercent = {
|
|
56
57
|
id: "valuePercent",
|
|
@@ -108,7 +108,7 @@ const getGGBOptions = (identifiers) => {
|
|
|
108
108
|
});
|
|
109
109
|
};
|
|
110
110
|
const getKeys = () => {
|
|
111
|
-
return ["lbracket", "semicolon", "rbracket", "
|
|
111
|
+
return ["lbracket", "semicolon", "rbracket", "infty"];
|
|
112
112
|
};
|
|
113
113
|
const isAnswerValid = (ans, { answer }) => {
|
|
114
114
|
const parsed = intervalParser(ans, { allowCommaInsteadOfSemicolon: true });
|