Skip to content

Commit

Permalink
1361: sort course grade by the calculatedGrade rather than the points…
Browse files Browse the repository at this point in the history
…Earned, as pointsEarned includes extra credit scores which doesn't match the course grade display string
  • Loading branch information
payten committed May 12, 2016
1 parent 4ea1dcc commit af88838
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2004,9 +2004,15 @@ public int compare(final GbStudentGradeInfo g1, final GbStudentGradeInfo g2) {
letterGrade2 = cg2.getEnteredGrade();
}

int gradeIndex1 = ascendingGrades.indexOf(letterGrade1);
int gradeIndex2 = ascendingGrades.indexOf(letterGrade2);

Double calculatedGrade1 = Double.valueOf(cg1.getCalculatedGrade());
Double calculatedGrade2 = Double.valueOf(cg2.getCalculatedGrade());

return new CompareToBuilder()
.append(ascendingGrades.indexOf(letterGrade1), ascendingGrades.indexOf(letterGrade2))
.append(ascendingGrades.indexOf(cg1.getPointsEarned()), ascendingGrades.indexOf(cg2.getPointsEarned()))
.append(gradeIndex1, gradeIndex2)
.append(calculatedGrade1, calculatedGrade2)
.toComparison();
}
}
Expand Down

0 comments on commit af88838

Please sign in to comment.