在线考试网页-即兴 [英] Online Exam Webpage - Improvise

查看:85
本文介绍了在线考试网页-即兴的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友,

我创建了一个在线考试网页.
用户选择开始考试"后,我将打开一个新窗口"并显示问题,但同时又会关闭现有窗口.
但是用户会打开新窗口并从Google那里获取答案.
我也允许用户输入一个单词的答案.
所以我不能阻止按键.

可以针对这个问题提出任何建议吗?

问候
AP

Dear Friends,

I have created a Online Exam Webpage.
Once the user select Start Exam, I am opening a New Window and displaying question and same time ill close the existing window.
But user opens new window and getting the answer from google.
I am alowing user to enter one word answer also.
So I cant block then from key press.

Can any suggest any idea for this issue.

Regards
AP

推荐答案

您可以将Javascript Blur事件附加到页面主体,然后使用它向服务器发送取消消息.
这样,当页面失去焦点时,您都​​可以取消考试.
一种方法是这样的:
You could attach Javascript Blur event to the page body, and use it to send a cancel to the server.
That way, when ever the page looses the focus, you can cancel the exam.
One way to do this is like this:
<body onblur="javascript:window.opener='x';window.close();">

在Chrome中可以使用该功能关闭窗口而不提示.

Which works in Chrome to close the window without prompting.


这篇关于在线考试网页-即兴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆