relative vs. absolute path

relative vs. absolute path

by renato pontefice -
Number of replies: 5
Hi all,
I've a BIG problem with the resource if my course.
After completing it, I've decoverted that the path to the resource are absolute sad
So, a student that try to access the course, can't see the resource. All the resource are charged on the server, but a student that can't resolve the address, can't see the images.
How can I set the path of the material relative? how ca I change it in my course?

TIA
Renato
Average of ratings: -
In reply to renato pontefice

Re: relative vs. absolute path

by Miguel Santos -
I have also found this a problem when moving a quiz with images in the question to another Moodle server. The images are absolute to the course # of the first Moodle, and hence the images are all broken.
In reply to Miguel Santos

Re: relative vs. absolute path

by renato pontefice -
Yes! it's so!
Have any body any Idea? some settings...or somethings like?

Renato
In reply to Miguel Santos

Re: relative vs. absolute path

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
Renato/Miguel - Have you considered using /admin/replace.php? This allows you to search the database for a particular string in a URL and replace it across the database. For Miguel, this may be a bit of a challenge because it may change existing good data to bad data. It may be better to go into the database and find where the URL is being stored and do a search and replace there based on the particular course id. In fact, if done properly you may even be able to search for instances where the course id in the URL does not match the course's current id and replace all of them at once. Peace - Anthony
In reply to Anthony Borrow

Re: relative vs. absolute path

by renato pontefice -
Ok Anthony,
Thank you for your sudgestion. But, is there someone that can tell me where do this things are stored? In wich table ? And What do I have to search?

Then, another question: Is there a way to set at the beginning of the course to use a relative path? This to evitate this kind of problems for the next time.

thank you again

Renato
In reply to renato pontefice

Re: relative vs. absolute path

by Just H -
Hi Renato

There is no setting, it's absolute only. I think it's something to do with being able to do course backups.

If you use replace.php as Anthony mentioned above, there's no need to look at the database, it works like a search and replace.

Regards
H