MDL-52506 mod_assign: Fix return links for atto auto save

This commit is contained in:
Ryan Wyllie 2016-05-06 04:36:19 +00:00
parent 1e72daa899
commit e6858c084a
2 changed files with 44 additions and 0 deletions

View file

@ -3899,6 +3899,12 @@ class assign {
// Need submit permission to submit an assignment.
$userid = optional_param('userid', $USER->id, PARAM_INT);
$user = $DB->get_record('user', array('id'=>$userid), '*', MUST_EXIST);
// This variation on the url will link direct to this student.
// The benefit is the url will be the same every time for this student, so Atto autosave drafts can match up.
$returnparams = array('userid' => $userid, 'rownum' => 0, 'useridlistid' => 0);
$this->register_return_link('editsubmission', $returnparams);
if ($userid == $USER->id) {
if (!$this->can_edit_submission($userid, $USER->id)) {
print_error('nopermission');