| Author |
Topic Search Topic Options
|
zaboss
Senior Member
Joined: 20 August 2002
Location: Romania
Status: Offline
Points: 454
|
Post Options
Thanks(0)
Quote Reply
Topic: ASP Timer Posted: 23 October 2003 at 10:29am |
I need an ASP script (well, perhaps not the script itself, but a hint on how to do it) to count down the time to a certain limit then redirect the user to another page. If the user moves to another page before the limit expires, I need to be able to pass the time to another page...
The best thing I found was this javascript. But it needs to adjustments: a) the time page expires must be triggered from a database, b) the remaining time must be put in a query string...
To be more clear and more specific: It is about a online exams script and I want to be able to set a time limit in which the user should finish - let's say, 30 mins. S0 this script should count down the remaining time and when the user is done to pass the value to the next page - where I do the marking - in a querystring. If the time expire, just redirect the user to a "we are sorry but you have failed page..."
|
|
|
 |
MorningZ
Senior Member
Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
|
Post Options
Thanks(0)
Quote Reply
Posted: 23 October 2003 at 10:35am |
yeah, but you fail to realize that ASP spits out the HTML to the client browser, and then it's done talking to the browser
so if they have 30 mins to do the exam, then set a session variable for when they start and compare it at the end and see if they passed or failed due to time
|
|
Contribute to the working anarchy we fondly call the Internet
|
 |
zaboss
Senior Member
Joined: 20 August 2002
Location: Romania
Status: Offline
Points: 454
|
Post Options
Thanks(0)
Quote Reply
Posted: 23 October 2003 at 10:43am |
|
Yep Mornigz. I know, that's why I'm asking for a ASP version of the script. I put this only to ilustrate what I need. The ideea is to let the user know the there are x min left 'till time out. It is rather depressing to complete an exam and get a messege that "We are sorry but your time has expired!" Don't you want to get that message before you complete the test?
|
|
|
 |
MorningZ
Senior Member
Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
|
Post Options
Thanks(0)
Quote Reply
Posted: 23 October 2003 at 11:02am |
|
yeah, but you are still overlooking that once the HTML is generated and delivered.. the server is all through talking to the broswer unless you do some sort of constant refreshing of the page (or a popup in the fore/back ground), which can get out of control
|
|
Contribute to the working anarchy we fondly call the Internet
|
 |
zaboss
Senior Member
Joined: 20 August 2002
Location: Romania
Status: Offline
Points: 454
|
Post Options
Thanks(0)
Quote Reply
Posted: 23 October 2003 at 11:11am |
Now I understand you first message  . So, i guess I need a combination of two methods. Using the Java script to display the timer to user, but I still don't know how to make the redirection in time  .
|
|
|
 |
KCWebMonkey
Senior Member
Go Chiefs!
Joined: 21 June 2002
Status: Offline
Points: 1319
|
Post Options
Thanks(0)
Quote Reply
Posted: 23 October 2003 at 12:05pm |
i wouldn't worry so much about redirecting them the moment that the time runs out. i would just worry about what to do if they submit the test after the time has run out.
|
 |
zaboss
Senior Member
Joined: 20 August 2002
Location: Romania
Status: Offline
Points: 454
|
Post Options
Thanks(0)
Quote Reply
Posted: 23 October 2003 at 2:10pm |
KC, how could he submit the test if is redirected? Anyway, I have a solution, to use the Jscript for redirecting and leting the user know how much time he/she have and puting a cookie with the moment the test start and on the marks page, retrive that cookie and do a DateDiff to have the time user passed the exam.
The only problem to this solution is that the exam can not be passed by someone who hasn't JScript and cookies enabled. That's why I'm after an ASP solution.
|
|
|
 |
KCWebMonkey
Senior Member
Go Chiefs!
Joined: 21 June 2002
Status: Offline
Points: 1319
|
Post Options
Thanks(0)
Quote Reply
Posted: 23 October 2003 at 2:41pm |
zaboss wrote:
KC, how could he submit the test if is redirected?
|
I wasn't saying use a redirect, i was just saying on the results page for the test: process the results if it's within the time limits, and display a message saying they failed or something if it's outside of the time limits.
|
 |