A Python script to compare Java projects using Stanford's MOSS plagiarism detection system.
The script operates in directory mode, allowing it to compare a project with multiple files instead of just a single file.
pip install -r requirements.txt
-
Go to MOSS and register for a user ID.
-
Create a
config.ini
file in the root directory and add the following line to it:[moss] userid = 123456789 # Replace this with your user ID
-
Create a folder containing the base files and another folder containing the files you want to compare, the structure of the folders should be as follows:
. ├── base_folder | ├── templateA.java | └── templateB.java └── comparing_folder ├── student1 | ├── Homework.java | └── Helper.java └── student2 ├── Homework.java └── Helper.java
-
Execute the following command:
python moss.py
-
A pop-up window will appear asking you to select the base folder and the comparing folder, if there is no base folder (no template code), simply press 'Cancel' on the pop-up window.
-
Wait for the script to finish executing. The results will be displayed in the terminal and a link to the MOSS report will be generated.