public function get_sort_columns() {
        $result = parent::get_sort_columns();

        $assignment = $this->assignment->get_instance();
        if (empty($assignment->blindmarking)) {
            $result = array_merge($result, array('userid' => SORT_ASC));
        } else {
            $result = array_merge($result, [
                    'COALESCE(s.timecreated, '  . time()        . ')'   => SORT_ASC,
                    'COALESCE(s.id, '           . PHP_INT_MAX   . ')'   => SORT_ASC,
                    'um.id'                                             => SORT_ASC,
                ]);
        }
        return $result;
    }
public function get_sort_columns() {
        $result = parent::get_sort_columns();

        $assignment = $this->assignment->get_instance();
        if (empty($assignment->blindmarking)) {
            $result = array_merge($result, array('userid' => SORT_ASC));
        } else {
            $result = array_merge($result, [
                    'COALESCE(s.timecreated, '  . time()        . ')'   => SORT_ASC,
                    'COALESCE(s.id, '           . PHP_INT_MAX   . ')'   => SORT_ASC,
                    'um.id'                                             => SORT_ASC,
                ]);
        }
        return $result;
    }
public function get_sort_columns ( ) { $ result = parent :: get_sort_columns ( ) ; $ assignment = $ this -> assignment -> get_instance ( ) ; if ( empty ( $ assignment -> blindmarking ) ) { $ result = array_merge ( $ result , array ( 'userid' => SORT_ASC ) ) ; } else { $ result = array_merge ( $ result , [ 'COALESCE(s.timecreated, ' . time ( ) . ')' => SORT_ASC , 'COALESCE(s.id, ' . PHP_INT_MAX . ')' => SORT_ASC , 'um.id' => SORT_ASC , ] ) ; } return $ result ; }
Always return a valid sort - even if the userid column is missing.
@return array column name => SORT_... constant.
Always return a valid sort - even if the userid column is missing .