Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit 3b988f1

Browse files
committed
Get srm practice problems only from active round.
1 parent acdbbfd commit 3b988f1

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

queries/get_practice_problems

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ SELECT
6868
), 0) AS my_points
6969
FROM problem p
7070
INNER JOIN component c ON c.problem_id = p.problem_id
71-
INNER JOIN round_component rc ON rc.component_id = c.component_id
71+
INNER JOIN round_component rc ON rc.component_id = c.component_id
72+
INNER JOIN round r ON r.round_id = rc.round_id AND r.status = 'A'
7273
INNER JOIN room ro ON ro.round_id = rc.round_id AND ro.room_type_id = 3 -- practice room
7374
INNER JOIN problem_type_lu ptl ON ptl.problem_type_id = p.problem_type_id
7475
WHERE p.status_id = 90

queries/get_practice_problems_count

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ SELECT
6666
FROM problem p
6767
INNER JOIN component c ON c.problem_id = p.problem_id
6868
INNER JOIN round_component rc ON rc.component_id = c.component_id
69+
INNER JOIN round r ON r.round_id = rc.round_id AND r.status = 'A'
6970
INNER JOIN room ro ON ro.round_id = rc.round_id AND ro.room_type_id = 3 -- practice room
7071
INNER JOIN problem_type_lu ptl ON ptl.problem_type_id = p.problem_type_id
7172
WHERE p.status_id = 90

0 commit comments

Comments
 (0)