mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-09-21 15:56:24 +08:00
last words that were uncompleted in time mode will now no longer affect raw and incorrect chars
This commit is contained in:
parent
77d670853d
commit
da887db497
|
@ -899,6 +899,10 @@ function countChars() {
|
|||
let spaces = 0;
|
||||
let correctspaces = 0;
|
||||
for (let i = 0; i < inputHistory.length; i++) {
|
||||
if (inputHistory[i] === currentInput) {
|
||||
//last word that was not finished
|
||||
continue;
|
||||
}
|
||||
if (inputHistory[i] == wordsList[i]) {
|
||||
//the word is correct
|
||||
correctWordChars += wordsList[i].length;
|
||||
|
@ -2054,8 +2058,12 @@ async function loadWordsHistory() {
|
|||
wordEl +=
|
||||
'<letter class="correct">' + wordsList[index][c] + "</letter>";
|
||||
} else {
|
||||
wordEl +=
|
||||
'<letter class="incorrect">' + wordsList[index][c] + "</letter>";
|
||||
if (input === currentInput) {
|
||||
wordEl += "<letter>" + wordsList[index][c] + "</letter>";
|
||||
} else {
|
||||
wordEl +=
|
||||
'<letter class="incorrect">' + wordsList[index][c] + "</letter>";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
wordEl += '<letter class="incorrect extra">' + input[c] + "</letter>";
|
||||
|
@ -2837,10 +2845,7 @@ $(document).keydown((event) => {
|
|||
currentKeypressCount++;
|
||||
} else {
|
||||
if (config.stopOnError) {
|
||||
if (
|
||||
config.difficulty == "expert" ||
|
||||
config.difficulty == "master"
|
||||
) {
|
||||
if (config.difficulty == "expert" || config.difficulty == "master") {
|
||||
showResult(true);
|
||||
if (!afkDetected) {
|
||||
let testNow = Date.now();
|
||||
|
|
Loading…
Reference in a new issue