protected static function export_glossary_data_for_user(array $glossarydata, \context_module $context,
                                                            array $subcontext, \stdClass $user) {
        // Fetch the generic module data for the glossary.
        $contextdata = helper::get_context_data($context, $user);
        // Merge with glossary data and write it.
        $contextdata = (object)array_merge((array)$contextdata, $glossarydata);
        writer::with_context($context)->export_data($subcontext, $contextdata);
        // Write generic module intro files.
        helper::export_context_files($context, $user);
    }