MDL-62668 mod_workshop: Return feedback for reviewer in assessment phase

Teachers were not able to view the existing feedback.
This commit is contained in:
Juan Leyva
2018-11-16 15:49:18 +01:00
parent 628a7bb557
commit d6b498f6ae
2 changed files with 6 additions and 2 deletions
+5 -2
View File
@@ -1042,8 +1042,11 @@ class mod_workshop_external extends external_api {
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'])) {