From: Alexander Goussas Date: Sun, 28 Jun 2026 16:24:39 +0000 (-0500) Subject: feat: add more questions X-Git-Url: http://git.frustrated-labs.net/?a=commitdiff_plain;h=3dd0b8acbc6c8c7140d5d660f0ac941ab3013352;p=open-the-box.git feat: add more questions --- 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