diff --git a/mod/assignment/lib.php b/mod/assignment/lib.php index ee8726ccc66..817ea85f9df 100644 --- a/mod/assignment/lib.php +++ b/mod/assignment/lib.php @@ -1760,7 +1760,7 @@ class assignment_base { $filename = $file->get_filename(); $found = true; $mimetype = $file->get_mimetype(); - $path = file_encode_url($CFG->wwwroot.'/pluginfile.php', '/'.$this->context->id.'/mod_assignment/submission/'.$userid.'/'.$filename); + $path = file_encode_url($CFG->wwwroot.'/pluginfile.php', '/'.$this->context->id.'/mod_assignment/submission/'.$submission->id.'/'.$filename); $output .= ''.$mimetype.''.s($filename).''; if ($this->portfolio_exportable() && has_capability('mod/assignment:exportownsubmission', $this->context)) { $button->set_callback_options('assignment_portfolio_caller', array('id' => $this->cm->id, 'fileid' => $file->get_id()), '/mod/assignment/locallib.php');