Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions classes/models/feedback.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,20 +189,6 @@ class feedback extends table_base {
*/
private $showgrade = true;

/**
* This function is used for student view, it determines if assessors' names should be displayed or should be hidden
* @return string assessor's name
*/
public function display_assessor_name() {

// check if assessor's name in this CW is set to hidden.
if ($this->is_assessor_anonymity_enabled()) {
return '';
} else {
return $this->assessor()->name();
}
}

/**
* @return string
*/
Expand Down
19 changes: 13 additions & 6 deletions renderers/object_renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,21 @@ public function render_feedback(feedback $feedback, $showtitle = true) {
$timeequal = ($feedback->timecreated == $feedback->timemodified);
$isautomaticagreement = ((!$issamplingenabled || $sampledfeedbackexists) && $assessoriszero && $timeequal);

if (!$isautomaticagreement && $feedback->assessorid != 0) {
$template->markername = $feedback->display_assessor_name();
if (!$isautomaticagreement && $assessor = $feedback->assessor()) {
$template->date = $feedback->timemodified;

// Marker image.
if ($feedback->assessor) {
$userpicture = new user_picture($feedback->assessor()->get_raw_record());
$userpicture->size = 100;
if (!$feedback->is_assessor_anonymity_enabled()) {
$template->markername = $assessor->name();
} else if ($feedback->is_moderation()) {
$template->markername = get_string('moderator', 'mod_coursework');
} else if ($stage = $feedback->get_assessor_stage_no()) {
$template->markername = get_string('markerheading', 'mod_coursework', $stage);
}

if ($feedback->is_assessor_anonymity_enabled()) {
$template->markerimg = $this->output->image_url('u/f1')->out(false);
} else {
$userpicture = new user_picture($assessor->get_raw_record());
$template->markerimg = $userpicture->get_url($this->page)->out(false);
}
}
Expand Down
5 changes: 5 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,11 @@ Coursework.
}

.path-mod-coursework {
.bg-cover {
background-size: cover;
background-position: center;
}

/* Hide activity header - date and description displayed differently. */
.activity-header {
display: none !important;
Expand Down
12 changes: 12 additions & 0 deletions tests/behat/feedback_single_marking.feature
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,15 @@ Feature: Adding and editing single feedback
And I visit the coursework page
Then I should not see "Admin User" in the ".coursework-feedback" "css_element"
But I should see "teacher teacher2" in the ".coursework-feedback" "css_element"

Scenario: Student cannot see marker when assessor anonymity is enabled
Given the submission is finalised
And there is finalised feedback for the submission from the teacher
And grades have been released
And I log out
When the coursework "assessoranonymity" setting is "1" in the database
And I log in as a student
And I visit the coursework page
Then I should not see "Admin User" in the ".coursework-feedback" "css_element"
And I should not see "teacher teacher2" in the ".coursework-feedback" "css_element"
But I should see "Marker 1" in the ".coursework-feedback" "css_element"
Loading