File resource in Moodle is another course element that can be used for serving files for students. It’s assumed that there will be only one file per resource, but you can upload multiple files and set one of them as default to be downloaded when student click on the resource.
We’ll be adding multiple resources and multiple files in this example. Doing so using pure php coding would be complicated enough to mess things up very easily, so we’ll use Moodle APIs to do some things for us. And it’ll be additional plus as we will be more Moodle version independent as long as API will remain not changed. Continue reading Moodle: Add (file) resources and upload files into it