From 7b28a2bd1e6619438be55e2709086a7d22c01cbd Mon Sep 17 00:00:00 2001 From: Yannick VERHENNE Date: Tue, 2 Sep 2025 21:11:37 +0200 Subject: [PATCH] Quiz: # Add sorting by date and search by user in pending.php --- main/exercise/pending.php | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/main/exercise/pending.php b/main/exercise/pending.php index 46b4d5b164f..9940ed41a69 100644 --- a/main/exercise/pending.php +++ b/main/exercise/pending.php @@ -296,6 +296,22 @@ function updateExerciseList(courseId) { ] ); +$userOptions = []; +if (!empty($filter_user)) { + $userInfo = api_get_user_info($filter_user); + if (!empty($userInfo)) { + $userOptions[$filter_user] = $userInfo['complete_name_with_username']; + } +} +$form->addSelectAjax( + 'filter_by_user', + get_lang('User'), + $userOptions, + [ + 'url' => api_get_path(WEB_AJAX_PATH).'user_manager.ajax.php?a=get_user_like', + ] +); + $status = [ 1 => get_lang('All'), 2 => get_lang('Validated'), @@ -445,8 +461,12 @@ function action_formatter(cellvalue, options, rowObject) { return ""+cellvalue+""; }'; -$extra_params['autowidth'] = 'true'; -$extra_params['height'] = 'auto'; +$extra_params = [ + 'autowidth' => 'true', + 'height' => 'auto', + 'sortname' => 'exe_date', + 'sortorder' => 'asc', +]; $gridJs = Display::grid_js( 'results', $url,