From 728e195c5e2eb4f269d06b1cfa881e668a6e542d Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Tue, 13 Feb 2018 11:25:52 +0800 Subject: [PATCH] MDL-61437 mod_quiz: rename question_build_display_preference function --- question/editlib.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/question/editlib.php b/question/editlib.php index 093dc1002e379..da255f515ddd7 100644 --- a/question/editlib.php +++ b/question/editlib.php @@ -481,7 +481,7 @@ function question_build_edit_resources($edittab, $baseurl, $params) { $pagevars['qpage'] = 0; } - $pagevars['qperpage'] = question_build_display_preference( + $pagevars['qperpage'] = question_set_or_get_user_preference( 'qperpage', $qperpage, DEFAULT_QUESTIONS_PER_PAGE, $thispageurl); $defaultcategory = question_make_default_categories($contexts->all()); @@ -503,9 +503,9 @@ function question_build_edit_resources($edittab, $baseurl, $params) { } // Display options. - $pagevars['recurse'] = question_build_display_preference('recurse', $recurse, 1, $thispageurl); - $pagevars['showhidden'] = question_build_display_preference('showhidden', $showhidden, 0, $thispageurl); - $pagevars['qbshowtext'] = question_build_display_preference('qbshowtext', $qbshowtext, 0, $thispageurl); + $pagevars['recurse'] = question_set_or_get_user_preference('recurse', $recurse, 1, $thispageurl); + $pagevars['showhidden'] = question_set_or_get_user_preference('showhidden', $showhidden, 0, $thispageurl); + $pagevars['qbshowtext'] = question_set_or_get_user_preference('qbshowtext', $qbshowtext, 0, $thispageurl); // Category list page. $pagevars['cpage'] = $cpage; @@ -548,7 +548,7 @@ function question_get_category_id_from_pagevars(array $pagevars) { */ function question_get_display_preference($param, $default, $type, $thispageurl) { $submittedvalue = optional_param($param, null, $type); - return question_build_display_preference($param, $submittedvalue, $default, $thispageurl); + return question_set_or_get_user_preference($param, $submittedvalue, $default, $thispageurl); } /** @@ -570,7 +570,7 @@ function question_get_display_preference($param, $default, $type, $thispageurl) * it to this URL. * @return mixed the parameter value to use. */ -function question_build_display_preference($name, $value, $default, $thispageurl) { +function question_set_or_get_user_preference($name, $value, $default, $thispageurl) { if (is_null($value)) { return get_user_preferences('question_bank_' . $name, $default); }