From 3dd0b8acbc6c8c7140d5d660f0ac941ab3013352 Mon Sep 17 00:00:00 2001 From: Alexander Goussas Date: Sun, 28 Jun 2026 11:24:39 -0500 Subject: [PATCH] feat: add more questions --- static/script.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/static/script.js b/static/script.js index c2c6bf7..3eea720 100644 --- a/static/script.js +++ b/static/script.js @@ -1,9 +1,9 @@ const questionsContainer = document.getElementById("question-container"); -const createQuestionCard = (question) => { +const createQuestionCard = (index, question) => { return `
-
+
${index + 1}
${question.question}
` } @@ -12,8 +12,8 @@ window.addEventListener('load', () => { fetch('/questions') .then(res => res.json()) .then(questions => - questions.forEach(question => - questionsContainer.innerHTML += createQuestionCard(question) + questions.forEach((index, question) => + questionsContainer.innerHTML += createQuestionCard(index, question) ) ) .then(() => document -- 2.43.0