Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…
Cannot retrieve contributors at this time
29 lines (24 sloc) 2.24 KB
<p align="center"><b>Relative URLs, media players and Hot Potatoes</b></p>
<div class="indent">
<p><i>URL</i><br />
the address of an internet resource, such as a webpage, image or sound file.
<i>absolute URL</i><br />
a URL that begins with &quot;http://&quot; is called an absolute URL.
Wherever it is used, it always refers to the same target resource.
<i>relative URL</i><br />
a URL that does not begin with &quot;http://&quot; is called a relative URL.
It can be combined with the absolute URL of a &quot;base&quot; page, to get
the absolute URL of the target resource.
<p><b>Relative URLs in Hot Potatoes quizzes</b></p>
<p>Relative URLs are a convenient way to specify images, sounds and videos in a Hot Potatoes quiz, because they allow the quiz to be viewed and tested on a local PC, before being uploaded to a Moodle site. When the quiz is uploaded to the Moodle site, the multimedia files must also be uploaded, so that they are available when the quiz is administered via Moodle.</p>
<p>For security reasons, Moodle does not allow direct access to course files. All requests for files in a given course go through a guardian script which verfies that the person requesting the file is enrolled in the course. However, this mechanism can break relative links used in the quiz, because the normal rules for deriving an absolute URL from a relative URL do not work.</p>
<p>The solution is simple enough: <font color="red"><b>all relative URLs must be converted to absolute URLs </b></font> by the time the quiz reaches the browser. In the case of Hot Potatoes quizzes, the URLs will be converted by Moodle, so content creators do not have to bother with this tedious and error-prone task. </p>
<p><b>Media players in Hot Potatoes quizzes </b></p>
<p>Some media players will not accept the media file if it comes via the script which guards the course files. In this situation, it is necessary to replace the media player with one that is known to be compatible with Moodle. You can do this yourself by modifying the reference to the media player in the quiz, or you can force Moodle to do it by setting the &quot;Force media plugins&quot; option on the quiz's settings page to &quot;Yes&quot;.</p>
Jump to Line
Something went wrong with that request. Please try again.