Skip to content
Browse files

MDL-31028: Added pathname hashes to eventdata

Also fix strict standard warning
  • Loading branch information...
1 parent e16e230 commit 4447223b384659ce87da4f324a77d2cc6523e07d @chtombleson chtombleson committed May 9, 2012
View
5 mod/assign/submission/file/locallib.php
@@ -200,9 +200,10 @@ public function save(stdClass $submission, stdClass $data) {
$eventdata->courseid = $this->assignment->get_course()->id;
$eventdata->userid = $USER->id;
if ($count > 1) {
- $eventdata->files = $files;
+ $eventdata->files = $files; // This is depreceated - please use pathnamehashes instead!
}
- $eventdata->file = $files;
+ $eventdata->file = $files; // This is depreceated - please use pathnamehashes instead!
+ $eventdata->pathnamehashes = array_keys($files);
events_trigger('assessable_file_uploaded', $eventdata);
View
3 mod/assignment/type/upload/assignment.class.php
@@ -600,8 +600,9 @@ function upload_file($mform, $options) {
$eventdata->courseid = $this->course->id;
$eventdata->userid = $USER->id;
if ($files) {
- $eventdata->files = $files;
+ $eventdata->files = $files; // This is depreceated - please use pathnamehashes instead!
}
+ $eventdata->pathnamehashes = array_keys($files);
events_trigger('assessable_file_uploaded', $eventdata);
$returnurl = new moodle_url('/mod/assignment/view.php', array('id'=>$this->cm->id));
redirect($returnurl);
View
3 mod/assignment/type/uploadsingle/assignment.class.php
@@ -237,7 +237,8 @@ function upload_file($mform) {
$eventdata->itemid = $submission->id;
$eventdata->courseid = $this->course->id;
$eventdata->userid = $USER->id;
- $eventdata->file = $file;
+ $eventdata->file = $file; // This is depreceated - please use pathnamehashes instead!
+ $eventdata->pathnamehashes = array($file->get_pathnamehash());
events_trigger('assessable_file_uploaded', $eventdata);
}
View
6 plagiarism/lib.php
@@ -44,13 +44,13 @@ public function get_links($linkarray) {
* hook to allow plagiarism specific information to be returned unformatted
* @param int $cmid
* @param int $userid
- * @param object $file moodle file object
+ * @param stored_file $file moodle file object
* @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
*/
- public function get_file_results($cmid, $userid, $file) {
+ public function get_file_results($cmid, $userid, stored_file $file) {
return array('analyzed' => '', 'score' => '', 'reporturl' => '');
}
/**
@@ -86,4 +86,4 @@ public function update_status($course, $cm) {
*/
public function plagiarism_cron() {
}
-}
+}

0 comments on commit 4447223

Please sign in to comment.
Something went wrong with that request. Please try again.