MDL-31818 grade: removed some broken code to do with overriding students per page...
authorAndrew Davis <andrew@moodle.com>
Fri, 2 Mar 2012 07:19:29 +0000 (14:19 +0700)
committerAndrew Davis <andrew@moodle.com>
Sat, 17 Mar 2012 02:51:21 +0000 (09:51 +0700)
grade/report/grader/index.php
grade/report/grader/lib.php

index 6cbaff1..890e204 100644 (file)
@@ -29,7 +29,6 @@ require_once $CFG->dirroot.'/grade/report/grader/lib.php';
 
 $courseid      = required_param('id', PARAM_INT);        // course id
 $page          = optional_param('page', 0, PARAM_INT);   // active page
-$perpageurl    = optional_param('perpage', 0, PARAM_INT);
 $edit          = optional_param('edit', -1, PARAM_BOOL); // sticky editting mode
 
 $sortitemid    = optional_param('sortitemid', 0, PARAM_ALPHANUM); // sort by which grade item
@@ -134,12 +133,6 @@ if ($data = data_submitted() and confirm_sesskey() and has_capability('moodle/gr
     $warnings = array();
 }
 
-
-// Override perpage if set in URL
-if ($perpageurl) {
-    $report->user_prefs['studentsperpage'] = $perpageurl;
-}
-
 // final grades MUST be loaded after the processing
 $report->load_users();
 $numusers = $report->get_numusers();
@@ -169,6 +162,7 @@ if ($USER->gradeediting[$course->id] && ($report->get_pref('showquickfeedback')
     echo '<input type="hidden" value="'.s($courseid).'" name="id" />';
     echo '<input type="hidden" value="'.sesskey().'" name="sesskey" />';
     echo '<input type="hidden" value="grader" name="report"/>';
+    echo '<input type="hidden" value="'.$page.'" name="page"/>';
     echo $reporthtml;
     echo '<div class="submit"><input type="submit" value="'.s(get_string('update')).'" /></div>';
     echo '</div></form>';
index 5771195..683850e 100644 (file)
@@ -137,12 +137,11 @@ class grade_report_grader extends grade_report {
 
         $this->baseurl = new moodle_url('index.php', array('id' => $this->courseid));
 
-        $studentsperpage = $this->get_pref('studentsperpage');
-        if (!empty($studentsperpage)) {
-            $this->baseurl->params(array('perpage' => $studentsperpage, 'page' => $this->page));
+        if (!empty($this->page)) {
+            $this->baseurl->params(array('page' => $this->page));
         }
 
-        $this->pbarurl = new moodle_url('/grade/report/grader/index.php', array('id' => $this->courseid, 'perpage' => $studentsperpage));
+        $this->pbarurl = new moodle_url('/grade/report/grader/index.php', array('id' => $this->courseid));
 
         $this->setup_groups();