I introduced a link in some of my hotpot exercises that when clicked took the user to a feedback activity within the same course. The URL I intruduced was this:
http://parles.upf.es/moodle/mod/feedback/view.php?id=1283
This worked flawlessly with the hot potatoes exercise outside the hotpot module but once I upload the exercise via the hotpot module, when the linked is clicked, it takes me to the following URL:
http://parles.upf.es/moodle/mod/hotpot/%5BURL%5D
I used JavaScript to insert the link:
<a style="cursor: pointer; text-decoration: underline;" onclick="window.open('http://parles.upf.es/moodle/mod/feedback/view.php?id=1283');return false;">here</a>
Why is this happening this to me?
Josep M.
Hi Josep,
I don't think the HotPot module is changing your links. I think they are being changed by Moodle when you upload the HTML to your site.
Being a security concious system, Moodle doesn't like "onclick" event handlers added to any <HTML> tags, so it changes them to "Xonclick" so they don't work. This is to prevent someone adding evil, javascript to seemingly harmless <HTML> content.
I wonder if the link would work if you changed it to the following:
<a style="cursor: pointer; text-decoration: underline;" href="http://parles.upf.es/moodle/mod/feedback/view.php?id=1283" target="_blank">here</a>
all the best
Gordon
P.S. Out of interest, if you decode "%5BURL%5D", you get "[URL]"
Josep,
have you modified the HP templates in the "mod/hotpot/templates/v6" folder? I think the "[URL]" is coming from there. Anyway, if you modify the links so they don't use the Javascript "onclick" to open the new window, but instead use the html "target" attribute, I think the problem will be solved.
cheers
Gordon
Thanks a lot, Gordon.
Josep M.