protected function define_table_columns() {
        $extrafields = get_extra_user_fields($this->context);

        // Define headers and columns.
        $cols = array(
            'timemodified' => get_string('datetime', 'gradereport_history'),
            'fullname' => get_string('name')
        );

        // Add headers for extra user fields.
        foreach ($extrafields as $field) {
            if (get_string_manager()->string_exists($field, 'moodle')) {
                $cols[$field] = get_string($field);
            } else {
                $cols[$field] = $field;
            }
        }

        // Add remaining headers.
        $cols = array_merge($cols, array(
            'itemname' => get_string('gradeitem', 'grades'),
            'prevgrade' => get_string('gradeold', 'gradereport_history'),
            'finalgrade' => get_string('gradenew', 'gradereport_history'),
            'grader' => get_string('grader', 'gradereport_history'),
            'source' => get_string('source', 'gradereport_history'),
            'overridden' => get_string('overridden', 'grades'),
            'locked' => get_string('locked', 'grades'),
            'excluded' => get_string('excluded', 'gradereport_history'),
            'feedback' => get_string('feedbacktext', 'gradereport_history')
            )
        );

        $this->define_columns(array_keys($cols));
        $this->define_headers(array_values($cols));
    }