Skip to content

Commit ac61ee6

Browse files
committed
Change exercise icon to show if exercise's deadline has passed
1 parent 25ffc15 commit ac61ee6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

tmc-plugin/src/fi/helsinki/cs/tmc/ui/ExerciseIconAnnotator.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ public Image annotateIcon(Project nbProject, Image origImg, boolean openedNode)
6868
//Had some very weird problems with that. Try again some day.
6969

7070
Image img = origImg;
71+
if (exercise.hasDeadlinePassed()) {
72+
img = ImageUtilities.createDisabledImage(origImg);
73+
}
7174
try {
7275
Image annotation = annotationIconForExericse(exercise);
7376
if (annotation != null) {
@@ -98,7 +101,7 @@ private Image annotationIconForExericse(Exercise exercise) throws IOException {
98101

99102
private String annotationIconNameForExercise(Exercise exercise) {
100103
if (exercise.hasDeadlinePassed()) {
101-
return null;
104+
return "expired-project-dot.png";
102105
} else if (exercise.isAttempted() && exercise.isCompleted() && exercise.isAllReviewPointsGiven()) {
103106
return "green-project-dot.png";
104107
} else if (exercise.isAttempted() && exercise.isCompleted()) {
427 Bytes
Loading

0 commit comments

Comments
 (0)