Linking to a html-course inside data repository

Linking to a html-course inside data repository

by Christopher Hausmanns -
Number of replies: 19
On our moodle.testinstallation, I tried to link to an external course I uploaded to the data repository. When calling the course from moodle, I get the first page (frameset), but the inner pages are not found. In my Apache error_log, I see that moodle tries to find the inner pages in the moodle root directory and does not solve the link to the data repository. What can I do?
Average of ratings: -
In reply to Christopher Hausmanns

Re: Linking to a html-course inside data repository

by Ron Banks -

It sounds like a linking issue to me.  Where was the course located before your upload.  Is every page relative-ly linked from the course root directory?  If not, then very possible, your links from the directory the index page is in to the other pages are broken.  Your links could be set to start at the webroot directory previously which may be at a different level at your new location. This becomes a  very big issue when moving html resources from one place to another, planning must be done in advance of resource creation to make sure it is moveable.

I have created a directory on the same level as Moodle called libroot, so these resources are outside of Moodle itself.  From libroot I install all my outside html resources.  For instance, below libroot, I have directories called books, media, papers, etc.  Each one of the packages in these directories are relatively linked within themselves, each package is relatively linked to libroot.  Therefore I can traverse all the packages using a dhtml tree menu all the way down to one page in any package.  However I can create a url to go to only one page of one resource as well.  In the Moodle mod resource is a link called web page (if I remember correctly).  This link allows me to create a url to any package, or the library itself, if wished, yet keeps everything framed in Moodle where the student does not get lost.

I hope this helps you.

In reply to Ron Banks

Re: Linking to a html-course inside data repository

by Ron Banks -
Well, I remembered another issue, after Moodle's  30 minute editing period smile, that may be causing the problem.  Did you happen to move the course from a Windows environment to a Linux OS environment?  If that is the case, you may need to check for capitalization issues in your links.  Windows does not distinguish between capitalization in directory/file naming but Linux does; therefore, if this is the case, the links would not be working.
In reply to Ron Banks

Re: Linking to a html-course inside data repository

by Christopher Hausmanns -
Hi Ron -

thank you very much for your tips - indeed I moved the course from a Windows environment to my Linux Webserver, but as I rechecked the links - everything was fine.
The problem seems to me that moodle somehow creates the internal links to load the first page of a course via php. But as the next pages are called by Apache itself it does not know that the first page was found in a directory somewhere else (the deep link is created in php!)
The solution might be what you mentioned: I have to write an xslt that relinks the complete courses (that are at least about 25 with over 3500links! - nice work mixed ).
Perhaps in the future I better build some SCORM Packages ....
Nevertheless thanks for your nice tip smile
In reply to Christopher Hausmanns

OLD STILL NOT SOLVED PROBLEM...

by Ger Tielemans -

It is an old, still not solved problem, that Moodle looks in the wrong folders. It is mentioned several times in the forums.

I consider it as a design flaw of Moodle if you - as user - have to do everytime so much extra work: it is complete against Martin's philosophy to keep the workload for the admin as low as possible...
And we all know who has to do all this extra work wink

In reply to Ger Tielemans

Re: OLD STILL NOT SOLVED PROBLEM...

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Ger. I have told you and demonstrated to you repeatedly for a long time that there is no problem here if you use relative links in the HTML and use slasharguments on the server. Do you spend a lot of time in Dutch coffee shops? clown
In reply to Martin Dougiamas

Re: OLD STILL NOT SOLVED PROBLEM...

by Martyn Overy -

Guys.. I thought you worked together !

Working together

In reply to Martyn Overy

Re: OLD STILL NOT SOLVED PROBLEM...

by Ger Tielemans -

It is not solved, the only trick I know is to place a page BEFORE the first page that calls the REAL first page, then move a folder with some of the images until Moodle sees that folder....in the root? (For example when we use a grabtool like Memoweb3 that grabs a set of pages from a website...

On a normal webserver the set of grabbed pages works perfect without any change...
Very difficult to explain to NORMAL users, the main target of Moodle smile that that is not so for moodle.

Some programming moodlers showed me another trick for Applets, I still have to study that after my Holiday smile

I can send you that grabset, so you could serious study the problem, because the slashes are (and were) always in placeon our servers. (see screendump) 

By the way, cleaning my desk before I go to Italy: ..talking about unanswered questions:

  1. How can I remove INSIDE moodle a complete group of "leaving" users? ...and all their data. (Yes, I know from the forum issue and the users that are therefordeath in the database) ....Or are they really gone when I kick them out their last course? (But how can I check were they have been wide eyes soI can kick them out?
  2. What should I tell our admin so it shows the Dutch dates in moodle sections, like it does on your website (and yes, it is set nl_NL)
  3. When takes moodle ALL*) the offered moduls and patches serious, so a normal user can plug-in a PERSONAL CHOICE from these updated moduls? (take XOOPS as an example. Chapeau for the way the handle add-ons)


*) bookmark=great, shelves=still a nice alternative for the resource map, dbAdmin=potential offering tuned views for database management for normal users, modified choice (= choice with choice limits), subsection=first step to IMS/CP, gradebook=much better then flat grades, linkingbeta_06a=some of us want this for a very long time.

 

In reply to Ger Tielemans

Re: OLD STILL NOT SOLVED PROBLEM...

by Tom Murdock -
Hey Ger,

I know I'm not normal, but I'm trying to figure out your workaround. smile If I understood it, we might bridge this distance between the way you know it works and the way Martin knows it works.

So please forgive me, let's say you grab a set of pages from a website. How are they saved? As html? Do you upload them to a folder? What images are you replacing?

I think this is a process that I haven't explored and I'd like to learn about.

thanks,
Tom
Average of ratings: Useful (1)
In reply to Ger Tielemans

Re: OLD STILL NOT SOLVED PROBLEM...

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Yes, please post a small data set that causes the problem you see (just one or two HTML files and an image).

I have a feeling your idea of a relative link is different to mine, which is:

<img src="image.jpg">  

<img src="images/coolimage.jpg">
In reply to Martin Dougiamas

Re: OLD STILL NOT SOLVED PROBLEM...

by Ger Tielemans -

Sometimes my images do not show up.

Then I look to the properties of that image and see that it links to low or to high

So I change sometimes <img src="../images/coolimageofM.jpg">

into: <img src="../../images/coolimageofM.jpg">

or the other way around until the image shows up. I do not see a logical pattern..


Flat sets of html-pages - even when it are complete dirs with subdirs and pictures - are never the problem. ( I created with Enersoft a complete website of 40 pages, made a zip of it beamed it up, unzipped, linked the first page and it works..)

The problem arises when these pages do other things then normal linking: (= I cannot follow their code) I have the feeling (no proof smile) that moodle interferes with these uncommon links..

Oops, where is that memoweb3 example, I have to create a new dump, where is memoweb3.. I will come back! Gives you time to answer the other questions smile

In reply to Ger Tielemans

Re: OLD STILL NOT SOLVED PROBLEM...

by Ger Tielemans -

OK here it is, a fresh dump of my favorit "Interactiv page" for demo use

Everything works with exception of the small icon on the bottom. (memoweb3)

I am not suprised that Moodle cannot find it: it should be:

"5 levels deeper and then one level up in another folder called index".

But what does moodle try to resolve it?

What would you do to solve this kind of diffucult paths tracing if yoy were moodle?

In reply to Ger Tielemans

Re: OLD STILL NOT SOLVED PROBLEM...

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
File paths resolved by file.php can not contain '..', see function detect_munged_arguments from weblib.php. All other relative links in uploaded html files should work fine.
In reply to Petr Skoda

Re: OLD STILL NOT SOLVED PROBLEM...

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
This is true, and in fact I just tonight modified this slightly in 1.3 stable because of a particular problem I was having with a Flash file that was being passed ".." as a file argument. eg

   http://server/file.php/5/somedir/somefile.swf?arg=../thing&otherarg=otherthing

But, what we are talking about here in this dicussion is different. Anytime the ".." appears within the relative link it gets converted by the browser and Moodle never sees it.

For example, if a page like this

   http://server/file.php/5/somedir/somefile.html

refers to an image like this

   ../image.gif

then the browser does not send this to the server:

   http://server/file.php/5/somedir/../image.gif

it actually sends this

   http://server/file.php/5/image.gif

which works fine everywhere I've ever seen.
In reply to Martin Dougiamas

Re: OLD STILL NOT SOLVED PROBLEM...

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
Every day I am learning something new big grin

Another thing I've just noticed, when I edit html file from files/index.php <html><body> tags are stripped, IMHO HTMLArea should be fixed or disabled here.
In reply to Petr Skoda

Re: OLD STILL NOT SOLVED PROBLEM...

by Ger Tielemans -
Also when you grab a link and put it behind a word as hyperlink: works fine the first time, until you reopen the html-editor: it then makes a wrong repair, ending up in an error message.
In reply to Ger Tielemans

Re: OLD STILL NOT SOLVED PROBLEM...

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Installed here.

Moodle doesn't even get to see that URL. The browser converts that relative URL (when you click on it) directly into this: http://moodle.org/index/_realurl.htm which it then sends to the server which of course gives an error.

I'm willing to fix Moodle problems, Ger, but Memoweb is the problem here. It's created a link that refers to another file not within the archive. Either that or you've pulled the archive apart ...

In any case, this would work exactly as badly on a "normal" web server ... it's no different.

In reply to Martin Dougiamas

OLD SOLVED PROBLEM...

by Ger Tielemans -
It works completely different then I thought...

(I solved this memoweb3 problem by creating the missing folder in the root of Moodle, "It bumps at the bottom and then climbs on folder up..", thought the infomatics tourist in me..big grin.
I thought that a long time a go it did not work for the Applet but that is fine now, must be a wrong way of dumping? So I am no longer complaining. One down, three to go.. )