public static function export_user_data(approved_contextlist $contextlist) {
        global $DB;
        // Export rules.
        $context = \context_user::instance($contextlist->get_user()->id);
        $rules = $DB->get_records('tool_monitor_rules', ['userid' => $contextlist->get_user()->id]);
        if ($rules) {
            static::export_monitor_rules($rules, $context);
        }
        // Export subscriptions.
        $subscriptions = subscription_manager::get_user_subscriptions(0, 0, $contextlist->get_user()->id);
        if ($subscriptions) {
            static::export_monitor_subscriptions($subscriptions, $context);
        }
    }