diff --git a/grade/report/lib.php b/grade/report/lib.php index 59c462b6000..063cda31fa2 100644 --- a/grade/report/lib.php +++ b/grade/report/lib.php @@ -598,6 +598,11 @@ abstract class grade_report { $matrix = ['up' => 'desc', 'down' => 'asc']; $strsort = get_string($matrix[$direction], 'moodle'); $arrow = $OUTPUT->pix_icon($pix[$direction], '', '', ['class' => 'sorticon']); + + if (!empty($sortlink)) { + $sortlink->param('sort', ($direction == 'up' ? 'asc' : 'desc')); + } + return html_writer::link($sortlink, $arrow, ['title' => $strsort, 'aria-label' => $strsort, 'data-collapse' => 'sort', 'class' => 'arrow_link py-1']); }