original_string: public static function view_submission($submissionid) {
          global $DB;
  
          $params = self::validate_parameters(self::view_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);
  
          $workshop->set_submission_viewed($submission);
  
          $result = array(
              'status' => true,
              'warnings' => $warnings,
          );
          return $result;
      }
code: public static function view_submission($submissionid) {
          global $DB;
  
          $params = self::validate_parameters(self::view_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);
  
          $workshop->set_submission_viewed($submission);
  
          $result = array(
              'status' => true,
              'warnings' => $warnings,
          );
          return $result;
      }
code_tokens: public static function view_submission ( $ submissionid ) { global $ DB ; $ params = self :: validate_parameters ( self :: view_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 ) ; $ workshop -> set_submission_viewed ( $ submission ) ; $ result = array ( 'status' => true , 'warnings' => $ warnings , ) ; return $ result ; }
docstring: Trigger the submission viewed event.
  
  @param int $submissionid submission id
  @return array of warnings and status result
  @since Moodle 3.4
  @throws moodle_exception
docstring_tokens: Trigger the submission viewed event .