summaryrefslogtreecommitdiff
path: root/lambda-calcul/haskell/public
diff options
context:
space:
mode:
authorArnaud Bailly <arnaud@pankzsoft.com>2025-11-05 07:55:45 +0100
committerArnaud Bailly <arnaud@pankzsoft.com>2025-11-05 07:55:45 +0100
commit72ed98c66d1585c94ee5383c19a1dec8e10bb050 (patch)
tree44605042e4a49411edf401ff9d206939e971a8d7 /lambda-calcul/haskell/public
parent947940230f1b14bb883e5f5de2593c52e2438c1c (diff)
downloadlambda-nantes-72ed98c66d1585c94ee5383c19a1dec8e10bb050.tar.gz
record last success/failure in score
Diffstat (limited to 'lambda-calcul/haskell/public')
-rw-r--r--lambda-calcul/haskell/public/leaderboard.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/lambda-calcul/haskell/public/leaderboard.js b/lambda-calcul/haskell/public/leaderboard.js
index 6162b4d..15b5b42 100644
--- a/lambda-calcul/haskell/public/leaderboard.js
+++ b/lambda-calcul/haskell/public/leaderboard.js
@@ -9,11 +9,17 @@ const updateLeaderboard = () => {
.then(response => response.json())
.then(data => {
const tbody = document.querySelector('table#leaderboard > tbody');
- data.sort((a, b) => a.grade - b.grade);
+ data.sort((a, b) => b.grade - a.grade);
data.forEach((entry, index) => {
const row = document.createElement('tr');
+ if(entry.lastResult) {
+ row.classList.add('success');
+ } else if (!entry.lastResult && entry.lastTest){
+ row.classList.add('fail');
+ }
+
const nameCell = document.createElement('td');
nameCell.textContent = entry.user;
row.appendChild(nameCell);