Skip to content

Commit

Permalink
Merge pull request #30 from joshwwarren/dictionary_option
Browse files Browse the repository at this point in the history
Add Dictionary Option to GetLaunchUrl()
  • Loading branch information
brianrogers authored Jul 18, 2017
2 parents defa213 + 1886126 commit 9e920be
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions RegistrationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,20 @@ public string GetLaunchUrl(string registrationId, string redirectOnExitUrl, stri
/// <param name="debugLogPointerUrl">Url that the server will postback a "pointer" url regarding
/// a saved debug log that resides on s3</param>
public string GetLaunchUrl(string registrationId, string redirectOnExitUrl, string cssUrl, string debugLogPointerUrl)
{
return GetLaunchUrl(registrationId, redirectOnExitUrl, cssUrl, debugLogPointerUrl, new Dictionary<string, object>());
}

/// <summary>
/// Gets the url to directly launch/view the course registration in a browser
/// </summary>
/// <param name="registrationId">Unique Identifier for the registration</param>
/// <param name="redirectOnExitUrl">Upon exit, the url that the SCORM player will redirect to</param>
/// <returns>URL to launch</returns>
/// <param name="debugLogPointerUrl">Url that the server will postback a "pointer" url regarding
/// a saved debug log that resides on s3</param>
/// <param name="parameters">Dictionary for any additional parameters that could be passed along in the request</param>
public string GetLaunchUrl(string registrationId, string redirectOnExitUrl, string cssUrl, string debugLogPointerUrl, IDictionary<string, object> parameters)
{
ServiceRequest request = new ServiceRequest(configuration);
request.Parameters.Add("regid", registrationId);
Expand All @@ -551,6 +565,9 @@ public string GetLaunchUrl(string registrationId, string redirectOnExitUrl, stri
request.Parameters.Add("cssurl", cssUrl);
if (!String.IsNullOrEmpty(debugLogPointerUrl))
request.Parameters.Add("saveDebugLogPointerUrl", debugLogPointerUrl);
if (parameters != null)
foreach (var parameter in parameters)
request.Parameters.Add(parameter.Key, parameter.Value);

return request.ConstructUrl("rustici.registration.launch");
}
Expand Down

0 comments on commit 9e920be

Please sign in to comment.