mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-09 13:44:29 +08:00
result is now not saved if failed due to difficulty
This commit is contained in:
parent
d724abe1e9
commit
ea439c266b
1 changed files with 9 additions and 4 deletions
|
|
@ -253,7 +253,7 @@ function compareInput() {
|
|||
// $(letterElems[i]).removeClass('incorrect').addClass('correct');
|
||||
} else {
|
||||
if(config.difficulty == "master"){
|
||||
showResult();
|
||||
showResult(true);
|
||||
}
|
||||
if (currentWord[i] == undefined) {
|
||||
ret +=
|
||||
|
|
@ -462,7 +462,7 @@ function showCrown() {
|
|||
}, 250,"easeOutCubic");
|
||||
}
|
||||
|
||||
function showResult() {
|
||||
function showResult(difficultyFailed = false) {
|
||||
testEnd = Date.now();
|
||||
testActive = false;
|
||||
setFocus(false);
|
||||
|
|
@ -503,7 +503,9 @@ function showResult() {
|
|||
// $("#result .stats .time .bottom").text(roundedToFixed(stats.time,1)+'s');
|
||||
}
|
||||
|
||||
if(afkDetected){
|
||||
if(difficultyFailed){
|
||||
showNotification("Test failed",3000);
|
||||
}else if(afkDetected){
|
||||
showNotification("Test invalid - AFK detected",3000);
|
||||
}else{
|
||||
let completedEvent = {
|
||||
|
|
@ -1239,9 +1241,12 @@ $(document).keydown((event) => {
|
|||
highlightBadWord();
|
||||
currentInput = "";
|
||||
currentWordIndex++;
|
||||
if (currentWordIndex == wordsList.length || config.difficulty == "expert") {
|
||||
if (currentWordIndex == wordsList.length) {
|
||||
showResult();
|
||||
return;
|
||||
}else if(config.difficulty == "expert"){
|
||||
showResult(true);
|
||||
return;
|
||||
}
|
||||
updateActiveElement();
|
||||
updateCaretPosition();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue