Internal and External IP Addresses - causes quiz problem

Internal and External IP Addresses - causes quiz problem

by Darren Spilling -
Number of replies: 3

I have installed Moodle on a server at our college that we also access via the Internet on a different IP.

At first there was a problem due to the config file www root variable.  However this was fixed using some code from a previous post as below:

http://moodle.org/mod/forum/discuss.php?d=651

if ($_SERVER['SERVER_PORT'] =='80') {
  $CFG->wwwroot = 'http://192.168.1.250';
} else {
  $CFG->wwwroot = 'https://gate.blabla.fr' ;
}

You can also check SERVER_ADDR or HTTP_HOST.

HTH
Fred

I thought everything was fine but I have since noticed that pictures are not displayed in quiz questions because the picture URL remains fixed at the URL that the user was on when they entered the question.

Has anyone got any ideas as everything else is working like a dream?

Thanks

Darren

Average of ratings: -
In reply to Darren Spilling

Re: Internal and External IP Addresses - causes quiz problem

by Darren Spilling -

No replies - either I am missing something or this is a difficult one?

I have since found that if you use show picture instead of adding a picture to the question box the URL's are OK.  However if you add a smiley to a forum post the URL seems to stay fixed at the URL you are currently on.

I presume that the config dir root is not used throughout moodle and this is why I have a problem with 2 URL's for the same installation?

Has anyone else had the same issue?

Darren

In reply to Darren Spilling

Re: Internal and External IP Addresses - causes quiz problem

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Is your setup like this because your network access router is 'port-forwarding' to your Moodle server?
In reply to Howard Miller

Re: Internal and External IP Addresses - causes quiz problem

by Darren Spilling -

We are set up like this because acess to our web based Moodle was too slow.  Hence we installed Moodle on one of our servers and made it available via the web.

This means there are 2 URL's one at college http://baggins/moodle  and from outside http://campus.lbc.school.nz/moodle

This is one installation with one database but 2 URL's.  It works really well but some links like smilies and pictures inserted in questions are fixed at the URL that you are using.  For example a smiley inserted at college can not be viewed via the web as the URL stays fixed at the URL of the college server and that is not accessible from outside using the inside URL.

I hope this clarifies things.

Thanks for the reply.

Darren