473,402 Members | 2,072 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,402 software developers and data experts.

how to Calculate Time

hi ,
am developing quiz application.

the questions will be displayed one at a time after clicking next button
only the next question will be displayed.

for evry test the time to finish this test will be maintained in back end.

so i set 75 minutes for a particulat test. after 75 minutes whether the

candidates completed all the question or not but the test must be closed.

can anybody tell me how to do this one.

thanx in advance
yoshitha
Nov 19 '05 #1
4 1089
Hi, Yoshitha!

Have a look at the System.TimeSpan struct.

It's returned by the mathematical operators for DateTime types.

Example:
// This might be a static member in your application class, or a member of
the "Test" class if you have one..
DateTime testStart = DateTime.Now;

// Do your stuff

// Check if 75 min has passed:
TimeSpan timeUsed = DateTime.Now - testStart;
if (timeUsed.TotalMinutes > 75)
{
// Stop test
}
HTH,
Lars-Erik

"yoshitha" <jy********@nannacomputers.com> wrote in message
news:ud**************@TK2MSFTNGP15.phx.gbl...
hi ,
am developing quiz application.

the questions will be displayed one at a time after clicking next button
only the next question will be displayed.

for evry test the time to finish this test will be maintained in back end.

so i set 75 minutes for a particulat test. after 75 minutes whether the

candidates completed all the question or not but the test must be closed.

can anybody tell me how to do this one.

thanx in advance
yoshitha

Nov 19 '05 #2
Simply you can use javascript settimeout method to post
page back...
-----Original Message-----
hi ,
am developing quiz application.

the questions will be displayed one at a time after clicking next buttononly the next question will be displayed.

for evry test the time to finish this test will be maintained in back end.
so i set 75 minutes for a particulat test. after 75 minutes whether the
candidates completed all the question or not but the test must be closed.
can anybody tell me how to do this one.

thanx in advance
yoshitha
.

Nov 19 '05 #3
Is it a web based application or a windows based
application?
I think it is a web based application because it is posted
aspnet section

-----Original Message-----
Hi, Yoshitha!

Have a look at the System.TimeSpan struct.

It's returned by the mathematical operators for DateTime types.
Example:
// This might be a static member in your application class, or a member ofthe "Test" class if you have one..
DateTime testStart = DateTime.Now;

// Do your stuff

// Check if 75 min has passed:
TimeSpan timeUsed = DateTime.Now - testStart;
if (timeUsed.TotalMinutes > 75)
{
// Stop test
}
HTH,
Lars-Erik

"yoshitha" <jy********@nannacomputers.com> wrote in messagenews:ud**************@TK2MSFTNGP15.phx.gbl...
hi ,
am developing quiz application.

the questions will be displayed one at a time after clicking next button only the next question will be displayed.

for evry test the time to finish this test will be maintained in back end.
so i set 75 minutes for a particulat test. after 75 minutes whether the
candidates completed all the question or not but the test must be closed.
can anybody tell me how to do this one.

thanx in advance
yoshitha

.

Nov 19 '05 #4
I think you're right. :)

Anyway - there's loads of possible ways to persist DateTime variables across
pages, but that's another issue. :)
(I.E. put the result of one of the string conversion methods in a cookie)

Lars-Erik

"Yunus Emre ALPÖZEN [MCP]" <an*******@discussions.microsoft.com> wrote in
message news:21****************************@phx.gbl...
Is it a web based application or a windows based
application?
I think it is a web based application because it is posted
aspnet section

-----Original Message-----
Hi, Yoshitha!

Have a look at the System.TimeSpan struct.

It's returned by the mathematical operators for DateTime

types.

Example:
// This might be a static member in your application

class, or a member of
the "Test" class if you have one..
DateTime testStart = DateTime.Now;

// Do your stuff

// Check if 75 min has passed:
TimeSpan timeUsed = DateTime.Now - testStart;
if (timeUsed.TotalMinutes > 75)
{
// Stop test
}
HTH,
Lars-Erik

"yoshitha" <jy********@nannacomputers.com> wrote in

message
news:ud**************@TK2MSFTNGP15.phx.gbl...
hi ,
am developing quiz application.

the questions will be displayed one at a time after clicking next button only the next question will be displayed.

for evry test the time to finish this test will be maintained in back end.
so i set 75 minutes for a particulat test. after 75 minutes whether the
candidates completed all the question or not but the test must be closed.
can anybody tell me how to do this one.

thanx in advance
yoshitha

.

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: sg_s123 | last post by:
============================================================================ 02-Feb-04 03-Feb-04 Staff Staff 0800hr- 1300hr- 1700hr- 1900hr- 0800hr- 1300hr- 1700hr- 1900hr- Number...
7
by: Tim Quon | last post by:
Hi Is there any function to get the current time so I can calculate the execution time of my code? What all is in the time.h and sys/times.h? Thanks Tim
6
by: Herrcho | last post by:
in K&R Chapter 6.3 it mentions two methods to calculate NKEYS. and points out the first one which is to terminate the list of initializers with a null pointer, then loop along keytab until the...
4
by: Qwert | last post by:
Hello, I do: Debug.WriteLine("A: " & DateTime.Now.Ticks.ToString) REM Calculate a bunch of stuff. Some loops and math functions. Debug.WriteLine("B: " & DateTime.Now.Ticks.ToString) but...
1
by: Bujji | last post by:
Hi, How to calculate Heap memory used by a process in HPUX machine (Itanium) using aCC compiler at run time ( My ultimate aim is to calculate heap memory at run-time and write it into a log...
5
by: Michael | last post by:
Hi. I need dinamically calculate input text field based on parent static TD before showing content of input. Please, advice. Michael
5
by: Beemer Biker | last post by:
I cant seem to get that date into any DateTime to make my calculation directly by subtracting "01-01-0000" from "now". After reading this:...
2
by: Lancelot | last post by:
Hello everyone. This is my first post here, but I've been looking for answer many time. I have a crazy idea in my head and since I am quite a newby to python, I am not sure where to start or if...
9
by: brendanmcdonagh | last post by:
Hi, I am designing a project for my friend as I am just a week old baby to vb and want to implement what I've learnt so far. She wants to be able to put start time, end time and lunch for each...
6
by: rrstudio2 | last post by:
I am using the following vba code to calculate the median of a table in MS Access: Public Function MedianOfRst(RstName As String, fldName As String) As Double 'This function will calculate the...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.