. namespace core_question\bank; /** * A column type for the name of the question name. * * @copyright 2009 Tim Hunt * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class question_name_column extends column_base { protected $checkboxespresent = null; public function get_name() { return 'questionname'; } protected function get_title() { return get_string('question'); } protected function label_for($question) { if (is_null($this->checkboxespresent)) { $this->checkboxespresent = $this->qbank->has_column('core_question\bank\checkbox_column'); } if ($this->checkboxespresent) { return 'checkq' . $question->id; } else { return ''; } } protected function display_content($question, $rowclasses) { $labelfor = $this->label_for($question); if ($labelfor) { echo ''; } } public function get_required_fields() { return array('q.id', 'q.name'); } public function is_sortable() { return 'q.name'; } }