Solved

Stopping user to return to the previous page

Posted on 2008-10-04
4
183 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now