MDL-14492 Provide feedback to user about redirect delay in loadsco.php. backport to 1.9.

This commit is contained in:
piers
2008-08-10 22:33:49 +00:00
parent eb8fa0ce5c
commit c0b72b725c
3 changed files with 20 additions and 6 deletions
+1 -1
View File
@@ -156,5 +156,5 @@ $string['unziperror'] = 'An error occurs during package unzip';
$string['othersettings'] = 'Additional settings';
$string['updatefreq'] = 'Auto-update frequency';
$string['options'] = 'Options';
$string['activityloading'] = "You will be automatically redirected to the activity in"; // used in conjunction with numseconds
?>
+19 -5
View File
@@ -112,20 +112,34 @@
$result = get_file_url($scorm->course .'/'. $basedir .'/'. $launcher);
}
}
$scormpixdir = $CFG->modpixpath.'/scorm/pix';
?>
<html>
<head>
<title>LoadSCO</title>
<script type="text/javascript">
//<![CDATA[
setTimeout('document.location = "<?php echo $result ?>";',<?php echo $delayseconds ?>000);
//]]>
function doredirect() {
var e = document.getElementById("countdown");
var cSeconds = parseInt(e.innerHTML);
var timer = setInterval(function() {
if( cSeconds ) {
e.innerHTML = --cSeconds;
} else {
clearInterval(timer);
document.body.innerHTML = "Activity loading, please wait ....";
location = "<?php echo $result ?>";
}
}, 1000);
}
//]]>
</script>
<noscript>
<meta http-equiv="refresh" content="<?php echo $delayseconds ?>;url=<?php echo $result ?>" />
</noscript>
</head>
<body>
&nbsp;
</body>
<body onload="doredirect();">
<p><?php echo get_string('activityloading', 'scorm');?> <span id="countdown"><?php echo $delayseconds ?></span> <?php echo get_string('numseconds');?>. &nbsp; <img src='<?php echo $scormpixdir;?>/wait.gif'><p>
</body>
</html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB