Click here to Skip to main content
15,887,394 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to create a Online Exam Project in Which 2 Timer Should be their one is showing Total Time Elapsed and Another timer is for Per Question.

Suppose i have 10 Question total Time Will Be 10 Min
and Per Question Time is One Minute

So i want My First Timer Shows 10 Min and Decreases Per Second and Second Time Run for One minute and after one minute over next question should appear and not reset Main timer that is 10 Min Timer.

Once 10 Min Timer is over it should redirect to Exam Over Page.I need Help
Thanks in Advance.

What I have tried:

I am able to use one timer but not able to use 2nd timer
Posted
Updated 15-Sep-17 8:19am
Comments
ZurdoDev 15-Sep-17 10:53am    
If you can do one timer then doing 2 should be very easy. What's the problem?

You only need one timer: You set it to repeat at one second intervals (or better half second) and check two values. Check the "exam over" first then the "question over" if it hasn't elapsed, and you're sorted.
 
Share this answer
 
Comments
vikas_poonam 15-Sep-17 12:23pm    
Thanks for Reply
But Problem is i need to show both time on screen and after Question over i need to reset its value.

so can you please explain Little bit more on your concept.
You confound timer and timer. The timer you display is a countdown, the computer timer is an utility used to launch periodic events, you decide what happen on such an event.
Tracking time is done with hardware RTC (Real Tome Clock).

So you need 1 timer to throw periodical events, those events launch a routine that handle countdown on screen, questions change and any thing you need.

RTC have a now function
set QuestionDL deadline to now+60 secondes
remaining time for question is QuestionDL-now

Question: your program perform 10 tests of 1 minute and 1 question per test. Is it really what it is supposed to be?
[Update]
Quote:
I have One Test With 10Question total Time is 10 Min

In this case, enforcing 1 minutes per question is wrong, it change the test.
- if I am slow to answer and need 2 minutes per question, I can expect 5 good answers. if you set a 1 minute limit per question, I can answer zero question.
- if first question is super easy and I answer in 10 seconds, I should have a 50 seconds bonus time for a later question. if you set a 1 minute limit per question, the 50 seconds are lost.
- In paper test, all questions are shown at same time and student can answer questions in any order and he can answer easy questions first which give bonus time for harder ones.
 
Share this answer
 
v4
Comments
vikas_poonam 16-Sep-17 2:35am    
I have One Test With 10Question total Time is 10 Min
Per question Time is One Min.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900