managing and updating a large number of files (repository, legacy files, show a directory)

managing and updating a large number of files (repository, legacy files, show a directory)

Stephen Ogden གིས-
Number of replies: 6

Hi all,

I'm trying to work out how (in M2) to replicate something we used to do in M1.9.

Our 1.9 workflow is:

  • Create a local directory structure (four folders each with many sub-folders) with several hundred files in.
  • Use some command-line scripts to sync these local files into a specific directory on the Moodle server.
  • In a Moodle course use 'display a directory' to link each of the four top level folders to the course.
  • On a regular basis synchronise the files knowing the files available in the course are updated.
  • On a regular basis add new files locally which will be synched to the server and also avaialble in the existing 'directory' resources.

In Moodle 2 I have found out how to create a repository on the server, and I can synchronise all my files/folders to this repository. However I can not work out how to display my four top level folders.

It appears to me that I can only make course 'folders' and have to manually re-create my file-system tree, and then one by one link to the hundreds of repository files in the right places. I am fairly sure that synchronising these existing files will make the updated files available in the course. However any new files added locally and synched to the server will not show up unless I manually add them.

Given I have hudreds of such files I am VERY happy to manage via a repository, but how can I display them (with ease) via the VLE? Have I misunderstood something fundamental?

many thanks

དཔྱ་སྙོམས་ཀྱི་སྐུགས་ཚུ།:Useful (1)
In reply to Stephen Ogden

Re: managing and updating a large number of files (repository, legacy files, show a directory)

Visvanath Ratnaweera གིས-
Particularly helpful Moodlers གི་པར Translators གི་པར
Hi Stephen

I don't have the answer, sorry. In fact I have a similar "simple" task which is apparently not possible in the 2.x core. See "User file space(s)" http://moodle.org/mod/forum/discuss.php?d=191894.

May be this long discussion, "Repositories and File management in 2.0 – Overview/Discussion" http://moodle.org/mod/forum/discuss.php?d=174702 touches our problem.
In reply to Stephen Ogden

Re: managing and updating a large number of files (repository, legacy files, show a directory)

Davo Smith གིས-
Core developers གི་པར Particularly helpful Moodlers གི་པར Peer reviewers གི་པར Plugin developers གི་པར

There is no built-in way to view a folder of files from a repository as a student on a course. Repositories are really meant for teachers / course creators to access resources that can then be used to build up the course within Moodle (rather than having a list of files already prepared).

A couple of possible solutions:

1. Use my drag and drop upload block to move a large number of files quickly into a course page (but these would not be displayed in a sub-folder and would need to be deleted individually when updated).

2. Write (or get someone to write for you) a plugin that could call the repository API and either:

a) display a raw list of files to the end user and let them download them directly from the repo OR

b) import all the files from a folder (and sub-folders?) in a repo into a folder within Moodle and display them there, with a button to 'refresh' the file list (or have it set up via cron to query every 10 min or so, to see if there are any changes to propagate)

I think option 2 is probably the best solution and probably not that difficult to do, but it would need someone to take the time to write it (and I'm not volunteering to do any more spare-time coding at the moment, so I'd only have time to do something like that if it came through my employers at Synergy Learning).

In reply to Davo Smith

Re: managing and updating a large number of files (repository, legacy files, show a directory)

Visvanath Ratnaweera གིས-
Particularly helpful Moodlers གི་པར Translators གི་པར
Hi Davo

Thanks a lot, very useful information (pity I can rate posts only as 'Userful' ;)

Any differences in this respect between 2.1 and 2.2? I have been testing under 2.1, could move to 2.2 as well.
In reply to Visvanath Ratnaweera

Re: managing and updating a large number of files (repository, legacy files, show a directory)

Davo Smith གིས-
Core developers གི་པར Particularly helpful Moodlers གི་པར Peer reviewers གི་པར Plugin developers གི་པར

In this instance, there is nothing different between 2.1 & 2.2 that I am aware of (but I'm ready to stand corrected on this point).

In reply to Davo Smith

Re: managing and updating a large number of files (repository, legacy files, show a directory)

Nathan Mares གིས-

Or a third option:

- extend the built in file manager to support drag and drop upload

- and store your file structure in an instance of the existing folder mod

I've spent a bit of time doing getting just this kind of thing working (inspired by your dndupload block Davo). I'd be happy to share it with the community if others are interested. There's also an AJAXy folder browser to complement it.

Unfortunately this kind of extension does necessitate a minor core hack to include a JS file (at least that's the only way I can figure out how to do that...)

Possibly not quite what you're after Stephen in terms of being able to manage your file structure outside of Moodle but it does remove the need to link to or upload each of the files one by one.

In reply to Nathan Mares

Re: managing and updating a large number of files (repository, legacy files, show a directory)

Davo Smith གིས-
Core developers གི་པར Particularly helpful Moodlers གི་པར Peer reviewers གི་པར Plugin developers གི་པར

The filemanager/filepicker elements already supports drag and drop upload as of Moodle 2.3 - see http://tracker.moodle.org/browse/MDL-29766