private function prepare_user_for_display($user, $extrafields, $now) {
        $details = array(
            'userid'              => $user->id,
            'courseid'            => $this->get_course()->id,
            'picture'             => new user_picture($user),
            'userfullnamedisplay' => fullname($user, has_capability('moodle/site:viewfullnames', $this->get_context())),
            'lastaccess'          => get_string('never'),
            'lastcourseaccess'    => get_string('never'),
        );

        foreach ($extrafields as $field) {
            $details[$field] = $user->{$field};
        }

        // Last time user has accessed the site.
        if (!empty($user->lastaccess)) {
            $details['lastaccess'] = format_time($now - $user->lastaccess);
        }

        // Last time user has accessed the course.
        if (!empty($user->lastcourseaccess)) {
            $details['lastcourseaccess'] = format_time($now - $user->lastcourseaccess);
        }
        return $details;
    }