动态更改时间戳 - 有建议吗?
I'm writing up an online examination site for an educational institution.可以为每次评估设置时间限制,一旦用户开始考试,就会在服务器上创建一个新的时间戳。问题是我们学校的电脑经常死机,学生被迫重新启动,从而浪费了考试时间。
我发现我可以将计时器存储为 cookie,但这很容易被破坏。有什么建议吗?谢谢。
I'm writing up an online examination site for an educational institution. Time limits can be set for each assessment, and once a user begins an exam, a new timestamp is created on the server. The problem is that our school computers often lock up and students are forced to restart, losing exam time.
I figured out I could store the timer as a cookie, but that could easily be compromised. Any suggestions? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以将时间戳存储在链接到其用户的数据库中(如果他们正在考试,我会假设他们有登录名),并每隔几秒执行一次 ajax 调用以检查他们是否仍然在线。
In this ajax check you can update the database with a new timestamp that indicates when they were last online, so if the computer locks up and they have to restart you can figure out how much time was lost.
You could store a timestamp in a database that is linked to their user (I would assume they have a login if they are doing exams) and perform an ajax call every few seconds to check if they are still online.
In this ajax check you can update the database with a new timestamp that indicates when they were last online, so if the computer locks up and they have to restart you can figure out how much time was lost.
您可以生成唯一的哈希值将其存储在 cookie 中
,并将所有需要的信息存储在数据库中,例如:
稍后(如果计算机重新启动)您可以从数据库中获取所有信息:
这样学生将无法更改时间戳
You could generate unique hash to store it in the cookie like
and store all the needed information in the database like:
and later (if computer is restarted) you can get all the information from the database:
this way the student won't be able to change the timestamp
continue
While I realise that this can at times be difficult the only really reliable solution to your dilema is a reliable network.
But lacking that what about another communication media or pathway that confirms the client state? Can you confirm that a domain controller can see the client on the LAN? If the PC is present but the web client isn't it is more likely a user manuipulated situation. Can something (domain controller, other network location?) note the appearance or disappearance of a client from the network?
Any method is open to abuse somehow. I think the only real assurance will come from human monitoring of frequence of and user experiencing restarts.