Online link: http://basic4ppc.com:51042/quiz/index.html
This is an example of an online quiz. When the WebSocket is connected five random questions are created.
The user can go back and forth between the questions. After the last question the user score is calculated.
The Change event is raised when the selected radio button changes. Instead of handling the Change event of each of the four radios we handle the Change event of the parent element:
Private Sub Questions_Div_Change (Params As Map) Dim target As String = Params.Get("target") 'find the checked radio Dim index As Int = target.SubString(1) 'remove the 'a' Dim qd As QuestionData = questions.Get(questionIndex) qd.UserAnswerIndex = index btnNext.SetProp("disabled", False) 'enable the next button End Sub
The example is included in the online examples project: http://www.basic4ppc.com/android/forum/threads/webapp-web-apps-overview.39811/
Note that jServer v2.02+ is required for this example (it fixes an issue with JQueryElement.SetProp).