Returns JavaScript that calls the SCORM function LMSSetValue (SCORM 1.2) or SetValue (SCORM 1.3).
Overloads Public Function GetJsSetValue( _
ByVal itemName As SetValueEnum, _
ByVal itemValue As String, _
ByVal checkForError As Boolean, _
ByVal includeScriptTags As Boolean, _
ByVal returnVarName As String, _
ByVal n1 As Int32, _
ByVal n2 As Int32 _
) As String
Overloads Public Function GetJsSetValue( _
ByVal itemName As SetValueEnum, _
ByVal itemValue As String, _
ByVal checkForError As Boolean, _
ByVal includeScriptTags As Boolean, _
ByVal returnVarName As String, _
ByVal n1 As Int32 _
) As String
Overloads Public Function GetJsSetValue( _
ByVal itemName As SetValueEnum, _
ByVal itemValue As String, _
ByVal checkForError As Boolean, _
ByVal includeScriptTags As Boolean, _
ByVal returnVarName As String _
) As String
Overloads Public Function GetJsSetValue( _
ByVal itemName As SetValueEnum, _
ByVal itemValue As String, _
ByVal checkForError As Boolean, _
ByVal includeScriptTags As Boolean, _
ByVal n1 As Int32, _
ByVal n2 As Int32 _
) As String
Overloads Public Function GetJsSetValue( _
ByVal itemName As SetValueEnum, _
ByVal itemValue As String, _
ByVal checkForError As Boolean, _
ByVal includeScriptTags As Boolean, _
ByVal n1 As Int32 _
) As String
Overloads Public Function GetJsSetValue( _
ByVal itemName As SetValueEnum, _
ByVal itemValue As String, _
ByVal checkForError As Boolean, _
ByVal includeScriptTags As Boolean _
) As String
The JavaScript from the GetJsApiLocate function must be added to your page prior to using the JavaScript from GetJsSetValue.
You can use the server side RegisterClientScriptBlock method to add the JavaScript from any LmsApi GetJs function to your HTML page.
The JavaScript returned from GetJsSetValue will do all of the following:
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 LmsApi2 = Me.LmsApiObject Dim js As String js = apiObject.GetJsApiLocate() Me.RegisterClientScriptBlock("apiLocate", js) js = apiObject.GetJsSetValue(SetValueEnum.location, pgName, False, True) Me.RegisterClientScriptBlock("setLessonLocation", js) js = apiObject.GetJsForLogoff(LogoffEnum.CommitAndTerminate, _ LogoffOptionsEnum.callsPlusWindowClose, "parent") Me.RegisterClientScriptBlock("apiLogoff", js) End Sub
LmsApi2 Class | LmsApi Members | GetJsGetValue | GetJsApiLocate | GetJsInitialize