public static function get_responses_analysis($feedbackid, $groupid = 0, $page = 0, $perpage = 0, $courseid = 0) {

        $params = array('feedbackid' => $feedbackid, 'groupid' => $groupid, 'page' => $page, 'perpage' => $perpage,
            'courseid' => $courseid);
        $params = self::validate_parameters(self::get_responses_analysis_parameters(), $params);
        $warnings = $itemsdata = array();

        list($feedback, $course, $cm, $context, $completioncourse) = self::validate_feedback($params['feedbackid'],
            $params['courseid']);

        // Check permissions.
        require_capability('mod/feedback:viewreports', $context);

        if (!empty($params['groupid'])) {
            $groupid = $params['groupid'];
            // Determine is the group is visible to user.
            if (!groups_group_visible($groupid, $course, $cm)) {
                throw new moodle_exception('notingroup');
            }
        } else {
            // Check to see if groups are being used here.
            if ($groupmode = groups_get_activity_groupmode($cm)) {
                $groupid = groups_get_activity_group($cm);
                // Determine is the group is visible to user (this is particullary for the group 0 -> all groups).
                if (!groups_group_visible($groupid, $course, $cm)) {
                    throw new moodle_exception('notingroup');
                }
            } else {
                $groupid = 0;
            }
        }

        $feedbackstructure = new mod_feedback_structure($feedback, $cm, $completioncourse->id);
        $responsestable = new mod_feedback_responses_table($feedbackstructure, $groupid);
        // Ensure responses number is correct prior returning them.
        $feedbackstructure->shuffle_anonym_responses();
        $anonresponsestable = new mod_feedback_responses_anon_table($feedbackstructure, $groupid);

        $result = array(
            'attempts'          => $responsestable->export_external_structure($params['page'], $params['perpage']),
            'totalattempts'     => $responsestable->get_total_responses_count(),
            'anonattempts'      => $anonresponsestable->export_external_structure($params['page'], $params['perpage']),
            'totalanonattempts' => $anonresponsestable->get_total_responses_count(),
            'warnings'       => $warnings
        );
        return $result;
    }
public static function get_responses_analysis($feedbackid, $groupid = 0, $page = 0, $perpage = 0, $courseid = 0) {

        $params = array('feedbackid' => $feedbackid, 'groupid' => $groupid, 'page' => $page, 'perpage' => $perpage,
            'courseid' => $courseid);
        $params = self::validate_parameters(self::get_responses_analysis_parameters(), $params);
        $warnings = $itemsdata = array();

        list($feedback, $course, $cm, $context, $completioncourse) = self::validate_feedback($params['feedbackid'],
            $params['courseid']);

        // Check permissions.
        require_capability('mod/feedback:viewreports', $context);

        if (!empty($params['groupid'])) {
            $groupid = $params['groupid'];
            // Determine is the group is visible to user.
            if (!groups_group_visible($groupid, $course, $cm)) {
                throw new moodle_exception('notingroup');
            }
        } else {
            // Check to see if groups are being used here.
            if ($groupmode = groups_get_activity_groupmode($cm)) {
                $groupid = groups_get_activity_group($cm);
                // Determine is the group is visible to user (this is particullary for the group 0 -> all groups).
                if (!groups_group_visible($groupid, $course, $cm)) {
                    throw new moodle_exception('notingroup');
                }
            } else {
                $groupid = 0;
            }
        }

        $feedbackstructure = new mod_feedback_structure($feedback, $cm, $completioncourse->id);
        $responsestable = new mod_feedback_responses_table($feedbackstructure, $groupid);
        // Ensure responses number is correct prior returning them.
        $feedbackstructure->shuffle_anonym_responses();
        $anonresponsestable = new mod_feedback_responses_anon_table($feedbackstructure, $groupid);

        $result = array(
            'attempts'          => $responsestable->export_external_structure($params['page'], $params['perpage']),
            'totalattempts'     => $responsestable->get_total_responses_count(),
            'anonattempts'      => $anonresponsestable->export_external_structure($params['page'], $params['perpage']),
            'totalanonattempts' => $anonresponsestable->get_total_responses_count(),
            'warnings'       => $warnings
        );
        return $result;
    }
public static function get_responses_analysis ( $ feedbackid , $ groupid = 0 , $ page = 0 , $ perpage = 0 , $ courseid = 0 ) { $ params = array ( 'feedbackid' => $ feedbackid , 'groupid' => $ groupid , 'page' => $ page , 'perpage' => $ perpage , 'courseid' => $ courseid ) ; $ params = self :: validate_parameters ( self :: get_responses_analysis_parameters ( ) , $ params ) ; $ warnings = $ itemsdata = array ( ) ; list ( $ feedback , $ course , $ cm , $ context , $ completioncourse ) = self :: validate_feedback ( $ params [ 'feedbackid' ] , $ params [ 'courseid' ] ) ; // Check permissions. require_capability ( 'mod/feedback:viewreports' , $ context ) ; if ( ! empty ( $ params [ 'groupid' ] ) ) { $ groupid = $ params [ 'groupid' ] ; // Determine is the group is visible to user. if ( ! groups_group_visible ( $ groupid , $ course , $ cm ) ) { throw new moodle_exception ( 'notingroup' ) ; } } else { // Check to see if groups are being used here. if ( $ groupmode = groups_get_activity_groupmode ( $ cm ) ) { $ groupid = groups_get_activity_group ( $ cm ) ; // Determine is the group is visible to user (this is particullary for the group 0 -> all groups). if ( ! groups_group_visible ( $ groupid , $ course , $ cm ) ) { throw new moodle_exception ( 'notingroup' ) ; } } else { $ groupid = 0 ; } } $ feedbackstructure = new mod_feedback_structure ( $ feedback , $ cm , $ completioncourse -> id ) ; $ responsestable = new mod_feedback_responses_table ( $ feedbackstructure , $ groupid ) ; // Ensure responses number is correct prior returning them. $ feedbackstructure -> shuffle_anonym_responses ( ) ; $ anonresponsestable = new mod_feedback_responses_anon_table ( $ feedbackstructure , $ groupid ) ; $ result = array ( 'attempts' => $ responsestable -> export_external_structure ( $ params [ 'page' ] , $ params [ 'perpage' ] ) , 'totalattempts' => $ responsestable -> get_total_responses_count ( ) , 'anonattempts' => $ anonresponsestable -> export_external_structure ( $ params [ 'page' ] , $ params [ 'perpage' ] ) , 'totalanonattempts' => $ anonresponsestable -> get_total_responses_count ( ) , 'warnings' => $ warnings ) ; return $ result ; }
Return the feedback user responses.

@param int $feedbackid feedback instance id
@param int $groupid Group id, 0 means that the function will determine the user group
@param int $page the page of records to return
@param int $perpage the number of records to return per page
@param int $courseid course where user completes the feedback (for site feedbacks only)
@return array of warnings and users attemps and responses
@throws moodle_exception
@since Moodle 3.3
Return the feedback user responses .