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.
Printable View
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.
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.
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?Quote:
Originally Posted by Ethan37
immediately after the question is asked
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?
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
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.
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
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?)
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.