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

Cache in the modules cminfo relevant information for the get_contents WS

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.7
    • 3.6.3
    • Other
    • MOODLE_36_STABLE
    • MOODLE_37_STABLE
    • MDL-65024-master
    • 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

      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)

            jleyva Juan Leyva
            jleyva Juan Leyva
            Dani Palou Dani Palou
            Adrian Greeve Adrian Greeve
            Janelle Barcega Janelle Barcega
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.