Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - ASP Timer
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ASP Timer

 Post Reply Post Reply Page  12>
Author
zaboss View Drop Down
Senior Member
Senior Member


Joined: 20 August 2002
Location: Romania
Status: Offline
Points: 454
Post Options Post Options   Thanks (0) Thanks(0)   Quote zaboss Quote  Post ReplyReply Direct Link To This Post 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..."

Cristian Banu
Soft 4 web
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
zaboss View Drop Down
Senior Member
Senior Member


Joined: 20 August 2002
Location: Romania
Status: Offline
Points: 454
Post Options Post Options   Thanks (0) Thanks(0)   Quote zaboss Quote  Post ReplyReply Direct Link To This Post 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?
Cristian Banu
Soft 4 web
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
zaboss View Drop Down
Senior Member
Senior Member


Joined: 20 August 2002
Location: Romania
Status: Offline
Points: 454
Post Options Post Options   Thanks (0) Thanks(0)   Quote zaboss Quote  Post ReplyReply Direct Link To This Post 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 .
Cristian Banu
Soft 4 web
Back to Top
KCWebMonkey View Drop Down
Senior Member
Senior Member
Avatar
Go Chiefs!

Joined: 21 June 2002
Status: Offline
Points: 1319
Post Options Post Options   Thanks (0) Thanks(0)   Quote KCWebMonkey Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
zaboss View Drop Down
Senior Member
Senior Member


Joined: 20 August 2002
Location: Romania
Status: Offline
Points: 454
Post Options Post Options   Thanks (0) Thanks(0)   Quote zaboss Quote  Post ReplyReply Direct Link To This Post 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.

Cristian Banu
Soft 4 web
Back to Top
KCWebMonkey View Drop Down
Senior Member
Senior Member
Avatar
Go Chiefs!

Joined: 21 June 2002
Status: Offline
Points: 1319
Post Options Post Options   Thanks (0) Thanks(0)   Quote KCWebMonkey Quote  Post ReplyReply Direct Link To This Post Posted: 23 October 2003 at 2:41pm
Originally posted by zaboss 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.

Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.