Skip to content

Commit 00f3e4a

Browse files
committed
Fix work access for teachers and students
1 parent 0356a28 commit 00f3e4a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main/work/work.lib.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5197,10 +5197,10 @@ function getFileContents($id, $course_info, $sessionId = 0, $correction = false)
51975197
*/
51985198

51995199
$work_is_visible = $item_info['visibility'] == 1 && $row['accepted'] == 1;
5200-
$doc_visible_for_all = $course_info['show_score'] == 1;
5200+
$doc_visible_for_all = (int) $course_info['show_score'] === 0;
52015201

52025202
$is_editor = api_is_allowed_to_edit(true, true, true);
5203-
$student_is_owner_of_work = user_is_author($row['id'], $row['user_id']);
5203+
$student_is_owner_of_work = user_is_author($row['id'], api_get_user_id());
52045204

52055205
if ($is_editor ||
52065206
$student_is_owner_of_work ||

0 commit comments

Comments
 (0)