From d63e7470a951c7ad3d5f729821e5d77b46ad0c0f Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Tue, 25 Mar 2014 12:45:36 +0800 Subject: [PATCH 1/2] MDL-44745 Assign: Make the grading table use the fullname function from the assign class. This will take blind marking into account when displaying student names. --- mod/assign/gradingtable.php | 12 ++++-------- mod/assign/locallib.php | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/mod/assign/gradingtable.php b/mod/assign/gradingtable.php index c4242511cff..c82686a8c72 100644 --- a/mod/assign/gradingtable.php +++ b/mod/assign/gradingtable.php @@ -731,9 +731,9 @@ class assign_grading_table extends table_sql implements renderable { if (!$this->is_downloading()) { $courseid = $this->assignment->get_course()->id; $link= new moodle_url('/user/view.php', array('id' =>$row->id, 'course'=>$courseid)); - $fullname = $this->output->action_link($link, fullname($row)); + $fullname = $this->output->action_link($link, $this->assignment->fullname($row)); } else { - $fullname = fullname($row); + $fullname = $this->assignment->fullname($row); } if (!$this->assignment->is_active_user($row->id)) { @@ -753,7 +753,7 @@ class assign_grading_table extends table_sql implements renderable { */ public function col_select(stdClass $row) { $selectcol = ''; $selectcol .= 'assignment->grading_disabled($row->id); if (!$this->is_downloading() && $this->hasgrade) { - $name = fullname($row); - if ($this->assignment->is_blind_marking()) { - $name = get_string('hiddenuser', 'assign') . - $this->assignment->get_uniqueid_for_user($row->userid); - } + $name = $this->assignment->fullname($row); $icon = $this->output->pix_icon('gradefeedback', get_string('gradeuser', 'assign', $name), 'mod_assign'); diff --git a/mod/assign/locallib.php b/mod/assign/locallib.php index 7c1bc49aca0..b4e027fb919 100644 --- a/mod/assign/locallib.php +++ b/mod/assign/locallib.php @@ -3231,7 +3231,7 @@ class assign { * @param stdClass $user The user record as required by fullname() * @return string The name. */ - protected function fullname($user) { + public function fullname($user) { if ($this->is_blind_marking()) { $uniqueid = $this->get_uniqueid_for_user($userid); return get_string('participant', 'assign') . ' ' . $uniqueid; From 4309255896ad3ddb181693002bdf95dfa4853532 Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Tue, 25 Mar 2014 12:49:36 +0800 Subject: [PATCH 2/2] MDL-44745 Assign: Fix typo in assign->fullname function This is a new function on master only. --- mod/assign/locallib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/assign/locallib.php b/mod/assign/locallib.php index b4e027fb919..b73be11b324 100644 --- a/mod/assign/locallib.php +++ b/mod/assign/locallib.php @@ -3233,7 +3233,7 @@ class assign { */ public function fullname($user) { if ($this->is_blind_marking()) { - $uniqueid = $this->get_uniqueid_for_user($userid); + $uniqueid = $this->get_uniqueid_for_user($user->id); return get_string('participant', 'assign') . ' ' . $uniqueid; } else { return fullname($user);