diff --git a/cmd/server/internal/public/index.html b/cmd/server/internal/public/index.html index eb569d4..bcae208 100644 --- a/cmd/server/internal/public/index.html +++ b/cmd/server/internal/public/index.html @@ -60,10 +60,15 @@ } document.getElementById("answers-list").hidden = false; http("GET", `/api/v1/questions/${g_live_question.ID}/answers`, (body) => { - let answers = JSON.parse(body); + let answers = JSON.parse(body).map((a) => a.Text); + answers.sort((a, b) => { + a = a.toLowerCase(); + b = b.toLowerCase(); + return (a > b) - (a < b) + }); let result = ""; for (let i of answers) - result += `
  • ${i.Text}
  • `; + result += `
  • ${i}
  • `; document.getElementById("answers-list").innerHTML = ``; }); }