This page describes how to use the moss241
script written by Rob Schluntz to check assignment submissions for plagiarism. This guide is written for CS 241 ISAs, but the script and most of the instructions below should work for other courses.
/u/cs241/handin
.
/u/cs241/handin/AxPy
. Make sure the "A" and "P" are uppercase (i.e. A3P4 rather than a3p4); if this naming convention is not followed then moss241
will not be able to find submissions from previous terms to compare with.For example, to download submissions for A3P4 and store them in /u/cs241/handin/A3P4, type: marm_sql -v -d A3P4Alternatively, you can download the submissions through the Marmoset web interface by going to the "Utilities" page for the project and clicking "Download all students' best submissions". You will then have to unzip the submissions and copy them into a folder under
/u/cs241/handin
.
/u/cs241/handin
): ./moss-bin/moss241.sh AxPyWhere "AxPy" is the name of the folder storing the assignment submissions that you created in the previous step. Again, it is important that the "A" and "P" are uppercase.
/u/cs241/handin/AxPy
folder. The results are separated by language, and if the submissions were compared with submissions from previous terms then they will also be separated by which term they were compared with. To view the results, navigate to /u/cs241/handin/AxPy/moss_summary.html
where the results for the current term and available past terms will be available by language. Note that Racket submissions are referred to as "Scheme" submissions for historical reasons.
There is a script for downloading all submission for a batch of assignment problems and run MOSS on all of them. From /u/cs241/handin, call /u/cs241/handin/moss-bin/MOSS_shortcut. It will ask for the assignment problems you want to run MOSS on. Separate the name of each problem by a space. When finish, press enter.
Here is a way to run Moss on many assignment problems at once, without having to type in the problems individually.
~/handin/moss-bin
.
ls
command that gives you the list of submission directories you want to run Moss on. For example, this command should capture all directories for Assignment 3 and Assignment 4 problems in the handin folder: ls -d ../A[34]P*
for dir in $(ls -d ../A[34]P*); do yes "n" | ./moss241.sh $(basename $dir); doneReplace the example
ls
command with your own command.basename
to get just the "AxPy" part of the directory name, which is what moss241
expects as input. We use yes "n" to pass a stream of n's to the command because moss241
will prompt you to abort if no base code is found for an assignment problem; we want to say "n" (for "No") to all of these abort prompts.
The moss241
script tries to compare the submissions from the current term to submissions from previous terms to catch cases where a student gets code from a friend who took the course in a previous term. Currently, moss241
is set up to compare the current term with at most three previous terms. The terms to compare with are specified by variables called TERM1NUM
, TERM2NUM
and TERM3NUM
, which are set by the moss-setup
script in the /u/cs241/handin/moss-bin
folder.
By default, moss-setup
sets these variables to numbers that correspond to the previous three terms. For example, if the current term is 1175 (Spring 2017), moss-setup
will pick 1171 (Winter 2017), 1169 (Fall 2016) and 1165 (Spring 2015) as the three terms to compare to. If you want different behavior, you will need to modify moss-setup
to set the variables to different values.
You can essentially make moss-setup
as complicated or simple as you want; the only requirement is that it sets the three variables TERM1NUM
, TERM2NUM
and TERM3NUM
to some term numbers. For example, you could modify it to compare with the previous three years rather than the previous three terms (i.e. if the current term is Fall 2012 it would pick Fall 2011, Fall 2010 and Fall 2009). Or you could simply hard-code the terms you want to compare with by commenting out the existing code and replacing it with lines that directly set each variable (e.g. TERM1NUM=1125
).
The term numbers you use should be in the "Registrar's Office" format, i.e. 1YRT where YR is a 2-digit number representing the year and T is a single digit representing the starting month of the term. The command termcode
returns the number for the current term in this format. The reason for this is that the directories in the archives containing the assignment submissions for previous terms use this term number format; moss241
will not be able to find the submissions for a previous term if you use a different format.
Often CS assignments will have some instructor-supplied base code that students are required to use in this submission. Obviously, we do not want Moss to flag this base code as plagiarism. Moss attempts to detect when base code was provided and leave it out of the matches it reports, but this does not always work perfectly and there are often false positives. To reduce the number of false positives, the base code files themselves can be passed into Moss through a command line option.
The moss241
script will look in the /u/cs241/handin/base
folder for base code, and if it finds base code corresponding to the assignment you are checking it will pass the base code into Moss. The base code files must be stored in a particular format; there should be one base code file for each combination of assignment and programming language. For example, supposing assignment "AxPy" used base code and the allowed languages were C++ and Racket, you would create files called AxPy.cc
and AxPy.rkt
in /u/cs241/handin/base
which contain the base code for the corresponding language.
In CS 241, all the base code files for assignments have been set up as of Fall 2012. However, if any of the assignments have changed significantly since that term, you may need to add new base code or modify the existing base code.
Some notes:
.cc
extension, not .cpp
.
moss241
are C, C++, Racket, Java and Scala. Any files that do not have a .c, .cc, .rkt, .java, or .scala extension are treated as ASCII text files by Moss. To supply base code that is not from one of these languages, store it in a file called AxPy
(no extension).
Some students have unfortunately posted their CS241 code on sites like Github, allowing other students to download and copy it. We want Moss to catch these cases, so moss241
has a feature where you can supply "external" code like this to be compared with student submissions. It works by simply copying the external code into the student submission directory before actually running Moss.
For the copying to work, the external code must be set up in a specific format:
~/handin/external
folder.
~/handin/external
. For example, for a particular Github repository you could store the code in something like ~/handin/external/github00
. This folder name must be at most 8 characters long, all alphabetic characters in the folder name must be lowercase, and it should not match any student user ID. Otherwise moss241
will have issues copying the external code, or the external code could overwrite a student submission. Adding numbers to the end of the folder name is a good way to ensure it does not match any student user ID.
~/handin/external/github00/A3P1
, ~/handin/external/github00/A3P2
, ~/handin/external/github00/A3P3
and so on.
~/handin/external
folder if you want an example to refer to.
The actual copying is done by a helper script called copy-external.sh
. If this script is not present in the moss-bin folder, the external code feature will not work.
The moss241
script and the helper scripts it uses are available for download below. They should work in other course accounts, but this cannot be guaranteed. Read through the source code for the scripts (they are commented) to see if anything might need to be changed, and test the script in a sandbox environment until you are sure it works.
One possible issue is that the script assumes the only file formats that occur in assignment submissions are C/C++/Racket/Java/Scala source code, or ASCII text. If your course uses some other programming language, Moss will treat the source code as ASCII text (even if it is a language that Moss has support for) unless you extend the script.
I | Attachment | History | Action | Size | Date | Who | Comment |
---|---|---|---|---|---|---|---|
![]() |
Scripts.zip | r4 r3 r2 r1 | manage | 8.4 K | 2020-04-06 - 11:06 | SylvieDavies |