From: tjhunt Date: Wed, 14 Mar 2007 15:29:46 +0000 (+0000) Subject: Notice when a student attempts a quiz, because there are no tabs to display. Merged... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=3eb89b9997ff865f024ff2b5765c63845f7414ed;p=moodle.git Notice when a student attempts a quiz, because there are no tabs to display. Merged from MOODLE_18_STABLE. --- 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) { ?>