Skip to content

Commit

Permalink
Fixed the issue that the skip button can still be clicked when switch…
Browse files Browse the repository at this point in the history
…ing questions
  • Loading branch information
SkyEye-FAST committed Jul 21, 2024
1 parent 6457eb9 commit 74b0e1f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions static/css/quiz_sub.css
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ input[type="text"] {
flex: 1;
}

#buttons button[disabled] {
opacity: 0.5 !important;
}

button {
background-color: transparent !important;
}
Expand Down
2 changes: 2 additions & 0 deletions static/js/quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,14 @@ $(document).ready(function () {

if (input === translation && !isLocked) {
isLocked = true;
$skipButton.attr("disabled", "true");
await delay(delayBetweenQuestions);
if (currentQuestionIndex === questionKeys.length - 1) {
await showSummary();
} else {
await fadeOutElement($info, fadeDuration);
currentQuestionIndex++;
$skipButton.removeAttr("disabled");
await initializeQuestion();
}
isLocked = false;
Expand Down

0 comments on commit 74b0e1f

Please sign in to comment.