Change main URL from scorm embedded page

Change main URL from scorm embedded page

by Giampaolo Mangiaracina -
Number of replies: 4

Hi,

 I have a scorm object inside a moodle page. The scorm content (edited with Storyline) ends with the usual storyline goodbye.html (something like “ok, you can go on with navigation…”). I edited this html and from this goodbye.html I’m trying to serve a link to go back to his parent course page, but every kind of href or window.open make the same thing: they change the goodbye.html window (the “square “ inside the main page) while main window (/mod/scorm/player.php) affect no changes! So in the end I have the same main content window (/mod/scorm/player.php) and the course page inside it (e.g. /course/view.php?id=16), where previously has played the scorm object.

I’m asking which is the real structure of the page! I’ve tried with every known target type (_self, _top, _parent …) and many javascript, but I think the problem is that the main page and the goodbye page inside it is like they have no relationship of parent/child… it seems they they’re just like “good friends”!

So, how can I change main window URL from an html loaded into the scorm window embedded in Moodle?  

Thanks

Giampaolo

Average of ratings: -
In reply to Giampaolo Mangiaracina

Re: Change main URL from scorm embedded page

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Giampaolo,
it depends on your version: it could be an <object /> or an <iframe />.
Did you try with something like parent.window.location = "/course/view.php?id=16"? Never tried by myself.

HTH,
Matteo

In reply to Matteo Scaramuccia

Re: Change main URL from scorm embedded page

by Giampaolo Mangiaracina -

It doesen't seem to work, but I'm guessing if I have to put the function in the parent (top) window, something like

function changeURL(url)
{
   if( url == ""){
   url = document.location.href;
    }
   document.location.href = url;
   }

and then call the function from goodbye.html

In this case I should put function in player.php?

In reply to Giampaolo Mangiaracina

Re: Change main URL from scorm embedded page

by Gennady Kucheruk -

We use iSpring Presenter and by default it makes links to open in the new browser window, but then there are two other settings available: the same window ("_self") - opens it within iframe(player.php)  and parent window ("_parent") - changes url in the address bar to the one specified in that link hence getting out of that iframe. Maybe there is something like that available in the Storyline. If not just google for "open link from iframe into parent window".

In reply to Gennady Kucheruk

Re: Change main URL from scorm embedded page

by Giampaolo Mangiaracina -

I don't know why yesterday din't work, but today works with target="_top" attribute.

Thank you anyway

G.