original_string: public function get_submission_by_id($id) {
          global $DB;
  
          // we intentionally check the workshopid here, too, so the workshop can't touch submissions
          // from other instances
          $authorfields      = user_picture::fields('u', null, 'authoridx', 'author');
          $gradeoverbyfields = user_picture::fields('g', null, 'gradeoverbyx', 'gradeoverby');
          $sql = "SELECT s.*, $authorfields, $gradeoverbyfields
                    FROM {workshop_submissions} s
              INNER JOIN {user} u ON (s.authorid = u.id)
               LEFT JOIN {user} g ON (s.gradeoverby = g.id)
                   WHERE s.example = 0 AND s.workshopid = :workshopid AND s.id = :id";
          $params = array('workshopid' => $this->id, 'id' => $id);
          return $DB->get_record_sql($sql, $params, MUST_EXIST);
      }
code: public function get_submission_by_id($id) {
          global $DB;
  
          // we intentionally check the workshopid here, too, so the workshop can't touch submissions
          // from other instances
          $authorfields      = user_picture::fields('u', null, 'authoridx', 'author');
          $gradeoverbyfields = user_picture::fields('g', null, 'gradeoverbyx', 'gradeoverby');
          $sql = "SELECT s.*, $authorfields, $gradeoverbyfields
                    FROM {workshop_submissions} s
              INNER JOIN {user} u ON (s.authorid = u.id)
               LEFT JOIN {user} g ON (s.gradeoverby = g.id)
                   WHERE s.example = 0 AND s.workshopid = :workshopid AND s.id = :id";
          $params = array('workshopid' => $this->id, 'id' => $id);
          return $DB->get_record_sql($sql, $params, MUST_EXIST);
      }
code_tokens: public function get_submission_by_id ( $ id ) { global $ DB ; // we intentionally check the workshopid here, too, so the workshop can't touch submissions // from other instances $ authorfields = user_picture :: fields ( 'u' , null , 'authoridx' , 'author' ) ; $ gradeoverbyfields = user_picture :: fields ( 'g' , null , 'gradeoverbyx' , 'gradeoverby' ) ; $ sql = "SELECT s.*, $authorfields, $gradeoverbyfields
                    FROM {workshop_submissions} s
              INNER JOIN {user} u ON (s.authorid = u.id)
               LEFT JOIN {user} g ON (s.gradeoverby = g.id)
                   WHERE s.example = 0 AND s.workshopid = :workshopid AND s.id = :id" ; $ params = array ( 'workshopid' => $ this -> id , 'id' => $ id ) ; return $ DB -> get_record_sql ( $ sql , $ params , MUST_EXIST ) ; }
docstring: Returns a submission record with the author's data
  
  @param int $id submission id
  @return stdclass
docstring_tokens: Returns a submission record with the author s data