mirror of
https://github.com/mudabbir-ahmad/peworkshop.git
synced 2026-10-07 19:50:20 +00:00
fixed stats page to show correct number of skipped clues. reflected this change accurately in leaderboards for users and admins as to not create a bug where a skipped clue would contribute to progress
This commit is contained in:
1 parent
2f9a6c732c
commit
4cd449c0cf
8 files changed
+46
-39
No files matched your search
@@ -25,12 +25,13 @@ export async function GET(request) {
|
||||
|
||||
// Get all teams with progress info and member count
|
||||
// Only include teams that have at least one member
|
||||
// Modify the SQL query to exclude skipped clues from the count
|
||||
const teams = await query(`
|
||||
SELECT
|
||||
t.id,
|
||||
t.name,
|
||||
t.id,
|
||||
t.name,
|
||||
t.code,
|
||||
COUNT(DISTINCT tc.clue_id) as cluesFound,
|
||||
COUNT(DISTINCT CASE WHEN tc.skipped = 0 OR tc.skipped IS NULL THEN tc.clue_id END) as cluesFound,
|
||||
MAX(tc.found_at) as lastActivity,
|
||||
COUNT(DISTINCT u.id) as memberCount
|
||||
FROM
|
||||
@@ -49,6 +50,7 @@ export async function GET(request) {
|
||||
`);
|
||||
|
||||
// Add progress percentage and total clues to each team
|
||||
// Make sure the progress calculation is consistent
|
||||
const teamsWithProgress = teams.map((team) => ({
|
||||
...team,
|
||||
totalClues,
|
||||
|
||||
Reference in new issue
Block a user