diff --git a/mod/quiz/edit.php b/mod/quiz/edit.php index efaf0bdb1327f..db22db5d9e4be 100644 --- a/mod/quiz/edit.php +++ b/mod/quiz/edit.php @@ -426,8 +426,7 @@ function module_specific_controls($totalnumber, $recurse, $category, $cmid, $cmo echo '
'; $questionbank->display('editq', $pagevars['qpage'], - $pagevars['qperpage'], $pagevars['qsortorder'], - $pagevars['qsortorderdecoded'], + $pagevars['qperpage'], $pagevars['cat'], $pagevars['recurse'], $pagevars['showhidden'], $pagevars['showquestiontext']); echo '
'; diff --git a/mod/quiz/editlib.php b/mod/quiz/editlib.php index f93d9c0ef5ae9..c93d47143cfcf 100644 --- a/mod/quiz/editlib.php +++ b/mod/quiz/editlib.php @@ -1065,8 +1065,8 @@ public function add_to_quiz_url($questionid) { return new moodle_url('/mod/quiz/edit.php', $params); } - public function display($tabname, $page, $perpage, $sortorder, - $sortorderdecoded, $cat, $recurse, $showhidden, $showquestiontext) { + public function display($tabname, $page, $perpage, $cat, + $recurse, $showhidden, $showquestiontext) { global $OUTPUT; if ($this->process_actions_needing_ui()) { return; @@ -1084,8 +1084,9 @@ public function display($tabname, $page, $perpage, $sortorder, $this->baseurl, $cat); // continues with list of questions - $this->display_question_list($this->contexts->having_one_edit_tab_cap($tabname), $this->baseurl, $cat, $this->cm, - $recurse, $page, $perpage, $showhidden, $sortorder, $sortorderdecoded, $showquestiontext, + $this->display_question_list($this->contexts->having_one_edit_tab_cap($tabname), + $this->baseurl, $cat, $this->cm, $recurse, $page, + $perpage, $showhidden, $showquestiontext, $this->contexts->having_cap('moodle/question:add')); $this->display_options($recurse, $showhidden, $showquestiontext); diff --git a/question/edit.php b/question/edit.php index b7e4181a1441b..fe948d2894f6d 100644 --- a/question/edit.php +++ b/question/edit.php @@ -71,10 +71,9 @@ echo $OUTPUT->header(); echo '
'; - $questionbank->display('questions', $pagevars['qpage'], - $pagevars['qperpage'], $pagevars['qsortorder'], $pagevars['qsortorderdecoded'], - $pagevars['cat'], $pagevars['recurse'], $pagevars['showhidden'], $pagevars['showquestiontext']); + $questionbank->display('questions', $pagevars['qpage'], $pagevars['qperpage'], + $pagevars['cat'], $pagevars['recurse'], $pagevars['showhidden'], + $pagevars['showquestiontext']); echo "
\n"; echo $OUTPUT->footer(); - diff --git a/question/editlib.php b/question/editlib.php index 865cbb6b7cd2d..afcfa38873348 100644 --- a/question/editlib.php +++ b/question/editlib.php @@ -155,7 +155,6 @@ public function is_extra_row() { /** * Output the column header cell. - * @param integer $currentsort 0 for none. 1 for normal sort, -1 for reverse sort. */ public function display_header() { echo ''; @@ -1103,8 +1102,8 @@ public function preview_question_url($questionid) { * category Chooses the category * displayoptions Sets display options */ - public function display($tabname, $page, $perpage, $sortorder, - $sortorderdecoded, $cat, $recurse, $showhidden, $showquestiontext){ + public function display($tabname, $page, $perpage, $cat, + $recurse, $showhidden, $showquestiontext) { global $PAGE, $OUTPUT; if ($this->process_actions_needing_ui()) { @@ -1126,8 +1125,9 @@ public function display($tabname, $page, $perpage, $sortorder, $this->print_category_info($category); // continues with list of questions - $this->display_question_list($this->contexts->having_one_edit_tab_cap($tabname), $this->baseurl, $cat, $this->cm, - $recurse, $page, $perpage, $showhidden, $sortorder, $sortorderdecoded, $showquestiontext, + $this->display_question_list($this->contexts->having_one_edit_tab_cap($tabname), + $this->baseurl, $cat, $this->cm, + $recurse, $page, $perpage, $showhidden, $showquestiontext, $this->contexts->having_cap('moodle/question:add')); } @@ -1232,7 +1232,6 @@ protected function create_new_question_form($category, $canadd) { */ protected function display_question_list($contexts, $pageurl, $categoryandcontext, $cm = null, $recurse=1, $page=0, $perpage=100, $showhidden=false, - $sortorder='typename', $sortorderdecoded='qtype, name ASC', $showquestiontext = false, $addcontexts = array()) { global $CFG, $DB, $OUTPUT; @@ -1576,17 +1575,12 @@ function question_edit_setup($edittab, $baseurl, $requirecmid = false, $requirec $pagevars['qperpage'] = DEFAULT_QUESTIONS_PER_PAGE; } - $sortoptions = array('alpha' => 'name, qtype ASC', - 'typealpha' => 'qtype, name ASC', - 'age' => 'id ASC'); - - if ($sortorder = optional_param('qsortorder', '', PARAM_ALPHA)) { - $pagevars['qsortorderdecoded'] = $sortoptions[$sortorder]; - $pagevars['qsortorder'] = $sortorder; - $thispageurl->param('qsortorder', $sortorder); - } else { - $pagevars['qsortorderdecoded'] = $sortoptions['typealpha']; - $pagevars['qsortorder'] = 'typealpha'; + for ($i = 1; $i <= question_bank_view::MAX_SORTS; $i++) { + $param = 'qbs' . $i; + if (!$sort = optional_param($param, '', PARAM_ALPHAEXT)) { + break; + } + $thispageurl->param($param, $sort); } $defaultcategory = question_make_default_categories($contexts->all());