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;
    }
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;
    }
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 ; }
Trigger the submission viewed event.

@param int $submissionid submission id
@return array of warnings and status result
@since Moodle 3.4
@throws moodle_exception
Trigger the submission viewed event .