API or other automated way to create file aliases in a moodle course?

API or other automated way to create file aliases in a moodle course?

by Christian Steinert -
Number of replies: 0

Dear all

I have been searching for a solution repeatedly but so far I was completely unsuccessful.

We are looking for a way how we can automatically create file aliases in moodle while storing the files in a repository. Our workflow is such that we have all files stored in different folders of a repository (in our case based on Amazon S3). Uploading the files to the repository is a simple, automated process.

However, the problem is that then there is always the need to create file aliases for these files in the individual courses that should use these files.  Ideally, what we would need are folder aliases that point from a moodle course to a repository folder but as far as I understand such a feature does not exist at the moment.

Without folder aliases the second-best way would be if we could automate the linking of individual files by writing custom code (e.g. in PHP) that creates the desired aliases automatically. I have searched repeatedly for some kind of API that could be called to create a file alias for a repository file. But the only API documentation I have found about repositories explains how one can program a new repository type. Sadly, this is not what we need - what we would need would be to call the functionality of a repository in an automated way in order to query the contents of a repository and then to create a file alias inside of one of our courses for one of our repository file.

Is there any way to accomplish this?

I think the lack of solving this kind of problem has been the main reason why there was a major user protest when the repository mechanism was introduced with moodle 2.0. The repository mechanism as such is very reasonable and in fact helps us a lot; but not having a mechanism through which uploaded repository files can automatically appear in a course has hurt us greatly and has created lots of manual work since we moved away from moodle 1.9.

Therefore, any suggestion how to automate the creation of file aliases - even if it involves some programming - would be greatly appreciated.

Many thanks!

Christian


Average of ratings: Useful (1)