/** * Render the list of quizzes that still need to be upgraded page. * @param array $quizzes of data about quizzes. * @param int $numveryoldattemtps only relevant before upgrade. * @return string html to output. */ public function quiz_list_page(local_qeupgradehelper_quiz_list $quizzes, $numveryoldattemtps = null) { $output = ''; $output .= $this->header(); $output .= $this->heading($quizzes->title); $output .= $this->box($quizzes->intro); $table = new html_table(); $table->head = $quizzes->get_col_headings(); $rowcount = 0; foreach ($quizzes->quizlist as $quizinfo) { $table->data[$rowcount] = $quizzes->get_row($quizinfo); if ($class = $quizzes->get_row_class($quizinfo)) { $table->rowclasses[$rowcount] = $class; } $rowcount += 1; } $table->data[] = $quizzes->get_total_row(); $output .= html_writer::table($table); if ($numveryoldattemtps) { $output .= $this->box(get_string('veryoldattemtps', 'local_qeupgradehelper', $numveryoldattemtps)); } $output .= $this->back_to_index(); $output .= $this->footer(); return $output; }
public function get_col_headings() { $headings = parent::get_col_headings(); $headings[] = get_string('action', 'local_qeupgradehelper'); return $headings; }