mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-11-10 17:04:49 +08:00
checking for consistency only when there is no funbox,
removing raw check due to new raw calculation
This commit is contained in:
parent
41dd0ace1f
commit
1f1734ae5d
1 changed files with 17 additions and 13 deletions
|
@ -828,18 +828,18 @@ function validateResult(result) {
|
|||
);
|
||||
return false;
|
||||
}
|
||||
if (result.allChars != undefined) {
|
||||
let raw = roundTo2((result.allChars * (60 / result.testDuration)) / 5);
|
||||
if (
|
||||
raw < result.rawWpm - result.rawWpm * 0.01 ||
|
||||
raw > result.rawWpm + result.rawWpm * 0.01
|
||||
) {
|
||||
console.error(
|
||||
`Could not validate result for ${result.uid}. raw ${raw} != ${result.rawWpm}`
|
||||
);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// if (result.allChars != undefined) {
|
||||
// let raw = roundTo2((result.allChars * (60 / result.testDuration)) / 5);
|
||||
// if (
|
||||
// raw < result.rawWpm - result.rawWpm * 0.01 ||
|
||||
// raw > result.rawWpm + result.rawWpm * 0.01
|
||||
// ) {
|
||||
// console.error(
|
||||
// `Could not validate result for ${result.uid}. raw ${raw} != ${result.rawWpm}`
|
||||
// );
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
if (result.mode === "time" && (result.mode2 === 15 || result.mode2 === 60)) {
|
||||
let keyPressTimeSum =
|
||||
result.keySpacing.reduce((total, val) => {
|
||||
|
@ -870,7 +870,11 @@ function validateResult(result) {
|
|||
if (result.chartData.wpm.filter((w) => w > 400).length > 0) return false;
|
||||
}
|
||||
|
||||
if (result.consistency < 10) return false;
|
||||
if (
|
||||
(result.funbox === undefined || result.funbox === "none") &&
|
||||
result.consistency < 10
|
||||
)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue