]> git.mjollnir.org Git - moodle.git/commitdiff
Fix up XHTML strick breakage introduce during the fix for MDL-13478.
authortjhunt <tjhunt>
Tue, 19 Aug 2008 05:17:07 +0000 (05:17 +0000)
committertjhunt <tjhunt>
Tue, 19 Aug 2008 05:17:07 +0000 (05:17 +0000)
mod/choice/lib.php

index 4225e9a159ab8e52c232f8346d14bfd0e739678f..bafb5ef8483c665736829db0863cb81c31d1797d 100644 (file)
@@ -350,11 +350,13 @@ function choice_show_results($choice, $course, $cm, $allresponses, $forcepublish
     $viewresponses = has_capability('mod/choice:readresponses', $context);
     switch ($forcepublish) {
         case CHOICE_PUBLISH_NAMES:
-                echo '<div id="tablecontainer">';
-                echo '<form id="attemptsform" method="post" action="'.$_SERVER['PHP_SELF'].'" onsubmit="var menu = document.getElementById(\'menuaction\'); return (menu.options[menu.selectedIndex].value == \'delete\' ? \''.addslashes_js(get_string('deleteattemptcheck','quiz')).'\' : true);">';
+            echo '<div id="tablecontainer">';
+            if ($viewresponses) {
+                echo '<form id="attemptsform" method="post" action="'.$_SERVER['PHP_SELF'].'" onsubmit="var menu = document.getElementById(\'menuaction\'); return (menu.options[menu.selectedIndex].value == \'delete\' ? \''.addslashes(get_string('deleteattemptcheck','quiz')).'\' : true);">';
                 echo '<div>';
                 echo '<input type="hidden" name="id" value="'.$cm->id.'" />';
                 echo '<input type="hidden" name="mode" value="overview" />';
+            }
 
             echo "<table cellpadding=\"5\" cellspacing=\"10\" class=\"results names\">";
             echo "<tr>";
@@ -462,9 +464,9 @@ function choice_show_results($choice, $course, $cm, $allresponses, $forcepublish
                 echo '</td><td></td></tr>';
             }
 
-            echo "</table>";
+            echo "</table></div>";
             if ($viewresponses) {
-                echo "</div></form></div>";
+                echo "</form></div>";
             }
             break;