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 [email protected] 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
@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