protected static function is_course_modified($courseid, $since) {
        $logmang = get_log_manager();
        $readers = $logmang->get_readers('core\log\sql_reader');
        $params = array('courseid' => $courseid, 'since' => $since);

        foreach ($readers as $readerpluginname => $reader) {
            $where = "courseid = :courseid and timecreated > :since and crud <> 'r'";

            // Prevent logs of prevous backups causing a false positive.
            if ($readerpluginname != 'logstore_legacy') {
                $where .= " and target <> 'course_backup'";
            }

            if ($reader->get_events_select_count($where, $params)) {
                return true;
            }
        }
        return false;
    }