Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-14492

Provide feedback to user about redirect delay in loadsco.php

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8.5
    • Fix Version/s: 1.8.7, 1.9.3, 2.0
    • Component/s: SCORM
    • Labels:
      None
    • Affected Branches:
      MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE, MOODLE_20_STABLE

      Description

      At the moment when a user opens a piece of content there is a 2 second delay in the loadsco.php page to allow API's etc to start, however there is no notification of this to the user so they may repeatedly click to launch course.

      I suggest an enhancement to the .mod/scorm/loadsco.php to include a message and countdown timer.

      Change the HTML at the end of the page to this:

      <html>
      <head>
      <title>LoadSCO</title>
      <script type="text/javascript">
      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 = "Redirecting...."; location = "<?php echo $result ?>"; }

      }, 1000);
      }
      //<![CDATA[
      //setTimeout('document.location = "<?php echo $result ?>";',<?php echo $delayseconds ?>000);
      //]]>
      </script>
      <noscript>
      <meta http-equiv="refresh" content="<?php echo $delayseconds ?>;url=<?php echo $result ?>" />
      </noscript>
      </head>
      <body onload="doredirect();">
      <p>You will be automatically redirected to the content in <span id="COUNTDOWN"><?php echo $delayseconds ?></span> second(s).<p>
      </body>
      </html>

      Will provide messaging and for JavaScript enabled browsers it will actually countdown the time.

        Attachments

        1. MDL-14492-head.patch
          1 kB
          Piers Harding
        2. MDL-14492-head2.patch
          1 kB
          Piers Harding

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  15/Oct/08