I have set-up 9 teachers with all their courses. But, two of the teachers want to use their pre-existing web sites (not connected to our moodle).
How can I change their links such that when you click on their courses, you get sent directly to their outside-moodle web site? Is this something I change somewhere in Sql?
Thanks for any help!
Enrico
Put a file called externservercourse.php
inside the course
directory of your moodle installation.
Inside this /course/externservercourse.php
place a function which returns the complete url for the outside moodle site, based on the course object passed to it. (You can use shortname or id if you like)
Name the function extern_server_course
. (Why different names were given to the file and the function inside is a complete mystery to me?)
Example:
function extern_server_course($course) {
if ($course->id == 23) {
return 'http://www.mywebsite.be';
}
}
However, every Moodle upgrade seems to make changes which breaks existing code. I am sure one of the upcoming versions of Moodle will alter this kind of functionality and then the redirects won't work anymore.
Maybe you should consider just putting a link to the outside website inside the Moodle course area.
OK I will go do this. Thanks for the help!
-enrico
Thanks for the help!
Jörg
Did you have to do anything other than add the file externservercourse.php to get this to work in Moodle 1.82?
I see the usual call to the function in course/view.php but when I try to use this to do an internal (or external) redirection I seel the contents of the function displayed at the top of the course page rather than the redirection happening.
Regards
Steve