Hello masters,
How are you all doing? I just have a question.
I am building this simple quiz application using ASP.NET/VB.NET and SQL Server for the database. Now what I want to happen is that when I click on submit button, it will count all the correct answers of the user based on the radio button he clicks.
I looked at the code above. Unless you are using array elements, do do not really need a FOR loop. You could do it simply like this:
Dim score As Integer = 0
If RbAnswers1.SelectedValue = "A" Then
score += 1
End If
If RbAnswers2.SelectedValue = "A" Then
score += 1
End If
lbCorrectAnswerCount.Text = score
Discuss This Question: 1  Reply