Skip to content

Commit

Permalink
Change Backlog Submission Date to Latest Result Date (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
T3C42 authored Nov 30, 2024
1 parent 59b5aa4 commit 1dd3400
Showing 1 changed file with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
package edu.kit.kastel.sdq.intelligrade.extensions.guis;

import java.awt.event.ActionEvent;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.time.format.FormatStyle;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
Expand Down Expand Up @@ -119,7 +119,7 @@ private void updateBacklog() {

// Participant
backlogList.add(new JBLabel(submission.getParticipantIdentifier()));
addSubmissionDateLabel(submission);
addResultDateLabel(submission);
// Correction Round
backlogList.add(new JBLabel("Round " + (submission.getCorrectionRound() + 1)));
addScoreItem(submission);
Expand All @@ -131,11 +131,18 @@ private void updateBacklog() {
this.updateUI();
}

private void addSubmissionDateLabel(ProgrammingSubmission submission) {
String dateText = submission
.getSubmissionDate()
.format(DateTimeFormatter.ofLocalizedDateTime(FormatStyle.SHORT, FormatStyle.SHORT));
backlogList.add(new JBLabel(dateText), "alignx right");
private void addResultDateLabel(ProgrammingSubmission submission) {
var latestResult = submission.getLatestResult();
String resultText = "";
if (submission.isSubmitted()) {
resultText = latestResult
.map(resultDTO -> resultDTO
.completionDate()
.withZoneSameInstant(ZoneId.systemDefault())
.format(DateTimeFormatter.ofPattern("dd.MM.yyyy HH:mm")))
.orElse("???");
}
backlogList.add(new JBLabel(resultText), "alignx right");
}

private void addScoreItem(ProgrammingSubmission submission) {
Expand Down

0 comments on commit 1dd3400

Please sign in to comment.