MDL-74054 core_question: Re-apply filters when performing a qbank action

This changes the root element used by the fragment when
applying filters, so that the whole of display_question_list()
is reloaded.

This ensures that the returnurl will be updated correctly on the
question actions and bulk actions without manipulating then
further in Javascript.
This commit is contained in:
Mark Johnson
2023-09-22 10:53:46 +08:00
committed by Andrew Nicols
parent 9890e67e6d
commit feef716c91
5 changed files with 19 additions and 20 deletions
+6 -3
View File
@@ -138,8 +138,8 @@ function core_question_output_fragment_question_data(array $args): string {
} else {
$thispageurl->param('courseid', $params['courseid']);
}
if (!empty($args['filterquery'])) {
$thispageurl->param('filter', $args['filterquery']);
if (!empty($args['filtercondition'])) {
$thispageurl->param('filter', $args['filtercondition']);
}
if (!empty($args['lastchanged'])) {
$thispageurl->param('lastchanged', $args['lastchanged']);
@@ -150,5 +150,8 @@ function core_question_output_fragment_question_data(array $args): string {
}
}
$questionbank = new $viewclass($contexts, $thispageurl, $course, $cm, $params, $extraparams);
return $questionbank->display_questions_table();
$questionbank->add_standard_search_conditions();
ob_start();
$questionbank->display_question_list();
return ob_get_clean();
}