diff --git a/public/css/style.scss b/public/css/style.scss index 8b25e0150..2f403b9d9 100644 --- a/public/css/style.scss +++ b/public/css/style.scss @@ -1490,7 +1490,8 @@ key { #showWordHistoryButton, #copyResultToClipboardButton, #restartTestButtonWithSameWordset, -#nextTestButton { +#nextTestButton, +#practiseMissedWordsButton { position: relative; border-radius: var(--roundness); padding: 1rem 2rem; diff --git a/public/index.html b/public/index.html index 68ba6cbb5..b13fd711b 100644 --- a/public/index.html +++ b/public/index.html @@ -1236,6 +1236,15 @@ > +
+ +
{ restartTest(); }); +$(document).on("keypress", "#practiseMissedWordsButton", (event) => { + if (event.keyCode == 13) { + if (missedWords.length > 0) { + changeMode("custom"); + customText = missedWords; + customTextIsRandom = true; + customTextWordCount = 50; + restartTest(); + } else { + showNotification("You haven't missed any words.", 2000); + } + } +}); + +$(document.body).on("click", "#practiseMissedWordsButton", (event) => { + if (missedWords.length > 0) { + changeMode("custom"); + customText = missedWords; + customTextIsRandom = true; + customTextWordCount = 50; + restartTest(); + } else { + showNotification("You haven't missed any words.", 2000); + } +}); + $(document).on("keypress", "#nextTestButton", (event) => { if (event.keyCode == 13) { restartTest(); @@ -4033,6 +4061,9 @@ $(document).keypress(function (event) { currentError.count++; currentError.words.push(currentWordIndex); thisCharCorrect = false; + if (!missedWords.includes(wordsList[currentWordIndex])) { + missedWords.push(wordsList[currentWordIndex]); + } } else { accuracyStats.correct++; thisCharCorrect = true;