original_string: protected function export_content(workshop_submission $workshopsubmission) {
  
          $output = '';
  
          if (!$workshopsubmission->is_anonymous()) {
              $author = username_load_fields_from_object((object)[], $workshopsubmission, 'author');
              $output .= html_writer::div(get_string('byfullnamewithoutlink', 'mod_workshop', fullname($author)));
          }
  
          $content = $this->format_exported_text($workshopsubmission->content, $workshopsubmission->contentformat);
          $content = portfolio_rewrite_pluginfile_urls($content, $this->workshop->context->id, 'mod_workshop',
              'submission_content', $workshopsubmission->id, $this->exporter->get('format'));
          $output .= html_writer::div($content);
  
          $output .= $this->export_files_list('submission_attachment');
  
          $strategy = $this->workshop->grading_strategy_instance();
  
          $canviewauthornames = has_capability('mod/workshop:viewauthornames', $this->workshop->context, $this->get('user'));
          $canviewreviewernames = has_capability('mod/workshop:viewreviewernames', $this->workshop->context, $this->get('user'));
  
          foreach ($this->assessments as $assessment) {
              $mform = $strategy->get_assessment_form(null, 'assessment', $assessment, false);
              $options = [
                  'showreviewer' => $canviewreviewernames,
                  'showauthor' => $canviewauthornames,
                  'showform' => true,
                  'showweight' => true,
              ];
              if ($assessment->reviewerid == $this->get('user')->id) {
                  $options['showreviewer'] = true;
              }
  
              $workshopassessment = $this->workshop->prepare_assessment($assessment, $mform, $options);
  
              if ($assessment->reviewerid == $this->get('user')->id) {
                  $workshopassessment->title = get_string('assessmentbyyourself', 'mod_workshop');
              } else {
                  $workshopassessment->title = get_string('assessment', 'mod_workshop');
              }
  
              $output .= html_writer::empty_tag('hr');
              $output .= $this->export_assessment($workshopassessment);
          }
  
          if (trim($this->workshop->instructauthors)) {
              $output .= html_writer::tag('h3', get_string('instructauthors', 'mod_workshop'));
              $content = $this->format_exported_text($this->workshop->instructauthors, $this->workshop->instructauthorsformat);
              $content = portfolio_rewrite_pluginfile_urls($content, $this->workshop->context->id, 'mod_workshop',
                  'instructauthors', 0, $this->exporter->get('format'));
              $output .= $content;
          }
  
          return html_writer::div($output);
      }
code: protected function export_content(workshop_submission $workshopsubmission) {
  
          $output = '';
  
          if (!$workshopsubmission->is_anonymous()) {
              $author = username_load_fields_from_object((object)[], $workshopsubmission, 'author');
              $output .= html_writer::div(get_string('byfullnamewithoutlink', 'mod_workshop', fullname($author)));
          }
  
          $content = $this->format_exported_text($workshopsubmission->content, $workshopsubmission->contentformat);
          $content = portfolio_rewrite_pluginfile_urls($content, $this->workshop->context->id, 'mod_workshop',
              'submission_content', $workshopsubmission->id, $this->exporter->get('format'));
          $output .= html_writer::div($content);
  
          $output .= $this->export_files_list('submission_attachment');
  
          $strategy = $this->workshop->grading_strategy_instance();
  
          $canviewauthornames = has_capability('mod/workshop:viewauthornames', $this->workshop->context, $this->get('user'));
          $canviewreviewernames = has_capability('mod/workshop:viewreviewernames', $this->workshop->context, $this->get('user'));
  
          foreach ($this->assessments as $assessment) {
              $mform = $strategy->get_assessment_form(null, 'assessment', $assessment, false);
              $options = [
                  'showreviewer' => $canviewreviewernames,
                  'showauthor' => $canviewauthornames,
                  'showform' => true,
                  'showweight' => true,
              ];
              if ($assessment->reviewerid == $this->get('user')->id) {
                  $options['showreviewer'] = true;
              }
  
              $workshopassessment = $this->workshop->prepare_assessment($assessment, $mform, $options);
  
              if ($assessment->reviewerid == $this->get('user')->id) {
                  $workshopassessment->title = get_string('assessmentbyyourself', 'mod_workshop');
              } else {
                  $workshopassessment->title = get_string('assessment', 'mod_workshop');
              }
  
              $output .= html_writer::empty_tag('hr');
              $output .= $this->export_assessment($workshopassessment);
          }
  
          if (trim($this->workshop->instructauthors)) {
              $output .= html_writer::tag('h3', get_string('instructauthors', 'mod_workshop'));
              $content = $this->format_exported_text($this->workshop->instructauthors, $this->workshop->instructauthorsformat);
              $content = portfolio_rewrite_pluginfile_urls($content, $this->workshop->context->id, 'mod_workshop',
                  'instructauthors', 0, $this->exporter->get('format'));
              $output .= $content;
          }
  
          return html_writer::div($output);
      }
code_tokens: protected function export_content ( workshop_submission $ workshopsubmission ) { $ output = '' ; if ( ! $ workshopsubmission -> is_anonymous ( ) ) { $ author = username_load_fields_from_object ( ( object ) [ ] , $ workshopsubmission , 'author' ) ; $ output .= html_writer :: div ( get_string ( 'byfullnamewithoutlink' , 'mod_workshop' , fullname ( $ author ) ) ) ; } $ content = $ this -> format_exported_text ( $ workshopsubmission -> content , $ workshopsubmission -> contentformat ) ; $ content = portfolio_rewrite_pluginfile_urls ( $ content , $ this -> workshop -> context -> id , 'mod_workshop' , 'submission_content' , $ workshopsubmission -> id , $ this -> exporter -> get ( 'format' ) ) ; $ output .= html_writer :: div ( $ content ) ; $ output .= $ this -> export_files_list ( 'submission_attachment' ) ; $ strategy = $ this -> workshop -> grading_strategy_instance ( ) ; $ canviewauthornames = has_capability ( 'mod/workshop:viewauthornames' , $ this -> workshop -> context , $ this -> get ( 'user' ) ) ; $ canviewreviewernames = has_capability ( 'mod/workshop:viewreviewernames' , $ this -> workshop -> context , $ this -> get ( 'user' ) ) ; foreach ( $ this -> assessments as $ assessment ) { $ mform = $ strategy -> get_assessment_form ( null , 'assessment' , $ assessment , false ) ; $ options = [ 'showreviewer' => $ canviewreviewernames , 'showauthor' => $ canviewauthornames , 'showform' => true , 'showweight' => true , ] ; if ( $ assessment -> reviewerid == $ this -> get ( 'user' ) -> id ) { $ options [ 'showreviewer' ] = true ; } $ workshopassessment = $ this -> workshop -> prepare_assessment ( $ assessment , $ mform , $ options ) ; if ( $ assessment -> reviewerid == $ this -> get ( 'user' ) -> id ) { $ workshopassessment -> title = get_string ( 'assessmentbyyourself' , 'mod_workshop' ) ; } else { $ workshopassessment -> title = get_string ( 'assessment' , 'mod_workshop' ) ; } $ output .= html_writer :: empty_tag ( 'hr' ) ; $ output .= $ this -> export_assessment ( $ workshopassessment ) ; } if ( trim ( $ this -> workshop -> instructauthors ) ) { $ output .= html_writer :: tag ( 'h3' , get_string ( 'instructauthors' , 'mod_workshop' ) ) ; $ content = $ this -> format_exported_text ( $ this -> workshop -> instructauthors , $ this -> workshop -> instructauthorsformat ) ; $ content = portfolio_rewrite_pluginfile_urls ( $ content , $ this -> workshop -> context -> id , 'mod_workshop' , 'instructauthors' , 0 , $ this -> exporter -> get ( 'format' ) ) ; $ output .= $ content ; } return html_writer :: div ( $ output ) ; }
docstring: Render the content of the submission.
  
  @param workshop_submission $workshopsubmission
  @return string
docstring_tokens: Render the content of the submission .