original_string: public function write_combined_feedback($questionoptions, $questionid, $contextid) {
          $fs = get_file_storage();
          $output = '';
  
          $fields = array('correctfeedback', 'partiallycorrectfeedback', 'incorrectfeedback');
          foreach ($fields as $field) {
              $formatfield = $field . 'format';
              $files = $fs->get_area_files($contextid, 'question', $field, $questionid);
  
              $output .= "    <{$field} {$this->format($questionoptions->$formatfield)}>\n";
              $output .= '      ' . $this->writetext($questionoptions->$field);
              $output .= $this->write_files($files);
              $output .= "    </{$field}>\n";
          }
  
          if (!empty($questionoptions->shownumcorrect)) {
              $output .= "    <shownumcorrect/>\n";
          }
          return $output;
      }
code: public function write_combined_feedback($questionoptions, $questionid, $contextid) {
          $fs = get_file_storage();
          $output = '';
  
          $fields = array('correctfeedback', 'partiallycorrectfeedback', 'incorrectfeedback');
          foreach ($fields as $field) {
              $formatfield = $field . 'format';
              $files = $fs->get_area_files($contextid, 'question', $field, $questionid);
  
              $output .= "    <{$field} {$this->format($questionoptions->$formatfield)}>\n";
              $output .= '      ' . $this->writetext($questionoptions->$field);
              $output .= $this->write_files($files);
              $output .= "    </{$field}>\n";
          }
  
          if (!empty($questionoptions->shownumcorrect)) {
              $output .= "    <shownumcorrect/>\n";
          }
          return $output;
      }
code_tokens: public function write_combined_feedback ( $ questionoptions , $ questionid , $ contextid ) { $ fs = get_file_storage ( ) ; $ output = '' ; $ fields = array ( 'correctfeedback' , 'partiallycorrectfeedback' , 'incorrectfeedback' ) ; foreach ( $ fields as $ field ) { $ formatfield = $ field . 'format' ; $ files = $ fs -> get_area_files ( $ contextid , 'question' , $ field , $ questionid ) ; $ output .= "    <{$field} {$this->format($questionoptions->$formatfield)}>\n" ; $ output .= '      ' . $ this -> writetext ( $ questionoptions -> $ field ) ; $ output .= $ this -> write_files ( $ files ) ; $ output .= "    </{$field}>\n" ; } if ( ! empty ( $ questionoptions -> shownumcorrect ) ) { $ output .= "    <shownumcorrect/>\n" ; } return $ output ; }
docstring: Output the combined feedback fields.
  @param object $questionoptions the question definition data.
  @param int $questionid the question id.
  @param int $contextid the question context id.
  @return string XML to output.
docstring_tokens: Output the combined feedback fields .