What is Moss?
Moss is a service developed by Stanford University that compares program source code files to identify similar code segments. It’s language-independent and can detect similarities even when code has been modified.Configuration
Before using Moss, you need to configure your Moss User ID:- Navigate to the Moss page for any assignment:
/moss/{assignment_id} - Enter your Moss User ID in the configuration form
- Click “Update” to save the configuration
Running Detection
To run plagiarism detection on an assignment:- Go to
/moss/{assignment_id} - Click the “Detect” button
- Wait for Moss to process the submissions
Detection Process
The detection process:moss_controller.php:76
What Happens During Detection
- Grouping: Submissions are grouped by problem
- File Collection: Final submissions for each user are collected
- Moss Execution: The Moss script is run on all submissions for each problem
- Background Processing: Detection runs in the background using shell execution
- Status Tracking: A
moss_runningfile is created to indicate processing
Viewing Results
After detection completes:Status Indicators
- Moss Link: If detection is complete, a URL to the Moss results page is displayed
- Processing: “submission submitted to moss, awaiting response, please be patience”
- Not Run: No link displayed if detection hasn’t been run
Result Display Logic
moss_controller.php:37
Routes
Available Moss routes:GET /moss/{id}- View Moss page for an assignmentPOST /moss/update/{id}- Update Moss configurationPOST /moss/detect/{id}- Run plagiarism detection
Permissions
Best Practices
- Run After Deadline: Run Moss detection after the assignment deadline when all submissions are in
- Per-Problem Analysis: Results are generated separately for each problem in an assignment
- Final Submissions Only: Only final (best-scoring) submissions are analyzed
- Review Results: Always manually review Moss results - similar code doesn’t always mean plagiarism
Troubleshooting
Moss Not Responding
If the status shows “awaiting response” for a long time:- Check if the
moss_runningfile exists in the problem directory - Check if the Moss service is available
- Verify your Moss User ID is correct
- Check server logs for errors
Invalid Moss User ID
If detection fails:- Verify you’ve registered for a Moss account
- Check that your User ID is correctly entered
- Ensure the moss script has execute permissions

