]> git.mjollnir.org Git - moodle.git/commitdiff
eliminate this nasty JavaScript that prints the button.
authorpichetp <pichetp>
Tue, 5 Jun 2007 15:28:03 +0000 (15:28 +0000)
committerpichetp <pichetp>
Tue, 5 Jun 2007 15:28:03 +0000 (15:28 +0000)
mod/quiz/view.php

index a59f9f2531b0c521d078caaf610735f5aec9ed34..778208d05d5d80e10b08644367edabccd658924b 100644 (file)
                 if (!empty($CFG->usesid) && !isset($_COOKIE[session_name()])) {
                     $attempturl = sid_process_url($attempturl);
                 }
-
-                // TODO eliminate this nasty JavaScript that prints the button.
-?>
-<script type="text/javascript">
-//<![CDATA[
-document.write('<input type="button" value="<?php echo $buttontext ?>" onclick="javascript: <?php
+                
+                echo '<input type="button" value="'.$buttontext.'" onclick="javascript:';
                 if ($strconfirmstartattempt) {
                     echo "if (confirm(\\'".addslashes_js($strconfirmstartattempt)."\\'))";
-                }
-?> window.open(\'<?php echo $attempturl ?>\', \'<?php echo $window ?>\', \'<?php echo $windowoptions ?>\'); " />');
-//]]>
-</script>
+                } 
+               echo " window.open('$attempturl','$window','$windowoptions'); ".' " />';   
+
+?>
 <noscript>
 <div>
     <?php print_heading(get_string('noscript', 'quiz')); ?>
 </div>
 </noscript>
-<?php
+<?php 
             }
 
             echo "</div>\n";