Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…to MOODLE_22_STABLE
  • Loading branch information...
commit 4bd74c8ddce16d8c87af3410f4f51ffc071431ab 2 parents 8227904 + 733196d
@nebgor nebgor authored
Showing with 10 additions and 4 deletions.
  1. +8 −2 lib/plagiarismlib.php
  2. +2 −2 mod/assignment/lib.php
View
10 lib/plagiarismlib.php
@@ -121,6 +121,7 @@ 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;
@@ -128,17 +129,20 @@ function plagiarism_update_status($course, $cm) {
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;
@@ -146,12 +150,14 @@ function plagiarism_print_disclosure($cmid) {
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.
View
4 mod/assignment/lib.php
@@ -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)) {
Please sign in to comment.
Something went wrong with that request. Please try again.