aboutsummaryrefslogtreecommitdiff
path: root/lib/models/Courseware/StructuralElement.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/models/Courseware/StructuralElement.php')
-rw-r--r--lib/models/Courseware/StructuralElement.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/models/Courseware/StructuralElement.php b/lib/models/Courseware/StructuralElement.php
index e72cc4f..8e06a39 100644
--- a/lib/models/Courseware/StructuralElement.php
+++ b/lib/models/Courseware/StructuralElement.php
@@ -391,6 +391,19 @@ class StructuralElement extends \SimpleORMap implements \PrivacyObject, \Feedbac
return true;
}
+ if ($task->isSubmitted()) {
+ if ($task->visible) {
+ return true;
+ }
+ $solvers = $task->getTaskGroup()->getSolvers();
+ foreach ($solvers as $solver) {
+ if ($solver->id === $user->id) {
+ return true;
+ }
+ }
+ return false;
+ }
+
return $task->userIsASolver($user);
}
@@ -1240,4 +1253,9 @@ SQL;
[$this->id, self::class]
);
}
+
+ public function isTaskVisible(): bool
+ {
+ return $this->payload['task-visibility'];
+ }
}