Merge branch 'MDL-58453-master' of git://github.com/jleyva/moodle
[moodle.git] / mod / feedback / classes / external.php
index f380f39..83c842b 100644 (file)
@@ -1002,6 +1002,10 @@ class mod_feedback_external extends external_api {
 
         list($feedback, $course, $cm, $context) = self::validate_feedback($params['feedbackid']);
 
+        if ($feedback->anonymous != FEEDBACK_ANONYMOUS_NO || $feedback->course == SITEID) {
+            throw new moodle_exception('anonymous', 'feedback');
+        }
+
         // Check permissions.
         require_capability('mod/feedback:viewreports', $context);