protected static function has_marked_assignment_submissions($assignmentid, $userid) {
        global $DB;

        $params = [
            'assignment' => $assignmentid,
            'teacher'    => $userid
        ];

        $sql = "SELECT count(s.id) as nomarked
                  FROM {assignment_submissions} s
                 WHERE s.assignment = :assignment
                   AND s.teacher = :teacher";

        $results = $DB->get_record_sql($sql, $params);

        return ($results->nomarked > 0) ? true : false;
    }
protected static function has_marked_assignment_submissions($assignmentid, $userid) {
        global $DB;

        $params = [
            'assignment' => $assignmentid,
            'teacher'    => $userid
        ];

        $sql = "SELECT count(s.id) as nomarked
                  FROM {assignment_submissions} s
                 WHERE s.assignment = :assignment
                   AND s.teacher = :teacher";

        $results = $DB->get_record_sql($sql, $params);

        return ($results->nomarked > 0) ? true : false;
    }
protected static function has_marked_assignment_submissions ( $ assignmentid , $ userid ) { global $ DB ; $ params = [ 'assignment' => $ assignmentid , 'teacher' => $ userid ] ; $ sql = "SELECT count(s.id) as nomarked
                  FROM {assignment_submissions} s
                 WHERE s.assignment = :assignment
                   AND s.teacher = :teacher" ; $ results = $ DB -> get_record_sql ( $ sql , $ params ) ; return ( $ results -> nomarked > 0 ) ? true : false ; }
Helper function to check if a user has marked assignment submissions for a given assignment.

@param int $assignmentid The assignment ID to check if user has marked associated submissions.
@param int $userid       The user ID to check if user has marked associated submissions.
@return bool             If user has marked associated submissions returns true, otherwise false.
@throws \dml_exception
Helper function to check if a user has marked assignment submissions for a given assignment .