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

Course Completion report performs recursive db queries

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Note to tester: If this is integrated at the same time as MDL-31914, the test instructions for that bug should mostly cover testing here. Functionality should not change with implementation of this change, just reduced database query load.

      • Enable 'Completion Tracking' in the Site Administration -> Advanced Features page
      • In a course, choose Edit Settings, and under 'Student Progress' change Completion tracking to Enabled and save changed
      • In an activity, choose Edit settings and, under 'Activity Completion', change Completion tracking to 'Show activity as complete when conditions are met', tick the 'Require view' checkbox and save changed
      • Open Settings Block -> Course Administration -> Completion Tracking
        • Under 'Activites Completed' check the new activity you just enabled
        • save changed
      • Open Reports -> Course Completion
      • Confirm:
        • there are no errors
        • That the module meta-data is correct (e.g. name, id)

      Functionality should not have changed with this patch

      Show
      Note to tester: If this is integrated at the same time as MDL-31914 , the test instructions for that bug should mostly cover testing here. Functionality should not change with implementation of this change, just reduced database query load. Enable 'Completion Tracking' in the Site Administration -> Advanced Features page In a course, choose Edit Settings, and under 'Student Progress' change Completion tracking to Enabled and save changed In an activity, choose Edit settings and, under 'Activity Completion', change Completion tracking to 'Show activity as complete when conditions are met', tick the 'Require view' checkbox and save changed Open Settings Block -> Course Administration -> Completion Tracking Under 'Activites Completed' check the new activity you just enabled save changed Open Reports -> Course Completion Confirm: there are no errors That the module meta-data is correct (e.g. name, id) Functionality should not have changed with this patch
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-31918-master-2

      Description

      Line 581 of report/completion/index.php calls get_record inside two foreach loops.

      This could be better achieved with something more like:

      $modinfo = get_fast_modinfo($course);
       
      foreach ($progress as $user) {
        foreach($criteria as $criterion) {
          $activity = $modinfo->cms[$criterion->moduleinstance];
        }
      }

        Attachments

          Activity

            People

            • Assignee:
              dobedobedoh Andrew Nicols
              Reporter:
              dobedobedoh Andrew Nicols
              Peer reviewer:
              Dan Poltawski
              Integrator:
              Sam Hemelryk
              Tester:
              Jason Fowler
              Participants:
              Component watchers:
              Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón, Adrian Greeve, Mihail Geshoski, Peter Dias
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                14/May/12