Skip to content

Commit

Permalink
MDL-74064 mod_assign: Notify submission removal does not reset timelimit
Browse files Browse the repository at this point in the history
  • Loading branch information
rezaies authored and HuongNV13 committed Apr 14, 2022
1 parent 6ac1477 commit 7252fef
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
6 changes: 4 additions & 2 deletions mod/assign/lang/en/assign.php
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,10 @@
$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';
Expand Down
13 changes: 10 additions & 3 deletions mod/assign/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -4474,10 +4474,17 @@ protected function view_remove_submission_confirm() {
$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,
Expand Down

0 comments on commit 7252fef

Please sign in to comment.