Forum Discussion
Passing Articulate's SCORM locale=xx-x parameter to an Embedded Navattic link which accepts lang=xx
Hi! reaching out to the community to see if anyone has a solution to this since I am not super familiar how to work this out in a SCORM package using scripts. Articulate support also wasn't able to give me a good solution and has suggested having button stack for each Navattic language which I feel is not scalable if we want to have more language options.
Background
- We are leveraging on Articulate's translation to export SCORMs as 1 single package with all the different language option we choose.
- We use an external LMS (Workramp specifically) where we upload these SCORMS from Articulate. This works great in that when users access the SCORM through Workramp they can dynamically choose the language they want for non-embedded URL content created via Articulate.
- I noticed that a parameter locale=xx-xx is seen in the SCORM's URL once user has selected the language they prefer. Example for Spanish it's locale=es-es.
- We use Navattic to create walkthroughs and embed them in Articulate as URL embeds. Navattic also can accept parameter in the format of lang=xx (example lang=es). But the URL embed in Articulate seems static? We want to be able to find a way for SCORM (created by Articulate) to pass the language parameter dynamically to Navattic so that whatever the user choose as their preferred language, it is consistent with the Navattic embed language as well.
I know that SCORMS are like webpages with javascripts, css and other assets. I have also seen this other post Passing variables from LMS into an embed | Articulate - Community but I am not sure how to go about pulling the parameter from SCORM / LMS Workramp and then dynamically having that Navattic that is URL Embed (via Articulate) accept a parameter?
Would be nice if someone actually has a solution to this.
4 Replies
- SamHillSuper Hero
Hi Kurby
In summary it looks like you want to:
- Retrieve the locale parameter from the SCORM content URL
- Parse the value and use the first two characters of the locale, for example en-us would become en
- Use the value of the parameter to append to a Navattic embed url https://someurl.com?lang=es
If you add the following script to your MASTER SLIDE, on timeline start, as well as define a Storyline text variable called lang. The following script assumes we are taking the locale param value from the Storyline contents URL. This may need adjusting, as the value may be in the parent document. I have added some console.log/console.warn to output if the values are found in the URL.
The script will then try and detect an iframe on each page. If it finds one, it will look for the text "navattic". If this exists, it will be processed adding the new parameter to the navattic URL. I've done rudimentary testing locally, but obviously can't do a full tests without access to your environment.
// set a default language const defaultLang = 'en'; // check if language is set if (getVar('lang') === '') { // language not set, parse from the URL const pageUrl = new URL(window.location.href); const locale = pageUrl.searchParams.get('locale'); if (locale && locale.length >= 2) { // first two chars of the locale param console.log(`locale param found: ${locale}`); setVar('lang', locale.substring(0, 2).toLowerCase()); } else { // default language console.warn(`locale param not found, defaulting to ${defaultLang}`); setVar('lang', defaultLang); } } // function to update Navattic embed URL, appending the language parameter const iframe = document.querySelector('iframe'); if (iframe && iframe.src.includes('navattic')) { const iframeUrl = new URL(iframe.src); const lang = getVar('lang'); iframeUrl.searchParams.set('lang', lang); iframe.src = iframeUrl.toString(); console.log(`updated iframe URL: ${iframe.src}`); }
- KurbyCommunity Member
Thanks SamHill. Unfortunately I was more looking at a solution for Articulate 360 instead of Storyline. Apologies that I didn't made that clear from the start. Is it true that 360 (unlike storyline0 is unable to have scripts? As such I was trying to see if someone has an idea of doing it at the exported SCORM level
- SamHillSuper Hero
Hi Kurby I'm not familiar with "Articulate 360" as an individual product. I thought that was the name of the desktop application for managing the individual software. I just saw you have Rise 360 tagged in the post. Sorry, I missed that. Can you confirm what you are authoring your content in. Is it Rise 360 or did you mean one of the Studio 360 products?