original_string: public static function get_finished_responses($feedbackid, $courseid = 0) {
          global $PAGE;
  
          $params = array('feedbackid' => $feedbackid, 'courseid' => $courseid);
          $params = self::validate_parameters(self::get_finished_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();
          // Load and get the responses from the last completed feedback.
          $feedbackcompletion->find_last_completed();
          $unfinished = $feedbackcompletion->get_finished_responses();
          foreach ($unfinished as $u) {
              $exporter = new feedback_value_exporter($u);
              $responses[] = $exporter->export($PAGE->get_renderer('core'));
          }
  
          $result = array(
              'responses' => $responses,
              'warnings' => $warnings
          );
          return $result;
      }
code: public static function get_finished_responses($feedbackid, $courseid = 0) {
          global $PAGE;
  
          $params = array('feedbackid' => $feedbackid, 'courseid' => $courseid);
          $params = self::validate_parameters(self::get_finished_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();
          // Load and get the responses from the last completed feedback.
          $feedbackcompletion->find_last_completed();
          $unfinished = $feedbackcompletion->get_finished_responses();
          foreach ($unfinished as $u) {
              $exporter = new feedback_value_exporter($u);
              $responses[] = $exporter->export($PAGE->get_renderer('core'));
          }
  
          $result = array(
              'responses' => $responses,
              'warnings' => $warnings
          );
          return $result;
      }
code_tokens: public static function get_finished_responses ( $ feedbackid , $ courseid = 0 ) { global $ PAGE ; $ params = array ( 'feedbackid' => $ feedbackid , 'courseid' => $ courseid ) ; $ params = self :: validate_parameters ( self :: get_finished_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 ( ) ; // Load and get the responses from the last completed feedback. $ feedbackcompletion -> find_last_completed ( ) ; $ unfinished = $ feedbackcompletion -> get_finished_responses ( ) ; foreach ( $ unfinished as $ u ) { $ exporter = new feedback_value_exporter ( $ u ) ; $ responses [ ] = $ exporter -> export ( $ PAGE -> get_renderer ( 'core' ) ) ; } $ result = array ( 'responses' => $ responses , 'warnings' => $ warnings ) ; return $ result ; }
docstring: Retrieves responses from the last finished 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 the responses
  @since Moodle 3.3
docstring_tokens: Retrieves responses from the last finished attempt .