Last post Dec 05, 2018 05:34 AM by Ackerly Xu
Nov 29, 2018 02:15 AM|shsu|LINK
For Online test page ,Below code is helping me to prevent copying link to another browser.But there are many test which user have to do simultaneously.This code prevent them from re-login to next exam..One test user can attend 3 times .like
that 10 test are there. how to do this .Appreciate the help
ByVal e As
Dim record =
= "have started"
Response.Write("you have started the exam")
Nov 30, 2018 03:10 AM|Ackerly Xu|LINK
You could use a counter to record the umber of exams.The counter is recorded in session.
Every time the user starts the exam, the counter will add one.
If its value is beyond 3, you could stop the exam.
Below is my code.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Dim record = Session("record")
If record Is Nothing Then
Session("record") = 1
Dim count As Int32 = Session("record")
Session("record") = count + 1
If count + 1 >= 4 Then
Response.Write("you have finished all the exams")
Nov 30, 2018 09:43 AM|shsu|LINK
Multiple users are using the system at the same time. If I login and tried to copy link to another browser,then it stops the user. that is fine
But if another user login in another browser also same you have started the exam" message is showing.I have login ID.. How can I restrict copying the link using Login ID.SEESION TIME OUT IS SET TO 60 FOR TEST earlier.so
I didn't use <sessionState mode="InProc"
or I placed the whole website session time out to be 60 minutes. I can not change it . Is it possible to have this particular session's time out to be 5 minutes.
Nov 30, 2018 01:42 PM|mgebhard|LINK
This is a pure design question and fundamental state management in ASP.
Session will not wok by itself because Session is unique to the browser instance. You can learn about Session by reading the documentation.
I recommend a database to track the user and the exam(s) they are taking. The table will have at least an exam id, User Id, start date and end date. When the user starts an exam, write a record to the database. When the user completes an exam, set the
If the user has 3 records without an end date then they have reached the max exam limit and cannot start a new exam. I'm assuming they can take 3 different exams at the same time.
All you have to do is check the user's exam state whenever needed. That could be on every request or when the user accesses an exam. This is very simple, assuming that you are using standard ASP.NET security and know the identity of the user.
Dec 05, 2018 05:23 AM|shsu|LINK
In my code and the database ,maximum 3 attempts are clearly defined. If user login for the 3rd time and select the same test for the 4 th time, they are not allowed to take the test and they can not even go to Test page.
But when they copy the Test page link to another browser ,then start exam page is showing .Exam page is a repeater with 3 pages,and they could do the test again.start exam page is having 3 pages in repeater control.
Dec 05, 2018 05:34 AM|Ackerly Xu|LINK
If you want to prevent the student to login with another browser, you should design a user table for the students.
For example , the table has three columns id , name , examtime(default is zero),password and you could use examtime to record exam time.
The use must login with the password.
And then after they login , you could save the use data (id,name,examtime) in your session.
Every time they go to the text page, you could update the user data in database , add the examtime.
If they use another browser, you could ask them to login and get the examtime in the database.
If it is bigger than three, then they are not allowed to restart the exam.