Picture of Chris Gillison
languagePicker pageIncompletePrompt routing issue
by Chris Gillison - Monday, 9 July 2018, 10:32 AM
 

Hi all,

I've installed and enabled both of the above extensions in a course. However, if I then run the course, select a language, click on any menu item, enter the page then hit the browser back button, the browser routes back to the language selector, not the menu. Then if you hit the browser back button again the browser routes back to the page you just left.

Without pageIncompletePrompt installed things work perfectly i.e. if I'm in a page, the browser back button takes me back to the menu, at which point the back button is disabled.

Looks to me like this is, dare I say it, a bug in pageIncompletePrompt.

Could anyone offer some guidance as to how to fix this problem?

Many thanks.

Picture of Matt Leathes
Re: languagePicker pageIncompletePrompt routing issue
by Matt Leathes - Monday, 9 July 2018, 12:07 PM
 

Hi Chris

This is working fine for me using all the latest stuff i.e. Adapt v3.2.0, languagePicker v2.0.0 and pageIncompletePrompt v2.0.6

Picture of Chris Gillison
Re: languagePicker pageIncompletePrompt routing issue
by Chris Gillison - Monday, 9 July 2018, 12:43 PM
 

Hi Matt,

Wierd. I'm using all the latest versions too (just set up a test course this morning).

If I'm in (say) English>Presentation Components, and I click the browser's (FF or Chrome) back button, I get taken to the language selector. Seems odd, as I would expect it to go to the English menu.

I'm running on localhost:9001. Does the behaviour change when it's actually online perhaps?

Picture of Matt Leathes
Re: languagePicker pageIncompletePrompt routing issue
by Matt Leathes - Monday, 9 July 2018, 1:53 PM
 
I'm running on localhost:9001. Does the behaviour change when it's actually online perhaps?

Don't think so, I'm also on localhost:9001 and am performing the exact same steps as you by the sound of it; also checked it works with both incomplete and completed 'Presentation Components' page.

The only way I can make it show the initial language picker screen again is by clearing the stored language i.e. open console and run require('core/js/adapt').offlineStorage.set('lang', undefined); - have you got anything running that might be preventing that data from being stored? As the tracking data is stored in cookies when you're running locally it might be worth clearing those out - in Firefox open the developer tools > storage > Cookies > right-click http://localhost:9001 and select Delete all.

Picture of Chris Gillison
Re: languagePicker pageIncompletePrompt routing issue
by Chris Gillison - Monday, 9 July 2018, 3:39 PM
 
have you got anything running that might be preventing that data from being stored?

Not that I'm aware of - and not by looking at my browser prefs either - all seems to be default settings. I don't really know what else to look for in that regard.

it might be worth clearing those out

Tried this - no change. Have also tested on laptop, PC and tablet and always getting the same result

I've posted my test site online here. Any chance you could take a quick look and let me know if it also works for you? Doesn't for me - goes back to the language selector every time!

 

Picture of Matt Leathes
Re: languagePicker pageIncompletePrompt routing issue
by Matt Leathes - Monday, 9 July 2018, 4:45 PM
 

OK interesting, it only seems to happen for me when the content is being loaded from a subfolder of the web server.

So if I use $ grunt server the content will be run from http://localhost:9001 - and works fine.

But if I fire up browser-sync in the same location the content runs from http://localhost:3000/build and then I get the same issue you're reporting.

Just to check - is there definitely going to be a browser back button available? Typically e-learning is launched in a browser popup window that doesn't have one - and the back button that's in the course itself works fine.

(Oh - and ignore what I was saying about cookies earlier - they only come into play if you use scorm_test_harness.html to run the course, sorry)

 

Picture of Chris Gillison
Re: languagePicker pageIncompletePrompt routing issue
by Chris Gillison - Monday, 9 July 2018, 5:12 PM
 

Curiouser and curiouser. (I'm afraid browser-sync doesn't mean anything to me Matt!)

Did my online test site work without a problem for you?

is there definitely going to be a browser back button available?

Looking at screenshots the client has sent of previous courses running in their LMS, yes, unfortunately! It's not the end of the world if they have to re-select their language to get back to the menu (and doubtless many learners will either not need/choose to go back, or use the adapt back button) - it's just a bit irritating!

Picture of Matt Leathes
Re: languagePicker pageIncompletePrompt routing issue
by Matt Leathes - Monday, 9 July 2018, 6:06 PM
 
Did my online test site work without a problem for you?

No, I had the same issue as you reported.

It's not the end of the world if they have to re-select their language to get back to the menu

When the course is running on the LMS they won't have to as the course will retrieve their previous choice from the LMS and restore that without a prompt.

I'd be more concerned about it trying to restart the session.

I don't really have a full solution for this - like I say it's very rare to see an LMS show the course in a browser window with a back button so it's not a problem for us. But I think I have a way you could hack around it if that might help? It will involve a bit of JavaScript though...

It might be worth getting your client to test it all first to find out exactly what will happen on their LMS.. and also to ask if the browser back button can be hidden.

browser-sync is just a command line tool for firing up a local web server btw

Picture of Chris Gillison
Re: languagePicker pageIncompletePrompt routing issue
by Chris Gillison - Tuesday, 10 July 2018, 11:51 AM
 

Thanks Matt.

I just uploaded my test course to my Moodle setup for a few tests (setting the browser back button to be visible).

Following the same course of actions as previously, when I hit the back button in 'Presentation Components', and then 'Yes' of the pageIncompletePrompt, it displays the 'Would you like to continue where you left off?' bookmarking prompt. Clicking 'Yes' at that point takes you back to where you were when you clicked the browser 'back' button (which isn't the end of the world albeit slightly strange. Clicking 'No' at that point takes you back to the menu.

The good news is it doesn't take you back to the languagePicker, which would, it seems, completely wipe your progress (not good!).

So I think I'll leave hacking into the JS for now and just bear it in mind in case the client comes back reporting issues.

Many thanks for your help looking into this.

Picture of Matt Leathes
Re: languagePicker pageIncompletePrompt routing issue
by Matt Leathes - Tuesday, 10 July 2018, 12:46 PM
 

One option I thought of which wouldn't involve hacking JS was to amend imsmanifest.xml to set the launch page to "index.html#" (the href attribute of the <resource> node) - assuming the LMS respects that and dutifully appends a hash to index.html, it should work.

Picture of Chris Gillison
Re: languagePicker pageIncompletePrompt routing issue
by Chris Gillison - Thursday, 12 July 2018, 7:56 AM
 

Hi Matt. That's a great workaround! Works perfectly.

Many thanks for your assisstance.