MOSS in the CS department
This is the resource page for the CS MOSS implementation. MOSS was developed and is mainted at Stanford. In order to facilitate its use in the CS department we have written a few programs that run MOSS locally.
LOCAL SERVER OPTION (laptop/home machine):
Download the python (version 2 python) script that submits to the CS moss daemon
Make sure that you have the requests module installed
Use the command: moss.py command on your local files (for details on arguments used, see below)
Copy and paste the resulting URL into your web browser
The URL produced by moss has a random number in the pathname (for obscurity) and is access restricted to Duke CS faculty who authenticate (for security)
LOCAL CS FILESYSTEM OPTION:
Log into one of the CS linux machines, login.cs.duke.edu is a good choice.
Use the command: moss.pl (for details on arguments used, see below)
Copy and paste the resulting URL into your web browser
The URL produced by moss has a random number in the pathname (for obscurity) and is access restricted to Duke CS faculty who authenticate (for security)
STANFORD SERVER OPTION:
Download the moss script from here: http://theory.stanford.edu/~aiken/moss/
Make sure the moss script is in your executable search path (or force it with ./) and use the command: moss
The local script will upload files to Stanford and create a URL for you
Note that this method is less secure than running locally and that the moss report will persist on the Stanford server for just 14 days
Another disadvantage of the Stanford server is that it can get bogged down and become slow/unreliable
USING MOSS
(n.b: see the -m option described at the end of this section):
Whether you are using the local versopms or the Stanford server method, the command line options are the same. The most basic usage is (note that for the local version you would use "moss.pl" instead of "moss"): moss path1 path2 ... pathn
where path1, path2, ... pathn are pathnames of files for moss to compare. You may use wildcards, so a typical usage might be:
moss submissions/*/src/foo.java
where the * would include all student submission directories. There are several things you can do to help moss. You can specify the language used with -l, e.g.,
moss -l java submissions/*/src/foo.java
If you have already given students a code skeleton upon which they should build, you can provide this to moss so that it won't be included in the matching analysis:
moss -l java -b skeleton.java submissions/*/src/foo.java
Moss already has some heuristics to try to filter out code that might have been provided by instructors. By default moss ignores code that appears in more than 10 files. To override this, use the -m flag. I strongly suggest that you set this to the maximum number of students in your class:
moss -l java -b skeleton.java -m 400 submissions/*/src/foo.java
Note that failure to use -m properly could cause you to miss widespread cheating.
FILENAME ISSUES
moss sometimes has problems with special characters in path names. If you are downloading submissions from Sakai, you may want to strip out spaces and ampersands. George Konidaris has kindly provided a script to help with this.
COMPARING WITH SOLUTIONS FROM PREVIOUS YEAR'S OR ONLINE SOURCES
Simply store this in other directories and add these pathnames, e.g.,
moss -l java -b skeleton.java -m 400 submissions/*/src/foo.java submissions14/*/src/foo.java submissions13/*/src/foo.java online/*/src/foo.java
INTERPRETING THE RESULTS
Moss will provide you with a list of matches approximately sorted from strongest to weakest. Click on a match to see the results. Click on the links on the top of the page for tips on how to interpret the results.
REPORTING MATCHES
Duke policy REQUIRES faculty to contact the office of student conduct and ask for guidance when academic integrity violations are suspected: http://integrity.duke.edu/faculty/
If it is necessary to prepare a report in a form that can be shown to a student, the office of student conduct, or a student conduct board, the lab staff can assist you in providing a secure method for sharing this information with the appropriate parties.
DEALING WITH WIDESPREAD COPYING
Please note the -m option above.
In the regrettable circumstance that you have a high number of strong matches, moss may not be able to display all the strong matches on a single web page. You can tell if you have this problem by scrolling to the bottom of the page and looking at the lowest scoring matches. If these are still high, then it's likely that you are missing some. If this happens, you should make an initial pass where you note strong matches and then move these matches to a separate folder. You may need to repeatedly thin out your submissions folder in this manner until you've found all of the strong matches.