使用 JavaScript 检查代码是否抄袭
我想知道如何使用 Javascript 检测代码抄袭。我想测试我要分发的作业提交。
我已经考虑过使用 MOSS,但是,据我所知,它是除了 C 之外,其他方面都很差。不幸的是,我还无法测试它,因为我没有提交。
如何检测 JavaScript 代码抄袭行为?
I was wondering how I can detect code plagiarism with Javascript. I want to test assignment submissions for homework I'm going to hand out.
I've looked at using MOSS, but—from what I've heard—it's pretty poor for anything other than C. Unfortunately, I can't test it yet because I don't have submissions.
How can I go about detecting code plagiarism with JavaScript?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
他们声称 MOSS 可在 Javascript 上运行。你为什么不尝试一下呢?编写一个 Javascript 文件,然后修改它,就像作弊者修改别人的代码并将其提供给 MOSS 看看它说了什么一样?
They claim that MOSS works on Javascript. Why don't you just try it. Write a Javascript file, then modify it, like a cheater would modify somebody elses code and feed it to MOSS to see what it says?
我构建了克隆检测工具,可以跨文件查找相似的代码块。
请参阅 CloneDR 概述
和示例报告。 CloneDR 适用于多种语言,并使用
语言结构使克隆检测高效有效。
I build Clone detection tools, that find similar blocks of code across files.
See CloneDR overview
and example reports. CloneDR works for a wide variety of languages, and uses
the langauge structure to makethe clone detection efficient and effective.
根据 yar 的评论,将 javascript 块粘贴到 Google 中会很好地工作 - 但阻止他们作弊现实吗?
你能否将任务分成两部分,第一部分允许他们“作弊”(如果他们愿意),但告诉他们课堂上会有任务的第二部分。然后让全班在监督课堂时间完成完全相同的任务。
如果每个人都第一次“作弊”,那是一回事。但是,如果有人无法在课堂上重做作业,那么他们a)作弊(这已经够糟糕了)并且b)什么也没学到(这更糟糕)。
利用互联网进行“研究”总是会发生,但那些忘记“研究”的人正在欺骗你和他们自己。
As per yar's comment pasting chunks of javascript into Google will work pretty well - but is stopping them cheating realistic?
Could you split the task into two parts, the first part allowing them to 'cheat' if they want to but tell them that there will be a second part of the task in class. Then have the class do exactly the same task in supervised class time.
If everyone has 'cheated' first time that's one thing. But if anyone is unable to redo their homework in class then they a) cheated (which is bad enough) and b) learnt nothing (which is worse).
Using the internet to 'research' is always going to happen - but its the ones who forget their 'research' that are cheating both you and themselves.
我不会特意尝试通过抄袭检查器。
代码就是代码,坏代码就是坏代码。 不会编码的人(那些谁更有可能复制/粘贴代码**)通常没有好的代码。如果您花几秒钟检查源代码,困难(以及围绕它们的可疑方法)将很容易被发现。有些东西就是不匹配,它应该打在你脸上。
**我认为改编的代码不是抄袭,除非它违反了作者的分发意图(例如违反版权或许可),并且鼓励学生简单地记录他们用作基础和/或合并的现有资源(如果有)以及鼓励他们理解和调整代码以满足他们的需求(并使其变得更好,有这么多代码)。我一直这样做是为了“真正的编程工作”。当然,这不是我的课程:-)
I wouldn't go out of my way to try and run through a plagiarism checker.
Code is code and bad code is bad code. People who can't code (those who are more likely to copy/paste code**) generally don't have good code. Difficulties (and questionable approaches around them) will be easily detectable if you even take a few seconds to check the source. Something just won't match up and it should smack you in the face.
**I would argue that adapted code isn't plagiarized unless it violates the authors distribution intent (e.g. violates copyright or license) and would encourage the students to simply document which existing resources, if any, they used as a base and/or incorporated as well as to encourage them to understand and adapt the code to fit their needs (and to make it better, so much code out there is soup). I do this all the time for "real programming work". Of course, it's not my curriculum :-)