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

get_course_progress_percentage is too slow

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.5.4, 3.6.2
    • Fix Version/s: 3.5.5, 3.6.3
    • Component/s: Web Services
    • Labels:
    • Affected Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE
    • Fixed Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE
    • Pull Master Branch:
      MDL-64889_master
    • Testing Instructions:
      Hide
      1. Create a course with 5 course modules, each with manual completion enabled.
      2. Enrol a user on the course
      3. Log in as the user, go to the course and tick 2 checkboxes
      4. Go to the Dashboard (/my)
      5. Find the course in the My Overview block
        • Confirm that the progress for the block shows 40%
      Show
      Create a course with 5 course modules, each with manual completion enabled. Enrol a user on the course Log in as the user, go to the course and tick 2 checkboxes Go to the Dashboard (/my) Find the course in the My Overview block Confirm that the progress for the block shows 40%

      Description

      Related to MDL-64886, another issue we have found as part of the enrol_get_users_courses webservice is that get_course_progress_percentage can take a long time (as much as 13 seconds on our larger courses, between 0.5 and 1 seconds on our typical courses).  It doesn't take many of these to hit the 30s timeout from the app's webservice calls.

      Fortunately, this appears to be an easy fix.  The call to $completion->get_data() in /completion/classes/progress.php has the wholecourse argument set to "false" even though its looping over every module on the course. Setting this to "true" appears to do the job.

        Attachments

          Activity

            People

            Assignee:
            marxjohnson Mark Johnson
            Reporter:
            marxjohnson Mark Johnson
            Peer reviewer:
            Sam Marshall Sam Marshall
            Integrator:
            Andrew Lyons Andrew Lyons
            Tester:
            Anna Carissa Sadia Anna Carissa Sadia
            Participants:
            Component watchers:
            Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              11/Mar/19

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 50 minutes
                1h 50m