Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
RasperRevision authored Sep 4, 2024
1 parent d4c9dfa commit 6412d8e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions quiz/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ <h1>Quiz</h1>
return selectedItems;
}

async function processItem(item) {
const answers = pickRandomItems(json_data, 3, item);
async function processItem(item, data) {
const answers = pickRandomItems(data, 3, item);
const meanings = shuffle([
[item.meaning || item.english, 0],
[answers[0][item.term ? "meaning" : "english"], 1],
Expand Down Expand Up @@ -343,7 +343,7 @@ <h1>Quiz</h1>
updateScore();

// do not change this - this is a for loop and not a foreach loop for a reason.
for (let i = 0; i < length; i++) await processItem(json_data[i]);
for (let i = 0; i < length; i++) await processItem(json_data[i], json_data);

endGame();
} catch (error) {
Expand Down

0 comments on commit 6412d8e

Please sign in to comment.