public static function get_feedback_access_information($feedbackid, $courseid = 0) {
        global $PAGE;

        $params = array(
            'feedbackid' => $feedbackid,
            'courseid' => $courseid,
        );
        $params = self::validate_parameters(self::get_feedback_access_information_parameters(), $params);

        list($feedback, $course, $cm, $context, $completioncourse) = self::validate_feedback($params['feedbackid'],
            $params['courseid']);
        $feedbackcompletion = new mod_feedback_completion($feedback, $cm, $completioncourse->id);

        $result = array();
        // Capabilities first.
        $result['canviewanalysis'] = $feedbackcompletion->can_view_analysis();
        $result['cancomplete'] = $feedbackcompletion->can_complete();
        $result['cansubmit'] = $feedbackcompletion->can_submit();
        $result['candeletesubmissions'] = has_capability('mod/feedback:deletesubmissions', $context);
        $result['canviewreports'] = has_capability('mod/feedback:viewreports', $context);
        $result['canedititems'] = has_capability('mod/feedback:edititems', $context);

        // Status information.
        $result['isempty'] = $feedbackcompletion->is_empty();
        $result['isopen'] = $feedbackcompletion->is_open();
        $anycourse = ($course->id == SITEID);
        $result['isalreadysubmitted'] = $feedbackcompletion->is_already_submitted($anycourse);
        $result['isanonymous'] = $feedbackcompletion->is_anonymous();

        $result['warnings'] = [];
        return $result;
    }