Skip to content

Commit

Permalink
MDL-51704 survey: Fix display problems in report page
Browse files Browse the repository at this point in the history
  • Loading branch information
dpalou committed Jan 26, 2016
1 parent eddec36 commit 156de65
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions mod/survey/report.php
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@
}
}

echo "<p <p class=\"centerpara\">";
echo "<p class=\"centerpara\">";
echo $OUTPUT->user_picture($user, array('courseid'=>$course->id));
echo "</p>";

Expand All @@ -409,7 +409,7 @@

if ($showscales) {
// Print overall summary
echo "<p <p class=\"centerpara\">>";
echo "<p class=\"centerpara\">";
survey_print_graph("id=$id&amp;sid=$student&amp;type=student.png");
echo "</p>";

Expand Down Expand Up @@ -446,7 +446,16 @@
$table = new html_table();
$table->head = array(get_string($question->text, "survey"));
$table->align = array ("left");
$table->data[] = array(s($answer->answer1)); // no html here, just plain text
if (!empty($question->options) && $answer->answer1 > 0) {
$answers = explode(',', get_string($question->options, 'survey'));
if ($answer->answer1 <= count($answers)) {
$table->data[] = array(s($answers[$answer->answer1 - 1])); // No html here, just plain text.
} else {
$table->data[] = array(s($answer->answer1)); // No html here, just plain text.
}
} else {
$table->data[] = array(s($answer->answer1)); // No html here, just plain text.
}
echo html_writer::table($table);
echo $OUTPUT->spacer(array('height'=>30));
}
Expand Down

0 comments on commit 156de65

Please sign in to comment.