Skip to content

Instantly share code, notes, and snippets.

@danielmai
Last active March 3, 2024 11:16
Show Gist options
  • Save danielmai/9162349 to your computer and use it in GitHub Desktop.
Save danielmai/9162349 to your computer and use it in GitHub Desktop.
Some words on getting started with Moss.

Checking Plagiarism with Moss

Moss (Measure of Software Similarity) is a service that is used to check for plagiarism with programming assignments.

Getting Started with Moss

Moss is simply a command-line script that sends the program files to a server. You give the moss script criteria (such as the programming language), ship off the files, and are returned with a link where you can view the results.

To get started with Moss, you need to register for it. Directions on how to register are on the Moss website, in the "Register for Moss" section. If you don't really understand the directions on the website, here's the gist of it: Email moss@moss.stanford.edu a message with the body:

registeruser
mail username@domain

Where username@domain is your email address.

In a little while, you'll be given an email that has a moss script with a unique user id just for you. It's a Perl script, so be sure your system can run Perl programs!

Options

There are detailed usage instructions in the moss script, but I'll cover two basic script options that should help you get started.

Specifying a language with -l

First off, the -l option tells the script what language to process the programs under. So the option -l java will process the files you send as java files.

Providing a label with -c ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Next, the -c option allows you to give a comments string that will appear on the report that Moss creates. This allows you to label the generated report for context.

A sample Moss command

Here's a simple one:

moss -l java -c "CS 46A Spring 2014 - Homework 1 Final" *.java

This will grade all of the java files in the current directory (*.java), specifying to Moss that the files are java files (-l java), and giving the report a label of CS 46A Spring 2014 - Homework 1 Final.

When you run this script, the files you specify will be sent to the Moss server, Once it's done generating the report, it will give you a link to the report on the command-line output.

Viewing Moss reports long after they've expired

The Moss report isn't saved on the server forever. It probably only lasts for a couple of weeks. If you want to see the report in the future, you would either have te send Moss the same files once more, or you can download them onto your machine. If you want to do the latter, you can do so with wget, for example:

wget -r -np http://moss.stanford.edu/results/619603464
@JeffCave
Copy link

From the script posted above:

Feel free to share this script with other instructors of programming
classes, but please do not place the script in a publicly accessible

You should probably delete the above comment.

@wa3573
Copy link

wa3573 commented Jun 4, 2018

@JeffCave
That must be outdated, it used to be only distributed to programming instructors and faculty but that has since changed, see the website:
https://theory.stanford.edu/~aiken/moss/

Moss is being provided in the hope that it will benefit the educational community. Moss is fast, easy to use, and free. In the past, access has been restricted to instructors and staff of programming courses. This is no longer the case, and anyone may obtain a Moss account.

@ipgogra
Copy link

ipgogra commented Jan 22, 2020

Would this be able to run on a MacOS? If so, how?

@danielmai
Copy link
Author

@ipgogra The moss tool interacts with the Moss service. Uploading to Moss should work on Mac as with any other system.

@ipgogra
Copy link

ipgogra commented Jan 22, 2020

@danielmai Thanks for responding. That's what I thought. I'm looking to use this for a class that I'm TA-ing for. Plagiarism is pretty rampant and hopefully we can detect it more effectively.

@abhilash1in
Copy link

It uploads the file successfully, but I'm getting a 404 when I try to open the results URL. Is anyone facing the same issue? Is MOSS down?

@alessiogambi
Copy link

@abhilash1in
Same here, uploading and processing seems to go fine, but reports are not accessible:

@lokitparas
Copy link

It uploads the file successfully, but I'm getting a 404 when I try to open the results URL. Is anyone facing the same issue? Is MOSS down?

I'm facing the same issue. Any updates yet?

@lujl1209
Copy link

I meet the 404 problem too. Any advice? thank you.

@FerhatAliTokuc
Copy link

ı have 404 problem. Yesterday everything is worked but today not :(
Do you know any solution ?

@comihai
Copy link

comihai commented Jun 4, 2020

I want to check for plagiarism a bunch of homeworks written in 8086 assembly language using MOSS script, but all the time I receive the message "File 1 File 2 Lines Matched / No matches were found in your submission.", even if I send the same file. The options are: "./moss -l a8086 -m 3 file1.asm file1.asm". There is expected another form for MOSS command or for assembly sources?

@XilunWu
Copy link

XilunWu commented Oct 5, 2020

I want to check for plagiarism a bunch of homeworks written in 8086 assembly language using MOSS script, but all the time I receive the message "File 1 File 2 Lines Matched / No matches were found in your submission.", even if I send the same file. The options are: "./moss -l a8086 -m 3 file1.asm file1.asm". There is expected another form for MOSS command or for assembly sources?

Same confusion here.

@comihai
Copy link

comihai commented Oct 6, 2020

I want to check for plagiarism a bunch of homeworks written in 8086 assembly language using MOSS script, but all the time I receive the message "File 1 File 2 Lines Matched / No matches were found in your submission.", even if I send the same file. The options are: "./moss -l a8086 -m 3 file1.asm file1.asm". There is expected another form for MOSS command or for assembly sources?

Same confusion here.

I used a blind approach, ASCII language which of course is not much help. I think that a8086 is a language not very used in assignments, as a result not maintained.

@Codequirychecker
Copy link

Codequiry uses Moss plagiarism checking software and has an advanced support for Java, C, C++, and Python.

@kaushikj
Copy link

I am unable to run the code for matlab files
This is the error I get

% ../moss.pl -l matlab -c "codecheck" ./*.mlx
% Checking files . . .
% File ./A01.mlx is not a text file. Request not sent.

How do I fix these? matlab files are supposed to be .mlx format

@SyedMuhamadYasir
Copy link

@danielmai i tried running it on Windows after installing Strawberry Perl , but the '*' extension does not work

so if i try to select all .py files using ' *.py ' command, it doesn't work .. can you help ?

@NazarPonochevnyi
Copy link

@danielmai i tried running it on Windows after installing Strawberry Perl , but the '*' extension does not work

so if i try to select all .py files using ' *.py ' command, it doesn't work .. can you help ?

The easiest way to solve it is to install Windows Subsystem for Linux and run your command inside Ubuntu command line like perl moss.pl -l python *.py. It works for me :)

@Luximo
Copy link

Luximo commented Feb 20, 2023

Codequiry uses Moss plagiarism checking software and has an advanced support for Java, C, C++, and Python.

Does Codequiry still uses Moss?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment