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

Quiz lib.php perfomance issue

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.9.3
    • 1.9.4
    • Quiz
    • None
    • MOODLE_19_STABLE
    • MOODLE_19_STABLE

    Description

      lib.php file for quiz module requires questionlib.php. This is somewhat expensive operation, as questionlib.php in turn load code of all question types.

      Hovewer, lib.php contains many function, and only part of them really requires functions from questionlib. It's called from many places, so there are a number of cases where questionlib loading is unnecessary. One example is recent_activity block on the course page (which isn't very fast in itself), cron is another one where time is important, there may be quite a lot of such cases, these are just things I spotted first. I'd suggest moving

      require_once($CFG->libdir.'/questionlib.php');

      from global code to functions that actually use questionlib.

      Attachments

        Activity

          People

            timhunt Tim Hunt
            oa_sychev Oleg Sychev
            Tim Hunt, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              28/Jan/09