Uploaded image for project: 'Moodle app'
  1. Moodle app
  2. MOBILE-2232

Decrease WebService calls in course list/overview

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3.2
    • Fix Version/s: 3.4.0
    • Component/s: Courses
    • Labels:
    • Testing Instructions:
      Hide
      1. In Moodle, create at least 2 courses and enrol some users in them. Enable and configure course completion for at least 1 course.
      2. In the app, open the Course Overview or My Courses.
      3. Open the Network tab from the inspector tools.
      4. Perform a PTR in the view. Check that only 3 WS calls are performed: get_users_courses, get_user_navigation_options and get_user_administration_options.
      5. Now click the kebab menu of a course that has completion enabled. Check that now another WS is called: core_completion_get_course_completion_status
      6. Now open any of the courses and perform a PTR in the section list. Check that only 3 WS calls are performed: core_course_get_contents and the options ones. Check that the options WS calls include all the user courses, not just the current one.
      7. Back in web, enable completion for a course that didn't have it.
      8. In the app, perform a PTR in the course list. After doing it, open the kebab menu of the modified course and check that now it displays the course completion option.
      Show
      In Moodle, create at least 2 courses and enrol some users in them. Enable and configure course completion for at least 1 course. In the app, open the Course Overview or My Courses. Open the Network tab from the inspector tools. Perform a PTR in the view. Check that only 3 WS calls are performed: get_users_courses , get_user_navigation_options and get_user_administration_options . Now click the kebab menu of a course that has completion enabled. Check that now another WS is called:  core_completion_get_course_completion_status .  Now open any of the courses and perform a PTR in the section list. Check that only 3 WS calls are performed:  core_course_get_contents and the options ones. Check that the options WS calls include all the user courses, not just the current one. Back in web, enable completion for a course that didn't have it. In the app, perform a PTR in the course list. After doing it, open the kebab menu of the modified course and check that now it displays the course completion option.
    • Affected Branches:
      MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Sprint:
      Moodle Mobile 3.4.0

      Description

      Right now when the course list or course overview is loaded we can perform a lot of WebService calls (at least 1 per course, core_completion_get_course_completion_status, but in older sites there can be several WS calls per course). We should try to improve this so these calls are only performed if the user clicks the kebab menu.

      Also, when the user performs a Pull To Refresh in one of these pages, we do 2 WebService calls per coursecore_course_get_user_navigation_options and core_course_get_user_administration_options. There should only be 1 call to each one of them with the whole list of courses. This happens because the handlers are reloaded when the data is invalidated (mmCoursesEventCourseOptionsInvalidated). Since this event is triggered before the controller has loaded the options for all the courses, each course loads its own options. 

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dpalou Dani Palou
              Reporter:
              dpalou Dani Palou
              Peer reviewer:
              Pau Ferrer
              Integrator:
              Juan Leyva
              Tester:
              Berta Maroto
              Participants:
              Component watchers:
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                30/Nov/17