Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-31818 grade: removed some broken code to do with overriding stude…

…nts per page, added a post variable so the page isnt lost when submitting grades
  • Loading branch information...
commit 989e8b7f0be0fc21575315290520aa692356ece3 1 parent 2eaa6c2
Andrew Davis authored nebgor committed
8  grade/report/grader/index.php
@@ -22,7 +22,6 @@
22 22
 
23 23
 $courseid      = required_param('id', PARAM_INT);        // course id
24 24
 $page          = optional_param('page', 0, PARAM_INT);   // active page
25  
-$perpageurl    = optional_param('perpage', 0, PARAM_INT);
26 25
 $edit          = optional_param('edit', -1, PARAM_BOOL); // sticky editting mode
27 26
 
28 27
 $sortitemid    = optional_param('sortitemid', 0, PARAM_ALPHANUM); // sort by which grade item
@@ -127,12 +126,6 @@
127 126
     $warnings = array();
128 127
 }
129 128
 
130  
-
131  
-// Override perpage if set in URL
132  
-if ($perpageurl) {
133  
-    $report->user_prefs['studentsperpage'] = $perpageurl;
134  
-}
135  
-
136 129
 // final grades MUST be loaded after the processing
137 130
 $report->load_users();
138 131
 $numusers = $report->get_numusers();
@@ -162,6 +155,7 @@
162 155
     echo '<input type="hidden" value="'.s($courseid).'" name="id" />';
163 156
     echo '<input type="hidden" value="'.sesskey().'" name="sesskey" />';
164 157
     echo '<input type="hidden" value="grader" name="report"/>';
  158
+    echo '<input type="hidden" value="'.$page.'" name="page"/>';
165 159
     echo $reporthtml;
166 160
     echo '<div class="submit"><input type="submit" value="'.s(get_string('update')).'" /></div>';
167 161
     echo '</div></form>';
7  grade/report/grader/lib.php
@@ -135,12 +135,11 @@ public function __construct($courseid, $gpr, $context, $page=null, $sortitemid=n
135 135
 
136 136
         $this->baseurl = new moodle_url('index.php', array('id' => $this->courseid));
137 137
 
138  
-        $studentsperpage = $this->get_pref('studentsperpage');
139  
-        if (!empty($studentsperpage)) {
140  
-            $this->baseurl->params(array('perpage' => $studentsperpage, 'page' => $this->page));
  138
+        if (!empty($this->page)) {
  139
+            $this->baseurl->params(array('page' => $this->page));
141 140
         }
142 141
 
143  
-        $this->pbarurl = new moodle_url('/grade/report/grader/index.php', array('id' => $this->courseid, 'perpage' => $studentsperpage));
  142
+        $this->pbarurl = new moodle_url('/grade/report/grader/index.php', array('id' => $this->courseid));
144 143
 
145 144
         $this->setup_groups();
146 145
 

0 notes on commit 989e8b7

Please sign in to comment.
Something went wrong with that request. Please try again.