Skip to content

Commit

Permalink
MDL-62668 mod_workshop: Return feedback for reviewer in assessment phase
Browse files Browse the repository at this point in the history
Teachers were not able to view the existing feedback.
  • Loading branch information
jleyva committed Jan 23, 2019
1 parent 7412ad6 commit e76b511
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mod/workshop/classes/external.php
Expand Up @@ -1042,8 +1042,11 @@ protected static function prepare_assessment_for_external($assessment, workshop
return null;
}

// Remove the feedback for the reviewer if the feedback phase is not valid or if we don't have enough permissions to see it.
if ($workshop->phase < workshop::PHASE_EVALUATION || !($isreviewer || $canviewallassessments)) {
// Remove the feedback for the reviewer if:
// I can't see it in the evaluation phase because I'm not a teacher or the reviewer AND
// I can't see it in the assessment phase because I'm not a teacher.
if (($workshop->phase < workshop::PHASE_EVALUATION || !($isreviewer || $canviewallassessments)) &&
($workshop->phase < workshop::PHASE_ASSESSMENT || !$canviewallassessments) ) {
// Remove all the feedback information (all the optional fields).
foreach ($properties as $attribute => $settings) {
if (!empty($settings['optional'])) {
Expand Down
1 change: 1 addition & 0 deletions mod/workshop/tests/external_test.php
Expand Up @@ -1451,6 +1451,7 @@ public function test_get_reviewer_assessments() {
$result = mod_workshop_external::get_reviewer_assessments($this->workshop->id, $this->student->id);
$result = external_api::clean_returnvalue(mod_workshop_external::get_reviewer_assessments_returns(), $result);
$this->assertCount(2, $result['assessments']);
$this->assertArrayNotHasKey('feedbackreviewer', $result['assessments'][0]);
}

/**
Expand Down

0 comments on commit e76b511

Please sign in to comment.