diff -ur moodle_19_temp/lang/en_utf8/admin.php moodle_19/lang/en_utf8/admin.php
--- moodle_19_temp/lang/en_utf8/admin.php	2009-06-05 17:56:05.000000000 +0800
+++ moodle_19/lang/en_utf8/admin.php	2009-06-05 18:17:05.000000000 +0800
@@ -118,7 +118,7 @@
 $string['configenablerssfeeds'] = 'This switch will enable RSS feeds from across the site.  To actually see any change you will need to enable RSS feeds in the individual modules too - go to the Modules settings under Admin Configuration.';
 $string['configenablerssfeedsdisabled'] = 'It is not available because RSS feeds are disabled in all the Site. To enable them, go to the Variables settings under Admin Configuration.';
 $string['configenablerssfeedsdisabled2'] = 'RSS feeds are disabled at the server level. You need to enable them first in Server/RSS.';
-$string['configenablesafebrowserintegration'] = 'This settings enables the integration of a Safe Browser for the quiz in Moodle.';
+$string['configenablesafebrowserintegration'] = 'This adds the choice \'Require Safe Exam Browser\' to the \'Browser security\' field on the quiz settings form. See http://www.safeexambrowser.org/ for more information.';
 $string['configenablestats'] = 'If you choose \'yes\' here, Moodle\'s cronjob will process the logs and gather some statistics.  Depending on the amount of traffic on your site, this can take awhile. If you enable this, you will be able to see some interesting graphs and statistics about each of your courses, or on a sitewide basis.';
 $string['configenabletrusttext'] = 'By default Moodle will always thoroughly clean text that comes from users to remove any possible bad scripts, media etc that could be a security risk.  The Trusted Content system is a way of giving particular users that you trust the ability to include these advanced features in their content without interference.  To enable this system, you need to first enable this setting, and then grant the Trusted Content permission to a specific Moodle role.  Texts created or uploaded by such users will be marked as trusted and will not be cleaned before display.';
 $string['configenrolmentplugins'] = 'Please choose the enrolment plugins you wish to use. Don\'t forget to configure the settings properly.<br /><br />You have to indicate which plugins are enabled, and <strong>one</strong> plugin can be set as the default plugin for <em>interactive</em> enrolment. To disable interactive enrolment, set \"enrollable\" to \"No\" in required courses.';
@@ -358,7 +358,7 @@
 $string['enablehtmlpurifier'] = 'Enable HTML Purifier';
 $string['enablerecordcache'] = 'Enable Record Cache';
 $string['enablerssfeeds'] = 'Enable RSS feeds';
-$string['enablesafebrowserintegration'] = 'Enable Safe Browser';
+$string['enablesafebrowserintegration'] = 'Enable Safe Exam Browser integration';
 $string['enablestats'] = 'Enable statistics';
 $string['enabletrusttext'] = 'Enable Trusted Content';
 $string['encoding'] = 'Encoding';
Only in moodle_19/lang/en_utf8/help/quiz: browsersecurity.html
diff -ur moodle_19_temp/lang/en_utf8/help/quiz/CVS/Entries moodle_19/lang/en_utf8/help/quiz/CVS/Entries
--- moodle_19_temp/lang/en_utf8/help/quiz/CVS/Entries	2009-06-05 17:56:05.000000000 +0800
+++ moodle_19/lang/en_utf8/help/quiz/CVS/Entries	2009-06-05 18:18:11.000000000 +0800
@@ -38,7 +38,7 @@
 /overviewdownload.html/1.4/Tue Sep  2 03:49:39 2008/-kk/TMOODLE_19_STABLE
 /penalty.html/1.2/Tue Sep  2 03:49:39 2008//TMOODLE_19_STABLE
 /penaltyscheme.html/1.2/Tue Sep  2 03:49:39 2008//TMOODLE_19_STABLE
-/popup.html/1.3/Tue Sep  2 03:49:39 2008//TMOODLE_19_STABLE
+/popup.html/1.3/Fri Jun  5 10:18:02 2009//TMOODLE_19_STABLE
 /questiondatasets.html/1.2/Tue Sep  2 03:49:39 2008//TMOODLE_19_STABLE
 /questionsperpage.html/1.2/Tue Sep  2 03:49:39 2008//TMOODLE_19_STABLE
 /questiontext.html/1.2/Tue Sep  2 03:49:39 2008/-kk/TMOODLE_19_STABLE
diff -ur moodle_19_temp/lang/en_utf8/help/quiz/popup.html moodle_19/lang/en_utf8/help/quiz/popup.html
--- moodle_19_temp/lang/en_utf8/help/quiz/popup.html	2009-06-05 17:56:05.000000000 +0800
+++ moodle_19/lang/en_utf8/help/quiz/popup.html	2009-06-05 18:18:02.000000000 +0800
@@ -1,8 +1,8 @@
-<h1>Browser security</h1>
+<h1>Display in a "secure" window</h1>
 
-<p>1.) Full screen pop-up with added javascript security: the "secure" window tries to 
-   provide a little more security for quizzes (making copying and cheating more difficult) 
-   by restricting some of the things that students can do with their browsers.</p>
+<p>The "secure" window tries to provide a little more security for quizzes 
+   (making copying and cheating more difficult) by restricting some of the things
+   that students can do with their browsers.</p>
 
 <p>What happens is that:</p>
  <ul>
@@ -12,21 +12,6 @@
      <li>Some keyboard commands are prevented.</li>
  </ul>
 
-<p>2.) Require use of Safe Exam Browser (SEB): you can attend the quiz only with the 
-   Safe Exam Browser. The navigation in the quiz is disabled for the students. This 
-   option is savailable if the admin-setting "Enable Safe Browser" in 
-   "Miscellaneous" -> "Experimental" is checked. The <a href="http://www.safeexambrowser.org/" target="_blank">Safe Exam Browser</a> is a 
-   webbrowser-environment to carry out online-exams safely. The software changes any computer into a secure 
-   workstation. It regulates the access to any utilities and prevents students from using unauthorised resources.</p>
-<ul>
-     <li>Fullscreen mode (without any navigation elements).</li>
-	<li>Prohibits close or leave the window with the test (unless submitted)</li>
-   	<li>Disables shortcuts/keys as Win, Ctrl+Alt+Del, Alt+F4, F1, Ctrl+p, Printscreen, ...</li>
-   	<li>Disables right-click</li>
-   	<li>Disables switch to other applications (unless permitted)</li>
-   	<li>Prohibits surf the internet (unless permitted)</li>
- </ul>
-
 <p>NOTE: <b>This security is NOT watertight</b>. Do NOT rely on these protections 
    as your sole strategy.  It is impossible to implement complete protection 
    of quizzes in a web environment so please do not rely on this option if 
@@ -34,4 +19,4 @@
    try are to create really large databases of questions from which you 
    randomly choose questions, or even better, rethink your overall assessment 
    to put more value on constructive forms of activity such as forum discussions, 
-   glossary building, wiki writing, workshops, assignments etc.</p>
\ No newline at end of file
+   glossary building, wiki writing, workshops, assignments etc.</p>
diff -ur moodle_19_temp/lang/en_utf8/quiz.php moodle_19/lang/en_utf8/quiz.php
--- moodle_19_temp/lang/en_utf8/quiz.php	2009-06-05 17:56:05.000000000 +0800
+++ moodle_19/lang/en_utf8/quiz.php	2009-06-05 18:53:23.000000000 +0800
@@ -72,6 +72,7 @@
 $string['blackboard'] = 'Blackboard';
 $string['blackboard_6'] = 'Blackboard V6+';
 $string['braceerror'] = 'Could not find {...} around answers';
+$string['browsersecurity'] = 'Browser security';
 $string['bothattempts'] = 'Show students with and without attempts';
 $string['calculated'] = 'Calculated';
 $string['calculatedquestion'] = 'Calculated Question not supported at line $a. The question will be ignored';
@@ -397,10 +398,10 @@
 $string['penaltyscheme'] = 'Apply penalties';
 $string['percentcorrect'] = 'Percent Correct';
 $string['pleaseclose'] = 'Your request has been processed. You can now close this window';
-$string['popup'] = 'Browser security';
+$string['popup'] = 'Show quiz in a &quot;secure&quot; window';
 $string['popupblockerwarning'] = 'This section of the test is in secure mode, this means that you need to take the quiz in a secure window. Please turn off your popup blocker. Thank you.';
 $string['popupnotice'] = 'Students will see this quiz in a secure window';
-$string['popupwithjavascriptsupport'] = 'Full screen pop-up with added javascript security';
+$string['popupwithjavascriptsupport'] = 'Full screen pop-up with some JavaScript security';
 $string['preview'] = 'Preview';
 $string['previewquestion'] = 'Preview question';
 $string['previewquiz'] = 'Preview $a';
@@ -486,7 +487,7 @@
 $string['reportsimplestat'] = 'Simple statistics';
 $string['requirepassword'] = 'Require password';
 $string['requirepasswordmessage'] = 'To attempt this quiz you need to know the quiz password';
-$string['requiresafeexambrowser'] = 'Require use of Safe Exam Browser (SEB)';
+$string['requiresafeexambrowser'] = 'Require the use of Safe Exam Browser';
 $string['requiresubnet'] = 'Require network address';
 $string['response'] = 'Response';
 $string['responses'] = 'Responses';
@@ -508,8 +509,8 @@
 $string['reviewresponsetoq'] = 'Review response (question $a)';
 $string['rqp'] = 'Remote Question';
 $string['rqps'] = 'Remote Questions';
-$string['safebrowseravailable']='Safe quiz: Only available with Safe Browser.';
-$string['safebrowsererror']='You are not allowed to attend to quiz. <br />You need a safe browser.';
+$string['safebrowsererror']='This quiz has been set up so that it may only be attempted using the Safe Exam Browser. You cannot attempt it form this web browser.';
+$string['safebrowsernotice']='This quiz has been configured so that students may only attempt it using the Safe Exam Browser.';
 $string['save'] = 'Save';
 $string['saveandedit'] = 'Save changes and edit questions';
 $string['savedfromdeletedcourse'] = 'Saved from deleted course \"$a\"';
diff -ur moodle_19_temp/mod/quiz/attempt.php moodle_19/mod/quiz/attempt.php
--- moodle_19_temp/mod/quiz/attempt.php	2009-06-05 17:56:05.000000000 +0800
+++ moodle_19/mod/quiz/attempt.php	2009-06-05 18:57:28.000000000 +0800
@@ -88,10 +88,10 @@
     if (!empty($quiz->attempts) and $numberofpreviousattempts >= $quiz->attempts) {
         print_error('nomoreattempts', 'quiz', "view.php?id={$cm->id}");
     }
-    
-// Check safe browser
+
+/// Check safe browser
     if (!$ispreviewing && $quiz->popup == 2 && !quiz_check_safe_browser()) {
-    	 print_error("safebrowsererror", "quiz", "view.php?id={$cm->id}");
+        print_error('safebrowsererror', 'quiz', "view.php?id={$cm->id}");
     }
 
 /// Check subnet access
@@ -417,12 +417,12 @@
     require_js($CFG->wwwroot . '/mod/quiz/quiz.js');
     $pagequestions = explode(',', $pagelist);
     $headtags = get_html_head_contributions($pagequestions, $questions, $states);
-    if (!$ispreviewing && $quiz->popup == 1) {
+    if (!$ispreviewing && $quiz->popup) {
         define('MESSAGE_WINDOW', true);  // This prevents the message window coming up
         print_header($course->shortname.': '.format_string($quiz->name), '', '', '', $headtags, false, '', '', false, ' class="securewindow"');
-        include('protect_js.php');
-    } elseif (!$ispreviewing && $quiz->popup == 2) {
-	    print_header($course->shortname.': '.format_string($quiz->name), '', '', '', $headtags, false, '', '', false, ' class="securewindow"');
+        if ($quiz->popup == 1) {
+            include('protect_js.php');
+        }
     } else {
         $strupdatemodule = has_capability('moodle/course:manageactivities', $coursecontext)
                     ? update_module_button($cm->id, $course->id, get_string('modulename', 'quiz'))
@@ -446,8 +446,10 @@
         print_single_button($CFG->wwwroot.'/mod/quiz/attempt.php', $buttonoptions, get_string('startagain', 'quiz'));
         echo '</div>';
     /// Notices about restrictions that would affect students.
-        if ($quiz->popup==1) {
+        if ($quiz->popup == 1) {
             notify(get_string('popupnotice', 'quiz'));
+        } else if ($quiz->popup == 2) {
+            notify(get_string('safebrowsernotice', 'quiz'));
         }
         if ($timestamp < $quiz->timeopen || ($quiz->timeclose && $timestamp > $quiz->timeclose)) {
             notify(get_string('notavailabletostudents', 'quiz'));
diff -ur moodle_19_temp/mod/quiz/config.html moodle_19/mod/quiz/config.html
--- moodle_19_temp/mod/quiz/config.html	2009-06-05 17:56:05.000000000 +0800
+++ moodle_19/mod/quiz/config.html	2009-06-08 17:18:44.000000000 +0800
@@ -291,17 +291,17 @@
 </tr>
 
 <tr valign="top">
-  <td align="right"><b><?php print_string("popup", "quiz") ?>:</b></td>
+  <td align="right"><b><?php print_string('browsersecurity', 'quiz') ?>:</b></td>
   <td>
     <?php
-	    $browseroptions = array(
-    	    0 => get_string('none', 'quiz'),
-        	1 => get_string('popupwithjavascriptsupport', 'quiz'));
-		if ($CFG->enablesafebrowserintegration) { 
-        	$options[2] = get_string('requiresafeexambrowser', 'quiz');
-		}
-       choose_from_menu ($browseroptions, "popup", $form->popup, "", "", "");
-       helpbutton("popup", get_string("popup","quiz"), "quiz");
+        $browseroptions = array(
+                0 => get_string('none', 'quiz'),
+                1 => get_string('popupwithjavascriptsupport', 'quiz'));
+        if ($CFG->enablesafebrowserintegration) { 
+            $browseroptions[2] = get_string('requiresafeexambrowser', 'quiz');
+        }
+        choose_from_menu ($browseroptions, 'popup', $form->popup, '', '', '');
+        helpbutton('browsersecurity', get_string('browsersecurity', 'quiz'), 'quiz');
     ?>
   </td>
   <td align="center">
diff -ur moodle_19_temp/mod/quiz/locallib.php moodle_19/mod/quiz/locallib.php
--- moodle_19_temp/mod/quiz/locallib.php	2009-06-05 17:56:05.000000000 +0800
+++ moodle_19/mod/quiz/locallib.php	2009-06-05 19:02:26.000000000 +0800
@@ -929,9 +929,7 @@
  * @return true, if browser is safe browser else false
  */
 function quiz_check_safe_browser() {
-    if (strpos($_SERVER['HTTP_USER_AGENT'], "SEB")) {
-    	 return true;
-    }
-    return false;
+    return strpos($_SERVER['HTTP_USER_AGENT'], "SEB") !== false;
 }
+
 ?>
\ No newline at end of file
diff -ur moodle_19_temp/mod/quiz/mod_form.php moodle_19/mod/quiz/mod_form.php
--- moodle_19_temp/mod/quiz/mod_form.php	2009-06-05 17:56:05.000000000 +0800
+++ moodle_19/mod/quiz/mod_form.php	2009-06-05 19:01:41.000000000 +0800
@@ -197,11 +197,11 @@
         $options = array(
                     0 => get_string('none', 'quiz'),
                     1 => get_string('popupwithjavascriptsupport', 'quiz'));
-		if ($CFG->enablesafebrowserintegration) { 
-        	$options[2] = get_string('requiresafeexambrowser', 'quiz');
-		}
-        $mform->addElement('select', 'popup', get_string("popup", "quiz"), $options);
-        $mform->setHelpButton('popup', array("popup", get_string("popup", "quiz"), "quiz"));
+        if ($CFG->enablesafebrowserintegration) { 
+            $options[2] = get_string('requiresafeexambrowser', 'quiz');
+        }
+        $mform->addElement('select', 'popup', get_string('browsersecurity', 'quiz'), $options);
+        $mform->setHelpButton('popup', array('browsersecurity', get_string('browsersecurity', 'quiz'), 'quiz'));
         $mform->setAdvanced('popup', $CFG->quiz_fix_popup);
         $mform->setDefault('popup', $CFG->quiz_popup);
 
diff -ur moodle_19_temp/mod/quiz/review.php moodle_19/mod/quiz/review.php
--- moodle_19_temp/mod/quiz/review.php	2009-06-05 17:56:05.000000000 +0800
+++ moodle_19/mod/quiz/review.php	2009-06-05 19:04:11.000000000 +0800
@@ -123,14 +123,13 @@
 
 /// Print the page header
     $pagequestions = explode(',', $pagelist);
-    $headtags = get_html_head_contributions($pagequestions, $questions, $states);  
-    if (!$isteacher && $quiz->popup == 1) {
+    $headtags = get_html_head_contributions($pagequestions, $questions, $states);
+    if (!$ispreviewing && $quiz->popup) {
         define('MESSAGE_WINDOW', true);  // This prevents the message window coming up
         print_header($course->shortname.': '.format_string($quiz->name), '', '', '', $headtags, false, '', '', false, '');
-        /// Include Javascript protection for this page
-        include('protect_js.php');
-    } elseif (!$isteacher && $quiz->popup == 2) {
-	    print_header($course->shortname.': '.format_string($quiz->name), '', '', '', $headtags, false, '', '', false, '');
+        if ($quiz->popup == 1) {
+            include('protect_js.php');
+        }
     } else {
         $strupdatemodule = has_capability('moodle/course:manageactivities', $coursecontext)
                     ? update_module_button($cm->id, $course->id, get_string('modulename', 'quiz'))
diff -ur moodle_19_temp/mod/quiz/view.php moodle_19/mod/quiz/view.php
--- moodle_19_temp/mod/quiz/view.php	2009-06-05 17:56:05.000000000 +0800
+++ moodle_19/mod/quiz/view.php	2009-06-05 19:08:37.000000000 +0800
@@ -344,9 +344,6 @@
 
     } else if ($available && $moreattempts) {
         echo "<br />";
-        if ($quiz->popup == 2) {
-            echo '<p style="text-align:center; color:red">'.get_string("safebrowseravailable", "quiz").'</p>';
-    	}
         echo "<div class=\"quizattempt\">";
 
         if ($unfinished) {
@@ -408,7 +405,7 @@
             $attempturl = "attempt.php?id=$cm->id";
 
             // Prepare options depending on whether the quiz should be a popup.
-            if (!empty($quiz->popup) && $quiz->popup==1) {
+            if ($quiz->popup == 1) {
                 $window = 'quizpopup';
                 $windowoptions = "left=0, top=0, height='+window.screen.height+', " .
                         "width='+window.screen.width+', channelmode=yes, fullscreen=yes, " .
@@ -424,7 +421,9 @@
                     echo "if (confirm('".addslashes_js($strconfirmstartattempt)."')) ";
                 }
                 echo "window.open('$attempturl','$window','$windowoptions');", '" />';
-            } else {
+            } else if ($quiz->popup == 2 && !quiz_check_safe_browser()) {
+                notify(get_string('safebrowsererror', 'quiz'));
+            }else {
                 print_single_button("attempt.php", array('id'=>$cm->id), $buttontext, 'get', '', false, '', false, $strconfirmstartattempt);
             }
 
@@ -486,7 +485,7 @@
     }
 
     $url = "review.php?q=$quiz->id&amp;attempt=$attempt->id";
-    if ($quiz->popup==1) {
+    if ($quiz->popup == 1) {
         $windowoptions = "left=0, top=0, channelmode=yes, fullscreen=yes, scrollbars=yes, resizeable=no, directories=no, toolbar=no, titlebar=no, location=no, status=no, menubar=no";
         return link_to_popup_window('/mod/quiz/' . $url, 'quizpopup', $linktext, '+window.screen.height+', '+window.screen.width+', '', $windowoptions, true);
     } else {

