I was frustrated by moodle's interface that will only let me add one resource at a time. So, I have developed some code in PHP that will add several resources at once with minimal effort. However, It does not use moodle's internal functions or any of the administrative menus. In a nutshell, it runs completely independent of moodle and just modifies the databases that are the backend for moodle. Also, this is mainly intended for an administrative user, or maybe a trusted teacher.
Why?
Most of the data that is going to go on our moodle site is a collection of word/pdf/ppt files. I tried using directory listings, but our directories aren't in a very end-user friendly naming convention. I also tried SCORMs, but I didnt really like having to click on the module in the topic (We like everything listed in the topic). Finding and naming all these files one by one with the moodle interface is an incredibly time-consuming and tedious task that I dont wish upon anyone.
Features
- Pulls all course names and ids from moodle's db and then lists them in a nice little menu that you can select
- Input box that lets you put in the topic id for which to add to (topic #3, etc). (The section ID is automatically computed via a database pull).
- Dropdown menus that list all the files in the moodledata/{$courseid} folder. (I couldn't stand to type in all of those file names!)
- A name box next to each location drop down that lets me add in the name that the end user sees for the resource.
- Some light error checking to prevent accidental database injections.
- I'm still working on the dropdown menu code, and I'm having trouble alphabetizing it (I think I just need to change the directory listing code to an array, but it works at the moment).
- Only works with MySQL (I'll be honest, I dont know how any other dB's work)
- It doesn't tie in with the moodle interface at all, and may not meet the moodle development "guidelines" they have set forth. However, it gets the task done it was developed to do.
- Files need to be uploaded via FTP, SMB, SFTP, SCP, or a web based form to the moodledata/{$courseid} folder. I didn't plan on having the ability to upload files built in to it (why use it then, just use moodle's internal resource interface).
- No built in security (I have plans to tie it into moodle's built in auth(this shouldn't be that hard to implement), but at the moment there is no security, I suggest .htaccess, or IP based permissions on your server).
- Runs relatively quick. It isnt including a massive ammount of files, and there aren't any graphics/header includes/etc associated with the code.
- The code is relatively short. At the moment the code is about 450 lines or so.
I hope people will find my tool as useful as it is for me, I'm saving tons of a time a day when adding files to courses.
Also, please excuse any gramatical/spelling errors and any run-on sentances. I'm actually still a high school senior, and engish was never really my forte.
Thanks,
Richie Foreman
CTE Dept, Mesa Public Schools
oforema[at]mpsaz.org