/** * Displays any attached files when the question is in read-only mode. * @param question_attempt $qa the question attempt to display. * @param question_display_options $options controls what should and should * not be displayed. Used to get the context. */ public function files_read_only(question_attempt $qa, question_display_options $options) { $files = $qa->get_last_qt_files('attachments', $options->context->id); $output = array(); foreach ($files as $file) { $output[] = html_writer::tag('p', html_writer::link($qa->get_response_file_url($file), $this->output->pix_icon(file_file_icon($file), get_mimetype_description($file), 'moodle', array('class' => 'icon')) . ' ' . s($file->get_filename()))); } return implode($output); }