/// find all accessible reports
if ($course->id !== SITEID) {
$reportavailable = false;
- if ($reports = get_list_of_plugins('grade/report')) { // Get all installed reports
- arsort($reports); // user is last, we want to test it first
- foreach ($reports as $plugin) {
- if (has_capability('gradereport/'.$plugin.':view', $context)) {
- //stop when fisrt visible found
- $reportavailable = true;
- break;
+ if (!empty($course->showgrades)) {
+ if ($reports = get_list_of_plugins('grade/report')) { // Get all installed reports
+ arsort($reports); // user is last, we want to test it first
+ foreach ($reports as $plugin) {
+ if (has_capability('gradereport/'.$plugin.':view', $context)) {
+ //stop when fisrt visible found
+ $reportavailable = true;
+ break;
+ }
}
}
}