MDL-18092 - better checking for empty vars when no users are in course. wrong place for empty check!

This commit is contained in:
danmarsden 2009-02-09 09:33:50 +00:00
parent 9acb770082
commit 82ab7cb535

View file

@ -379,12 +379,13 @@ function choice_show_results($choice, $course, $cm, $allresponses, $forcepublish
}
echo "</tr><tr>";
if ($choice->showunanswered && !empty($allresponses[0])) {
if ($choice->showunanswered) {
echo "<td class=\"col$count data\" >";
// added empty row so that when the next iteration is empty,
// we do not get <table></table> erro from w3c validator
// MDL-7861
echo "<table class=\"choiceresponse\"><tr><td></td></tr>";
if (!empty($allresponses[0])) {
foreach ($allresponses[0] as $user) {
echo "<tr>";
echo "<td class=\"picture\">";
@ -395,6 +396,7 @@ function choice_show_results($choice, $course, $cm, $allresponses, $forcepublish
echo "</a>";
echo "</td></tr>";
}
}
echo "</table></td>";
}
$count = 0;