Skip to content

Commit

Permalink
Fixing a bug that pending review and review requests appear in dashbo…
Browse files Browse the repository at this point in the history
…ard summary (as well as in mail notifications) even for archived groups (archived groups are now excluded).
  • Loading branch information
krulis-martin committed Sep 30, 2024
1 parent 6d522b2 commit 3c5ea57
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/model/repository/AssignmentSolutions.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,11 @@ public function filterBestSolutions(array $solutions): array
public function findLingeringReviews(DateTime $threshold): array
{
$qb = $this->createQueryBuilder('s');
$qb->innerJoin("s.assignment", "a")->innerJoin("a.group", "g");
$qb->where($qb->expr()->isNull("s.reviewedAt"))
->andWhere($qb->expr()->isNotNull("s.reviewStartedAt"))
->andWhere($qb->expr()->lt("s.reviewStartedAt", ":threshold"))
->andWhere($qb->expr()->isNull("g.archivedAt"))
->setParameter('threshold', $threshold);
return $qb->getQuery()->getResult();
}
Expand All @@ -293,6 +295,7 @@ public function findPendingReviewsOfTeacher(User $user): array
->andWhere($qb->expr()->in("gm.type", [ GroupMembership::TYPE_ADMIN, GroupMembership::TYPE_SUPERVISOR ]))
->andWhere($qb->expr()->isNotNull("s.reviewStartedAt"))
->andWhere($qb->expr()->isNull("s.reviewedAt"))
->andWhere($qb->expr()->isNull("g.archivedAt"))
->setParameter('user', $user->getId());
return $qb->getQuery()->getResult();
}
Expand Down Expand Up @@ -380,6 +383,7 @@ public function findReviewRequestSolutionsOfTeacher(User $user): array
->andWhere($qb->expr()->in("gm.type", [ GroupMembership::TYPE_ADMIN, GroupMembership::TYPE_SUPERVISOR ]))
->andWhere($qb->expr()->isNull("s.reviewStartedAt"))
->andWhere($qb->expr()->eq("s.reviewRequest", 1))
->andWhere($qb->expr()->isNull("g.archivedAt"))
->setParameter('user', $user->getId());
return $qb->getQuery()->getResult();
}
Expand Down

0 comments on commit 3c5ea57

Please sign in to comment.