diff --git a/src/main/java/com/appirio/service/challengefeeder/manager/ChallengeDetailMMFeederManager.java b/src/main/java/com/appirio/service/challengefeeder/manager/ChallengeDetailMMFeederManager.java index d92f9b3..3471190 100644 --- a/src/main/java/com/appirio/service/challengefeeder/manager/ChallengeDetailMMFeederManager.java +++ b/src/main/java/com/appirio/service/challengefeeder/manager/ChallengeDetailMMFeederManager.java @@ -123,7 +123,7 @@ private static void associateAllSubmissions(List challenges Double proveScore = 0.0; for (int i = 0; i < provisionalResult.size(); i++) { provRankNoTie++; - if (!proveScore.equals(provisionalResult.get(i).getProvisionalScore())) { + if (proveScore == null || provisionalResult.get(i).getProvisionalScore() == null || !proveScore.equals(provisionalResult.get(i).getProvisionalScore())) { provRank = provRankNoTie; } proveScore = provisionalResult.get(i).getProvisionalScore(); @@ -173,6 +173,18 @@ private static void associateAllSubmissions(List challenges } userSubmissions.sort((UserSubmissionData usd1, UserSubmissionData usd2) -> { + if (usd1 == null && usd2 == null) { + return 0; + } + + if(usd1 == null) { + return 1; + } + + if(usd2== null) { + return -1; + } + Double r1; Double r2; if (c.getIsSysTestCompleted()) { @@ -182,6 +194,11 @@ private static void associateAllSubmissions(List challenges r1 = (usd1.getSubmissions().size() > 0) ? usd1.getSubmissions().get(0).getFinalScore() : null; r2 = (usd2.getSubmissions().size() > 0) ? usd2.getSubmissions().get(0).getFinalScore() : null; } + + if (r1 == null && r2 == null) { + return 0; + } + if (r1 == null) return 1; if (r2 == null) return -1; if (r1 > r2) { diff --git a/src/main/resources/sql/mm-feeder-into-challenges/get_marathon_matches_for_challenge_details.sql b/src/main/resources/sql/mm-feeder-into-challenges/get_marathon_matches_for_challenge_details.sql index 8139528..1c65c80 100644 --- a/src/main/resources/sql/mm-feeder-into-challenges/get_marathon_matches_for_challenge_details.sql +++ b/src/main/resources/sql/mm-feeder-into-challenges/get_marathon_matches_for_challenge_details.sql @@ -13,4 +13,4 @@ left join informixoltp\:round_component rc on r.round_id = rc.round_id left join informixoltp\:component c on rc.component_id = c.component_id left join tcs_catalog\:project_info pi on pi.project_info_type_id = 56 and pi.value::decimal = r.round_id left join informixoltp\:round_segment rs on rs.round_id = r.round_id and rs.segment_id = 5 -where pi.project_id is null and r.round_type_id = 13 and {filter} \ No newline at end of file +where pi.project_id is null and r.round_type_id in (13, 15, 16, 19, 22, 23) and {filter} \ No newline at end of file diff --git a/src/main/resources/sql/mm-feeder-into-challenges/get_marathon_matches_for_challenge_listing.sql b/src/main/resources/sql/mm-feeder-into-challenges/get_marathon_matches_for_challenge_listing.sql index 3b9a08e..86a6705 100644 --- a/src/main/resources/sql/mm-feeder-into-challenges/get_marathon_matches_for_challenge_listing.sql +++ b/src/main/resources/sql/mm-feeder-into-challenges/get_marathon_matches_for_challenge_listing.sql @@ -29,4 +29,4 @@ left join informixoltp\:component comp on comp.component_id = rc.component_id left join informixoltp\:round_segment rs_reg on rs_reg.round_id = r.round_id and rs_reg.segment_id = 1 left join informixoltp\:round_segment rs_sub on rs_sub.round_id = r.round_id and rs_sub.segment_id = 2 left join tcs_catalog\:project_info pi on pi.project_info_type_id = 56 and pi.value::decimal = r.round_id -where pi.project_id is null and r.round_type_id = 13 and {filter} \ No newline at end of file +where pi.project_id is null and r.round_type_id in (13, 15, 16, 19, 22, 23) and {filter} \ No newline at end of file diff --git a/src/main/resources/sql/mmatches-feeder/get_mmatches.sql b/src/main/resources/sql/mmatches-feeder/get_mmatches.sql index 8a9f822..5c8c55d 100644 --- a/src/main/resources/sql/mmatches-feeder/get_mmatches.sql +++ b/src/main/resources/sql/mmatches-feeder/get_mmatches.sql @@ -61,5 +61,5 @@ FROM INFORMIXOLTP\:problem AS problem ON problem.problem_id = component.problem_id WHERE - round.round_type_id = 13 + round.round_type_id in (13, 15, 16, 19, 22, 23) AND {filter} diff --git a/src/main/resources/sql/mmatches-feeder/get_user_ids.sql b/src/main/resources/sql/mmatches-feeder/get_user_ids.sql index 661783f..2e0dd56 100644 --- a/src/main/resources/sql/mmatches-feeder/get_user_ids.sql +++ b/src/main/resources/sql/mmatches-feeder/get_user_ids.sql @@ -19,4 +19,4 @@ FROM tcs_catalog\:user AS user_table ON user_table.user_id = round_registration.coder_id WHERE - round.round_type_id = 13 AND {filter} \ No newline at end of file + round.round_type_id in (13, 15, 16, 19, 22, 23) AND {filter} \ No newline at end of file diff --git a/src/main/resources/sql/mmatches-feeder/job/get_mm_registration_phase_started.sql b/src/main/resources/sql/mmatches-feeder/job/get_mm_registration_phase_started.sql index 1e3eedb..0278d7b 100644 --- a/src/main/resources/sql/mmatches-feeder/job/get_mm_registration_phase_started.sql +++ b/src/main/resources/sql/mmatches-feeder/job/get_mm_registration_phase_started.sql @@ -7,7 +7,7 @@ FROM AND registration_segment.segment_id = 1 LEFT JOIN tcs_catalog\:project_info pi on pi.project_info_type_id = 56 and pi.value::decimal = round.round_id WHERE - pi.project_id is null AND round.round_type_id = 13 + pi.project_id is null AND round.round_type_id in (13, 15, 16, 19, 22, 23 ) AND ( (1 = :lastRunTimestamp) OR