9

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?

Alex Ciminian
  • 11,398
  • 15
  • 60
  • 94
  • 4
    How many students do you have? If it's less than 15, spend 3 minutes talking to each and you'll have rounded up the most suspicious. Then you can check chunks of code in Google. – Dan Rosenstark Apr 05 '10 at 23:29
  • 1
    Well, there are going to be more than a hundred submissions... Not all of them from my students (there's three of us teaching assistants), but I'm going to grade all of the assignments. The talk part's going to happen, but I need assistance in pointing out the prospective culprits :). – Alex Ciminian Apr 05 '10 at 23:34
  • +1 Trying to work out who used the internet to 'research' the problem and who plain lifted the answer off their favourite Q & A site is a tough job - I wish you well. – amelvin Apr 05 '10 at 23:45
  • 1
    to point out the prospective culprits, here are some guidelines: if they look up and away, rub their necks, or touch their ears, they are lying. http://www.southparkstudios.com/clips/224680/ – Anurag Apr 05 '10 at 23:50
  • 4
    Don't Google the code, Google the *problem*. Then familiarize yourself with the top five solutions and check them against your students' work. That will probably catch 80-90% of the cheating, if it exists. – Robusto Apr 05 '10 at 23:53
  • At my job as a software dev, if I'm stuck on a problem, I googles it. Isn't it funny that we label students as cheaters, for doing what we do naturally? – Alan Apr 20 '13 at 05:25
  • 1
    @Alan, I was not interested in catching people who use open code as an inspiration, I just cross-checked their assignments for similarity so that they don't share their work. – Alex Ciminian May 08 '13 at 11:26
  • Is this really worthy of reopening? If we're deciding that it's not a tool request surely it is then far too broad. The answers read more like responses on workplace.stackexchange.com than anything programming related. – OGHaza Jan 24 '17 at 00:51

4 Answers4

5

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?

Strelok
  • 50,229
  • 9
  • 102
  • 115
3

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.

Adriaan
  • 17,741
  • 7
  • 42
  • 75
Ira Baxter
  • 93,541
  • 22
  • 172
  • 341
  • That sounds really interesting. The programs will be under 1000 lines, I'll drop you a line when I have some 'test material' :). Thanks!! – Alex Ciminian Apr 06 '10 at 08:57
2

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.

amelvin
  • 8,919
  • 4
  • 38
  • 59
  • It sounds like this is a teaching assistant, not a teacher, so changes to the lesson plan are probably unfeasible. – tloflin Apr 05 '10 at 23:48
  • 1
    I think they want to detect plagiarism in a sense of one student copying the other. Not if they copied code from Google. – Strelok Apr 06 '10 at 00:09
  • @tloflin - that's a good point, I was trying to establish a baseline to measure 'cheating' against - but a different baseline may be needed. – amelvin Apr 06 '10 at 10:49
  • @strelokstrelok - I was trying to point out that learning / researching / cheating are all different sides of some oddly shaped coin. – amelvin Apr 06 '10 at 10:50
  • I like your suggestion. If I ever teach a class again, I will use it. – Andrew Eisenberg Apr 20 '13 at 05:22
2

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 :-)

  • 1
    From my (limited) experience, the majority of plagiarism attempts at my school are between students (i.e. one does the homework and gives it to others that modify it), not from the Web. If they want to use open source code to help them in their assignment they are free to do so. – Alex Ciminian Apr 06 '10 at 09:03