diff --git a/main/gradebook/gradebook.php b/main/gradebook/gradebook.php
index 8ee6de70e0..c598951a17 100644
--- a/main/gradebook/gradebook.php
+++ b/main/gradebook/gradebook.php
@@ -573,7 +573,7 @@ if (isset ($_GET['studentoverview'])) {
}
$gradebooktable= new GradebookTable($cats[0], $allcat, $alleval, $alllink, $addparams);
-if ((empty ($allcat)) && (empty ($alleval)) && (empty ($alllink)) && (!$is_platform_admin) && ($is_course_admin) && (!isset ($_GET['selectcat']))) {
+if (((empty ($allcat)) && (empty ($alleval)) && (empty ($alllink)) && (!$is_platform_admin) && ($is_course_admin) && (!isset ($_GET['selectcat']))) && api_is_course_tutor()) {
Display :: display_normal_message(get_lang('GradebookWelcomeMessage') . '
';
- if (($is_course_admin) && (!isset ($_GET['search']))) {
+ if (api_is_course_tutor() && ($is_course_admin) && (!isset ($_GET['search']))) {
if ($selectcat == '0') {
if ($show_add_qualification === true) {
// $header .= '
' . get_lang('NewCategory') . '';
diff --git a/main/gradebook/lib/fe/gradebooktable.class.php b/main/gradebook/lib/fe/gradebooktable.class.php
index 0b01208fbd..3ae7e6cddc 100644
--- a/main/gradebook/lib/fe/gradebooktable.class.php
+++ b/main/gradebook/lib/fe/gradebooktable.class.php
@@ -49,13 +49,13 @@ class GradebookTable extends SortableTable
$this->set_additional_parameters($addparams);
}
$column= 0;
- if (api_is_allowed_to_create_course() && ($_SESSION['studentview']<>'studentview') || (isset($_GET['isStudentView']) && $_GET['isStudentView']=='false')) {
+ if (api_is_course_tutor() && api_is_allowed_to_create_course() && ($_SESSION['studentview']<>'studentview') || (isset($_GET['isStudentView']) && $_GET['isStudentView']=='false')) {
$this->set_header($column++,'','','width="25px"');
}
$this->set_header($column++, get_lang('Type'),'','width="35px"');
$this->set_header($column++, get_lang('Name'));
$this->set_header($column++, get_lang('Description'));
- if (api_is_allowed_to_create_course() && $_SESSION['studentview']<>'studentview' || (isset($_GET['isStudentView']) && $_GET['isStudentView']=='false')) {
+ if (api_is_course_tutor() && api_is_allowed_to_create_course() && $_SESSION['studentview']<>'studentview' || (isset($_GET['isStudentView']) && $_GET['isStudentView']=='false')) {
$this->set_header($column++, get_lang('Weight'),'','width="50px"');
} else {
if (empty($_GET['selectcat'])) {
@@ -68,7 +68,7 @@ class GradebookTable extends SortableTable
}
$this->set_header($column++, get_lang('Date'),true, 'width="100px"');
//admins get an edit column
- if (api_is_allowed_to_create_course() && $_SESSION['studentview']<>'studentview' || (isset($_GET['isStudentView']) && $_GET['isStudentView']=='false')) {
+ if (api_is_course_tutor() && api_is_allowed_to_create_course() && $_SESSION['studentview']<>'studentview' || (isset($_GET['isStudentView']) && $_GET['isStudentView']=='false')) {
$this->set_header($column++, get_lang('Modify'), false, 'width="100"');
//actions on multiple selected documents
$this->set_form_actions(array (
@@ -141,14 +141,14 @@ class GradebookTable extends SortableTable
$invisibility_span_open = (api_is_allowed_to_create_course() && $item->is_visible() == '0') ? '
' : '';
$invisibility_span_close = (api_is_allowed_to_create_course() && $item->is_visible() == '0') ? '' : '';
- if (api_is_allowed_to_create_course() && ($_SESSION['studentview']<>'studentview') || (isset($_GET['isStudentView']) && $_GET['isStudentView']=='false')) {
+ if (api_is_course_tutor() && api_is_allowed_to_create_course() && ($_SESSION['studentview']<>'studentview') || (isset($_GET['isStudentView']) && $_GET['isStudentView']=='false')) {
$row[] = $this->build_id_column ($item);
}
$row[] = $this->build_type_column ($item);
$row[] = $invisibility_span_open . $this->build_name_link ($item) . $invisibility_span_close;
$row[] = $invisibility_span_open . $data[2] . $invisibility_span_close;
- if (api_is_allowed_to_create_course()) {
+ if (api_is_course_tutor() && api_is_allowed_to_create_course()) {
$row[] = $invisibility_span_open . $data[3] . $invisibility_span_close;
} else {
@@ -181,7 +181,7 @@ class GradebookTable extends SortableTable
$row[] = $invisibility_span_open . str_replace(' ',' ',$data[4]) . $invisibility_span_close;
//admins get an edit column
- if (api_is_allowed_to_create_course() && ($_SESSION['studentview']<>'studentview' || (isset($_GET['isStudentView']) && $_GET['isStudentView']=='false'))) {
+ if (api_is_course_tutor() && api_is_allowed_to_create_course() && ($_SESSION['studentview']<>'studentview' || (isset($_GET['isStudentView']) && $_GET['isStudentView']=='false'))) {
$cat=new Category();
$show_message=$cat->show_message_resource_delete($item->get_course_code());