Results 1 to 3 of 3

Thread: Quiz App that accepts more than 1 choice

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2001
    Posts
    2

    Angry Quiz App that accepts more than 1 choice

    Hi, i'm pretty new to VB and need help creating a Quiz application. I see a lot of quiz app that only accept 1 answer with the radial button, but i need a more advance one.

    The quiz should be able to accept more than 1 choice using a checkbox. (example: a question with 2 or more answer)
    also the questions and answers are in .txt. If you think using a database is more suitable. i wouldn't mind it either,but i prefer it being in .txt.

    I desperately need your help. thanx!

    if you also know of a good book on VB in building application like this. Please recommend it to me. Thanx.
    Last edited by nunu; Sep 20th, 2001 at 09:38 AM.

  2. #2
    Addicted Member jestes's Avatar
    Join Date
    Jan 2001
    Location
    Dallas
    Posts
    248

    Use This Site as your book

    If you want to answer a quiz with multiple choice, you should use a combobox. Put the control on your form, stick the answers in the combobox, then use a select case statement to check for the correct answer.

    i.e.
    Select Case cboAnswer.Text

    Case "True"
    msgbox "Your Answer is Correct!"

    Case "False"
    msgbox "LOSER!"

    End Select

  3. #3
    Hyperactive Member SjR's Avatar
    Join Date
    Jul 2001
    Location
    Birmingham, UK
    Posts
    336
    So if I'm reading this correctly, the user can provide multiple answers (bit like one of those awful date-match questionaires... "I like pubs and swimming and reading and gardening" sort of things)

    You're on the right track with check boxes.
    (Presumably then there aren't any right or wrong answers?)

    I would suggest using a control array of checkboxes and a command button. Maybe something like this?
    VB Code:
    1. Private sub Command1_Click()
    2.     For i=1 to check1.Count
    3.         If check1(i).Value = 1 then
    4.             ---
    5.         Else
    6.             ---
    7.         End If
    8.     Next i
    9. End Sub
    I can't really offer any more advice at this time as you haven't said much about how it will work.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width