/    Sign up×
Community /Pin to ProfileBookmark

Quiz, user must not switch to another window

In a Quiz script made in PHP, I am trying to use Javascript to disable possibility for user to switch to another window.

Means, if the Quiz window went blur, if user switched to another window, using taskbar, or using Start menu, or using Alt-Tab, the Quiz window has to either:
– back to top immidiately (not a good solution);
– close itself immidiately (and write the username into the log with description and timestamp, user would not be able to login next 24 hrs);
– ask user if he/she wants to close the window, because he does the step toward switching to another window – he tries to cheat.

Anybody saw tutorial, manual, step by step Javascript guide how to do this?

I already have few solutions, but this seems to be big problem to solve. I tried to find tutorial for this on Internet, but – only few pages have similar, but not the same topic.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@KorOct 17.2005 — You may not dissable possibility for user to switch to whichever window he wants to, if he previouselly had open that page, as all the web pages are already in it's cache, and browsers sees them from there.... If the pages are "javascript" linked, there might be some weak solution, but they are quickly to be bypassed by the user by, let's say, disabling javascript. Whichever you may need (and it not quite clear) you must deffinitely try a server-side application to circle through pages or to avoid cheating.
Copy linkTweet thisAlerts:
@aditya_internetOct 19.2005 — Hi,

You can use the suggestion given in last post but u may use few restrictions as well to avoid user from cheating.

I dont know the level of code u r working on.

If it is supposed to be used on a high end website then I may work on developing a restriction system to avoid such things.

Please let me know the purpose of ur script and where it is to be used.
×

Success!

Help @computerforce spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.15,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...