In our last episode, <h3j3v315jrg4ttj011l8r0ajodatgasaas@4ax.com>, the
lovely and talented Geoff Cox broadcast on
comp.infosystems.
www.authoring.html:
> Hello,
> I am preparing a site where it is important that the user moves from
> page 1 to page 2 to page 3 etc as a series of tests are presented and
> the order is important.
> Is it possible to make sure that this happens?!
If all you want to do is present a sequence of pages to a casual user, you
can do this with server-side scripting. The only HTML issue involved here
is using a hidden input to tell your script what page the user was on
previously (if any) so the script can write the next page. Of course if you
have a sequence of tests, the script can probably be devised to deduce what
page to write next by the values of test items it has.
This will be good enough for "What is your Luv IQ?" kinds of amusements or
evaluate-your-own-knowledge types of test. It won't be secure in any sense
from someone interested in cheating or otherwise messing with the results.
> One thought I've had is that to stop a user arriving at say page 2 by
> using Google, I can put all these pages into a password protected
> folder (using htaccss/htpasswd). The users would be presented with the
> same user name and password on the public page. Is there any other
> way?
I don't quite understand how Google comes into it. If all you want to do is
ensure that someone who comes to the test always gets the first page, simply
have your script write the first page if no test variables are set. If you
do not want casual users to bookmark intermediate results, use POST and not
GET. .htaccess is not necessary for that and doesn't provide sufficient
security for serious employment/academic test where someone would be
motivated to cheat.
In other words:
Your test url looks like:
http://mydomain/testscript.cgi (or .php or .pl or whatever)
That is also the form ACTION for all the pages of your test.
The url does not look like
http://mydomain/test/page1.cgi,
http://mydomain/test/page2.cgi,
http://mydomain/test/page3.cgi, etc.
It always looks like
http://mydomain/testscript.cgi, so there are no links
or booksmarks to page 2, page 3, etc.
If your script finds no test variables set (POSTed), it writes page 1. If
it finds page 1 items set but not page 2 variables set, it sticks the page 1
values in hidden inputs and writes page 2, and so forth. You can use either
server-side or client-side scripting to check for the validity of responses
(i.e. can users skip some/all items, are item basically in the right form,
etc.) Since this isn't really secure from people who intend to cheat, you
could user client-side scripting to score as you go along --- but this will
leave out and piss off people who do not have client-side scripting or do
not have it turned on. It also won't save much hassle when scoring of items
on later pages depends on responses to earlier items.
How to do the scripting is, of course, not within the scope of this
newsgroup.
--
Lars Eighner <http://larseighner.com/>
usenet@larseighner.com
Countdown: 294 days to go.