Merge branch 'MDL-50799-master' of git://github.com/merrill-oakland/moodle

This commit is contained in:
Dan Poltawski 2015-07-13 16:08:23 +01:00
commit 5852140e65
2 changed files with 8 additions and 2 deletions

View File

@ -715,8 +715,13 @@ class view {
echo $OUTPUT->render($pagingbar);
if ($totalnumber > DEFAULT_QUESTIONS_PER_PAGE) {
if ($perpage == DEFAULT_QUESTIONS_PER_PAGE) {
$url = new \moodle_url('edit.php', array_merge($pageurl->params(), array('qperpage' => 1000)));
$showall = '<a href="'.$url.'">'.get_string('showall', 'moodle', $totalnumber).'</a>';
$url = new \moodle_url('edit.php', array_merge($pageurl->params(),
array('qperpage' => MAXIMUM_QUESTIONS_PER_PAGE)));
if ($totalnumber > MAXIMUM_QUESTIONS_PER_PAGE) {
$showall = '<a href="'.$url.'">'.get_string('showperpage', 'moodle', MAXIMUM_QUESTIONS_PER_PAGE).'</a>';
} else {
$showall = '<a href="'.$url.'">'.get_string('showall', 'moodle', $totalnumber).'</a>';
}
} else {
$url = new \moodle_url('edit.php', array_merge($pageurl->params(),
array('qperpage' => DEFAULT_QUESTIONS_PER_PAGE)));

View File

@ -31,6 +31,7 @@ defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir . '/questionlib.php');
define('DEFAULT_QUESTIONS_PER_PAGE', 20);
define('MAXIMUM_QUESTIONS_PER_PAGE', 1000);
function get_module_from_cmid($cmid) {
global $CFG, $DB;