Skip to content

Commit

Permalink
SAK-44840 - Assignments / grade report missing student record if same…
Browse files Browse the repository at this point in the history
… name as another student (sakaiproject#8926)
  • Loading branch information
jonespm authored Jan 4, 2021
1 parent ed77d6e commit 2fa4eab
Showing 1 changed file with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import java.util.regex.Pattern;
import java.util.stream.Collectors;

import org.apache.commons.lang3.builder.CompareToBuilder;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.CellType;
Expand Down Expand Up @@ -449,17 +450,8 @@ public int hashCode() {

@Override
public int compareTo(Submitter o) {
int value = Boolean.compare(this.anonymous, o.anonymous);
if (value == 0) {
if (anonymous) {
// Sort by ID for anonymous ones
value = this.id.compareTo(o.id);
} else {
// Sort by sortName for normal ones.
value = this.sortName.compareTo(o.sortName);
}
}
return value;
// Sort by sortName for normal ones, but id if they're the same
return new CompareToBuilder().append(this.sortName, o.sortName).append(this.id, o.id).toComparison();
}

void setNotes(Optional<List<String>> notes) {
Expand Down

0 comments on commit 2fa4eab

Please sign in to comment.