Click here to Skip to main content
15,886,724 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Syntax help Pin
blackjack21506-Apr-08 22:49
blackjack21506-Apr-08 22:49 
GeneralRe: Syntax help Pin
Luc Pattyn7-Apr-08 0:52
sitebuilderLuc Pattyn7-Apr-08 0:52 
GeneralRe: Syntax help Pin
Chinners6-Apr-08 22:50
Chinners6-Apr-08 22:50 
Question(missing code} detect path service Pin
hassanasp6-Apr-08 11:57
hassanasp6-Apr-08 11:57 
GeneralRe: (missing code} detect path service Pin
Christian Graus6-Apr-08 15:44
protectorChristian Graus6-Apr-08 15:44 
GeneralRe: (missing code} detect path service Pin
Luc Pattyn7-Apr-08 0:56
sitebuilderLuc Pattyn7-Apr-08 0:56 
GeneralRe: (missing code} detect path service Pin
Christian Graus7-Apr-08 1:01
protectorChristian Graus7-Apr-08 1:01 
Questionhow to check correct answer in quiz Pin
bapu28896-Apr-08 9:01
bapu28896-Apr-08 9:01 
Hello
I am making small quiz with vb.net 2003 and all the questions and options are in access database there is one column for question and 4 columns for wrong answers and one for correct answer

this is the code

Try<br />
                Do<br />
                    odaTest.Fill(dsTest)<br />
                    R = CInt(Int(ArraySize * Rnd()))<br />
<br />
                    '[Go to the next entry]<br />
                    Me.BindingContext(dsTest, "MyTest").Position = R<br />
                Loop Until Asked(R) = False<br />
                PoAns = DataView1.Item(R).Item("CorrectAns")<br />
                WAnswer(0) = DataView1.Item(R).Item("Op1")<br />
                WAnswer(1) = DataView1.Item(R).Item("Op2")<br />
                WAnswer(2) = DataView1.Item(R).Item("Op3")<br />
                WAnswer(3) = DataView1.Item(R).Item("Op4")<br />
                'randomize 4 options<br />
                For X As Integer = 0 To 3<br />
                    MyTB(CInt(Rnd() * 3)).Text = WAnswer(X)<br />
<br />
                Next X<br />
<br />
                'now randomize one correct answer<br />
                MyTB(CInt(Rnd() * 3)).Text = PoAns<br />
                AskedQ += 1<br />
                Asked(R) = True<br />
            Catch eLoad As System.Exception<br />
                MessageBox.Show(eLoad.Message)<br />
            End Try


And i am checking correct answer like this

 Private Sub CheckAnswer()<br />
        If CheckedTB.Text = PoAns Then<br />
            MsgBox("Right", MsgBoxStyle.MsgBoxSetForeground)<br />
        End If<br />
<br />
    End Sub


So now problem is some time it's shows same wrong answer in two different textboxes but it's shows correct answer in different textbox every time so now i am bit confuse that am i going in to right direction any help Unsure | :~
Confused | :confused:
GeneralRe: how to check correct answer in quiz Pin
Christian Graus6-Apr-08 11:13
protectorChristian Graus6-Apr-08 11:13 
QuestionRe: how to check correct answer in quiz Pin
bapu28897-Apr-08 8:19
bapu28897-Apr-08 8:19 
GeneralRe: how to check correct answer in quiz Pin
Christian Graus7-Apr-08 11:46
protectorChristian Graus7-Apr-08 11:46 
AnswerRe: how to check correct answer in quiz Pin
bapu28899-Apr-08 8:55
bapu28899-Apr-08 8:55 
QuestionHow to use link labels ? Pin
Meme_856-Apr-08 5:33
Meme_856-Apr-08 5:33 
GeneralRe: How to use link labels ? Pin
Christian Graus6-Apr-08 11:15
protectorChristian Graus6-Apr-08 11:15 
Questionhelp..save time Pin
Member 44429165-Apr-08 22:57
Member 44429165-Apr-08 22:57 
GeneralRe: help..save time Pin
Thomas Stockwell6-Apr-08 3:48
professionalThomas Stockwell6-Apr-08 3:48 
Questioncombo selected index change event Pin
vijaylumar5-Apr-08 20:08
vijaylumar5-Apr-08 20:08 
GeneralRe: combo selected index change event Pin
Chinners6-Apr-08 23:23
Chinners6-Apr-08 23:23 
QuestionStop/Start a service Pin
hassanasp5-Apr-08 16:04
hassanasp5-Apr-08 16:04 
GeneralRe: Stop/Start a service Pin
Christian Graus6-Apr-08 16:43
protectorChristian Graus6-Apr-08 16:43 
GeneralExcel Value to textbox [modified] Pin
Member 44350515-Apr-08 3:14
Member 44350515-Apr-08 3:14 
Questionsystem date format Pin
pathak785-Apr-08 2:25
pathak785-Apr-08 2:25 
GeneralRe: system date format Pin
Rajesh Anuhya5-Apr-08 2:34
professionalRajesh Anuhya5-Apr-08 2:34 
GeneralRe: system date format Pin
pathak785-Apr-08 2:42
pathak785-Apr-08 2:42 
GeneralRe: system date format Pin
darkelv5-Apr-08 6:29
darkelv5-Apr-08 6:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.