防止复制网页中的文本
我有测验申请。机器人在聊天中提出不同的问题,这些问题属于不同的知识领域。最先回答问题的用户,获得积分。问题是,一些用户在谷歌上搜索答案。我想以某种方式阻止用户处理网页问题和谷歌搜索答案。
我什至不确定这是否可能,无论如何可能有人有任何想法
I've got quiz application. Where robot ask different questions in chat, this questions belong to different areas of knowledges. User that answered question first, receive points. The problem is, that some users googling answers. I want somehow prevent users from coping question from web page and googling answers.
I'm not even sure, that this is possible, anyway probably someone got any ideas
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(11)
这里:
如何使用 CSS 禁用文本选择突出显示?
禁止他们回答窗口的 onBlur 事件何时被触发。他们仍然可以使用其他设备,但无法在同一台计算机上作弊。
Here:
How to disable text selection highlighting using CSS?
Disallow them from being able to answer when the window's onBlur event is fired. They can still use other devices, but they won't be able to cheat on the same computer.
在粘贴问题的 div 标签中,添加以下代码行:
这将防止复制标签内的任何内容...
In your div tag where you paste your question, add the following line of code:
This will prevent copying of anything that is within the tags...
没有什么好的方法可以做到这一点。作弊者几乎可以解决所有问题。
唯一想到的是将问题输出为动态生成的图像。这将防止复制粘贴。不过,您必须决定真正的保护程度有多大——大多数简短的问题都可以立即输入谷歌,不是吗?
There is no good way to do this. A cheater will be able to work around pretty much everything.
The only thing that comes to mind is to output the questions as dynamically generated images. That would protect against copy-pasting. You'll have to decide how much of a protection that really is, though - most short questions can be typed into Google in no time, can't they?
请注意,想要通过浏览器端的 Greasemonkey 脚本或类似脚本覆盖禁止复制规则的人可能会通过 Google 找到此问题。
除了选择禁用之外,我至少在一个网站上看到过以下策略:
Note that this question might be found via Google by people who want to override a no-copy rule via a Greasemonkey script or the like on the browser side.
In addition to select disabling, I've seen the following tactic in at least one website:
您还可以将页面设为图像而不是 html/文本。
从图像中复制文本并不容易。必须对其进行保存和 OCR 处理。
You could also make the page an image instead of html/text.
It is not easy to copy the text from an image. It would have to be saved and OCR'd.
您可以在包含测验/问题的元素顶部放置一个透明的 PNG 吗?
Could you place a transparent PNG on top of the element that contains the quiz/question?
如果您使用 JQuery,则使用:
在您想要禁用的地方调用此函数。
If you are using JQuery then use:
Call this function where you want to disable.
对于未来可能不想阻止突出显示或希望允许用户复制有限数量字符的谷歌用户:
For future googlers who may not want to block highlighting or want to allow user to copy a limited number of characters :
您可以通过谷歌查询每个给定的答案,如果没有完全匹配,则很可能是用户自己输入的,您可以授予积分。
You could query each given answer with google and in case there is no exact match, it's very likely that the user has typed it in by him/herself and you can grant points.
对于普通用户,您可以简单地在 body、div 或任何其他元素上设置“draggable=true”,并且看起来像图像以避免复制。 Offcourse JS 选项就在那里。两者均应用于此处
For normal users, you can simply set the "draggable=true" on body, div or any other element and will look like an image to avoid its copying. Offcourse JS option is there. Both are applied in Here