Permanent Links on the exercise

Permanent Links on the exercise

by Mariana Curado Malta -
Number of replies: 4
Hello,

I have changed my moodle from and URL to another.

All my Hotpots point to the "old" URL on the top of the page "HomePage" Link (link that get's you back to the main page of the course). So when the student follows that link it gives him/her an error since the old page does not exist anymore.

Does anyone knows how to configure the link without the URL (relative link instead of permanent link?)

I tried ../../course/view.php?id=XXX (where XXX is the number of the course) but it does not work.

Thank you for your help, Mariana
Average of ratings: -
In reply to Mariana Curado Malta

Re: Permanent Links on the exercise

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
How about using the "admin/replace.php" script?

You access it through your browser. The URL would be something like:
Enter the old url and the new url and let Moodle search the database making the replacements.

Gordon
Average of ratings: Useful (1)
In reply to Gordon Bateson

Re: Permanent Links on the exercise

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Sorry, I think I misunderstood. I don't think my previous post is relevant, so please ignore it.

You are trying to use a relative URL back to the couse page instead of an absolute url? I am afraid that won't work because the HotPot module will seek out relative URLs and convert them to absolute URLs. Usually people use relative URLs to specify images and sounds that they want to use in their HotPots.

So what to do ...

Well you could specify the URL as being relative to the root of the web server. For example ...
  • instead of this:
    http://mydomain/path/to/moodle/course/view.php?id=99
  • use this:
    /path/to/moodle/course/view.php?id=99
Does your HotPot have the Moodle navigation bar displayed? Because that has a link back to the course page which you could direct your students to.

Or you could use a search and replace utility like "InfoRapid Search and Replace" (free) or DreamWeaver ($$) which can changef all the absolute URLs in yoru Hot Potatoes quiz files fairly easily.

Let us know if you want more ideas smile
Gordon
Average of ratings: Useful (1)
In reply to Gordon Bateson

Re: Permanent Links on the exercise

by Mariana Curado Malta -
"Well you could specify the URL as being relative to the root of the web server. For example ...
  • instead of this:
    http://mydomain/path/to/moodle/course/view.php?id=99
  • use this:
    /path/to/moodle/course/view.php?id=99"
When I am in the hotpot I have this link:
http://mydomain.com/mod/hotpot/view.php?id=1191

And I want to get back to:
http://mydomain.com/view.php?id=1191

So what I did was on the link:
../../view.php?id=1191

But it does not work. I get the following link (error page)
http://mydomain.com/file.php/26/course/view.php?id=26

"Does your HotPot have the Moodle navigation bar displayed? "

That is a very important question that might give me the solution! Actually it does not give me any moodle bar. And I think it should give. I am not the person in charge to construct and upload the hotpot exercises so I do not know How it is being done. I should check then. I am going to ask for a hotpot file an try myself.

Thank you! And I'll keep updated this post,
Mariana
In reply to Mariana Curado Malta

Re: Permanent Links on the exercise

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
If it were me, I would try this ...
  • change a link like this:
    <a href="../../course/view.php?id=99">
  • to something like this:
    <a href="../../course/view.php?id=99" onclick="location='../../course/view.php?id=99'; return false;">
Although the href="..." will be converted, to an absolute URL, the onclick="..." will not be, and the onclick will override the href="..." when the quiz appears in the student's browser.

cumprimentos,
Gordon