mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 04:22:07 +02:00
Merge branch 'MDL-65835-master' of git://github.com/abgreeve/moodle
This commit is contained in:
commit
88fbee25d9
@ -363,6 +363,8 @@ function edit_module_post_actions($moduleinfo, $course) {
|
||||
if ($hasgrades) {
|
||||
grade_regrade_final_grades($course->id);
|
||||
}
|
||||
|
||||
// To be removed (deprecated) with MDL-67526 (both lines).
|
||||
require_once($CFG->libdir.'/plagiarismlib.php');
|
||||
plagiarism_save_form_elements($moduleinfo);
|
||||
|
||||
|
@ -81,6 +81,8 @@ function plagiarism_get_file_results($cmid, $userid, $file) {
|
||||
/**
|
||||
* saves/updates plagiarism settings from a modules config page - called by course/modedit.php
|
||||
*
|
||||
* @deprecated Since Moodle 3.9. MDL-65835 Please use {plugin name}_coursemodule_edit_post_actions() instead.
|
||||
* @todo MDL-67526 This is to be moved from here to deprecatedlib.php in Moodle 4.3
|
||||
* @param object $data - form data
|
||||
*/
|
||||
function plagiarism_save_form_elements($data) {
|
||||
@ -93,6 +95,14 @@ function plagiarism_save_form_elements($data) {
|
||||
require_once($dir.'/lib.php');
|
||||
$plagiarismclass = "plagiarism_plugin_$plugin";
|
||||
$plagiarismplugin = new $plagiarismclass;
|
||||
|
||||
$reflectionmethod = new ReflectionMethod($plagiarismplugin, 'save_form_elements');
|
||||
if ($reflectionmethod->getDeclaringClass()->getName() == get_class($plagiarismplugin)) {
|
||||
$text = 'plagiarism_plugin::save_form_elements() is deprecated.';
|
||||
$text .= ' Use plagiarism_' . $plugin . '_coursemodule_edit_post_actions() instead';
|
||||
debugging($text, DEBUG_DEVELOPER);
|
||||
}
|
||||
|
||||
$plagiarismplugin->save_form_elements($data);
|
||||
}
|
||||
}
|
||||
@ -100,6 +110,8 @@ function plagiarism_save_form_elements($data) {
|
||||
/**
|
||||
* adds the list of plagiarism settings to a form - called inside modules that have enabled plagiarism
|
||||
*
|
||||
* @deprecated Since Moodle 3.9. MDL-65835 Please use {plugin name}_coursemodule_standard_elements() instead.
|
||||
* @todo MDL-67526 This is to be moved from here to deprecatedlib.php in Moodle 4.3
|
||||
* @param object $mform - Moodle form object
|
||||
* @param object $context - context object
|
||||
* @param string $modulename - Name of the module
|
||||
@ -114,6 +126,14 @@ function plagiarism_get_form_elements_module($mform, $context, $modulename = "")
|
||||
require_once($dir.'/lib.php');
|
||||
$plagiarismclass = "plagiarism_plugin_$plugin";
|
||||
$plagiarismplugin = new $plagiarismclass;
|
||||
|
||||
$reflectionmethod = new ReflectionMethod($plagiarismplugin, 'get_form_elements_module');
|
||||
if ($reflectionmethod->getDeclaringClass()->getName() == get_class($plagiarismplugin)) {
|
||||
$text = 'plagiarism_plugin::get_form_elements_module() is deprecated.';
|
||||
$text .= ' Use plagiarism_' . $plugin . '_coursemodule_standard_elements() instead';
|
||||
debugging($text, DEBUG_DEVELOPER);
|
||||
}
|
||||
|
||||
$plagiarismplugin->get_form_elements_module($mform, $context, $modulename);
|
||||
}
|
||||
}
|
||||
|
@ -9,6 +9,8 @@ information provided here is intended especially for developers.
|
||||
- question_is_only_toplevel_category_in_context
|
||||
* format_float() now accepts a special value (-1) as the $decimalpoints parameter
|
||||
which means auto-detecting number of decimal points.
|
||||
* plagiarism_save_form_elements() has been deprecated. Please use {plugin name}_coursemodule_edit_post_actions() instead.
|
||||
* plagiarism_get_form_elements_module() has been deprecated. Please use {plugin name}_coursemodule_standard_elements() instead.
|
||||
|
||||
=== 3.8 ===
|
||||
* Add CLI option to notify all cron tasks to stop: admin/cli/cron.php --stop
|
||||
|
@ -186,7 +186,7 @@ class mod_assign_mod_form extends moodleform_mod {
|
||||
$mform->addElement('selectyesno', 'sendstudentnotifications', $name);
|
||||
$mform->addHelpButton('sendstudentnotifications', 'sendstudentnotificationsdefault', 'assign');
|
||||
|
||||
// Plagiarism enabling form.
|
||||
// Plagiarism enabling form. To be removed (deprecated) with MDL-67526.
|
||||
if (!empty($CFG->enableplagiarism)) {
|
||||
require_once($CFG->libdir . '/plagiarismlib.php');
|
||||
plagiarism_get_form_elements_module($mform, $ctx->get_course_context(), 'mod_assign');
|
||||
|
@ -206,6 +206,7 @@ class mod_forum_mod_form extends moodleform_mod {
|
||||
$mform->hideIf('warnafter', 'blockperiod', 'eq', 0);
|
||||
|
||||
$coursecontext = context_course::instance($COURSE->id);
|
||||
// To be removed (deprecated) with MDL-67526.
|
||||
plagiarism_get_form_elements_module($mform, $coursecontext, 'mod_forum');
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
|
@ -249,6 +249,7 @@ class mod_workshop_mod_form extends moodleform_mod {
|
||||
$mform->addElement('date_time_selector', 'assessmentend', $label, array('optional' => true));
|
||||
|
||||
$coursecontext = context_course::instance($this->course->id);
|
||||
// To be removed (deprecated) with MDL-67526.
|
||||
plagiarism_get_form_elements_module($mform, $coursecontext, 'mod_workshop');
|
||||
|
||||
// Common module settings, Restrict availability, Activity completion etc. ----
|
||||
|
@ -71,13 +71,18 @@ abstract class plagiarism_plugin {
|
||||
}
|
||||
/**
|
||||
* hook to add plagiarism specific settings to a module settings page
|
||||
* @deprecated Since Moodle 3.9. MDL-65835 Please use {plugin name}_coursemodule_edit_post_actions() instead.
|
||||
* @todo MDL-67526 Remove this method.
|
||||
* @param object $mform - Moodle form
|
||||
* @param object $context - current context
|
||||
* @param string $modulename - Name of the module
|
||||
*/
|
||||
public function get_form_elements_module($mform, $context, $modulename = "") {
|
||||
}
|
||||
/* hook to save plagiarism specific settings on a module settings page
|
||||
/**
|
||||
* 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.
|
||||
* @param object $data - data from an mform submission.
|
||||
*/
|
||||
public function save_form_elements($data) {
|
||||
|
@ -1,4 +1,10 @@
|
||||
This files describes API changes for code that uses the plagiarism API.
|
||||
|
||||
=== 3.9 ===
|
||||
|
||||
* The method get_form_elements_module has been deprecated. Please use {plugin name}_coursemodule_edit_post_actions() instead.
|
||||
* The method save_form_elements has been deprecated. Please use {plugin name}_coursemodule_standard_elements() instead.
|
||||
|
||||
=== 3.7 ===
|
||||
|
||||
* The plagiarism_cron() function has been deleted, plugins should implement their own scheduled tasks.
|
||||
|
Loading…
x
Reference in New Issue
Block a user