fixed live wpm not considering correct but not submitted words

fixed raw not considering not submitted words - raw graph should be smoother
This commit is contained in:
Jack 2020-09-15 17:55:56 +01:00
parent ee616b5151
commit 6a8ee9018e

View file

@ -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);