Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-31028: Added pathname hashes to eventdata

Also fix strict standard warning
  • Loading branch information...
commit 4447223b384659ce87da4f324a77d2cc6523e07d 1 parent e16e230
Christopher Tombleson chtombleson authored
5 mod/assign/submission/file/locallib.php
@@ -200,9 +200,10 @@ public function save(stdClass $submission, stdClass $data) {
200 200 $eventdata->courseid = $this->assignment->get_course()->id;
201 201 $eventdata->userid = $USER->id;
202 202 if ($count > 1) {
203   - $eventdata->files = $files;
  203 + $eventdata->files = $files; // This is depreceated - please use pathnamehashes instead!
204 204 }
205   - $eventdata->file = $files;
  205 + $eventdata->file = $files; // This is depreceated - please use pathnamehashes instead!
  206 + $eventdata->pathnamehashes = array_keys($files);
206 207 events_trigger('assessable_file_uploaded', $eventdata);
207 208
208 209
3  mod/assignment/type/upload/assignment.class.php
@@ -600,8 +600,9 @@ function upload_file($mform, $options) {
600 600 $eventdata->courseid = $this->course->id;
601 601 $eventdata->userid = $USER->id;
602 602 if ($files) {
603   - $eventdata->files = $files;
  603 + $eventdata->files = $files; // This is depreceated - please use pathnamehashes instead!
604 604 }
  605 + $eventdata->pathnamehashes = array_keys($files);
605 606 events_trigger('assessable_file_uploaded', $eventdata);
606 607 $returnurl = new moodle_url('/mod/assignment/view.php', array('id'=>$this->cm->id));
607 608 redirect($returnurl);
3  mod/assignment/type/uploadsingle/assignment.class.php
@@ -237,7 +237,8 @@ function upload_file($mform) {
237 237 $eventdata->itemid = $submission->id;
238 238 $eventdata->courseid = $this->course->id;
239 239 $eventdata->userid = $USER->id;
240   - $eventdata->file = $file;
  240 + $eventdata->file = $file; // This is depreceated - please use pathnamehashes instead!
  241 + $eventdata->pathnamehashes = array($file->get_pathnamehash());
241 242 events_trigger('assessable_file_uploaded', $eventdata);
242 243 }
243 244
6 plagiarism/lib.php
@@ -44,13 +44,13 @@ public function get_links($linkarray) {
44 44 * hook to allow plagiarism specific information to be returned unformatted
45 45 * @param int $cmid
46 46 * @param int $userid
47   - * @param object $file moodle file object
  47 + * @param stored_file $file moodle file object
48 48 * @return array containing at least:
49 49 * - 'analyzed' - whether the file has been successfully analyzed
50 50 * - 'score' - similarity score - ('' if not known)
51 51 * - 'reporturl' - url of originality report - '' if unavailable
52 52 */
53   - public function get_file_results($cmid, $userid, $file) {
  53 + public function get_file_results($cmid, $userid, stored_file $file) {
54 54 return array('analyzed' => '', 'score' => '', 'reporturl' => '');
55 55 }
56 56 /**
@@ -86,4 +86,4 @@ public function update_status($course, $cm) {
86 86 */
87 87 public function plagiarism_cron() {
88 88 }
89   -}
  89 +}

0 comments on commit 4447223

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