diff --git a/lib/plagiarismlib.php b/lib/plagiarismlib.php index d8e246e9dbc..ae89d2558ed 100644 --- a/lib/plagiarismlib.php +++ b/lib/plagiarismlib.php @@ -56,6 +56,8 @@ function plagiarism_get_links($linkarray) { /** * returns array of plagiarism details about specified file * + * @deprecated Since Moodle 4.0. - this function was a placeholder and not used in core. + * @todo MDL-71326 This is to be moved from here to deprecatedlib.php in Moodle 4.4 * @param int $cmid * @param int $userid * @param object $file moodle file object @@ -64,6 +66,8 @@ function plagiarism_get_links($linkarray) { */ function plagiarism_get_file_results($cmid, $userid, $file) { global $CFG; + $text = 'plagiarism_get_file_results is deprecated, please use plagiarism_get_links() or plugin specific functions.'; + debugging($text, DEBUG_DEVELOPER); $allresults = array(); if (empty($CFG->enableplagiarism)) { return $allresults; @@ -140,6 +144,8 @@ function plagiarism_get_form_elements_module($mform, $context, $modulename = "") /** * Allows a plagiarism plugin to print a button/link at the top of activity overview report pages. * + * @deprecated Since Moodle 4.0 - Please use {plugin name}_before_standard_top_of_body_html instead. + * @todo MDL-71326 Remove this method. * @param object $course - full Course object * @param object $cm - full cm object * @return string @@ -155,6 +161,13 @@ function plagiarism_update_status($course, $cm) { require_once($dir.'/lib.php'); $plagiarismclass = "plagiarism_plugin_$plugin"; $plagiarismplugin = new $plagiarismclass; + + $reflectionmethod = new ReflectionMethod($plagiarismplugin, 'update_status'); + if ($reflectionmethod->getDeclaringClass()->getName() == get_class($plagiarismplugin)) { + $text = 'plagiarism_plugin::update_status() is deprecated.'; + $text .= ' Use plagiarism_' . $plugin . '_before_standard_top_of_body_html() instead'; + debugging($text, DEBUG_DEVELOPER); + } $output .= $plagiarismplugin->update_status($course, $cm); } return $output; diff --git a/plagiarism/lib.php b/plagiarism/lib.php index 364b05e82e0..bc444cc7c71 100644 --- a/plagiarism/lib.php +++ b/plagiarism/lib.php @@ -41,7 +41,8 @@ abstract class plagiarism_plugin { /** * Return the list of form element names. - * + * @deprecated Since Moodle 4.0 - this function was a placeholder and not used in core. + * @todo MDL-71326 Remove this method. * @return array contains the form element names. */ public function get_configs() { @@ -58,6 +59,8 @@ abstract class plagiarism_plugin { } /** * hook to allow plagiarism specific information to be returned unformatted + * @deprecated Since Moodle 4.0 - this function was a placeholder and not used in core Moodle code. + * @todo MDL-71326 Remove this method. * @param int $cmid * @param int $userid * @param $file file object @@ -96,7 +99,8 @@ abstract class plagiarism_plugin { } /** * hook to allow status of submitted files to be updated - called on grading/report pages. - * + * @deprecated Since Moodle 4.0 - Please use {plugin name}_before_standard_top_of_body_html instead. + * @todo MDL-71326 Remove this method. * @param object $course - full Course object * @param object $cm - full cm object */ diff --git a/plagiarism/upgrade.txt b/plagiarism/upgrade.txt index f726421053d..e871f36ddf6 100644 --- a/plagiarism/upgrade.txt +++ b/plagiarism/upgrade.txt @@ -1,5 +1,11 @@ This files describes API changes for code that uses the plagiarism API. +=== 4.0 === +* The method update_status() has been deprecated. Please use {plugin name}_before_standard_top_of_body_html() instead. +* The method get_configs() has been deprecated and will be removed from the abstract class as it was not used in core. +* The method plagiarism_get_file_results has been deprecated - it was not used in core - please call a plagiarism + plugins internal functions directly instead of using this function. + === 3.11 === * Support for Essay question type in Quiz has now been implemented, allowing plagiarism plugins to display information on the quiz overview report and when viewing an essay question response.