15,964,364 members
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

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
ZurdoDev 15-Sep-17 10:53am
If you can do one timer then doing 2 should be very easy. What's the problem?

## Solution 1

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.

vikas_poonam 15-Sep-17 12:23pm
But Problem is i need to show both time on screen and after Question over i need to reset its value.

## Solution 2

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.

v4
vikas_poonam 16-Sep-17 2:35am
I have One Test With 10Question total Time is 10 Min
Per question Time is One Min.