Returns JavaScript to handle various logoff options. Depending on parameter values, the returned JavaScript may include SCORM calls to both LMSCommit (SCORM 1.2) or Commit (SCORM 1.3), and LMSFinish (SCORM 1.2) or Terminate (SCORM 1.3), and a command to close the SCO window. Calls may be placed inside a JavaScript function. See Techniques For Calling LMSFinish for more information.
Public Function GetJsForLogoff( _
ByVal callTypes As LogoffEnum, _
ByVal logoffOption As LogoffOptionsEnum , _
Optional ByVal windowToClose As String = "self", _
Optional ByVal functionName As String = "lmsLogoff" _
) As String
The JavaScript from the GetJsApiLocate function must be added to your page prior to using the JavaScript from GetJsForLogoff.
You can use the server side RegisterClientScriptBlock method to add the JavaScript from any LmsApi GetJs function to your HTML page.
The following example assumes that the VBTrain.WebTracking.LmsApi2 namespace has been imported, and that the LmsApi for the session is stored as a property (LmsApiObject) of the current class.
[Visual Basic]
Private Sub BtnExit_Click( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles BtnExit.Click Dim pgName As String = Me.CurrentPageName Dim apiObject As LmsApi = Me.LmsApiObject Dim js As String js = apiObject.GetJsApiLocate() Me.RegisterClientScriptBlock("apiLocate", js) js = apiObject.GetJsSetValue(SetValueEnum.location, pgName, True) Me.RegisterClientScriptBlock("setLessonLocation", js) js = apiObject.GetJsForLogoff(LogoffEnum.CommitAndTerminate, _ LogoffOptionsEnum.callsPlusWindowClose, "parent") Me.RegisterClientScriptBlock("apiLogoff", js) End Sub
LmsApi2 Class | LmsApi Members | Techniques For Calling LMSFinish |GetJsApiLocate | GetJsCommit | GetJsFinish