Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
SkyEye-FAST committed Jul 12, 2024
1 parent d8b950a commit 7677319
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions static/js/quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ $(document).ready(function () {

$inputBox.on('input', function () {
const input = $(this).val();
const currentKey = questionKeys[currentQuestionIndex];
const currentIndex = currentQuestionIndex;

const currentKey = questionKeys[currentIndex];
const { translation } = questionsData[currentKey];

if (!isComposing) {
Expand All @@ -133,7 +135,7 @@ $(document).ready(function () {
if (input === translation) {
$(".box").css("background-color", "#79b851");

if (currentQuestionIndex === questionKeys.length - 1) {
if (currentIndex === questionKeys.length - 1) {
setTimeout(showSummary, delayBetweenQuestions);
} else {
setTimeout(() => {
Expand All @@ -144,6 +146,7 @@ $(document).ready(function () {
}
});


// Initialize first question
initializeQuestion();
});
});

0 comments on commit 7677319

Please sign in to comment.