Table of Contents

Code Similarity

Generating a Code Similarity report

Code Similarity is available for courses with an Institutional license.

Code Similarity is a tool to help determine how similar students’ code is. It does not automatically detect plagiarism but rather shows you how similar two programs are to one another. To get started using Code Similarity, you will need a programming assignment. You will find a step called “Review Similarity” underneath Statistics and above Settings.

New Review Similarity step in the left sidebar

On that page, you’ll be asked to choose a programming language. This will compare student submissions across those file types and ignore the rest. You also have the ability to upload starter code (or template files) at this time so that similarity matches will ignore student code that matches those files.

How to choose a language, and upload starter code

Once the report has been generated, a list of students and their submitted files will be displayed, along with the other student whose submission was most similar to that file.

By default, the results will be sorted by the length of the code that was similar across the pair of submissions. This number is related to the number of tokens in the passages that were similar. A token is a single element of code, e.g. keywords, identifiers, operators, literals, etc.

Student-submitted files for a sample submission, each listed along with the file that's most similar to it

You can click on a student’s file to be taken to the similarity page where you see a comparison view of the file selected and its most similar matching file from another student in the course.

Student-submitted files for a sample submission, each listed along with the file that's most similar to it

In the right sidebar, you can jump to different matching blocks of code by using the numbered buttons. You can also see which students had the next most similar files. If you’d like, you can also click the Print Report button to print a document containing the code and all highlighted areas where the two code files are similar.

Compatible programming languages

Though Programming Assignments and Code Autograder can process all programming languages, currently, Gradescope Code Similarity can only review the following languages for similarity:

C, C++, C#, F#, Go, Java, JavaScript, Matlab, MIPS, ML, Python, and R.

Was this article helpful?
Awesome, glad that it's helpful! 🙌 Have ideas on how we can improve? Sorry to hear that. Let us know what we can improve!
Need help?

Assignment and Question Statistics

Writing Formulas and Equations (LaTeX)

Contact