Merge branch 'MDL-74282-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE

This commit is contained in:
Jun Pataleta
2022-07-11 20:35:40 +08:00
4 changed files with 11 additions and 2 deletions
+6 -1
View File
@@ -3050,7 +3050,7 @@ abstract class grade_helper {
* @return array
*/
public static function get_plugins_reports($courseid) {
global $SITE;
global $SITE, $CFG;
if (self::$gradereports !== null) {
return self::$gradereports;
@@ -3064,6 +3064,11 @@ abstract class grade_helper {
continue;
}
// Remove outcomes report if outcomes not enabled.
if ($plugin === 'outcomes' && empty($CFG->enableoutcomes)) {
continue;
}
// Remove ones we can't see
if (!has_capability('gradereport/'.$plugin.':view', $context)) {
continue;
+4
View File
@@ -39,6 +39,10 @@ $context = context_course::instance($course->id);
require_capability('gradereport/outcomes:view', $context);
if (empty($CFG->enableoutcomes)) {
redirect(course_get_url($course), get_string('outcomesdisabled', 'core_grades'));
}
// First make sure we have proper final grades.
grade_regrade_final_grades_if_required($course);
-1
View File
@@ -71,7 +71,6 @@ Feature: We can enter in grades and view reports from the gradebook
Scenario: Grade a grade item and ensure the results display correctly in the gradebook
When I navigate to "View > User report" in the course gradebook
And "Grader report" "link" should exist
And "Outcomes report" "link" should exist
And the "Select all or one user" select box should contain "All users (1)"
And I log out
And I log in as "student1"
+1
View File
@@ -599,6 +599,7 @@ $string['outcomescoursecustom'] = 'Custom used (no remove)';
$string['outcomescoursenotused'] = 'Standard not used';
$string['outcomescourseused'] = 'Standard used (no remove)';
$string['outcomescustom'] = 'Custom outcomes';
$string['outcomesdisabled'] = 'Outcomes are not enabled';
$string['outcomeshortname'] = 'Short name';
$string['outcomesstandard'] = 'Standard outcomes';
$string['outcomesstandardavailable'] = 'Available standard outcomes';