original_string: public static function get_submission($submissionid) {
          global $USER, $DB, $PAGE;
  
          $params = self::validate_parameters(self::get_submission_parameters(), array('submissionid' => $submissionid));
          $warnings = array();
  
          // Get and validate the submission and workshop.
          $submission = $DB->get_record('workshop_submissions', array('id' => $params['submissionid']), '*', MUST_EXIST);
          list($workshop, $course, $cm, $context) = self::validate_workshop($submission->workshopid);
  
          self::validate_submission($submission, $workshop);
  
          $submission = self::prepare_submission_for_external($submission, $workshop);
  
          $related = array('context' => $context);
          $exporter = new submission_exporter($submission, $related);
          return array(
              'submission' => $exporter->export($PAGE->get_renderer('core')),
              'warnings' => $warnings
          );
      }
code: public static function get_submission($submissionid) {
          global $USER, $DB, $PAGE;
  
          $params = self::validate_parameters(self::get_submission_parameters(), array('submissionid' => $submissionid));
          $warnings = array();
  
          // Get and validate the submission and workshop.
          $submission = $DB->get_record('workshop_submissions', array('id' => $params['submissionid']), '*', MUST_EXIST);
          list($workshop, $course, $cm, $context) = self::validate_workshop($submission->workshopid);
  
          self::validate_submission($submission, $workshop);
  
          $submission = self::prepare_submission_for_external($submission, $workshop);
  
          $related = array('context' => $context);
          $exporter = new submission_exporter($submission, $related);
          return array(
              'submission' => $exporter->export($PAGE->get_renderer('core')),
              'warnings' => $warnings
          );
      }
code_tokens: public static function get_submission ( $ submissionid ) { global $ USER , $ DB , $ PAGE ; $ params = self :: validate_parameters ( self :: get_submission_parameters ( ) , array ( 'submissionid' => $ submissionid ) ) ; $ warnings = array ( ) ; // Get and validate the submission and workshop. $ submission = $ DB -> get_record ( 'workshop_submissions' , array ( 'id' => $ params [ 'submissionid' ] ) , '*' , MUST_EXIST ) ; list ( $ workshop , $ course , $ cm , $ context ) = self :: validate_workshop ( $ submission -> workshopid ) ; self :: validate_submission ( $ submission , $ workshop ) ; $ submission = self :: prepare_submission_for_external ( $ submission , $ workshop ) ; $ related = array ( 'context' => $ context ) ; $ exporter = new submission_exporter ( $ submission , $ related ) ; return array ( 'submission' => $ exporter -> export ( $ PAGE -> get_renderer ( 'core' ) ) , 'warnings' => $ warnings ) ; }
docstring: Retrieves the given submission.
  
  @param int $submissionid the submission id
  @return array containing the submission and warnings.
  @since Moodle 3.4
  @throws moodle_exception
docstring_tokens: Retrieves the given submission .