Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Plagiarism plugins: Difference between revisions

From MoodleDocs
(intial page)
 
m (get_form_elements is incorrect, it should be get_form_elements_module)
 
(12 intermediate revisions by 5 users not shown)
Line 1: Line 1:
==Introduction==
The Plagiarism API is a core set of functions that all Moodle code can use to send user submitted content to Plagiarism Prevention systems


== Architecture ==
A typical user story:
all the global functions are contained within /plagiarism/lib.php and each plagiarism tool has it's own plugin directory with db folder for capabilities/event handlers/database tables required.
# When Plagiarism tools are enabled (in site administration/advanced features and also check site administration/plugins/plagiarism/manage plagiarism plugins), every module that allows it will have a group of settings added to allow management of sending the user content to a plagiarism service.
# A user enters some content/submits a file inside a module that a teacher/Admin has configured the tool to be used.
# An Event is triggered which contains details about the user, module and submission they have made
# Event handlers in the Plagiarism plugin are triggered and process anything required.
# Hooks for displaying information returned from the Plagiarism tools to both the user and teacher (controlled by the plugin)
===Supported Modules ===
The following modules are the only ones who have currently implemented support for the plagiarism api
* Assignment 2.2 -
** Single Upload Assignment
** Advanced Assignment
** Online Text Assignment
* Assignment
* Forum
* Workshop


===Plugins and libraries===
==Examples==
Each Plagiarism Tool will have it's own plugin directory - eg /plagiarism/turnitin/
* Urkund https://github.com/danmarsden/moodle-plagiarism_urkund
* Turnitin https://github.com/turnitin/moodle-plagiarism_turnitin
* PlagScan https://api.plagscan.com/plagscan_2015071501.zip


====Abstract Baseclass : plagiarism_plugin====
==Template==
Use this git branch as a base for your new plugin: https://github.com/danmarsden/moodle-plagiarism_new
(replace all instances of "new" with the folder name of your new plugin)
==Naming conventions==
Following Naming conventions should be kept in mind while writing a plagiarism plugin:-


Each Plagiarism plugin must subclass this in a file called plagiarism/pluginname/lib.php - the subclass must be named using the plugin directory as a suffix - eg: ''class plagiarism_plugin_turnitin extends plagiarism_plugin {''
*Folder name should be same as pluginname
=====Class methods=====
*Name of the extended class should be plagiarism_plugin_pluginname
Here are the methods that each Plagiarism Plugin can override.
*Each plugin must define the string "pluginname" in the language files.
 
== Interfacing to APIs  ==


======cron======
======cron======
This function is triggered by Cron to allow any scheduled tasks to be processed.
This function was deprecated in 3.1, Moodle 2.7 added the new [[Task_API]] which should now be used instead. in versions prior to 3.1 this function must exist within your local class but can be empty if you have migrated to using the newer [[Task_API]]


======get_form_elements======
======get_form_elements_module======
This function allows the addition of any Plagiarism specific settings to an mform inside a module settings page.
This function allows the addition of any Plagiarism specific settings to an mform inside a module settings page.


Line 32: Line 55:
===Event Triggers===
===Event Triggers===
Modules that support the Plagiarism API should have appropriate event triggers when a user has updated text that requires processing by the Plagiarism API
Modules that support the Plagiarism API should have appropriate event triggers when a user has updated text that requires processing by the Plagiarism API
==See also==
* [[How_to_add_support_for_a_Plagiarism_Plugin_to_my_activity_module]]
[[Category:Plugins]]

Latest revision as of 10:15, 18 October 2017

Introduction

The Plagiarism API is a core set of functions that all Moodle code can use to send user submitted content to Plagiarism Prevention systems

A typical user story:

  1. When Plagiarism tools are enabled (in site administration/advanced features and also check site administration/plugins/plagiarism/manage plagiarism plugins), every module that allows it will have a group of settings added to allow management of sending the user content to a plagiarism service.
  2. A user enters some content/submits a file inside a module that a teacher/Admin has configured the tool to be used.
  3. An Event is triggered which contains details about the user, module and submission they have made
  4. Event handlers in the Plagiarism plugin are triggered and process anything required.
  5. Hooks for displaying information returned from the Plagiarism tools to both the user and teacher (controlled by the plugin)

Supported Modules

The following modules are the only ones who have currently implemented support for the plagiarism api

  • Assignment 2.2 -
    • Single Upload Assignment
    • Advanced Assignment
    • Online Text Assignment
  • Assignment
  • Forum
  • Workshop

Examples

Template

Use this git branch as a base for your new plugin: https://github.com/danmarsden/moodle-plagiarism_new (replace all instances of "new" with the folder name of your new plugin)

Naming conventions

Following Naming conventions should be kept in mind while writing a plagiarism plugin:-

  • Folder name should be same as pluginname
  • Name of the extended class should be plagiarism_plugin_pluginname
  • Each plugin must define the string "pluginname" in the language files.

Interfacing to APIs

cron

This function was deprecated in 3.1, Moodle 2.7 added the new Task_API which should now be used instead. in versions prior to 3.1 this function must exist within your local class but can be empty if you have migrated to using the newer Task_API

get_form_elements_module

This function allows the addition of any Plagiarism specific settings to an mform inside a module settings page.

save_form_elements

This function is triggered when a teacher saves the settings on a module page to allows storing of any Plagiarism specific settings.

get_links

This function provides a hook to allow information to be displayed beside a users submission - for example the grading page for teachers to display an originality score/link to more information or to allow a student to see the same information.

print_disclosure

This function allows the plugin to display a message to users inside the submission page to let them know that the submission will be passed to a plagiarism prevention system.

update_status

This function is called on pages that display a full list of users eg grading pages to allow the status of any submissions to be checked. This function is called every time the report page is loaded so it should perform appropriate caching.

Event Triggers

Modules that support the Plagiarism API should have appropriate event triggers when a user has updated text that requires processing by the Plagiarism API


See also