mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-74041 quiz: use own size for paging the question bank
This commit is contained in:
parent
10e8ffe312
commit
aac5b47cea
4 changed files with 29 additions and 12 deletions
|
@ -252,10 +252,12 @@ function question_edit_setup($edittab, $baseurl, $requirecmid = false, $unused =
|
|||
* @param string $edittab Code for this edit tab
|
||||
* @param string $baseurl The name of the script calling this funciton. For examle 'qusetion/edit.php'.
|
||||
* @param array $params The provided parameters to construct the resources with.
|
||||
* @param int $defaultquestionsperpage number of questions per page, if not given in the URL.
|
||||
* @return array $thispageurl, $contexts, $cmid, $cm, $module, $pagevars
|
||||
*/
|
||||
function question_build_edit_resources($edittab, $baseurl, $params) {
|
||||
global $DB, $PAGE, $CFG;
|
||||
function question_build_edit_resources($edittab, $baseurl, $params,
|
||||
$defaultquestionsperpage = DEFAULT_QUESTIONS_PER_PAGE) {
|
||||
global $DB;
|
||||
|
||||
$thispageurl = new moodle_url($baseurl);
|
||||
$thispageurl->remove_all_params(); // We are going to explicity add back everything important - this avoids unwanted params from being retained.
|
||||
|
@ -372,8 +374,12 @@ function question_build_edit_resources($edittab, $baseurl, $params) {
|
|||
$pagevars['qpage'] = 0;
|
||||
}
|
||||
|
||||
$pagevars['qperpage'] = question_set_or_get_user_preference(
|
||||
'qperpage', $qperpage, DEFAULT_QUESTIONS_PER_PAGE, $thispageurl);
|
||||
if ($defaultquestionsperpage == DEFAULT_QUESTIONS_PER_PAGE) {
|
||||
$pagevars['qperpage'] = question_set_or_get_user_preference(
|
||||
'qperpage', $qperpage, DEFAULT_QUESTIONS_PER_PAGE, $thispageurl);
|
||||
} else {
|
||||
$pagevars['qperpage'] = $qperpage ?? $defaultquestionsperpage;
|
||||
}
|
||||
|
||||
$defaultcategory = question_make_default_categories($contexts->all());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue