original_string: protected function import_or_save_files($field, $context, $component, $filearea, $itemid) {
          if (!empty($field['itemid'])) {
              // This is the normal case. We are safing the questions editing form.
              return file_save_draft_area_files($field['itemid'], $context->id, $component,
                      $filearea, $itemid, $this->fileoptions, trim($field['text']));
  
          } else if (!empty($field['files'])) {
              // This is the case when we are doing an import.
              foreach ($field['files'] as $file) {
                  $this->import_file($context, $component,  $filearea, $itemid, $file);
              }
          }
          return trim($field['text']);
      }
code: protected function import_or_save_files($field, $context, $component, $filearea, $itemid) {
          if (!empty($field['itemid'])) {
              // This is the normal case. We are safing the questions editing form.
              return file_save_draft_area_files($field['itemid'], $context->id, $component,
                      $filearea, $itemid, $this->fileoptions, trim($field['text']));
  
          } else if (!empty($field['files'])) {
              // This is the case when we are doing an import.
              foreach ($field['files'] as $file) {
                  $this->import_file($context, $component,  $filearea, $itemid, $file);
              }
          }
          return trim($field['text']);
      }
code_tokens: protected function import_or_save_files ( $ field , $ context , $ component , $ filearea , $ itemid ) { if ( ! empty ( $ field [ 'itemid' ] ) ) { // This is the normal case. We are safing the questions editing form. return file_save_draft_area_files ( $ field [ 'itemid' ] , $ context -> id , $ component , $ filearea , $ itemid , $ this -> fileoptions , trim ( $ field [ 'text' ] ) ) ; } else if ( ! empty ( $ field [ 'files' ] ) ) { // This is the case when we are doing an import. foreach ( $ field [ 'files' ] as $ file ) { $ this -> import_file ( $ context , $ component , $ filearea , $ itemid , $ file ) ; } } return trim ( $ field [ 'text' ] ) ; }
docstring: Save the file belonging to one text field.
  
  @param array $field the data from the form (or from import). This will
  normally have come from the formslib editor element, so it will be an
  array with keys 'text', 'format' and 'itemid'. However, when we are
  importing, it will be an array with keys 'text', 'format' and 'files'
  @param object $context the context the question is in.
  @param string $component indentifies the file area question.
  @param string $filearea indentifies the file area questiontext,
  generalfeedback, answerfeedback, etc.
  @param int $itemid identifies the file area.
  
  @return string the text for this field, after files have been processed.
docstring_tokens: Save the file belonging to one text field .