Results 1 to 11 of 11

Thread: [RESOLVED] timer control

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    80

    Resolved [RESOLVED] timer control

    How can i make a program do this:

    - check during 20 secs if an answer is correct
    - if the answer is correct or not, do something

    I'm not sure how i can use a Timer control for this.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: timer control

    Do you have the code to check to see if an answer is correct?

    If so, just place in the Timer1_Timer event, and set the Timers interval. It will execute whatever code is in its Timer event when the interval you have set elapses.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    80

    Re: timer control

    that would mean when, after the 20 secs are over, it'll check the code in the timer1_timer event if the answer is right, but:

    it's supposed to check within those 20 sec

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: timer control

    Quote Originally Posted by Ethan37
    that would mean when, after the 20 secs are over, it'll check the code in the timer1_timer event if the answer is right, but:

    it's supposed to check within those 20 sec
    At what point is it supposed to know that it should check?

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    80

    Re: timer control

    immediately after the question is asked

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: timer control

    The question is presented on the screen.

    How does it get answered?

    Are there mutliple choice option buttons?

    A textbox into which answers are typed and then a submitt button is clicked?

    Some other way?

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    80

    Re: timer control

    actually, my program checks incoming strings from an irc-server if the answer is right

    but it's alright to say it's a textbox input

  8. #8
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: timer control

    Ok....in that case, as soon as the string is put in the textbox its Change event should fire.

    I would put the code to check the answer there and see how that works.

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    80

    Re: timer control

    ok, and combining that with a timer event that will, after twenty secs say: time's up if the answer is not given, and if the answer is given the timer interval will be set to 0.

    I'll try that

    thx

  10. #10
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: timer control

    How long do they have to submit an answer?

    Can they change their mind? (I.E., the anwer to question one is Cabbage. But, instead of that I type in Cole Slaw, and as soon as I send I realize my mistake, and put Cabbage in and send that. Is this possible?)

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    80

    Re: [RESOLVED] timer control

    yes, that's the case. you have 20 seconds to enter answers and it doesn't have to be right at once. you can enter another answer and it will check if its' the right answer

    if its wrong you get a hint after 20 secs, if its right you get the next question

    I managed to use the timer for the program to wait to give a hint.
    Using a counter for the hints (max.4), the Timer.interval will be reset to zero.

    Then the next question will be displayed.

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