Plagiarism plugins: Difference between revisions
m (moved Developing a Plagiarism Plugin to Plagiarism plugins) |
No edit summary |
||
Line 39: | Line 39: | ||
===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== | |||
* [[Plagiarism API]] | |||
[[Category:Plugins]] |
Revision as of 06:25, 30 January 2012
Create a new plugin
- 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
- take a look at the following git branches for examples of how to use the code:
https://github.com/danmarsden/moodle-plagiarism_turnitin https://github.com/danmarsden/moodle-plagiarism_crot https://github.com/danmarsden/moodle-plagiarism_urkund
Architecture
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.
Plugins and libraries
Each Plagiarism Tool will have it's own plugin directory - eg /plagiarism/turnitin/
Abstract Baseclass : 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 {
Class methods
Here are the methods that each Plagiarism Plugin can override.
cron
This function is triggered by Cron to allow any scheduled tasks to be processed.
get_form_elements
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