mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 13:02:07 +02:00
MDL-19052 fixed separate group mode access on grader report; merged from MOODLE_19_STABLE
This commit is contained in:
parent
48a4c84986
commit
7a9ba4b4e2
@ -112,6 +112,7 @@ if (!empty($target) && !empty($action) && confirm_sesskey()) {
|
||||
grade_report_grader::process_action($target, $action);
|
||||
}
|
||||
|
||||
$reportname = get_string('modulename', 'gradereport_grader');
|
||||
// Initialise the grader report object
|
||||
$report = new grade_report_grader($courseid, $gpr, $context, $page, $sortitemid);
|
||||
require_js(array('yui_yahoo', 'yui_dom', 'yui_event', 'yui_container', 'yui_connection', 'yui_dragdrop', 'yui_element', 'yui_json'));
|
||||
@ -119,6 +120,14 @@ if ($report->get_pref('enableajax')) {
|
||||
$report = new grade_report_grader_ajax($courseid, $gpr, $context, $page, $sortitemid);
|
||||
}
|
||||
|
||||
// make sure separate group does not prevent view
|
||||
if ($report->currentgroup == -2) {
|
||||
print_grade_page_head($COURSE->id, 'report', 'grader', $reportname, false, null, $buttons);
|
||||
print_heading(get_string("notingroup"));
|
||||
print_footer($course);
|
||||
exit;
|
||||
}
|
||||
|
||||
/// processing posted grades & feedback here
|
||||
if ($data = data_submitted() and confirm_sesskey() and has_capability('moodle/grade:edit', $context)) {
|
||||
$warnings = $report->process_data($data);
|
||||
@ -138,8 +147,6 @@ $numusers = $report->get_numusers();
|
||||
$report->load_final_grades();
|
||||
|
||||
/// Print header
|
||||
$reportname = get_string('modulename', 'gradereport_grader');
|
||||
// Matt - removed stylesheet
|
||||
print_grade_page_head($COURSE->id, 'report', 'grader', $reportname, false, null, $buttons);
|
||||
|
||||
echo $report->group_selector;
|
||||
|
@ -305,8 +305,12 @@ abstract class grade_report {
|
||||
protected function setup_groups() {
|
||||
/// find out current groups mode
|
||||
if ($this->groupmode = groups_get_course_groupmode($this->course)) {
|
||||
$this->currentgroup = groups_get_course_group($this->course, true);
|
||||
$this->group_selector = groups_print_course_menu($this->course, $this->pbarurl, true);
|
||||
$this->currentgroup = groups_get_course_group($this->course);
|
||||
|
||||
if ($this->groupmode == SEPARATEGROUPS and !$this->currentgroup and !has_capability('moodle/site:accessallgroups', $this->context)) {
|
||||
$this->currentgroup = -2; // means can not accesss any groups at all
|
||||
}
|
||||
|
||||
if ($this->currentgroup) {
|
||||
$this->groupsql = " JOIN {groups_members} gm ON gm.userid = u.id ";
|
||||
|
Loading…
x
Reference in New Issue
Block a user