From eb62aaa70b99be2f1db4fc493f1104051d31eab5 Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 10 Nov 2020 18:07:42 +0000 Subject: [PATCH] fixed word highlight causing difficulties to not work as intended. fixes #550 --- src/js/script.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/js/script.js b/src/js/script.js index 4abae3d95..d0fa67e25 100644 --- a/src/js/script.js +++ b/src/js/script.js @@ -941,6 +941,23 @@ function compareInput(showError) { // this is when input so far is correct correctSoFar = true; } + if (!correctSoFar) { + if (config.difficulty == "master") { + if (!resultVisible) { + inputHistory.push(currentInput); + correctedHistory.push(currentCorrected); + document + .querySelector("#words .word.active") + .setAttribute("input", currentInput.replace(/'/g, "'")); + lastSecondNotRound = true; + showResult(true); + } + let testNow = Date.now(); + let testSeconds = roundTo2((testNow - testStart) / 1000); + incompleteTestSeconds += testSeconds; + restartCount++; + } + } let classString = correctSoFar ? "correct" : "incorrect"; if (config.blindMode) { classString = "correct";