Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 310 and 400] [Versions 311 and 400] [Versions 39 and 400] [Versions 400 and 402] [Versions 400 and 403]

plagiarismlib.php - Contains core Plagiarism related functions.

Copyright: 2010 Dan Marsden http://danmarsden.com
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 235 lines (9 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 7 functions


Functions that are not part of a class:

plagiarism_get_links($linkarray)   X-Ref
displays the similarity score and provides a link to the full report if allowed.

return: string - url to allow login/viewing of a similarity report
param: object  $linkarray contains all relevant information for the plugin to generate a link

plagiarism_get_file_results($cmid, $userid, $file)   X-Ref
returns array of plagiarism details about specified file

return: array - sets of details about specified file, one array of details per plagiarism plugin
param: int $cmid
param: int $userid
param: object $file moodle file object

plagiarism_save_form_elements($data)   X-Ref
saves/updates plagiarism settings from a modules config page - called by course/modedit.php

param: object $data - form data

plagiarism_get_form_elements_module($mform, $context, $modulename = "")   X-Ref
adds the list of plagiarism settings to a form - called inside modules that have enabled plagiarism

param: object $mform - Moodle form object
param: object $context - context object
param: string $modulename - Name of the module

plagiarism_update_status($course, $cm)   X-Ref
Allows a plagiarism plugin to print a button/link at the top of activity overview report pages.

return: string
param: object $course - full Course object
param: object $cm - full cm object

plagiarism_print_disclosure($cmid)   X-Ref
Function that prints the student disclosure notifying that the files will be checked for plagiarism

return: string
param: integer $cmid - the cmid of this module

plagiarism_load_available_plugins()   X-Ref
Helper function - also loads lib file of plagiarism plugin

return: array of available plugins