Nobody
2013-02-08 13:34:26 UTC
Here is my code so far.
Public Class frmProverbsTest
Dim i As Integer
Dim Result As String = Nothing
Dim Total As Integer = 0
Dim Questions() As String = {"The squeaky wheel gets the grease", "Cry and you cry alone", "Opposites attract", "Spare the rod and spoil the child", "Actions speak louder than words", "Familiarity breeds contempt", "Marry in haste, repent at leisure"}
Dim ans() As Boolean = {True, True, False, False, True, False, True}
Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
Dim i As Integer
txtbox1.Text = Questions(i)
For i = 0 To 6
If rbTrue.Checked = True And ans(i) = True Then
Total += 1
End If
If rbFalse.Checked = True And ans(i) = False Then
Total += 1
End If
Next
End Sub
Private Sub btnScore_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnScore.Click
Select Case Total
Case Total < 5
Result = "You might consider taking Psychology 101"
Case Total = 5, 6
Result = "Excellent"
Case Total = 7
Result = "Perfect"
End Select
txtboxResult.Text = Result
txtboxCorrect.Text = i
End Sub
End Class
My first problem is that the textbox isn't displaying the Questions. It only displays one, then when you hit next nothing happens. Also when I click Done it doesn't give a Result, it is left blank and # correct is always 0.
So how can I fix this? Am I going about it the right way at least? Thanks in advance.