Hello everyone,
I got the issue that after copying a course with a filemanager $mform the included file doesn't copy correctly. More precisely the file doesn't get a new contextid in mdl_files.
You can find the plugincode here. That creates the issue that you have manually save the form to get access to the file in a answer attempt.
Do you have any idea if this is a known issue? It could also be that I'm making a mistake in my code but I tried to use Moodle plugins as a reference. Maybe there is an issue with me trying to get the correct filearea? (attachments).
Thanks in advance!