protected static function export_data_content($context, $recordobj, $fieldobj, $contentobj) {
        $value = (object)[
            'field' => [
                // Name and description are displayed in mod_data without applying format_string().
                'name' => $fieldobj->name,
                'description' => $fieldobj->description,
                'type' => $fieldobj->type,
                'required' => transform::yesno($fieldobj->required),
            ],
            'content' => $contentobj->content
        ];
        foreach (['content1', 'content2', 'content3', 'content4'] as $key) {
            if ($contentobj->$key !== null) {
                $value->$key = $contentobj->$key;
            }
        }
        $classname = manager::get_provider_classname_for_component('datafield_' . $fieldobj->type);
        if (class_exists($classname) && is_subclass_of($classname, datafield_provider::class)) {
            component_class_callback($classname, 'export_data_content',
                [$context, $recordobj, $fieldobj, $contentobj, $value]);
        } else {
            // Data field plugin does not implement datafield_provider, just export default value.
            writer::with_context($context)->export_data([$recordobj->id, $contentobj->id], $value);
        }
        writer::with_context($context)->export_area_files([$recordobj->id, $contentobj->id], 'mod_data',
            'content', $contentobj->id);
    }