Skip to content

Commit

Permalink
Merge branch 'MDL-31818_grader_paging' of git://github.com/andyjdavis…
Browse files Browse the repository at this point in the history
…/moodle
  • Loading branch information
Aparup Banerjee committed Mar 20, 2012
2 parents ef844d0 + 4a29d29 commit 7d2b2e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
8 changes: 1 addition & 7 deletions grade/report/grader/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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>';
Expand Down
7 changes: 3 additions & 4 deletions grade/report/grader/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 7d2b2e8

Please sign in to comment.