Skip to content

Commit

Permalink
Do not show exercises with more than 100% when the filter is applied (l…
Browse files Browse the repository at this point in the history
  • Loading branch information
1-alex98 authored Dec 17, 2020
1 parent f89718e commit a3d90ac
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit a3d90ac

Please sign in to comment.