Permalink
Browse files

Merge branch 'm22_MDL-31461' of git://github.com/danmarsden/moodle in…

…to MOODLE_22_STABLE
  • Loading branch information...
2 parents 8227904 + 733196d commit 4bd74c8ddce16d8c87af3410f4f51ffc071431ab @nebgor nebgor committed Feb 8, 2012
Showing with 10 additions and 4 deletions.
  1. +8 −2 lib/plagiarismlib.php
  2. +2 −2 mod/assignment/lib.php
View
@@ -121,37 +121,43 @@ function plagiarism_get_form_elements_module($mform, $context) {
*
* @param object $course - full Course object
* @param object $cm - full cm object
+ * @return string
*/
function plagiarism_update_status($course, $cm) {
global $CFG;
if (empty($CFG->enableplagiarism)) {
return '';
}
$plagiarismplugins = plagiarism_load_available_plugins();
+ $output = '';
foreach($plagiarismplugins as $plugin => $dir) {
require_once($dir.'/lib.php');
$plagiarismclass = "plagiarism_plugin_$plugin";
$plagiarismplugin = new $plagiarismclass;
- $plagiarismplugin->update_status($course, $cm);
+ $output .= $plagiarismplugin->update_status($course, $cm);
}
+ return $output;
}
/**
* Function that prints the student disclosure notifying that the files will be checked for plagiarism
* @param integer $cmid - the cmid of this module
+* @return string
*/
function plagiarism_print_disclosure($cmid) {
global $CFG;
if (empty($CFG->enableplagiarism)) {
return '';
}
$plagiarismplugins = plagiarism_load_available_plugins();
+ $output = '';
foreach($plagiarismplugins as $plugin => $dir) {
require_once($dir.'/lib.php');
$plagiarismclass = "plagiarism_plugin_$plugin";
$plagiarismplugin = new $plagiarismclass;
- $plagiarismplugin->print_disclosure($cmid);
+ $output .= $plagiarismplugin->print_disclosure($cmid);
}
+ return $output;
}
/**
* used by admin/cron.php to get similarity scores from submitted files.
@@ -211,7 +211,7 @@ function view_intro() {
echo $OUTPUT->box_start('generalbox boxaligncenter', 'intro');
echo format_module_intro('assignment', $this->assignment, $this->cm->id);
echo $OUTPUT->box_end();
- plagiarism_print_disclosure($this->cm->id);
+ echo plagiarism_print_disclosure($this->cm->id);
}
/**
@@ -1221,7 +1221,7 @@ function display_submissions($message='') {
echo '<div class="usersubmissions">';
//hook to allow plagiarism plugins to update status/print links.
- plagiarism_update_status($this->course, $this->cm);
+ echo plagiarism_update_status($this->course, $this->cm);
$course_context = get_context_instance(CONTEXT_COURSE, $course->id);
if (has_capability('gradereport/grader:view', $course_context) && has_capability('moodle/grade:viewall', $course_context)) {

0 comments on commit 4bd74c8

Please sign in to comment.