473,379 Members | 1,245 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

timers for a math quiz

lee123
556 512MB
i'm new to visual been working on access databases for a while but i would like to create a basic math quiz form to where it has a timer on the bottom to time a certain time and at the end of the time it flashes "times up" and the person taking the quiz is giving a "incorrect' msgbox or a "correct" msgbox response and then the "correct" answer.. this is a prodject for my kids for school i would appriciate anyone who has kids to help me with this one. thank you!!!
Mar 8 '07 #1
27 3210
Killer42
8,435 Expert 8TB
i'm new to visual been working on access databases for a while but i would like to create a basic math quiz form to where it has a timer on the bottom to time a certain time and at the end of the time it flashes "times up" and the person taking the quiz is giving a "incorrect' msgbox or a "correct" msgbox response and then the "correct" answer.. this is a prodject for my kids for school i would appriciate anyone who has kids to help me with this one.
Can you be a bit more specific about what part of this task you need help with?

And are you writing this in Access VBA, or standalone Visual Basic? Which version?
Mar 8 '07 #2
lee123
556 512MB
I'm using visual basic 6 acually i want to make this. but don't know how to approch this it would be cool to do. well it could look like this



1- have a start button on top
2- have three text boxes underneath the start button, one for number 1
the next text box for number two, the third box for the answer
on the bottom have text boxes for how many answers right
and how many answers wrong.
4- a check button
5 a timer with a certain time like (60 sec)
6when times up have it say "times up"


well if u can help me that would be great. i could put the text boxes in there but for the codes no i wouldn't now what to put. i just need the codes.
Mar 8 '07 #3
willakawill
1,646 1GB
You can use a timer. Set the interval to a minute and the ontimer event will pop up your message... "too late c: drive deleted" or something friendly like that :)
Mar 8 '07 #4
lee123
556 512MB
well what i need is how to set up the timer in the code box and what to put in the code box example when i push the start button i want it to display random numbers in the two text boxes and start the timer so when the person has the two problems he can type in a answer in the answer box and press check to see if he is correct or incorrect with the msgboxes then give the right answer
the moral is to see how many questions they can get right in 60sec. or 120 sec
Mar 8 '07 #5
willakawill
1,646 1GB
Excellent. Let us know how you are getting on with it, and if you get stuck at some point come back and show us how far you have got with the code.
Mar 8 '07 #6
lee123
556 512MB
well i got the numbers to answer incorrect or correct but how do you get it to display when the person gets it right to put how many answers he got in the correct box or incorrect box Whatis the code for this and how do I get teh timer to work on the bottome when they press the start button
Mar 9 '07 #7
Killer42
8,435 Expert 8TB
well i got the numbers to answer incorrect or correct but how do you get it to display when the person gets it right to put how many answers he got in the correct box or incorrect box Whatis the code for this and how do I get teh timer to work on the bottome when they press the start button
In the start button's click event, set the Enabled property of the timer to True.
Mar 9 '07 #8
lee123
556 512MB
you know it is, still nothing may be i'm not getting the answers i need because i keep asking how i would set up the code but no one seems to know how to. is there somewhere or someone you can direct me to to help me get this thing working because so far i got

IN THE STATRBUTTON

number1 = int(rnd*10+1)
number2 = int(rnd *10 +1)

IN THE ANSWERCHECK

dim answer as integer

answer = val(number1) + val(number2)
if answer = useranswer then
msgbox "correct"
else
msgbox "incorrect the correct answer is." & answer
end if

you see all of this works but the timer (textbox) i have on the bottom
of the quiz has nothing so when i click the start button only the
number1 & number2 and answer is working so how can i get the timer to display
in the right (text) box i have made for it to work. because there is nothing in there its blank....
Mar 9 '07 #9
willakawill
1,646 1GB
What do you want to put in your textbox when you click the start button?
Mar 9 '07 #10
lee123
556 512MB
well first off i want to put how many answers they got "right" in the correct box and how many they got "wrong" in the incorrect box but thats not all i need to know how i can put a timer on the bottom to time them how would i do that....
Mar 10 '07 #11
willakawill
1,646 1GB
well first off i want to put how many answers they got "right" in the correct box and how many they got "wrong" in the incorrect box but thats not all i need to know how i can put a timer on the bottom to time them how would i do that....
You didn't answer my question
Mar 10 '07 #12
lee123
556 512MB
the timer that gives the person (60 seconds) or someother time
Mar 10 '07 #13
Killer42
8,435 Expert 8TB
the timer that gives the person (60 seconds) or someother time
The timer doesn't go in the button. It's a separate control on the form. And to quote myself earlier in the thread... In the start button's click event, set the Enabled property of the timer to True.
Mar 10 '07 #14
lee123
556 512MB
well in my previous threads i said it was set to true but still nothing so there is something else wrong that im doing or im not understanding what your saying
for example when i click on my start button (not in run mode), either:

1 i look in the property box ( in the start button) and find the "enabled" because it only answers True, or false . right
or.......
2- click on the timer box, which i have and looked in the property box and checked to see if the "enabled " was set to true and it also is.

my timer and start button are separate i thought when i would click on the start button the timer would begain so i thought i could stick a code (in the start button) to make the timer start,,,but if there is something else i could do then tell me or if im doing this all wrong then tell me
Mar 10 '07 #15
willakawill
1,646 1GB
Expand|Select|Wrap|Line Numbers
  1. Me.Timer1.Interval = 1500 'one and a half secs
  2. Me.Timer1.Enabled = True
When you enable the timer it counts the time that you have told it to and then raises a timer event
Expand|Select|Wrap|Line Numbers
  1. Private Sub Timer1_Timer()
  2.    Me.Label1.Caption = "Time's up. You're done"
  3. End Sub
Mar 10 '07 #16
lee123
556 512MB
well i put the code in like this

me.timer1.interval = what ever i put the number as ( p.s ) i haven't put the second code in yet i wanted to see if this work before i did.

when i put (me.) a window pops up so i know that is working
when i put (timer1) a window pops up and thats working

but....

when i start putting (interval) in guess what? a window doesn't pop up the word (interval) isn't on the list so there is something wrong here this is so difficult im going insane here. this is what i have on my form:

1- 1button named (startbutton)
2-three txtboxone named (number1) the next txtbox named (number2) the third txtbox named ( useranswer)
3 one button named (answercheck)
4- 1 txtbox named (txtcorrect)
5- 1 txtbox named (txtincorrect)
6- 1 txtbox named (timer1)


so there it is in a nutshell where is my problem. did i not name my txtboxes right or is there something im missing that you can tell
Mar 10 '07 #17
willakawill
1,646 1GB
You don't have a timer control on the form?
Mar 10 '07 #18
lee123
556 512MB
well that worked but can't you see the time counting down in a txtbox or is this to far fetched to do or is there somother way to do it
Mar 10 '07 #19
lee123
556 512MB
like a digital timer
Mar 10 '07 #20
Write this code for setting the timer to work:(Double click Timer icon & write inside it): code looks something like this....
Expand|Select|Wrap|Line Numbers
  1. Private Sub Timer1_Timer()
  2.     var = var + 1
  3.     Text1.Text = Date      
  4.     Text1.Text = Time
  5. End Sub
Important things are: (1)Declare "var" used in timer block as integer in the General section i.e. at the beginning of code window.
(2)Set the Timer Interval in the Timer property to 1000.
(3)Text1.Text = Date gives Date (Where Text1 is name of first text box)
Text1.Text = Time gives Time
Text1.Text = Now gives both Date & Time (Use this if you need both in single text box).
If you do this you should get the right answer.....Let me the progress.





you know it is, still nothing may be i'm not getting the answers i need because i keep asking how i would set up the code but no one seems to know how to. is there somewhere or someone you can direct me to to help me get this thing working because so far i got

IN THE STATRBUTTON

number1 = int(rnd*10+1)
number2 = int(rnd *10 +1)

IN THE ANSWERCHECK

dim answer as integer

answer = val(number1) + val(number2)
if answer = useranswer then
msgbox "correct"
else
msgbox "incorrect the correct answer is." & answer
end if

you see all of this works but the timer (textbox) i have on the bottom
of the quiz has nothing so when i click the start button only the
number1 & number2 and answer is working so how can i get the timer to display
in the right (text) box i have made for it to work. because there is nothing in there its blank....
Mar 11 '07 #21
willakawill
1,646 1GB
You might want to add:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Timer1_Timer()
  2.     var = var + 1
  3.     Text1.Text = var & " secs"
  4.     If var = 60 Then
  5.         Timer1.Enabled = False
  6.          var = 0
  7.          Text1.Text = "Time Up!"
  8.     End If
  9. End Sub
Mar 11 '07 #22
Killer42
8,435 Expert 8TB
Expand|Select|Wrap|Line Numbers
  1. Private Sub Timer1_Timer()
  2.     var = var + 1
  3.     Text1.Text = Date      
  4.     Text1.Text = Time
  5. End Sub
I just hope the OP doesn't copy this code exactly, and expect both date and time in Text1.
Mar 11 '07 #23
willakawill
1,646 1GB
I just hope the OP doesn't copy this code exactly, and expect both date and time in Text1.
OP did not ask for date. Don't know why there would be a date there. This code gives a count of seconds which was what he asked for. Should be able to figure out the rest.
Mar 11 '07 #24
Killer42
8,435 Expert 8TB
OP did not ask for date. Don't know why there would be a date there. This code gives a count of seconds which was what he asked for. Should be able to figure out the rest.
It also puts the date in a textbox, then immediately overwrites it with the time. A lot of newbies will expect to see both date and time in the textbox. This idea that putting things in a variable concatenates rather than replacing seems fairly common in the less experienced.
Mar 11 '07 #25
willakawill
1,646 1GB
It also puts the date in a textbox, then immediately overwrites it with the time. A lot of newbies will expect to see both date and time in the textbox. This idea that putting things in a variable concatenates rather than replacing seems fairly common in the less experienced.
I got a bit lost on what you were saying. There is no date in the code snippet that I posted. Of course the code posted with the date and then the time is pointless.
Mar 12 '07 #26
lee123
556 512MB
well i'll try what you said and thanks for the help
Mar 13 '07 #27
Killer42
8,435 Expert 8TB
...There is no date in the code snippet that I posted...
Never said there was. It was in prasadvb's post.
Mar 13 '07 #28

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Sketcher | last post by:
Hi, I am trying to create a quiz, Code is as follows: <html> <head> <title>Quiz</title> </head> <BODY> <Center><TABLE cellSpacing=3 cellPadding=0 border=0>
5
by: Vandana Rola | last post by:
Hello Everyone, I am a beginner in Javascript.I want to create fun quiz tool using javascript (no database). The feature of that tool is every question has five choices. The user needs to select...
4
by: DAL | last post by:
I want to build my kid a program that cycles through questions (using a label for the question), and lets him choose one of two radio buttons for the right answer. How do I get every set of...
2
by: kenny | last post by:
I'm making a quiz to be posted on the internet. but I'm facing difficulties in finding a simple timer for the quiz (unlimited timing) which will keep on running regardless to the change of the page...
0
NoPeasHear
by: NoPeasHear | last post by:
I don't know what I am doing wrong... I used this tutorial... http://www.permadi.com/tutorial/flashMXQuiz/index.html It works with their quiz.xml file, but when I add an option for multiple...
3
by: Raqueeb Hassan | last post by:
Hello, I was helping one of my friend's school on setting up a online quiz system. They have the AMP systems to host php+mysql. The quiz script/software should have the following features: a....
5
nomad
by: nomad | last post by:
Hello Everyone: Just want to ask how easy would it be to build a quiz in Java. I have not use Java for a few months (5). Quiz would need the following: 1. T or F and mulitiple question, possible...
3
by: empiresolutions | last post by:
I am building a app that creates quizzes. This is how it goes - - Create Quiz - Provide up to 10 different types of Quiz Results - Give up to 50 Questions - Each Question has up to 10 possible...
0
by: Artem Ploujnikov | last post by:
Hello everyone I'm building an adaptive quiz system that uses some non-trivial math formulas, and I would like to figure out the most widely supported way of handling arbitrary-precision math...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.