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

Cache in the modules cminfo relevant information for the get_contents WS

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.6.3
    • Fix Version/s: 3.7
    • Component/s: Other
    • Labels:
    • Testing Instructions:
      Hide
      1. As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      2. Create a course in the site, enrolling one user as student
      3. Inside the course create an URL resource (link) pointing to https://www.google.com
      4. Create a Token in the mobile app service for the student you used in step 2
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      5. Open the console an execute this new curl request, replacing wstoken with the token you just created and the site url with yours. Replace the courseid with the course you created in step 2 (in bold and underlined).

        curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseid=3&wsfunction=core_course_get_contents&wstoken=3af67232a7596ceb658df4db329e5ad6&options[0][name]=excludecontents&options[0][value]=true' --compressed | python -m "json.tool"

      1. Check that you receive the URL resource information and that in the "customdata" field you see the link to google.com (note that the link may be escaped like http:\\/
        /www.google.com
      Show
      As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings Create a course in the site, enrolling one user as student Inside the course create an URL resource (link) pointing to https://www.google.com Create a Token in the mobile app service for the student you used in step 2 Click on Site administration ► Plugins ► Web services ► Manage tokens Open the console an execute this new curl request, replacing wstoken with the token you just created and the site url with yours. Replace the courseid with the course you created in step 2 (in bold and underlined). curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseid= 3 &wsfunction=core_course_get_contents&wstoken= 3af67232a7596ceb658df4db329e5ad6 &options [0] [name] =excludecontents&options [0] [value] =true' --compressed | python -m "json.tool" Check that you receive the URL resource information and that in the "customdata" field you see the link to google.com (note that the link may be escaped like http:\\/ /www.google.com
    • Affected Branches:
      MOODLE_36_STABLE
    • Fixed Branches:
      MOODLE_37_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-65024-master

      Description

      This issue is about performance: In order to avoid multiple calls to the core_course_get_contents WS to retrieve information required to build the main course view in an external cliente (like the Mobile app), some information should be cached via the get_coursemodule_info callback.

      Particulary:

      • For mod_url: The final full URL
      • For mod_lti: The external icon url (if any)

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  20/May/19

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours, 13 minutes
                  2h 13m