|
|
 |
FN-FORUM: RE: Timer!
date posted 17th January 2005 22:36
Why not create a new table in access.
When someone starts a course, create a new record.
Columns:
1. USERID [PK i]
2. COURSEID [PK ii]
3. MAXCOURSEMINUTES [set to 720 or whatever]
4. COURSETIMESOFAR [set to 0 initially]
5. LASTCHECKDATETIME [currenttime]
6. LOGGEDON [set to true]
In course ASP:
Read row
If (Row.CoursetimesoFar >= Row.MaxCourseMinutes)
{
Delete Row;
Finish Course;
}
else
{
if (!LoggedOn)
{
LoggedOn = true;
Set LastCheckDateTime = timeNow;
}
else
ElapsedTime = TimeNow - Row.LastcheckDateTime;
Row.CourseTimeSoFar += ElapsedTime;
}
}
LogOut:
[and/or session timeout]
Row.LoggedOn = false;
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.834 / Virus Database: 568 - Release Date: 14/01/2005
|
 |
|