Set up an FTP repository in 2.0

Set up an FTP repository in 2.0

by Joseph Rézeau -
Number of replies: 15
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hello,

I am - still reluctantly wink - trying to use the new repository system in Moodle 2.0. How can I do the following?

I do not have (and I do not want to have) any of the "fancy" new repositories (Alfresco, Box.net, Dropbox, Flickr etc.) that are available in 2.0.

On my 1&1 web space I have a "moodle_repository" folder with a number of files I intend to use in my moodle 2.0 test site.

What kind of repository should I setup in my moodle site Manage repositories? I actually need a kind of FTP repository facility, but it does not exist. Maybe WebDav, but I still have not found a convincing step-by-step explanation of how to do this in the Moodle forums.

Joseph

Average of ratings: -
In reply to Joseph Rézeau

Re: Set up an FTP repository in 2.0

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
My understanding is that this IS the file system repository you were talking about in another post - ie - you create a folder on your server and that becomes your choice in the filesystem repository. When it is in a course teachers can access files that are in it - as long as they have been added to the folder on the server via ftp. Have you seen this? http://moodle.drupalgardens.com/article/tue-06152010-1918/ftp-files-moodle-20-repository-api
Or have I misunderstood you? It won't be much use to our teachers as we don't have FTP access to the server to make and upload to such a "moodle-repository" folder.
In reply to Mary Cooch

Re: Set up an FTP repository in 2.0

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Mary and thanks for the help. You are misunderstanding me. In this case I do not want to use a files repository inside my moodle 2.0 server/moodledata/ folder, but in a totally different place on the web.
In reply to Joseph Rézeau

Re: Set up an FTP repository in 2.0

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
bump!
In reply to Joseph Rézeau

Re: Set up an FTP repository in 2.0

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
I don't know Joseph but maybe if I do that "bump" too, someone better informed will see itbig grin
In reply to Mary Cooch

Re: Set up an FTP repository in 2.0

by Clarence Prudhoe -

Hi Joseph,

I also need an FTP repository that the Teacher can access.  You wrote:

  • I actually need a kind of FTP repository facility, but it does not exist.
  • Maybe WebDav, but I still have not found a convincing step-by-step explanation of how to do this in the Moodle forums.

I tried to set up the WebDav using my cPanel with no success.  It requires the administrator to setup the WebDav via cPanel, then each teacher must download and install the WebDav application.  I couldn't get the server to accept the login credentials.   I didn't contact my host, but I assume it won't work on a shared server. 

So I took a closer look at the Moodle File System Repository.  I found that you can combine the File System Repository with the Private Files Block so a teacher can access and upload files to both the Common Instance folders and the Private Instance folders using the File Picker.  At least this is the way I think it is supposed to work.  There is a bug that won't allow you to view the Private Instance folders in the File Picker (see http://tracker.moodle.org/browse/MDL-24210).

You can FTP files to the the File System Repository, but you have to have some way to give a teacher access to FTP.  I tried the password protected function in cPanel but the teacher still has to download and install an FTP application like FileZilla.  Then he must setup the username and password to access the password protected folders.  This is complected and won't be easy for many teachers to setup.

I found an open source project at Net2FTP.com that I installed on my server.  This works well because the administrator has the burden of setting up the folders and the login access.  Then you can create a URL link to your Net2FTP server side application in each course and just give your teachers their login credentials.  The teachers can only access the folders you have enabled for them but they can upload .zip files and extract them, create subfolders, rename and delete files, etc.  If you have enabled the Moodle File System Repository, then they can ftp their files to their folder and then use them in Moodle using the Private Files block or the html editor File Picker . 

Net2FTP does not appear to have added any features in the past year, but the product seems to be stable and it works well.  It would be really great if someone could combine the features in Net2FTP with the File Picker.  This would solove a lot of problems.

Hope this helps,

Clarence

In reply to Clarence Prudhoe

Re: Set up an FTP repository in 2.0

by Clarence Prudhoe -

Hi,

Dongsheng Cai just gave me the best explaination of how the File System Repository is suposed to work.  He also fixed the bug so this should all work now.  I think this is going to satisfy my need fo the FTP Repository.  This is what Dongsheng said:

There are three places to add repository:

  • Site administration -> Plugins -> Repositories
    If you create a file system instance here, it will be available site-wide
  • Course -> Repositories
    If you create instance here, it will be available in current course, no matter you are teacher or not
  • Profile -> repositories
    only admin users have permission to setup file system instance in user context, and it is private

repository/filesystem:view applies to all instances which is available in current course, for example, if you set repository/filesystem:view is not allowed for student role, all file system instances are invisible for all students.

It should work like this:

Teacher decides to set up a new course, so he/she needs to upload course materials first.

  • Teacher asks the Site Admin to create a new folder on the server, and add a file system instance in the course level (because only admin has the capability to do it).  I understand it is not convenient here but to use files on the server is quite dangerous, so we have to take sys admin into account.
  • Then everybody in this course will be able to see the shared files by default,  if the teacher wants to limit the access to the files, he/she needs to change the Role Definition repository/filesystem:view capability, say, restrict to teacher only.

Hope this helps,

Clarence

Average of ratings: Useful (1)
In reply to Clarence Prudhoe

Re: Set up an FTP repository in 2.0

by Diane Villemure -

RE: Then everybody in this course will be able to see the shared files by default,  if the teacher wants to limit the access to the files, he/she needs to change the Role Definition repository/filesystem:view capability, say, restrict to teacher only.

I did that both at the course level and Front page level (deleted the default "Authenticated User" and specified only the type of users that were allowed) but when I log in using a student ID and go to Navigation > My profile > My private files, the File picker dialog box displays the file system repository and all the files therein. In "Setup repository on file system" I DID NOT check "Allow users to add a repository instance into the course" as well as I DID NOT check "Allow users to add a repository instance into the user context".  Note that the repositories were created via Site administration -> Plugins -> Repositories and as such they are site-wide. What am I missing?

In reply to Diane Villemure

Re: Set up an FTP repository in 2.0

by Diane Villemure -

Even though students do not have permission to view file system repository, they still do via the Navigation > My profile > My private files. Should this be documented as a bug?

In reply to Diane Villemure

Re: Set up an FTP repository in 2.0

by Clarence Prudhoe -

Hi Diane,

I'm no expert on the Repository Site Files, but I think I understand how they work.  At least this is how I am using them.

If you go to Site Administration > Plugins > Repositories and set up a Site File repository from there, it will be visible to everybody in all courses on the site.

If you check the boxes for "Allow users to add a repository instance into the course (can be configured only by admins)" AND/OR "Allow users to add a repository instance into the user context (can be configured only by admins)", you must set these up in the course in which you want to use them.

While logged in as the Administrator, go your course and find Settings > Course Administration > Repositories.  Click Repositories.  From there you can set up a Course Repository that is only visible in that course. 

Then under My profile > Repositories, you can setup a personal file repository.

Also, you must edit the Teacher Role to allow the Course Repository and Profile Repository to be visible to the teacher.

This seems to be working for me.  The course teacher can see the Course and Profile file system repositories but the students can't.  Hope this helps.

Clarence

In reply to Clarence Prudhoe

Re: Set up an FTP repository in 2.0

by Diane Villemure -

Thanks Clarence for your reply. I deleted the folders created via Site Administration > Plugins > Repositories since, EVEN THOUGH I set permissions otherwise, these repositories are viewable by everybody (is that a bug?)

My issue now is that Repositories is not an option that appears under Settings > Course Administration (see screenshot). What am I missing?

Attachment settings.gif
In reply to Diane Villemure

Re: Set up an FTP repository in 2.0

by Clarence Prudhoe -

Hi Diane,

Did you put a check in the first box in Site Admin > Plugins > Repositories > File System ?   The repository will not be visible in Settings > Course Administration until you check this box and save the new setting.

Also, did you setup the repository in the course while logged in as Admin?  The teacher can't see the course repository until the admin sets it up.

Clarence

 

In reply to Clarence Prudhoe

Re: Set up an FTP repository in 2.0

by Diane Villemure -

Thanks again Clarence,

I followed your instructions. Logged in as a Teacher I could see the repository folder I created as an Admin but what is confusing for a Teacher is that the Course repositories page contained these links

Name Repository plug-ins Settings Delete
Server files Server files

Recent files Recent files

Upload a file Upload a file

Private files Private files

Survey Law File system Settings Delete

Create a repository instance

When I clicked on "Settings" and "Create "File system" instance" links, I got this response: "Sorry, but you do not currently have permissions to do that (Setup repository on file system)"

Yet permissions to "Manage files in folder module" and "View file system repository" are set to Yes in the teacher's permissions. Furthermore, both the "Allow users to add a repository instance into the course" and "Allow users to add a repository instance into the user context" are ticked. So why are those links appearing in the Teacher's repository if they are "invalid" no matter what?

THE GOOD NEWS, is that Student can't see the repository I created at the course level. So that is one problem fixed.

In reply to Diane Villemure

Re: Set up an FTP repository in 2.0

by Clarence Prudhoe -

Hi Diane,

Glad that helped.  Like you I have spent a lot time trying to understand and use the File System Repositories.

It was explained to me that the teacher isn't allow to create file system repositories for security reasons.  Only the Admin is allowed to create repositories on the server.   Teachers can use them once they have been set up.

It would be less confusing if the Create a Repository link were only visible to the Admin.

Clarence

In reply to Clarence Prudhoe

Re: Set up an FTP repository in 2.0

by Diane Villemure -

Thanks to Dongsheng Cai (see http://tracker.moodle.org/browse/MDL-24700) , the "bug" was not in the code but in the navigation. When I followed his "Site administration / Users / Permissions / Define roles" suggestion and redefined the Authenticated User role to not view "Repository: File system" and edited the Teacher role to view it, I was able to control visibility of repositories created site-wide (i.e. via Site Admin > Plugins > Repositories > File System. What I had done (and it didn't work) was to go to "Settings / Users / Permissions and make the changes there.

Note that I still think that by default Student should not be allowed to view "file system" repository since that is where teacher course files reside.

In reply to Diane Villemure

Re: Set up an FTP repository in 2.0

by Zisis Zisis -

Ok.

so just to sum up because i think the new repository system is something new to all of us.

what is the optimum way of making a private folder for every student, edited only by a teacher or the administrator?

what i cannot figure out is how me as an administrator or student can create a folder for every of my students and edit the contents of it.

 

Thanks in advance