From 6a8ee9018e8a2d61f96df2ff6f0e0e484a6ae3e1 Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 15 Sep 2020 17:55:56 +0100 Subject: [PATCH] fixed live wpm not considering correct but not submitted words fixed raw not considering not submitted words - raw graph should be smoother --- public/js/script.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/js/script.js b/public/js/script.js index 2fd8661d9..35c075816 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -2773,6 +2773,10 @@ function liveWpmAndRaw() { } chars += inputHistory[i].length; } + if (wordsList[currentWordIndex] === currentInput) { + correctWordChars += currentInput.length; + } + chars += currentInput.length; let testNow = Date.now(); let testSeconds = (testNow - testStart) / 1000; let wpm = Math.round(((correctWordChars + spaces) * (60 / testSeconds)) / 5);