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

Commit 2f6abdd

Browse files
authored
Merge pull request #124 from topcoder-platform/dev
fix for population of Marathon Matches
2 parents c49b55d + df21e11 commit 2f6abdd

File tree

6 files changed

+23
-6
lines changed

6 files changed

+23
-6
lines changed

src/main/java/com/appirio/service/challengefeeder/manager/ChallengeDetailMMFeederManager.java

+18-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ private static void associateAllSubmissions(List<ChallengeDetailData> challenges
123123
Double proveScore = 0.0;
124124
for (int i = 0; i < provisionalResult.size(); i++) {
125125
provRankNoTie++;
126-
if (!proveScore.equals(provisionalResult.get(i).getProvisionalScore())) {
126+
if (proveScore == null || provisionalResult.get(i).getProvisionalScore() == null || !proveScore.equals(provisionalResult.get(i).getProvisionalScore())) {
127127
provRank = provRankNoTie;
128128
}
129129
proveScore = provisionalResult.get(i).getProvisionalScore();
@@ -173,6 +173,18 @@ private static void associateAllSubmissions(List<ChallengeDetailData> challenges
173173
}
174174

175175
userSubmissions.sort((UserSubmissionData usd1, UserSubmissionData usd2) -> {
176+
if (usd1 == null && usd2 == null) {
177+
return 0;
178+
}
179+
180+
if(usd1 == null) {
181+
return 1;
182+
}
183+
184+
if(usd2== null) {
185+
return -1;
186+
}
187+
176188
Double r1;
177189
Double r2;
178190
if (c.getIsSysTestCompleted()) {
@@ -182,6 +194,11 @@ private static void associateAllSubmissions(List<ChallengeDetailData> challenges
182194
r1 = (usd1.getSubmissions().size() > 0) ? usd1.getSubmissions().get(0).getFinalScore() : null;
183195
r2 = (usd2.getSubmissions().size() > 0) ? usd2.getSubmissions().get(0).getFinalScore() : null;
184196
}
197+
198+
if (r1 == null && r2 == null) {
199+
return 0;
200+
}
201+
185202
if (r1 == null) return 1;
186203
if (r2 == null) return -1;
187204
if (r1 > r2) {

src/main/resources/sql/mm-feeder-into-challenges/get_marathon_matches_for_challenge_details.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ left join informixoltp\:round_component rc on r.round_id = rc.round_id
1313
left join informixoltp\:component c on rc.component_id = c.component_id
1414
left join tcs_catalog\:project_info pi on pi.project_info_type_id = 56 and pi.value::decimal = r.round_id
1515
left join informixoltp\:round_segment rs on rs.round_id = r.round_id and rs.segment_id = 5
16-
where pi.project_id is null and r.round_type_id = 13 and {filter}
16+
where pi.project_id is null and r.round_type_id in (13, 15, 16, 19, 22, 23) and {filter}

src/main/resources/sql/mm-feeder-into-challenges/get_marathon_matches_for_challenge_listing.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ left join informixoltp\:component comp on comp.component_id = rc.component_id
2929
left join informixoltp\:round_segment rs_reg on rs_reg.round_id = r.round_id and rs_reg.segment_id = 1
3030
left join informixoltp\:round_segment rs_sub on rs_sub.round_id = r.round_id and rs_sub.segment_id = 2
3131
left join tcs_catalog\:project_info pi on pi.project_info_type_id = 56 and pi.value::decimal = r.round_id
32-
where pi.project_id is null and r.round_type_id = 13 and {filter}
32+
where pi.project_id is null and r.round_type_id in (13, 15, 16, 19, 22, 23) and {filter}

src/main/resources/sql/mmatches-feeder/get_mmatches.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,5 @@ FROM
6161
INFORMIXOLTP\:problem AS problem
6262
ON problem.problem_id = component.problem_id
6363
WHERE
64-
round.round_type_id = 13
64+
round.round_type_id in (13, 15, 16, 19, 22, 23)
6565
AND {filter}

src/main/resources/sql/mmatches-feeder/get_user_ids.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ FROM
1919
tcs_catalog\:user AS user_table
2020
ON user_table.user_id = round_registration.coder_id
2121
WHERE
22-
round.round_type_id = 13 AND {filter}
22+
round.round_type_id in (13, 15, 16, 19, 22, 23) AND {filter}

src/main/resources/sql/mmatches-feeder/job/get_mm_registration_phase_started.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ FROM
77
AND registration_segment.segment_id = 1
88
LEFT JOIN tcs_catalog\:project_info pi on pi.project_info_type_id = 56 and pi.value::decimal = round.round_id
99
WHERE
10-
pi.project_id is null AND round.round_type_id = 13
10+
pi.project_id is null AND round.round_type_id in (13, 15, 16, 19, 22, 23 )
1111
AND (
1212
(1 = :lastRunTimestamp)
1313
OR

0 commit comments

Comments
 (0)