Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions app/V1Module/security/Policies/AssignmentPermissionPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,14 @@ public function userIsNotLockedElsewhereStrictly(Identity $identity, Assignment
}

/**
* The assignment is not in an exam group, or it is already after the exam.
* The assignment is not in an exam group, or it is still before/already after the exam.
*/
public function isExamNotInProgress(Identity $identity, Assignment $assignment): bool
{
$group = $assignment->getGroup();
$now = new DateTime();
return $group && (!$group->hasExamPeriodSet($now) || $group->getExamEnd() < $now);
return $group && (!$group->hasExamPeriodSet($now) ||
$now < $group->getExamBegin() || $group->getExamEnd() < $now);
}

/**
Expand Down
1 change: 0 additions & 1 deletion app/V1Module/security/Policies/GroupPermissionPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use App\Model\Entity\Group;
use App\Model\Entity\Instance;
use App\Model\Repository\Groups;
use App\Security\Identity;
use DateTIme;

Expand Down