From a3d90acd80498376633847108b538982fc4be911 Mon Sep 17 00:00:00 2001 From: Alexander von Trostorff <19996713+axel1200@users.noreply.github.com> Date: Thu, 17 Dec 2020 22:48:54 +0100 Subject: [PATCH] Do not show exercises with more than 100% when the filter is applied (#2564) --- .../overview/course-exercises/course-exercises.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/app/overview/course-exercises/course-exercises.component.ts b/src/main/webapp/app/overview/course-exercises/course-exercises.component.ts index ea1fc3f50c08..94bf954522d9 100644 --- a/src/main/webapp/app/overview/course-exercises/course-exercises.component.ts +++ b/src/main/webapp/app/overview/course-exercises/course-exercises.component.ts @@ -6,7 +6,7 @@ import { Subscription } from 'rxjs/Subscription'; import { TranslateService } from '@ngx-translate/core'; import * as moment from 'moment'; import { AccountService } from 'app/core/auth/account.service'; -import { sum, flatten, maxBy } from 'lodash'; +import { flatten, maxBy, sum } from 'lodash'; import { GuidedTourService } from 'app/guided-tour/guided-tour.service'; import { courseExerciseOverviewTour } from 'app/guided-tour/tours/course-exercise-overview-tour'; import { isOrion } from 'app/shared/orion/orion'; @@ -148,7 +148,7 @@ export class CourseExercisesComponent implements OnInit, OnChanges, OnDestroy { */ private needsWork(exercise: Exercise): boolean { const latestResult = maxBy(flatten(exercise.studentParticipations?.map((participation) => participation.results)), 'completionDate'); - return !latestResult || latestResult.score !== 100; + return !latestResult || !latestResult.score || latestResult.score < 100; } /**