Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
zkPorpoise committed Feb 27, 2024
1 parent f081a35 commit 826a21e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions leaderboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@
})
.then((output) => {
const tableBody = document.getElementById('tableBody');
output.map((user) => {
Object.keys(output).forEach((key) => {
let newRow = document.createElement('tr');
newRow.innerHTML = `<td>${user.username.slice(0,15)}...</td><td>${user.numberofresponses}</td><td>${user.numberofcorrectresponses}</td><td>${user.score}</td>`
tableBody.appendChild(newRow);
})
newRow.innerHTML = `<td>${output[key].username}</td><td>${output[key].numberofresponses}</td><td>${output[key].numberofcorrectresponses}</td><td>${output[key].score}</td>`
});
})
.catch((err) => {
// TODO: put some logic here to surface the error
Expand Down Expand Up @@ -59,8 +58,8 @@ <h2 id="🐬"> LEADERBOARD </h2>
<thead>
<tr>
<th>Username</th>
<th>Number of Responses</th>
<th>Number of Correct Responses</th>
<th># of Responses</th>
<th># Correct Responses</th>
<th>Score</th>
</tr>
</thead>
Expand Down

0 comments on commit 826a21e

Please sign in to comment.