diff --git a/mod/choice/lib.php b/mod/choice/lib.php index 5d4f71712aa..6a54b276562 100644 --- a/mod/choice/lib.php +++ b/mod/choice/lib.php @@ -375,21 +375,23 @@ function choice_show_results($choice, $course, $cm, $allresponses, $forcepublish } echo ""; - if ($choice->showunanswered && !empty($allresponses[0])) { + if ($choice->showunanswered) { echo ""; // added empty row so that when the next iteration is empty, // we do not get
erro from w3c validator // MDL-7861 echo ""; - foreach ($allresponses[0] as $user) { - echo ""; - echo ""; + if (!empty($allresponses[0])) { + foreach ($allresponses[0] as $user) { + echo ""; + echo ""; + } } echo "
"; - print_user_picture($user->id, $course->id, $user->picture); - echo ""; - echo "wwwroot/user/view.php?id=$user->id&course=$course->id\">"; - echo fullname($user, $hascapfullnames); - echo ""; - echo "
"; + print_user_picture($user->id, $course->id, $user->picture); + echo ""; + echo "wwwroot/user/view.php?id=$user->id&course=$course->id\">"; + echo fullname($user, $hascapfullnames); + echo ""; + echo "
"; }