+
+ public function check_file_access($qa, $options, $component, $filearea, $args, $forcedownload) {
+ if ($component == 'question' && $filearea == 'response_attachments') {
+ // Response attachments visible if the question has them.
+ return $this->attachments != 0;
+
+ } else {
+ return parent::check_file_access($qa, $options, $component, $filearea, $args, $forcedownload);
+ }
+ }