Results 1 to 5 of 5

Thread: HELP!!!URGENT!!!NEED By Noon

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2000
    Posts
    1

    Angry

    I hope someone can help. I need to create a Sample Test. This test has 10 questions, 3 option buttons (answers), a command button (NEXT) to go to next question and finally a Summary Page. I have 10 forms with the questions and 3 opt buttons on them also with the command button (NEXT) on each one. I'm not sure how to go about selecting the answer and putting it in the proper place on the Summary Page. The Summary Page has these fields: Total Questions, Number Right, Number Wrong and Percentage Right.If at all possible I need something by noon on DEC 6.

    Is it possible to use a single form and create a datafile to store my questions and answers? If so how?

  2. #2
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    dim an array of your total question, ex:dim answer(10) as boolean

    Then each time you click next,verify if he has the good answer:
    if yes:answer(0)=True

    if no:answer(0)=False

    In your summary form:
    go thru your array, count the true,count the false and
    divide your total of question(ubound(answer))by the number
    of good answer times 100.(for your %)

    Hope i gave enough for you to start!!

  3. #3
    Hyperactive Member
    Join Date
    Nov 2000
    Location
    Mexico City
    Posts
    306

    Cool

    ´cause of the urgence, you can do this:
    First, a module variable with the actual question (1 to 10). This will allow you to move forward and back. Use a select case to assign the question to a label. Use an array of integers(1 to 10) to save the answer, save it in both butttons (<- and ->). Initialize it to the first option. When the user press <- or ->, the value of the proper option must change.
    When the user finish the test, make a for to do the summary.

    Any doubt, let me know.
    If things were easy, users might be programmers.

  4. #4
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Wink hmm...some ideas

    if you want to use the 10 forms...set up some public variables.

    Public Answer(9) as string

    or maybe you set the whole thing to one form using Arrays.

    Dim Question(9) as string
    Dim Answer(9) as string
    Dim Correct as Integer


    The set each question ...

    Question(0) = "First question..."
    Question(1) = "Second..."
    Etc.
    (dont forget to set the answers too)

    Use the indexes to set your labels

    Click the next button...adds 1 to counter

    label1.caption = question(Counter)

    Etc...

    I don't want to write the whole thing since this is a school project!


    good luck hope this helps!
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  5. #5
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008
    Use three public variables which update on the fly, then on the summary page, output the values into the various text boxes.

    Calculate the percentage right on the fly. Check that variables two and three (right and wrong) add up to var one (total q's)

    As each q is answered (NEXT is pressed) update the relevant variable.

    Questions and answers can be stored as plain text in a file and you can retrieve the data into an array. The array values can then be output to your ten forms text boxes and option buttons. Look up Open #

    If you have a database, it would be even easier. You could use GetRows to fill a Variant Array.

    I can't explain any further, 'cos I have to go home. It is past noon already for soome of us, but you have left it a bit late.

    Cheers,

    P.
    Not nearly so tired now...

    Haven't been around much so be gentle...

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