Solved

Stopping user to return to the previous page

Posted on 2008-10-04
4
185 Views
Last Modified: 2013-12-12
Hi,
I am working on an online assessment test:
3 test pages, with form inputs (multiple choice). Tests taken one after the other (English, Maths and Science). The users sing in and login before they can start the tests.
Is there any way to stop the user to go back to the test page they have completed and left, without restricting their access to the test pages not yet accessed.
0
Comment
Question by:Erikal
4 Comments
 
LVL 82

Accepted Solution

by:
hielo earned 500 total points
ID: 22641245
somewhere in your db you should be tracking the responses supplied by specific users. So when a user logs in successfully, obtain a list of the pending tests only and save it to a session variable. So if a user decides to go to "test1" page and that page is NOT in your session variable, then redirect to some other page(perhaps one that will show them the allowed tests they can take).
0
 
LVL 14

Expert Comment

by:ali_kayahan
ID: 22641274
In addition to storing tracks in DB and sessions you can set cookies to prevent logging same page from other browsers.
0
 
LVL 9

Expert Comment

by:syedasimmeesaq
ID: 22641600
I think easiest way would be if you set a complete field in you mysql db for English, Math and Science. When the user finish the test, make sure your mysql db gets updated. you can send a hidden value on update to mysql.
ok so then how to prevent the users going back? Put a check on each of your page at the top
something like this

if($row["complete"]==1) {
// redirect them
} else
{
//your test
}

hope this helps
0
 

Author Closing Comment

by:Erikal
ID: 31503046
Thank you very much. You have been a fantastic help.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo‚Ķ
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question