original_string: public function view(stdClass $submission) {
          global $CFG;
          $result = '';
  
          $onlinetextsubmission = $this->get_onlinetext_submission($submission->id);
  
          if ($onlinetextsubmission) {
  
              // Render for portfolio API.
              $result .= $this->assignment->render_editor_content(ASSIGNSUBMISSION_ONLINETEXT_FILEAREA,
                                                                  $onlinetextsubmission->submission,
                                                                  $this->get_type(),
                                                                  'onlinetext',
                                                                  'assignsubmission_onlinetext');
  
              $plagiarismlinks = '';
  
              if (!empty($CFG->enableplagiarism)) {
                  require_once($CFG->libdir . '/plagiarismlib.php');
  
                  $plagiarismlinks .= plagiarism_get_links(array('userid' => $submission->userid,
                      'content' => trim($onlinetextsubmission->onlinetext),
                      'cmid' => $this->assignment->get_course_module()->id,
                      'course' => $this->assignment->get_course()->id,
                      'assignment' => $submission->assignment));
              }
          }
  
          return $plagiarismlinks . $result;
      }
code: public function view(stdClass $submission) {
          global $CFG;
          $result = '';
  
          $onlinetextsubmission = $this->get_onlinetext_submission($submission->id);
  
          if ($onlinetextsubmission) {
  
              // Render for portfolio API.
              $result .= $this->assignment->render_editor_content(ASSIGNSUBMISSION_ONLINETEXT_FILEAREA,
                                                                  $onlinetextsubmission->submission,
                                                                  $this->get_type(),
                                                                  'onlinetext',
                                                                  'assignsubmission_onlinetext');
  
              $plagiarismlinks = '';
  
              if (!empty($CFG->enableplagiarism)) {
                  require_once($CFG->libdir . '/plagiarismlib.php');
  
                  $plagiarismlinks .= plagiarism_get_links(array('userid' => $submission->userid,
                      'content' => trim($onlinetextsubmission->onlinetext),
                      'cmid' => $this->assignment->get_course_module()->id,
                      'course' => $this->assignment->get_course()->id,
                      'assignment' => $submission->assignment));
              }
          }
  
          return $plagiarismlinks . $result;
      }
code_tokens: public function view ( stdClass $ submission ) { global $ CFG ; $ result = '' ; $ onlinetextsubmission = $ this -> get_onlinetext_submission ( $ submission -> id ) ; if ( $ onlinetextsubmission ) { // Render for portfolio API. $ result .= $ this -> assignment -> render_editor_content ( ASSIGNSUBMISSION_ONLINETEXT_FILEAREA , $ onlinetextsubmission -> submission , $ this -> get_type ( ) , 'onlinetext' , 'assignsubmission_onlinetext' ) ; $ plagiarismlinks = '' ; if ( ! empty ( $ CFG -> enableplagiarism ) ) { require_once ( $ CFG -> libdir . '/plagiarismlib.php' ) ; $ plagiarismlinks .= plagiarism_get_links ( array ( 'userid' => $ submission -> userid , 'content' => trim ( $ onlinetextsubmission -> onlinetext ) , 'cmid' => $ this -> assignment -> get_course_module ( ) -> id , 'course' => $ this -> assignment -> get_course ( ) -> id , 'assignment' => $ submission -> assignment ) ) ; } } return $ plagiarismlinks . $ result ; }
docstring: Display the saved text content from the editor in the view table
  
  @param stdClass $submission
  @return string
docstring_tokens: Display the saved text content from the editor in the view table