Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to force to view the page ONLY once?

Posted on 1999-07-14
9
Medium Priority
?
146 Views
Last Modified: 2013-12-25
Hello,
My college plan to put the exam question on the web.
We are using ASP, MSSQL 7.0, IE/Netscape.

The conditions are :
1. There is javascript to count the time down in each page.
When the time is up, it will jump to next question.

2. The student should read the question on the web page
once.  And he/she should not use go back to read the
previous question again.

3. Also, the student should not "refresh" the page since
this would reset the timer in the javascript.

Would anyone tell me how to force the user to view
the web page ONLY once?

Thanks.
rgds.
alanpong@hkstar.com
0
Comment
Question by:alanpong
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 1

Author Comment

by:alanpong
ID: 1864045
I agree java can do a better job in this case.
But can asp + javascript do so?
0
 
LVL 4

Expert Comment

by:siabod
ID: 1864046
Well, little suggestion, if you do it in asp then you could choose to set a session variable which contains on which page you should be, if the current page is not that variable, then it should jump to the right page...
0
 
LVL 4

Expert Comment

by:siabod
ID: 1864047
other advantage of that session variable is that if the student opens a second browser then that one will also jump to the question it should be
0
DFW AZURE MEETUP TONIGHT FRI 6PM

We will be discussing what Azure Stack is, how does it fit into the suit of offerings that Azure has currently, and where can it fit into your organizations technology stack. We will also be discussing limitations of the platform while covering various applicable scenarios.

 
LVL 11

Accepted Solution

by:
mouatts earned 400 total points
ID: 1864048
Following on from what siabod said

create a single page which looks at a session variable and then includes the actual page to be displayed based on that
ie

global.asa
----------

SUB Session_OnStart
session("pageno")=0
END SUB

default.asp
-----------
<%
SELECT CASE session("pageno")

CASE 0
     <!--#include file="c:\questions\instructions.asp"-->
CASE 1
     <!--#include file="c:\questions\1.asp"-->
CASE 2
     <!--#include file="c:\questions\2.asp"-->
END SELECT
session("pageno")=Session("pageno")+1
%>

The path I have suggested puts the page outside the virtual directory structure so that it is not possible to enter the URL to grab the page.

The first page displayed should not be a question so that if the user rejects the cookie that creating a session would produce they can only see the instructions and not a question.

In addition to this you will need to ensure that no pages are cached locally.

HTH
Steve

0
 
LVL 1

Author Comment

by:alanpong
ID: 1864049
mouatts,
Assume, i am reading question2, when i click on "back"
say on IE, I predict I will see question1 again.

Ahhh... maybe, the page in the history address list
is always "default.asp" and the "back" button will not
be enabled. And only "refresh" is possible.....

Anyway, let me try your method first....

=====================================================
To those who want to give comment or answer :
Let me summarize/simplify the question :
The rule is to read question1 , question2, question3 and so on. And no Back.

Thanks.
0
 
LVL 11

Expert Comment

by:mouatts
ID: 1864050
In answer to your question when you click back from page 2 you will not get page 1 but page 3 because the URL is always the same and so long as the page isn't cached a new request will have to be made of the Server. I think!!!!

However if this isn't the case there is a technique to resolve it in that we make each page a two stage process in that when the session value is 1 we increment it and issue a redirection to the same page. When the value is 2 we increment again and issue a page. When the value is 3 we redirect as before and so on.

Because the redirection was issued before the actual page if they do a back they will reload the redirection which will force them back to the server again and not the page that was previoiusly sent.

Actually if you have started yet you might like to do this straight away because I know that this will work. (use reponse.redirect("default.asp") to do the redirection.

Steve
0
 
LVL 1

Author Comment

by:alanpong
ID: 1864051
mouatts,
Great.  I open a new window for showing the question.
(without toolbar, address box...)  No back and forward.

Thank you very much.

---

I am try to solve another problem in the project.
Examination time will be displayed on the page.
The student cannot answer the question when time
is up.

Anyway , i try to fix it first.....
(maybe, server push technique and cookie may help...
i think...)
0
 
LVL 11

Expert Comment

by:mouatts
ID: 1864052
Client pull - not server push.

Steve
0
 
LVL 1

Author Comment

by:alanpong
ID: 1864053
mouatts,
I fixed the "examination time" problem.
The algorithm is quite straight forward and
looks like this :

1. Session("ExamStartTime") = Now()
Session("ExamTime") = 100   (in minute)
Session("CurrentTime") = Now()

3. On getting each question,
Do
{
Session("CurrentTime") = Now()
if (Session("CurrentTime")-Session("ExamStartTime"))
 > Session("ExamTime") then
Response.redirect("TimeOut.asp")
End if
}

--

Hope no drawback and the student cannot break the system
and cheat in this exam.

0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Suggested Courses

670 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