Assignment types ::: assignment_uploadcode
Maintained by Daniele Gazzelloni
A Plagiarism Detection plugin for Moodle 1.9.* through use of similarity-tester and Graphviz packages.

SIM-Plagiarism 1.0

Moodle 1.9
Released: Sunday, November 4, 2012, 3:29 AM
*** Anti-Plagiarism plugin for Moodle 1.9.3
- by Daniele Gazzelloni []


1. Introduction
2. Prerequisite
3. Installation & Configuration
4. Known Bugs
5. ToDo
6. Thanks
7. Links


Hi there, this is a plagiarism plugin for Moodle 1.9.3.

It can detect plagiarism in C and Java language (.c, .h, .java, .zip files allowed into the upload's subimissions form). Zip files are automatically extracted and only C or Java files will be analyzed in the drawGraphs panel.

This plugin is supposed to work in this way:
An exercise (.c file, .java file, and so on) is submitted via the uploadcode assignment plugin. Then, the admin (or who have the right permissions to view and analyze those exercises in that course) can have access to drawGraphs.php page, and can analyze those exercises via Global graphs, specific and comparison graphs functions.

This plugins uses the package similarity-tester written by Dick Grune (


* Moodle 1.9.* (2.0.*+ won't work)
* An unix-like server
* PHP <=5.2.* (required for Moodle 1.9.*)
* MySQL <=5.2.* (required for Moodle 1.9.*)
* PHP's ShellExec function execution allowed.
* Graphviz library pre-installed.
* Similarity-tester package pre-installed (sim_c and sim_java, by Dick Grune)




Grapghviz package:

Installation & Configuration

*MOODLE_PATH means the root path of your moodle installation.*

Just copy the entire uploadcode directory into *MOODLE_PATH*/mod/assignments/type. The final directory should looks like this:

Configuration variables can be edited in uploadcode/config.php file.

NOTE: This plugin is currently not tested under Windows server (think most internal paths won't work until a code revision).

Known Bugs

- When comparing a file with another the similarity-tester package usally can't determinate who of them is the copy of the other one. This will risult in different vector directions when drawing the global or anonymous global graphs. Lets explain with a simple example:

stud1.c structure:
| |
| |

stud2.c structure:

It's evident that stud2.c is composed by 100% of material of stud1.c. But, in that case of analysis: who plagiarized who? Is Student1 that plagiarized stud2.c file and then added a "BLOCK B" by his own, or is Student 2 that plagiarized half stud1.c file?

Well: similarity-tester package can't determine that. This will risults in graphs like these:

stud1-/ \-stud2

stud1-/ \-stud2

And, obviously, both are corrects.

- Help buttons currently points at empty links.
- Support for other programming languages (only C and Java currently available)
- Code revision to make the plugin works under Windows server.
- Porting of this plugin in Moodle 2.x and above.
- Avoiding use of shell_exec(). The goal can be reached cutting dependencies between the base plugin and Graphviz / sim binaries, maybe integrating completely similarity-tester package into PHP files and using Graphiviz php functions (graphviz-php package) instead of plot binary and svg files.
- Adjusting Graph interface to support features like image zooming, image exporting, or something like that.
- Inserting some kind of buttons / text-box that will allow the teacher / admin to filter only selected values of percentages. For example, what if I want to not show percentages lower then 60%? ;)


- Daniel Atzori for providing me Russian, Ukrainian, Catalan, French and Spanish translations.


SIM-Plagiarism home:

My personal website:

Similarity-tester package

Graphviz - Graph Visualization Software

Version information

Version build number
Version release name
Stable version
MD5 Sum
Supported software
Moodle 1.9, PHP 5.2, PHP 5.1
  • Latest release for Moodle 1.9

Default installation instructions for plugins of the type Assignment types

  1. Make sure you have all the required versions.
  2. Download and unpack the module.
  3. Place the folder (eg "myassigntype") in the "mod/assignment/type" subdirectory.
  4. Visit to finish the installation