Index: attempt.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/quiz/attempt.php,v retrieving revision 1.131.2.17 diff -u -r1.131.2.17 attempt.php --- attempt.php 30 Sep 2009 10:58:03 -0000 1.131.2.17 +++ attempt.php 3 Dec 2009 18:50:05 -0000 @@ -25,6 +25,7 @@ $finishattempt = optional_param('finishattempt', 0, PARAM_BOOL); $timeup = optional_param('timeup', 0, PARAM_BOOL); // True if form was submitted by timer. $forcenew = optional_param('forcenew', false, PARAM_BOOL); // Teacher has requested new preview + $previewasstudent = optional_param('previewasstudent', 0, PARAM_BOOL); // Teacher has requested preview as student if ($id) { if (! $cm = get_coursemodule_from_id('quiz', $id)) { @@ -77,7 +78,7 @@ $strattemptnum = get_string('attempt', 'quiz', $attemptnumber); $strquizzes = get_string("modulenameplural", "quiz"); - $popup = $quiz->popup && !$ispreviewing; // Controls whether this is shown in a javascript-protected window or with a safe browser. + $popup = $quiz->popup && (!$ispreviewing || $previewasstudent); // Controls whether this is shown in a javascript-protected window or with a safe browser. /// We intentionally do not check open and close times here. Instead we do it lower down. /// This is to deal with what happens when someone submits close to the exact moment when the quiz closes. @@ -417,7 +418,7 @@ require_js($CFG->wwwroot . '/mod/quiz/quiz.js'); $pagequestions = explode(',', $pagelist); $headtags = get_html_head_contributions($pagequestions, $questions, $states); - if (!$ispreviewing && $quiz->popup) { + if ($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"'); if ($quiz->popup == 1) { @@ -434,7 +435,7 @@ echo '
'; // for overlib // Print the quiz name heading and tabs for teacher, etc. - if ($ispreviewing) { + if ($ispreviewing && !$previewasstudent) { $currenttab = 'preview'; include('tabs.php'); @@ -468,7 +469,7 @@ // Start the form $quiz->thispageurl = $CFG->wwwroot . '/mod/quiz/attempt.php?q=' . s($quiz->id) . '&page=' . s($page); $quiz->cmid = $cm->id; - echo '