/** * Displays the table */ public function display() { global $OUTPUT; groups_print_activity_menu($this->feedbackstructure->get_cm(), $this->baseurl->out()); $grandtotal = $this->get_total_responses_count(); if (!$grandtotal) { echo $OUTPUT->box(get_string('nothingtodisplay'), 'generalbox nothingtodisplay'); return; } $this->out($this->showall ? $grandtotal : FEEDBACK_DEFAULT_PAGE_COUNT, $grandtotal > FEEDBACK_DEFAULT_PAGE_COUNT); // Toggle 'Show all' link. if ($this->totalrows > FEEDBACK_DEFAULT_PAGE_COUNT) { if (!$this->use_pages) { echo html_writer::div(html_writer::link(new moodle_url($this->baseurl, [$this->showallparamname => 0]), get_string('showperpage', '', FEEDBACK_DEFAULT_PAGE_COUNT)), 'showall'); } else { echo html_writer::div(html_writer::link(new moodle_url($this->baseurl, [$this->showallparamname => 1]), get_string('showall', '', $this->totalrows)), 'showall'); } } }
/** * Returns the current course module * @return cm_info */ public function get_cm() { return $this->structure->get_cm(); }