From 3eb89b9997ff865f024ff2b5765c63845f7414ed Mon Sep 17 00:00:00 2001 From: tjhunt Date: Wed, 14 Mar 2007 15:29:46 +0000 Subject: [PATCH] Notice when a student attempts a quiz, because there are no tabs to display. Merged from MOODLE_18_STABLE. --- lib/weblib.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/weblib.php b/lib/weblib.php index 9c083a3b19..f2b0b8848f 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -4973,6 +4973,13 @@ function redirect($url, $message='', $delay=-1, $adminroot = '') { $url = html_entity_decode($encodedurl); $surl = addslashes($url); +/// At developer debug level. Don't redirect if errors have been printed on screen. + $errorprinted = false; + if (debugging('', DEBUG_DEVELOPER) && $CFG->debugdisplay && error_get_last()) { + $errorprinted = true; + $message = "Error output, so disabling automatic redirect.

" . $message; + } + /// when no message and header printed yet, try to redirect if (empty($message) and !defined('HEADER_PRINTED')) { @@ -5015,14 +5022,15 @@ function redirect($url, $message='', $delay=-1, $adminroot = '') { } if (! defined('HEADER_PRINTED')) { // this type of redirect might not be working in some browsers - such as lynx :-( - print_header('', '', '', '', ''); + print_header('', '', '', '', $errorprinted ? '' : ('')); $delay += 3; // double redirect prevention, it was sometimes breaking upgrades before 1.7 } echo '

'; echo '

'. $message .'

'; echo '

( '. get_string('continue') .' )

'; echo '
'; -// it might be better not to set timeout the same for both types of redirect, so that we can be sure which one wins + + if (!$errorprinted) { ?>