Skip to content

Commit 1a95c69

Browse files
author
\nrlucke
committed
TestBlock: record attempts for students only
1 parent 1969e28 commit 1a95c69

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

blocks/TestBlock/TestBlock.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@ public function student_view()
7979
'vips14' => $this->vipsVersion('1.4')
8080
);
8181
}
82-
83-
$assignment->recordAssignmentAttempt($user->id);
82+
if ($GLOBALS['perm']->have_studip_perm('user', $this->_model->course->id, $user->id) &&
83+
!$GLOBALS['perm']->have_studip_perm('tutor', $this->_model->course->id, $user->id)) {
84+
$assignment->recordAssignmentAttempt($user->id);
85+
}
8486

8587
return array_merge($this->getAttrArray(), array(
8688
'active' => $active,

0 commit comments

Comments
 (0)