Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions sql/reports/topcoder/leaderboard-generic.sql
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ member_submissions AS (
ON s."challengeId" = cc.challenge_id
AND s."memberId" IS NOT NULL
LEFT JOIN LATERAL (
SELECT rs."aggregateScore", rs."scorecardId"
SELECT rs."aggregateScore", rs."scorecardId", rs."isPassing"
FROM reviews."reviewSummation" AS rs
WHERE rs."submissionId" = s.id
AND COALESCE(rs."isFinal", TRUE) = TRUE
Expand Down Expand Up @@ -131,8 +131,14 @@ member_submissions AS (
AND UPPER(ai_decision.status::text) = 'PASSED')
OR (
NOT challenge_reviewers.is_ai_only_challenge
AND COALESCE(final_review."aggregateScore", s."finalScore"::double precision, s."initialScore"::double precision)
>= COALESCE(sc."minimumPassingScore", sc."minScore", 0)
AND (
final_review."isPassing" IS TRUE
OR (
final_review."isPassing" IS NULL
AND COALESCE(final_review."aggregateScore", s."finalScore"::double precision, s."initialScore"::double precision)
>= COALESCE(sc."minimumPassingScore", sc."minScore", 0)
)
)
)
)
),
Expand Down
2 changes: 1 addition & 1 deletion src/reports/topcoder/topcoder-reports.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,7 @@ export class TopcoderReportsService implements OnModuleDestroy {
row.durationDays * (filters.pointsPerDay ?? 0);
const relativeRank = row.placement / Math.max(1, row.submissionsCount);
const sqrt = Math.sqrt(relativeRank);
const pointsByWin = log / sqrt;
const pointsByWin = Math.round(log / sqrt);

entriesByUser[row.userId].points += pointsByWin;
entriesByUser[row.userId].wins[row.challengeId] = pointsByWin;
Expand Down
Loading