diff options
| author | Finn Schneider <schneider@data-quest.de> | 2026-03-19 16:45:16 +0100 |
|---|---|---|
| committer | Finn Schneider <schneider@data-quest.de> | 2026-03-19 16:45:16 +0100 |
| commit | f897832eb2c8750fa51f37a5f673639362815494 (patch) | |
| tree | f6b4f607394645533a1b3f6c9cdd0d8bf02913d0 /lib/models/Questionnaire.php | |
| parent | 063dafb012c6bdeedd5257bf8117b5949c915763 (diff) | |
course views
Diffstat (limited to 'lib/models/Questionnaire.php')
| -rw-r--r-- | lib/models/Questionnaire.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/models/Questionnaire.php b/lib/models/Questionnaire.php index 52fc7f2..17a399e 100644 --- a/lib/models/Questionnaire.php +++ b/lib/models/Questionnaire.php @@ -155,6 +155,11 @@ class Questionnaire extends SimpleORMap implements PrivacyObject public function isAnswerable() { + if ($this->template_id && Context::isCourse() + && User::findCurrent()->hasPermissionLevel('tutor', Context::get())) { + return false; + } + if (!$this->isViewable() || !$this->isRunning()) { return false; } @@ -273,8 +278,10 @@ class Questionnaire extends SimpleORMap implements PrivacyObject && $this->countAnswers() >= $this->minimum_responses; return $eval_visible - && ($this->resultvisibility === 'afterending' && $this->isStopped() - || $this->resultvisibility === 'afterparticipation' && $this->isAnswered()); + && (($this->resultvisibility === 'afterending' && $this->isStopped()) + || ($this->resultvisibility === 'afterparticipation' && $this->isAnswered()) + || ($this->resultvisibility === 'afterparticipation' + && $user->hasPermissionLevel('tutor', Context::get()))); } return $this['resultvisibility'] === 'always' |
