mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
MDL-18092 - better checking for empty vars when no users are in course. wrong place for empty check!
This commit is contained in:
parent
9acb770082
commit
82ab7cb535
1 changed files with 12 additions and 10 deletions
|
@ -379,21 +379,23 @@ function choice_show_results($choice, $course, $cm, $allresponses, $forcepublish
|
||||||
}
|
}
|
||||||
echo "</tr><tr>";
|
echo "</tr><tr>";
|
||||||
|
|
||||||
if ($choice->showunanswered && !empty($allresponses[0])) {
|
if ($choice->showunanswered) {
|
||||||
echo "<td class=\"col$count data\" >";
|
echo "<td class=\"col$count data\" >";
|
||||||
// added empty row so that when the next iteration is empty,
|
// added empty row so that when the next iteration is empty,
|
||||||
// we do not get <table></table> erro from w3c validator
|
// we do not get <table></table> erro from w3c validator
|
||||||
// MDL-7861
|
// MDL-7861
|
||||||
echo "<table class=\"choiceresponse\"><tr><td></td></tr>";
|
echo "<table class=\"choiceresponse\"><tr><td></td></tr>";
|
||||||
foreach ($allresponses[0] as $user) {
|
if (!empty($allresponses[0])) {
|
||||||
echo "<tr>";
|
foreach ($allresponses[0] as $user) {
|
||||||
echo "<td class=\"picture\">";
|
echo "<tr>";
|
||||||
print_user_picture($user->id, $course->id, $user->picture);
|
echo "<td class=\"picture\">";
|
||||||
echo "</td><td class=\"fullname\">";
|
print_user_picture($user->id, $course->id, $user->picture);
|
||||||
echo "<a href=\"$CFG->wwwroot/user/view.php?id=$user->id&course=$course->id\">";
|
echo "</td><td class=\"fullname\">";
|
||||||
echo fullname($user, $hascapfullnames);
|
echo "<a href=\"$CFG->wwwroot/user/view.php?id=$user->id&course=$course->id\">";
|
||||||
echo "</a>";
|
echo fullname($user, $hascapfullnames);
|
||||||
echo "</td></tr>";
|
echo "</a>";
|
||||||
|
echo "</td></tr>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
echo "</table></td>";
|
echo "</table></td>";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue