Results 1 to 7 of 7

Thread: multiple choice dilema :-(

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2001
    Location
    cornwall, England
    Posts
    110

    Unhappy multiple choice dilema :-(

    can anyone tell me the best way to code a program with questions (20) with multiple choice answers (4)

    tink

  2. #2
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    School assignment?

    20 isn't a lot, so you could get away with a simple text file that might look a bit like this...

    Code:
    How many humps does a camel have?;2;15;3;10;2
    1st bit being the question, next 4 being possible answers and the last being the correct answer.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2001
    Location
    cornwall, England
    Posts
    110

    multiple choice dilema

    chrisjk
    thanks for the reply, got all the questions , but not sure how to call up the questions, and being 4 possible answers coding it to the right answer eg:

    whats the capital of the UK London, Dublin, Bristol, Bath

    how do i code to say London?
    tink

  4. #4
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    send us all your questions/answers if you can

  5. #5
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    I would tweek chrisjk's method just a bit and put the following in my file

    Code:
    whats the capital of the UK London;Dublin;Bristol;Bath;1
    Where the 1 indicates the correct answer.

    If you have VB6 you can use the Split function to break up the line above at the semi-colons. (If you don't have VB 6 you'd haver to split it up yourself). The last entry in the resulting array would then contain 1 and you could use that as the index into the array to display the answer. If that's confusing let me know if you have VB6 or not and I'll do the code for you.

  6. #6
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    Originally posted by MartinLiss
    The last entry in the resulting array would then contain 1 and you could use that as the index into the array to display the answer.
    Good point, but then it should probably then be zero based

  7. #7

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