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

fix for population of Marathon Matches #124

Merged
merged 7 commits into from
May 13, 2020
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private static void associateAllSubmissions(List<ChallengeDetailData> 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();
Expand Down Expand Up @@ -173,6 +173,18 @@ private static void associateAllSubmissions(List<ChallengeDetailData> 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()) {
Expand All @@ -182,6 +194,11 @@ private static void associateAllSubmissions(List<ChallengeDetailData> 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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
where pi.project_id is null and r.round_type_id in (13, 15, 16, 19, 22, 23) and {filter}
Original file line number Diff line number Diff line change
Expand Up @@ -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}
where pi.project_id is null and r.round_type_id in (13, 15, 16, 19, 22, 23) and {filter}
2 changes: 1 addition & 1 deletion src/main/resources/sql/mmatches-feeder/get_mmatches.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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}
2 changes: 1 addition & 1 deletion src/main/resources/sql/mmatches-feeder/get_user_ids.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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}
round.round_type_id in (13, 15, 16, 19, 22, 23) AND {filter}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down