How to manually copy files from one course to another

How to manually copy files from one course to another

- Helena Garcia の投稿
返信数: 3

I'm coding a local plugin in Moodle and I'm trying to copy resources from one course to another one manually (not doing a backup and restoring).

I've tried to manually get the resource, the course_module, the context and finally the file from DB, then copying rows and updating the fields that concern to the new course, and also chaning SHA1 from pathnamehash file's table field.

Any ideas or alternatives to do that?

Thanks!

Helena Garcia への返信

Re: How to manually copy files from one course to another

- Tim Hunt の投稿
画像 Core developers 画像 Documentation writers 画像 Particularly helpful Moodlers 画像 Peer reviewers 画像 Plugin developers