2010-09-20 07:32:31 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// This file is part of Moodle - http://moodle.org/
|
|
|
|
//
|
|
|
|
// Moodle is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// Moodle is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
/**
|
|
|
|
* lib.php - Contains Plagiarism base class used by plugins.
|
|
|
|
*
|
2014-05-19 17:03:04 +01:00
|
|
|
* @since Moodle 2.0
|
2016-01-08 11:09:29 +00:00
|
|
|
* @package core_plagiarism
|
2010-09-20 07:32:31 +00:00
|
|
|
* @copyright 2010 Dan Marsden http://danmarsden.com
|
|
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (!defined('MOODLE_INTERNAL')) {
|
|
|
|
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
|
|
|
|
}
|
|
|
|
|
2016-01-08 11:09:29 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Plagiarism base class used by plugins.
|
|
|
|
*
|
|
|
|
* @since Moodle 2.0
|
|
|
|
* @package core_plagiarism
|
|
|
|
* @copyright 2010 Dan Marsden http://danmarsden.com
|
|
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
|
*/
|
|
|
|
abstract class plagiarism_plugin {
|
2013-01-02 13:58:42 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the list of form element names.
|
|
|
|
*
|
|
|
|
* @return array contains the form element names.
|
|
|
|
*/
|
|
|
|
public function get_configs() {
|
|
|
|
return array();
|
|
|
|
}
|
|
|
|
|
2010-09-20 07:32:31 +00:00
|
|
|
/**
|
2015-03-10 14:13:20 +00:00
|
|
|
* hook to allow plagiarism specific information to be displayed beside a submission
|
2010-09-20 07:32:31 +00:00
|
|
|
* @param array $linkarraycontains all relevant information for the plugin to generate a link
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function get_links($linkarray) {
|
|
|
|
return '';
|
|
|
|
}
|
2011-11-17 13:21:08 +13:00
|
|
|
/**
|
|
|
|
* hook to allow plagiarism specific information to be returned unformatted
|
|
|
|
* @param int $cmid
|
|
|
|
* @param int $userid
|
2012-06-29 21:30:20 +05:30
|
|
|
* @param $file file object
|
2011-11-17 13:21:08 +13:00
|
|
|
* @return array containing at least:
|
|
|
|
* - 'analyzed' - whether the file has been successfully analyzed
|
|
|
|
* - 'score' - similarity score - ('' if not known)
|
|
|
|
* - 'reporturl' - url of originality report - '' if unavailable
|
|
|
|
*/
|
2012-06-29 21:30:20 +05:30
|
|
|
public function get_file_results($cmid, $userid, $file) {
|
2011-11-17 13:21:08 +13:00
|
|
|
return array('analyzed' => '', 'score' => '', 'reporturl' => '');
|
|
|
|
}
|
2010-09-20 07:32:31 +00:00
|
|
|
/**
|
|
|
|
* hook to add plagiarism specific settings to a module settings page
|
2019-12-16 14:57:01 +08:00
|
|
|
* @deprecated Since Moodle 3.9. MDL-65835 Please use {plugin name}_coursemodule_edit_post_actions() instead.
|
|
|
|
* @todo MDL-67526 Remove this method.
|
2010-09-20 07:32:31 +00:00
|
|
|
* @param object $mform - Moodle form
|
|
|
|
* @param object $context - current context
|
2012-08-13 20:31:45 +05:30
|
|
|
* @param string $modulename - Name of the module
|
2010-09-20 07:32:31 +00:00
|
|
|
*/
|
2012-08-13 20:31:45 +05:30
|
|
|
public function get_form_elements_module($mform, $context, $modulename = "") {
|
2010-09-20 07:32:31 +00:00
|
|
|
}
|
2019-12-16 14:57:01 +08:00
|
|
|
/**
|
|
|
|
* hook to save plagiarism specific settings on a module settings page
|
|
|
|
* @deprecated Since Moodle 3.9. MDL-65835 Please use {plugin name}_coursemodule_standard_elements() instead.
|
|
|
|
* @todo MDL-67526 Remove this method.
|
2010-09-20 07:32:31 +00:00
|
|
|
* @param object $data - data from an mform submission.
|
|
|
|
*/
|
|
|
|
public function save_form_elements($data) {
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* hook to allow a disclosure to be printed notifying users what will happen with their submission
|
|
|
|
* @param int $cmid - course module id
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function print_disclosure($cmid) {
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* hook to allow status of submitted files to be updated - called on grading/report pages.
|
|
|
|
*
|
|
|
|
* @param object $course - full Course object
|
|
|
|
* @param object $cm - full cm object
|
|
|
|
*/
|
|
|
|
public function update_status($course, $cm) {
|
|
|
|
}
|
2012-05-09 13:46:20 +12:00
|
|
|
}
|