Skip to content

Commit

Permalink
MDL-31028: Added pathname hashes to eventdata
Browse files Browse the repository at this point in the history
Also fix strict standard warning
  • Loading branch information
Christopher Tombleson committed May 9, 2012
1 parent e16e230 commit 4447223
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
5 changes: 3 additions & 2 deletions mod/assign/submission/file/locallib.php
Expand Up @@ -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);


Expand Down
3 changes: 2 additions & 1 deletion mod/assignment/type/upload/assignment.class.php
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion mod/assignment/type/uploadsingle/assignment.class.php
Expand Up @@ -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);
}

Expand Down
6 changes: 3 additions & 3 deletions plagiarism/lib.php
Expand Up @@ -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' => '');
}
/**
Expand Down Expand Up @@ -86,4 +86,4 @@ public function update_status($course, $cm) {
*/
public function plagiarism_cron() {
}
}
}

0 comments on commit 4447223

Please sign in to comment.