Publish results with student's names in horizontal position

Publish results with student's names in horizontal position

Höfundur Dima P. -
Number of replies: 3

Hi, i'm not a developer, but I want to publish results with student's names in horizontal position. I have many options and verticaly moodle renders them incorrectly (not showing all collumns).

I found one function in renderer.php:

display_publish_name_vertical.

So now i need to modify this or to create new function similar to this.  I would appreciate if anyone post some examples how to create tables. 

Meðaltal dóma: -
In reply to Dima P.

Ats: Publish results with student's names in horizontal position

Höfundur Dima P. -

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.

Attachment asd.JPG
Meðaltal dóma:Useful (1)
In reply to Dima P.

Ats: Publish results with student's names in horizontal position

Höfundur Dima P. -

Forgot to post yesterday that I finished. I changed a little bit code and now everything works fine (how i want).  

 

Admins can delete this discussion (monologue). 

In reply to Dima P.

Re: Ats: Publish results with student's names in horizontal position

Höfundur Paula Clough -

Thanks for sharing this, Dima.  I have a admin user who has been asking me about something similar.  I think this will help!

Paula svalur