My jsp is about learning language.User can login to access the online test whereas admin can add question for the test .there are several types of questions such as fill-in-the-blank ,multiple choice and dictation. Besides,there are several rules and regulations that need to be obeyed. User have to login and select which test to be taken ( quiz 1,quiz 2..).once user is login successfully, they can choose freely which type of questions (fill-in-the-blank,multiple choice..) that they want to answer. but they have to answer all questions in those parts within the certain duration(e.g. 1 hour). Furthermore, each user can only login once for each test. The marks are then accumulated and stored in database.
What is the best way to ensure user login once for each test only?The user should be alert once the session is times up and redirect them to page that display their result for each parts. So how to determine their session is expired and display time remaining in status bar while they explore through out each page? I found an example that display remaining time that invoked in body onload event. but the remaining time is not run once i explore to other page.and run again when i explore to that page. i also encounter problem that the remaining time is 'refresh' if i clicked on the Refresh button. how to i keep the remain time while session is valid ?last but not least,if multiple users is accessing the page, how to keep their respective remaining time?
Your help and opinion are much appreciated. that's better if you can provide example code. thanks in advance!