MDL-58006 assign: Reset blindmarking assignments to hidden

Fix to reset blindmarking assigments to hidden as part of Course reset with behat test
This commit is contained in:
Zig Tan 2018-01-22 11:35:52 +08:00
parent f68150ad05
commit 1a9e8542c5
2 changed files with 26 additions and 4 deletions

View File

@ -1130,11 +1130,11 @@ class assign {
// Remove all grades from gradebook.
require_once($CFG->dirroot.'/mod/assign/lib.php');
assign_reset_gradebook($data->courseid);
}
// Reset revealidentities if both submissions and grades have been reset.
if ($this->get_instance()->blindmarking && $this->get_instance()->revealidentities) {
$DB->set_field('assign', 'revealidentities', 0, array('id' => $this->get_instance()->id));
}
// Reset revealidentities for assign if blindmarking is enabled.
if ($this->get_instance()->blindmarking) {
$DB->set_field('assign', 'revealidentities', 0, array('id' => $this->get_instance()->id));
}
}

View File

@ -108,3 +108,25 @@ Feature: Assign reset
And I follow "Test assignment name"
And I navigate to "Group overrides" in current page administration
Then I should not see "Group 1"
Scenario: Use course reset to reset blind marking assignment.
Given I follow "Test assignment name"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| blindmarking | 1 |
And I press "Save"
When I follow "Test assignment name"
And I navigate to "View all submissions" in current page administration
And I select "Reveal student identities" from the "Grading action" singleselect
And I press "Continue"
And I should see "Sam1 Student1"
And I am on "Course 1" course homepage
When I navigate to "Reset" node in "Course administration"
And I set the following fields to these values:
| Delete all submissions | 1 |
And I press "Reset course"
And I press "Continue"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I navigate to "View all submissions" in current page administration
Then I should not see "Sam1 Student1"