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

        $params = array('feedbackid' => $feedbackid, 'courseid' => $courseid);
        $params = self::validate_parameters(self::get_unfinished_responses_parameters(), $params);
        $warnings = $itemsdata = array();

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

        $responses = array();
        $unfinished = $feedbackcompletion->get_unfinished_responses();
        foreach ($unfinished as $u) {
            $exporter = new feedback_valuetmp_exporter($u);
            $responses[] = $exporter->export($PAGE->get_renderer('core'));
        }

        $result = array(
            'responses' => $responses,
            'warnings' => $warnings
        );
        return $result;
    }
public static function get_unfinished_responses($feedbackid, $courseid = 0) {
        global $PAGE;

        $params = array('feedbackid' => $feedbackid, 'courseid' => $courseid);
        $params = self::validate_parameters(self::get_unfinished_responses_parameters(), $params);
        $warnings = $itemsdata = array();

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

        $responses = array();
        $unfinished = $feedbackcompletion->get_unfinished_responses();
        foreach ($unfinished as $u) {
            $exporter = new feedback_valuetmp_exporter($u);
            $responses[] = $exporter->export($PAGE->get_renderer('core'));
        }

        $result = array(
            'responses' => $responses,
            'warnings' => $warnings
        );
        return $result;
    }
public static function get_unfinished_responses ( $ feedbackid , $ courseid = 0 ) { global $ PAGE ; $ params = array ( 'feedbackid' => $ feedbackid , 'courseid' => $ courseid ) ; $ params = self :: validate_parameters ( self :: get_unfinished_responses_parameters ( ) , $ params ) ; $ warnings = $ itemsdata = array ( ) ; list ( $ feedback , $ course , $ cm , $ context , $ completioncourse ) = self :: validate_feedback ( $ params [ 'feedbackid' ] , $ params [ 'courseid' ] ) ; $ feedbackcompletion = new mod_feedback_completion ( $ feedback , $ cm , $ completioncourse -> id ) ; $ responses = array ( ) ; $ unfinished = $ feedbackcompletion -> get_unfinished_responses ( ) ; foreach ( $ unfinished as $ u ) { $ exporter = new feedback_valuetmp_exporter ( $ u ) ; $ responses [ ] = $ exporter -> export ( $ PAGE -> get_renderer ( 'core' ) ) ; } $ result = array ( 'responses' => $ responses , 'warnings' => $ warnings ) ; return $ result ; }
Retrieves responses from the current unfinished attempt.

@param array $feedbackid feedback instance id
@param int $courseid course where user completes the feedback (for site feedbacks only)
@return array of warnings and launch information
@since Moodle 3.3
Retrieves responses from the current unfinished attempt .