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

Commit b74658e

Browse files
committed
Merge pull request #378 from Ghost141/dev
Update for srm practice problems api
2 parents 533fbf5 + c7aa435 commit b74658e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

queries/get_practice_problems

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ SELECT
1616
WHEN (p.problem_type_id = 1 AND p.proposed_difficulty_id = 3) THEN 'Hard'::nvarchar(50)
1717
END AS difficulty
1818
, rc.points
19-
, CASE WHEN EXISTS (
19+
, NVL(CASE WHEN EXISTS (
2020
SELECT 1
2121
FROM component_state cs
2222
WHERE cs.status_id < 120
@@ -57,7 +57,7 @@ SELECT
5757
AND pcs.status_id != 150
5858
AND pcs.coder_id = @userId@
5959
) THEN 'Viewed'::nvarchar(50)
60-
END AS status
60+
END, 'New') AS status
6161
, NVL((
6262
SELECT
6363
points

queries/get_practice_problems_count

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ SELECT
1313
WHEN (p.problem_type_id = 1 AND p.proposed_difficulty_id = 3) THEN 'Hard'::nvarchar(50)
1414
END AS difficulty
1515
, rc.points
16-
, CASE WHEN EXISTS (
16+
, NVL(CASE WHEN EXISTS (
1717
SELECT 1
1818
FROM component_state cs
1919
WHERE cs.status_id < 120
@@ -54,7 +54,7 @@ SELECT
5454
AND pcs.status_id != 150
5555
AND pcs.coder_id = @userId@
5656
) THEN 'Viewed'::nvarchar(50)
57-
END AS status
57+
END, 'New') AS status
5858
, NVL((
5959
SELECT
6060
points

0 commit comments

Comments
 (0)