Skip to content

Commit

Permalink
MDL-55505 mod_assign: Editing previous attempt works correctly.
Browse files Browse the repository at this point in the history
Editing a previous attempt keeps the current feedback and grades
as it should and does not override them.
  • Loading branch information
abgreeve committed Sep 8, 2016
1 parent 04b0fec commit 598e621
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mod/assign/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2930,9 +2930,9 @@ public function get_user_grade($userid, $create, $attemptnumber=-1) {
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;
Expand Down
3 changes: 2 additions & 1 deletion mod/assign/tests/behat/edit_previous_feedback.feature
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Feature: In an assignment, teachers can edit feedback for a students previous su
Then I log in as "student2"
And I follow "Course 1"
And I follow "Test assignment name"
And I click on ".mod-assign-history-link" "css_element"
And I should see "I'm the teacher second feedback" in the "Feedback comments" "table_row"
And I should see "50.00"
And I click on ".mod-assign-history-link" "css_element"
And I should not see "I'm the teacher second feedback" in the "Feedback comments" "table_row"

0 comments on commit 598e621

Please sign in to comment.