mirror of
https://github.com/moodle/moodle.git
synced 2025-04-05 08:23:01 +02:00
Merge branch 'MDL-64507-v2' of git://github.com/danmarsden/moodle
This commit is contained in:
commit
4b38f761c1
@ -5422,6 +5422,12 @@ class assign {
|
||||
$gradercache = array();
|
||||
$cangrade = has_capability('mod/assign:grade', $this->get_context());
|
||||
|
||||
// Show the grader's identity if 'Hide Grader' is disabled or has the 'Show Hidden Grader' capability.
|
||||
$showgradername = (
|
||||
has_capability('mod/assign:showhiddengrader', $this->context, $userid) or
|
||||
!$this->is_hidden_grader()
|
||||
);
|
||||
|
||||
// Need gradingitem and gradingmanager.
|
||||
$gradingmanager = get_grading_manager($this->get_context(), 'mod_assign', 'submissions');
|
||||
$controller = $gradingmanager->get_active_controller();
|
||||
@ -5439,7 +5445,9 @@ class assign {
|
||||
|
||||
foreach ($grades as $grade) {
|
||||
// First lookup the grader info.
|
||||
if (isset($gradercache[$grade->grader])) {
|
||||
if (!$showgradername) {
|
||||
$grade->grader = null;
|
||||
} else if (isset($gradercache[$grade->grader])) {
|
||||
$grade->grader = $gradercache[$grade->grader];
|
||||
} else if ($grade->grader > 0) {
|
||||
// Not in cache - need to load the grader record.
|
||||
|
@ -25,6 +25,7 @@ Feature: In an assignment, students start a new attempt based on their previous
|
||||
| assignsubmission_onlinetext_enabled | 1 |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Attempts reopened | Manually |
|
||||
| Hide grader identity from students | Yes |
|
||||
And I log out
|
||||
And I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
@ -45,12 +46,13 @@ Feature: In an assignment, students start a new attempt based on their previous
|
||||
And I press "Ok"
|
||||
And I click on "Edit settings" "link"
|
||||
And I log out
|
||||
And I log in as "student1"
|
||||
Then I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Test assignment name"
|
||||
And I should not see "Teacher 1"
|
||||
And I press "Add a new attempt based on previous submission"
|
||||
And I press "Save changes"
|
||||
Then I log out
|
||||
And I log out
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Test assignment name"
|
||||
|
Loading…
x
Reference in New Issue
Block a user