Browse files

MDL-34593: Plagiarism API - add extra plgin param to get_form_element…

…s_module
  • Loading branch information...
1 parent 87e9331 commit 67fbfe8b54f53f0c62b19779fe720c012986902b @kanikagoyal kanikagoyal committed Aug 13, 2012
View
5 lib/plagiarismlib.php
@@ -102,8 +102,9 @@ function plagiarism_save_form_elements($data) {
*
* @param object $mform - Moodle form object
* @param object $context - context object
+ * @param string $modulename - Name of the module
*/
-function plagiarism_get_form_elements_module($mform, $context) {
+function plagiarism_get_form_elements_module($mform, $context, $modulename = "") {
global $CFG;
if (empty($CFG->enableplagiarism)) {
return '';
@@ -113,7 +114,7 @@ function plagiarism_get_form_elements_module($mform, $context) {
require_once($dir.'/lib.php');
$plagiarismclass = "plagiarism_plugin_$plugin";
$plagiarismplugin = new $plagiarismclass;
- $plagiarismplugin->get_form_elements_module($mform, $context);
+ $plagiarismplugin->get_form_elements_module($mform, $context, $modulename);
}
}
/**
View
2 mod/assign/mod_form.php
@@ -112,7 +112,7 @@ function definition() {
if (!empty($CFG->enableplagiarism)) {
/** Include plagiarismlib.php */
require_once($CFG->libdir . '/plagiarismlib.php');
- plagiarism_get_form_elements_module($mform, $ctx->get_course_context());
+ plagiarism_get_form_elements_module($mform, $ctx->get_course_context(), 'mod_assign');
}
$assignment->add_all_plugin_settings($mform);
View
2 mod/assignment/type/online/assignment.class.php
@@ -310,7 +310,7 @@ function setup_elements(&$mform) {
$mform->setDefault('var1', 0);
$coursecontext = context_course::instance($COURSE->id);
- plagiarism_get_form_elements_module($mform, $coursecontext);
+ plagiarism_get_form_elements_module($mform, $coursecontext, 'mod_assignment');
}
View
2 mod/assignment/type/upload/assignment.class.php
@@ -1082,7 +1082,7 @@ function setup_elements(&$mform) {
$mform->setDefault('var4', 1);
$course_context = context_course::instance($COURSE->id);
- plagiarism_get_form_elements_module($mform, $course_context);
+ plagiarism_get_form_elements_module($mform, $course_context, 'mod_assignment');
}
function portfolio_exportable() {
View
2 mod/assignment/type/uploadsingle/assignment.class.php
@@ -294,7 +294,7 @@ function setup_elements(&$mform) {
$mform->setDefault('maxbytes', $CFG->assignment_maxbytes);
$course_context = context_course::instance($COURSE->id);
- plagiarism_get_form_elements_module($mform, $course_context);
+ plagiarism_get_form_elements_module($mform, $course_context, 'mod_assignment');
}
function portfolio_exportable() {
View
2 mod/forum/mod_form.php
@@ -140,7 +140,7 @@ function definition() {
$mform->disabledIf('warnafter', 'blockperiod', 'eq', 0);
$coursecontext = context_course::instance($COURSE->id);
- plagiarism_get_form_elements_module($mform, $coursecontext);
+ plagiarism_get_form_elements_module($mform, $coursecontext, 'mod_forum');
//-------------------------------------------------------------------------------
View
2 mod/workshop/mod_form.php
@@ -198,7 +198,7 @@ public function definition() {
$mform->setAdvanced('assessmentend');
$coursecontext = context_course::instance($this->course->id);
- plagiarism_get_form_elements_module($mform, $coursecontext);
+ plagiarism_get_form_elements_module($mform, $coursecontext, 'mod_workshop');
// Common module settings, Restrict availability, Activity completion etc. ----
$features = array('groups'=>true, 'groupings'=>true, 'groupmembersonly'=>true,
View
3 plagiarism/lib.php
@@ -57,8 +57,9 @@ public function get_file_results($cmid, $userid, $file) {
* hook to add plagiarism specific settings to a module settings page
* @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) {
+ public function get_form_elements_module($mform, $context, $modulename = "") {
}
/* hook to save plagiarism specific settings on a module settings page
* @param object $data - data from an mform submission.

0 comments on commit 67fbfe8

Please sign in to comment.