Plagiarism API improvements

Jump to: navigation, search
Notice: Moodle Docs is currently in read-only mode following a spam attack. We are working to reopen it as soon as possible.
Plagiarism API improvements
Project state Completed
Tracker issue MDL-32225
Assignee Kanika Goyal

Moodle 2.3

GSOC '12


This is a GSOC 2012 Project. The goal of this project is to extend some core modules to use the Plagiarism API.

Project Details


The Plagiarism API is a core set of functions that all Moodle code can use to send user submitted content to Plagiarism Prevention systems. When a user submits a file (or content) inside a module that has been configured for the Plagiarism Plugin, an event is triggered which contains details about user, module and submissions. Plagiarism plugin has event handlers which will then check for plagiarism content. Plugin will return the hooks (defined in Plagiarism API) for displaying information to both the user and the teacher.

Currently, Plagiarism API only supports Single upload assignment and Advanced uploading of assignments. This project aims at extending the support to other Moodle modules such as -

1. Online assignment type (Assignment 2.2)

2. Assignment

3. Workshop module

4. Quiz module (essay questions)

5. Forums posts (file attachments)

After the implementation of relevant hooks for the Plagiarism API and then adding the support for new hooks in the above mentioned modules, the current Plagiarism Plugins will be improved to support these new hooks.

Plagiarism Plugins-


Plagiarism API requires hooks for modules to trigger an event (like assessable_file_upload in case of assignment module), that is, to pass user submitted content to Plagiarism Plugin and also to allow display of information (such as similarity score) on teachers and students page. Plagiarism plugin have listener for the event which will then do the necessary processing, that is, check submitted content for plagiarism. Settings of Plagiarism API are configured by adding a hook plagiarism_get_form_elements_module ($mform, $course_context) in the module form.

In case of-

1. Online type (Assigment 2.2) - This assignment type asks users to compose and edit text, using the normal editing tools. Added the support for assessable_content_uploaded, which allows sending of content, that is online text to the Plagiarism Plugin. When the online text is added/modified, an event assessable_content_uploaded which contains content as $eventdata->content. Plagiarism Plugin has handler for this event, which then creates a temporary file with this content and submits it for checking of Plagiarism.

2. Assignment - This is a new assignment module. Students can submit any digital content (files), such as word-processed documents. Alternatively, or in addition, the assignment may require students to type text directly into the text editor. Added the support for assessable_content_uploaded which contains files as well as online text submitted by the student. Whenever a student submits the assignment, the files as well as text submitted is sent to the Plagiarism Plugins through event assessable_content_uploaded.

3. Workshop - Added the support for assessable_content_uploaded which helps in sending files as well as online text submitted by the student in workshop module. Whenever student submits, the files as well as text submitted is sent to the Plagiarism Plugins through event asessable_content_uploaded.

4. Forum posts - File attachments are stored in moodledata folder as stored_file objects of moodle. This file along with the content of the post is submitted to the Plagiarism Plugin through the event assessable_content_uploaded.

Plagiarism API is also responsible for displaying the results to teachers "view submission" and students "view page". The hooks for display results may or may not be same for all the modules.

Integrated the above implemented hooks with the following Plagiarism Plugins -


Main Task - Add Plagiarism API hooks to other areas of Moodle Code

Sub Tasks -

Relevant Links