mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 09:56:38 +02:00
MDL-52506 mod_assign: Fix return links for atto auto save
This commit is contained in:
parent
1e72daa899
commit
e6858c084a
2 changed files with 44 additions and 0 deletions
|
@ -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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue