From 87b76246dc000d9dcdc85c75a289f8f0c8c66b34 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 24 Oct 2021 01:29:25 +0100 Subject: [PATCH] fixed wpm validation not working. closes #2029 --- backend/handlers/validation.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/handlers/validation.js b/backend/handlers/validation.js index 5912cb624..6f6e89e8b 100644 --- a/backend/handlers/validation.js +++ b/backend/handlers/validation.js @@ -26,8 +26,9 @@ function validateResult(result) { ); return false; } - let wpm = roundTo2((result.correctChars * (60 / result.testDuration)) / 5); + let wpm = roundTo2((result.charStats[0] * (60 / result.testDuration)) / 5); if ( + isNaN(wpm) || wpm < result.wpm - result.wpm * 0.01 || wpm > result.wpm + result.wpm * 0.01 ) {