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'));
$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);
$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;
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 ";