对于使用JavaScript来检查测验答案最安全的方法 [英] Most Secure Method for Using Javascript To Check Quiz Answers

查看:104
本文介绍了对于使用JavaScript来检查测验答案最安全的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用AJAX + PHP设计相匹配的问答游戏项目工作发奋后,我才知道,我的公司使用,销售其产品的学习套件不会让我在后台运行服务器端脚本来安全检查答案。这一切都是因为一个不幸的层次专制。

After working strenuously on a project using AJAX + PHP designing a matching quiz game, I learned that the learning suite that my company uses to distribute its products does not let me run server-side scripts on the backend to check answers securely. This is all due to an unfortunate hierarchical autocracy.

长话短说,我必须以某种方式检查客户端上的答案(或找出一些棘手的)。幸运的是,我已经能够jQuery的上传到本地文件夹结构,这样我就可以使用它。

Long story short, I have to somehow check answers on the client side (or figure out something tricky). Luckily, I have been able to upload jQuery to the local folder structure so I can use that.

什么是检查在客户端的客户的答案最安全的方法?或者是有一些方法来引用外部文件......像一个XML文件什么的,更安全地核对答案?

What is the most secure method for checking clients' answers on the client-side? Or is there some way to reference an external file...like an XML file or something, to check the answers more securely?

推荐答案

我唯一能想到的是模糊处理您的code的。这个过程也被称为是污染减量它。如果你这样做你的code将难以阅读,因此稍微更难以破解。它并不能使它牢不可破的,但它使生活稍微困难的那些谁愿意作弊。您有几种选择:

The only thing I can think of is obfuscating your code. This process is also known is minifying it. If you do this your code will be harder to read and thus marginally more difficult to hack. It does not make it unhackable, but it makes life slightly more difficult for those who wish to cheat. You have several options:

  • YUI compressor
  • /packer/
  • JSmin
  • UglifyJS
  • Google Closure Compiler (I recommend this one)

我认为,涵盖了所有的主要的,但如果你知道的更多,我没有提及,请在下面留下评论。

I think that covers all of the main ones, but if you know of any more that I haven't mentioned, please leave a comment below.

相关问题这样的回答:是否有一个良好的JavaScript极小

Related question to this answer: Is there a good JavaScript minimizer?

这篇关于对于使用JavaScript来检查测验答案最安全的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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