So i changed a little bit and now it shows options the right way - horizintal.
This fragment of code is from display_publish_name_vertical function:
foreach ($choices->options as $optionid => $options) {
$coldata = '';
if ($choices->showunanswered && $optionid == 0) {
$coldata .= html_writer::tag('div', format_string(get_string('notanswered', 'choice')), array('class'=>'option'));
} else if ($optionid > 0) {
$coldata .= html_writer::tag('div', format_string($choices->options[$optionid]->text), array('class'=>'option'));
}
$numberofuser = 0;
if (!empty($options->user) && count($options->user) > 0) {
$numberofuser = count($options->user);
}
$coldata .= html_writer::tag('div', ' ('.$numberofuser. ')', array('class'=>'numberofuser', 'title' => get_string('numberofuser', 'choice')));
$columns[] = $coldata;
$datacell = new html_table_cell();
$datacell->text = $coldata;
$datacell->attributes = array('class'=>'header');
$row = new html_table_row();
$row->cells = array($datacell);
$rows[] = $row;
}
$table->data = $rows;
$table->head = false;
But now i need to show student's names in other cells.