Follow

Dynamic RedirectOnExitUrls with SCORM Engine

Avatar

If you need to have the user redirected to a dynamic page when they exit your courses, you can do this by adding the following code to your SCORM Engine Integration files.


note: replace CLIENTNAME with your integration's prefix

 
CLIENTNAMEExternalConfiguration.cs

 


public const DEFAULT__EXIT_URL = string.Empty;  

public string ExitUrl = DEFAULT__EXIT_URL;
 

 


CLIENTNAMEIntegration.cs

/// <summary>       
/// See <see cref="IntegrationInterface.GetRedirectOnExitUrl(ExternalConfiguration)"/> for a full description.
/// </summary> /// <param name="externalConfig">External configuration information.</param>
/// <returns>Value specified in the configuration repository under the <see cref="Constants.CONFIG_REDIRECT_ON_EXIT_URL"/> setting.</returns>

public override string GetRedirectOnExitUrl(ExternalConfiguration externalConfig)
{
 
CLIENTNAMEExternalConfiguration myExternalConfig = externalConfig as CLIENTNAMEExternalConfiguration;

if (myExternalConfig == null)
{
     throw new ScormContentPlayerApplicationException("The external configuration id argument was not a valid CLIENTNAMEExternalConfiguration object."); 
  }

if (myExternalConfig.ExitUrl != string.Empty)
{
  return ExitUrl;
}
else
{
   return this.GetConfigurationSetting(Constants.CONFIG_REDIRECT_ON_EXIT_URL);                
}
}

/// <summary>                
/// See <see cref="IntegrationInterface.GetRedirectOnExitUrl(ExternalRegistrationId, ExternalConfiguration)"/> for a full description.
/// </summary> /// <param name="externalReg">External identifier for the registration that is currently being delivered.</param>
/// <param name="externalConfig">External configuration information.</param>
/// <returns>Value specified in the configuration repository under the <see cref="Constants.CONFIG_REDIRECT_ON_EXIT_URL"/> setting.</returns>

public override string GetRedirectOnExitUrl(ExternalRegistrationId externalReg, ExternalConfiguration externalConfig)
{
  return GetRedirectOnExitUrl(externalConfig);
}
 

 

Once all of this code is part of your integration, you can send the dynamic RedirectOnExitUrl through your launch string like this:

 

[your launch string]?registration=[yourRegString]&configuration=ExitUrl|[your url]

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request
Powered by Zendesk