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