• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How do I communicate Advanced Actions and Variables between SCOs?

Explorer ,
Oct 21, 2015 Oct 21, 2015

Copy link to clipboard

Copied

I want to use the multi-SCO packager, or something that provides that same functionality, to break up my courses by lesson so that they load faster.  But, at the beginning of the course I've set it up so that the learner can input their name, title, etc. to personalize the course.  I am required to post everything on an LMS, so is there any way to set it up so that the variables and/or advanced actions that are setup in the first SCO or accessed and used by the subsequent SCOs without re-creating them in each SCO?

Thanks.

Jay 

Views

357

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Oct 21, 2015 Oct 21, 2015

Copy link to clipboard

Copied

Technically SCO's cannot communicate with each other.

You could use localStorage in the users browser to set and retrieve the variables.

The student name should already be available from the LMS via the CP variable cpQuizInfoStudentName.

I don't have time right now to set up a local storage, but the following example is used in a course where if the user changes the volume settings, it is written to local storage so that the volume is the same across all SCOs. It not set up for CP variables though.

var courseID = "yourCourseID"+".";

function getConnected()
{
if ( window.location.href.indexOf("http") == 0 )
{
  return true;
}
else
{
  return false;
}
}

//Checks if brower supports localStorage
function supports_html5_storage()
{
if ( typeof(Storage) !== "undefined" )
{
   return true;
}
else
{
  return false;
}
}

function getVolume()
{
var thisVol = courseID+"myVolume";

if ( supports_html5_storage() )
{
  if ( localStorage.getItem(thisVol) == null || localStorage.getItem(thisVol) == 'undefined' )
  {
   localStorage.setItem(thisVol, 60);
   return 60;
  }
  else
  {
   return parseInt( localStorage.getItem(thisVol) );
  }
}
else
{
  alert("Your browser does not support local storage, your volume setting cannot be saved for this module.")
}
 
}

//function called from the main file when user changes volume settings
function setVolume( vol )
{
if ( supports_html5_storage() )
{
  localStorage[courseID+"myVolume"] = vol;
}
}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 22, 2015 Oct 22, 2015

Copy link to clipboard

Copied

LATEST

Thanks much for the feedback.  I'll have to check with out IT folks, but this might work.

Jay

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources