From 428a45808b6cf845e4d0ebdf1a57b471c5f25a26 Mon Sep 17 00:00:00 2001 From: soomean05 Date: Mon, 31 Aug 2026 16:28:11 -0700 Subject: [PATCH 1/3] Update scoreboard immediately after score changes --- static/scoreboard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/scoreboard.js b/static/scoreboard.js index 34ce2009..f48d7c1c 100644 --- a/static/scoreboard.js +++ b/static/scoreboard.js @@ -32,7 +32,7 @@ function increase_score(id){ contentType: "application/json; charset=utf-8", data : JSON.stringify(team_id), success: function(result){ - + display_scoreboard(result.scoreboard); }, error: function(request, status, error){ console.log("Error"); From 82abe9baf35e4e526491a4ce61e0e0f71557b69f Mon Sep 17 00:00:00 2001 From: soomean05 Date: Mon, 31 Aug 2026 16:28:39 -0700 Subject: [PATCH 2/3] Update scoreboard immediately after score changes --- .idea/.gitignore | 3 +++ .idea/2020-Coding-Challenge.iml | 9 +++++++++ .idea/misc.xml | 6 ++++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ 5 files changed, 32 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/2020-Coding-Challenge.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..26d33521 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/2020-Coding-Challenge.iml b/.idea/2020-Coding-Challenge.iml new file mode 100644 index 00000000..d6ebd480 --- /dev/null +++ b/.idea/2020-Coding-Challenge.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..89ee7535 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..bb4ca52a --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..35eb1ddf --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file From ea63e3a2f31a9d844d93772cd2fabc1963e71f32 Mon Sep 17 00:00:00 2001 From: soomean05 Date: Mon, 31 Aug 2026 16:35:09 -0700 Subject: [PATCH 3/3] Sort scoreboard by score after updates --- server.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server.py b/server.py index 372a266c..0cb04aa9 100644 --- a/server.py +++ b/server.py @@ -51,6 +51,8 @@ def increase_score(): if team["id"] == team_id: team["score"] += 1 + scoreboard.sort(key=lambda team: team["score"], reverse=True) + return jsonify(scoreboard=scoreboard)