} else { $responsetitle = get_string('response_nr', 'feedback') . ': ' . $completedrecord->random_response . ' (' . get_string('anonymous', 'feedback') . ')'; } echo $OUTPUT->heading($responsetitle, 4); $form = new mod_feedback_complete_form(mod_feedback_complete_form::MODE_VIEW_RESPONSE, $feedbackstructure, 'feedback_viewresponse_form'); $form->display(); list($prevresponseurl, $returnurl, $nextresponseurl) = $userid ? $responsestable->get_reponse_navigation_links($completedrecord) : $anonresponsestable->get_reponse_navigation_links($completedrecord); echo html_writer::start_div('response_navigation'); echo $prevresponseurl ? html_writer::link($prevresponseurl, get_string('prev'), ['class' => 'prev_response']) : ''; echo html_writer::link($returnurl, get_string('back'), ['class' => 'back_to_list']); echo $nextresponseurl ? html_writer::link($nextresponseurl, get_string('next'), ['class' => 'next_response']) : ''; echo html_writer::end_div(); } else { // Print the list of responses. $courseselectform->display(); // Show non-anonymous responses (always retrieve them even if current feedback is anonymous). $totalrows = $responsestable->get_total_responses_count(); if (!$feedbackstructure->is_anonymous() || $totalrows) { echo $OUTPUT->heading(get_string('non_anonymous_entries', 'feedback', $totalrows), 4); $responsestable->display(); } // Show anonymous responses (always retrieve them even if current feedback is not anonymous). $feedbackstructure->shuffle_anonym_responses(); $totalrows = $anonresponsestable->get_total_responses_count(); if ($feedbackstructure->is_anonymous() || $totalrows) { echo $OUTPUT->heading(get_string('anonymous_entries', 'feedback', $totalrows), 4); $anonresponsestable->display(); } } // Finish the page. echo $OUTPUT->footer();