From a4c60fd3878f3e8186a020b0d09c80466cff301b Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 13 Dec 2020 23:43:37 +0000 Subject: [PATCH] sub second runs will now not have an extra data point on the graph --- src/js/script.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/js/script.js b/src/js/script.js index 3e7a670d6..fbcf8fd52 100644 --- a/src/js/script.js +++ b/src/js/script.js @@ -1122,9 +1122,9 @@ function compareInput(showError) { currentCorrected = ""; //last character typed, show result if (!resultVisible) { - if (keypressPerSecond.length === 0) { - keypressPerSecond.push(currentKeypress); - } + // if (keypressPerSecond.length === 0) { + // keypressPerSecond.push(currentKeypress); + // } lastSecondNotRound = true; showResult(); } @@ -1711,6 +1711,12 @@ function showCrown() { let resultCalculating = false; function showResult(difficultyFailed = false) { + console.log(keypressPerSecond); + console.log(errorsPerSecond); + console.log(wpmHistory); + console.log(rawHistory); + console.log("-"); + resultCalculating = true; resultVisible = true; testEnd = performance.now(); @@ -1896,6 +1902,11 @@ function showResult(difficultyFailed = false) { wpmOverTimeChart.data.labels = labels; + console.log(keypressPerSecond); + console.log(errorsPerSecond); + console.log(wpmHistory); + console.log(rawHistory); + let rawWpmPerSecondRaw = keypressPerSecond.map((f) => Math.round((f.count / 5) * 60) );