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;
    }