MDL-55505 mod_assign: Editing previous attempt works correctly.

Editing a previous attempt keeps the current feedback and grades
as it should and does not override them.
This commit is contained in:
Adrian Greeve 2016-09-05 11:33:56 +08:00
parent 0344082208
commit a14cde804e
2 changed files with 4 additions and 3 deletions

View file

@ -3165,9 +3165,9 @@ class assign {
if ($attemptnumber < 0 || $create) {
// Make sure this grade matches the latest submission attempt.
if ($this->get_instance()->teamsubmission) {
$submission = $this->get_group_submission($userid, 0, true);
$submission = $this->get_group_submission($userid, 0, true, $attemptnumber);
} else {
$submission = $this->get_user_submission($userid, true);
$submission = $this->get_user_submission($userid, true, $attemptnumber);
}
if ($submission) {
$attemptnumber = $submission->attemptnumber;