fixed word highlight causing difficulties to not work as intended. fixes #550

This commit is contained in:
Jack 2020-11-10 18:07:42 +00:00
parent 6452fb274f
commit eb62aaa70b

View file

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