Link to a folder with files in it

Link to a folder with files in it

by Richard van Iwaarden -
Number of replies: 7
Picture of Particularly helpful Moodlers

We are in trouble after our upgrade from 1.9. This is what we did in 1.9.

We made a course which said 'class schedule'. In the class schedule data map we uploaded our files using FTP. In the course 'class schedule' we had a link to the index.html file. This file was updated every 15 minutes.

Now we made the upgrade to 2.3 and it seems this is no longer possible. I thought repositiries were the answer, so I created a file repository with the same files in it (called class schedule).

I try adding this to the course 'class schedule' but this is not possible. As long as it is one html file, it works fine. But the fact is that it is many html files linking to eachother (different classes ofcourse).

So now what? It seems I have to place the class schedule files on another server as Moodle 2.3 can't handle this anymore. Am I wrong?

Average of ratings: -
In reply to Richard van Iwaarden

Re: Link to a folder with files in it

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Does this answer your question: http://moodle.org/mod/forum/discuss.php?d=194486#p847497 ? OK, it was for 2.1/2.2, I don't know whether that's still valid for 2.3.
In reply to Visvanath Ratnaweera

Re: Link to a folder with files in it

by Richard van Iwaarden -
Picture of Particularly helpful Moodlers

Not really because my files are updated every 5 minutes.

I also would like them not to be visible by the outside world but by my Moodleusers only. Placing them into a seperate folder on the server will loose the Moodle authentication en make the files visible by everyone who knows the correct link to the files.

In reply to Richard van Iwaarden

Re: Link to a folder with files in it

by Richard van Iwaarden -
Picture of Particularly helpful Moodlers

Anyone?

In reply to Richard van Iwaarden

Re: Link to a folder with files in it

by Gavin Henrick -
Picture of Plugin developers

Hi,

Forgive incorrect assumptions ->
Requirement: be able to update the timetable files for each class anytime required.

1.9 solution - using a folder of files in moodledata

For Moodle 2, lets do a block instead...

a) create a simple block which has a link to the schedule (you could build in auto-guessed which schedule per course or whatever, but ignore that for now)

b) the block has a link to page which then has the content for the schedule.


the "page" would be php instead of just html, requires login and so forth in it..

Yes, would require your "output" to be happy to be parts of the block, but I think this would be a small amount of changes perhaps.

Just one approach that may be useful..

In reply to Gavin Henrick

Re: Link to a folder with files in it

by Richard van Iwaarden -
Picture of Particularly helpful Moodlers

Thank you Gavin for your time and reply.

Unfortunately, the class schedule are all HTML files.

Many schools in Europe use Untis for class schedules. http://www.grupet.at/

Untis creates many html files which are updated every 10 minutes. We have about 500 schedules, so making a block for every schedule is not really possible.

I have now reverted to moving the html files to a different webserver and using .htaccess to make sure it's not visible for the outside world. This does however mean that the students have to login twice to see the schedule.

In reply to Richard van Iwaarden

Re: Link to a folder with files in it

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

This sounds like something that is fairly difficult to implement without any coding, but should be fairly straightforward to implement with a small PHP script.

You would need a script that could authenticate the user and retrieve the HTML file from the correct location. It would then need to rewrite any links within the HTML file to make sure that further files were retrieved through the same script, before sending the resulting file back to the user.

The extra complications might be the following:

  1. Is there just a single 'class schedule' starting point, or are there different class schedule index.html files for different classes?
  2. If there are different classes, does it matter if everyone on your Moodle site can access them, or does there need to be a further check to see which classes each student can access?
  3. Are there any additional files (e.g. images, scripts), or is it just HTML? (Obviously there should be no attempt to rewrite links within an image file, but a script file may need some careful checking to see if any rewriting was needed).

If the answer to 1 or 2 is no, and 3 can be done via a simple file-extension check, then this is something that a Moodle developer could probably put together in an hour or so (depending on how much customisation you wanted via the UI, or if hard-coded file paths, etc. was acceptable).

In reply to Davo Smith

Re: Link to a folder with files in it

by Richard van Iwaarden -
Picture of Particularly helpful Moodlers

1+3 YES

2 NO

--

I have given this up, obviously a class schedule is very important and schools have started. I am now using my pre-moodle old method: a sperate webserver where the files are uploaded using FTP.