Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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 4a29d2912c96d8370b6afdfb6d89514de3dfe12d 1 parent 5bbf3cb
@andyjdavis andyjdavis authored
Showing with 4 additions and 11 deletions.
  1. +1 −7 grade/report/grader/index.php
  2. +3 −4 grade/report/grader/lib.php
View
8 grade/report/grader/index.php
@@ -29,7 +29,6 @@
$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 @@
$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 @@
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>';
View
7 grade/report/grader/lib.php
@@ -137,12 +137,11 @@ public function __construct($courseid, $gpr, $context, $page=null, $sortitemid=n
$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();
Please sign in to comment.
Something went wrong with that request. Please try again.