From 7252fef24bb207ce955e0d972901f0cefba8042d Mon Sep 17 00:00:00 2001 From: Shamim Rezaie Date: Mon, 28 Mar 2022 19:37:03 +1100 Subject: [PATCH] MDL-74064 mod_assign: Notify submission removal does not reset timelimit --- mod/assign/lang/en/assign.php | 6 ++++-- mod/assign/locallib.php | 13 ++++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/mod/assign/lang/en/assign.php b/mod/assign/lang/en/assign.php index 465d99ce3c0..814a1aee60c 100644 --- a/mod/assign/lang/en/assign.php +++ b/mod/assign/lang/en/assign.php @@ -476,8 +476,10 @@ $string['requireallteammemberssubmit_help'] = 'If enabled, all members of the st $string['recordid'] = 'Identifier'; $string['removesubmission'] = 'Remove submission'; $string['removesubmissionforstudent'] = 'Remove submission for student: (id={$a->id}, fullname={$a->fullname}).'; -$string['removesubmissionconfirm'] = 'Are you sure you want to remove the submission data?'; -$string['removesubmissionconfirmforstudent'] = 'Are you sure you want to remove the submission data for student {$a}?'; +$string['removesubmissionconfirm'] = 'Are you sure you want to remove your submission?'; +$string['removesubmissionconfirmforstudent'] = 'Are you sure you want to remove the submission for {$a}?'; +$string['removesubmissionconfirmforstudentwithtimelimit'] = 'Are you sure you want to remove the submission for {$a}? Please note that this will not reset the student\'s time limit. You can give more time by adding a time limit user override.'; +$string['removesubmissionconfirmwithtimelimit'] = 'Are you sure you want to remove your submission? Please note that this will not reset your time limit.'; $string['revealidentities'] = 'Reveal student identities'; $string['revealidentitiesconfirm'] = 'Are you sure you want to reveal student identities for this assignment? This operation cannot be undone. Once the student identities have been revealed, the marks will be released to the gradebook.'; $string['reverttodefaults'] = 'Revert to assignment defaults'; diff --git a/mod/assign/locallib.php b/mod/assign/locallib.php index 05c53f2a5f0..5c0d9a85c18 100644 --- a/mod/assign/locallib.php +++ b/mod/assign/locallib.php @@ -4474,10 +4474,17 @@ class assign { $cancelurl = new moodle_url('/mod/assign/view.php', $urlparams); if ($userid == $USER->id) { - $confirmstr = get_string('removesubmissionconfirm', 'assign'); + if ($this->is_time_limit_enabled($userid)) { + $confirmstr = get_string('removesubmissionconfirmwithtimelimit', 'assign'); + } else { + $confirmstr = get_string('removesubmissionconfirm', 'assign'); + } } else { - $name = $this->fullname($user); - $confirmstr = get_string('removesubmissionconfirmforstudent', 'assign', $name); + if ($this->is_time_limit_enabled($userid)) { + $confirmstr = get_string('removesubmissionconfirmforstudentwithtimelimit', 'assign', $this->fullname($user)); + } else { + $confirmstr = get_string('removesubmissionconfirmforstudent', 'assign', $this->fullname($user)); + } } $o .= $this->get_renderer()->confirm($confirmstr, $confirmurl,