Permalink
Browse files

MDL-31291: Do not show students names who have not submitted when bli…

…nd marking is enabled.
  • Loading branch information...
1 parent b473171 commit 88cfe469984f6426bfd3d7edeb9ad0dbabc28088 Damyon Wiese committed Sep 3, 2012
Showing with 17 additions and 5 deletions.
  1. +7 −3 mod/assign/locallib.php
  2. +5 −1 mod/assign/renderable.php
  3. +5 −1 mod/assign/renderer.php
View
@@ -1483,6 +1483,10 @@ public function get_submission_group_members_who_have_not_submitted($groupid, $o
$submission = $this->get_user_submission($member->id, false);
if ($submission && $submission->status != ASSIGN_SUBMISSION_STATUS_DRAFT) {
unset($members[$id]);
+ } else {
+ if ($this->is_blind_marking()) {
+ $members[$id]->alias = get_string('hiddenuser', 'assign') . $this->get_uniqueid_for_user($id);
+ }
}
}
return $members;
@@ -1987,8 +1991,7 @@ private function view_single_grade_page($mform, $offset=0) {
if ($grade) {
$extensionduedate = $grade->extensionduedate;
}
- $showedit = has_capability('mod/assign:submit', $this->context) &&
- $this->submissions_open($userid) && ($this->is_any_submission_plugin_enabled());
+ $showedit = $this->submissions_open($userid) && ($this->is_any_submission_plugin_enabled());
if ($teamsubmission) {
$showsubmit = $showedit && $teamsubmission && ($teamsubmission->status == ASSIGN_SUBMISSION_STATUS_DRAFT);
@@ -2019,7 +2022,8 @@ private function view_single_grade_page($mform, $offset=0) {
$showsubmit,
$viewfullnames,
$extensionduedate,
- $this->get_context()));
+ $this->get_context(),
+ $this->is_blind_marking()));
}
if ($grade) {
$data = new stdClass();
@@ -335,6 +335,8 @@ class assign_submission_status implements renderable {
public $extensionduedate = 0;
/** @var context context */
public $context = 0;
+ /** @var bool blindmarking - Should we hide student identities from graders? */
+ public $blindmarking = false;
/**
* constructor
@@ -362,13 +364,14 @@ class assign_submission_status implements renderable {
* @param bool $canviewfullnames
* @param int $extensionduedate - Any extension to the due date granted for this user
* @param context $context - Any extension to the due date granted for this user
+ * @param blindmarking $blindmarking - Should we hide student identities from graders?
*/
public function __construct($allowsubmissionsfromdate, $alwaysshowdescription, $submission,
$teamsubmissionenabled, $teamsubmission, $submissiongroup,
$submissiongroupmemberswhoneedtosubmit, $submissionsenabled,
$locked, $graded, $duedate, $cutoffdate, $submissionplugins, $returnaction, $returnparams,
$coursemoduleid, $courseid, $view, $canedit, $cansubmit, $canviewfullnames, $extensionduedate,
- $context) {
+ $context, $blindmarking) {
$this->allowsubmissionsfromdate = $allowsubmissionsfromdate;
$this->alwaysshowdescription = $alwaysshowdescription;
$this->submission = $submission;
@@ -392,6 +395,7 @@ public function __construct($allowsubmissionsfromdate, $alwaysshowdescription, $
$this->canviewfullnames = $canviewfullnames;
$this->extensionduedate = $extensionduedate;
$this->context = $context;
+ $this->blindmarking = $blindmarking;
}
}
View
@@ -429,7 +429,11 @@ public function render_assign_submission_status(assign_submission_status $status
$userslist = array();
foreach ($members as $member) {
$url = new moodle_url('/user/view.php', array('id' => $member->id, 'course'=>$status->courseid));
- $userslist[] = $this->output->action_link($url, fullname($member, $status->canviewfullnames));
+ if ($status->view == assign_submission_status::GRADER_VIEW && $status->blindmarking) {
+ $userslist[] = $member->alias;
+ } else {
+ $userslist[] = $this->output->action_link($url, fullname($member, $status->canviewfullnames));
+ }
}
if (count($userslist) > 0) {
$userstr = join(', ', $userslist);

0 comments on commit 88cfe46

Please sign in to comment.