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

WebService core_enrol_get_users_courses should return the timemodified field so the app can apply the same sortening for starred courses

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Minor
    • 4.0
    • 4.0
    • Web Services
    • MOODLE_400_STABLE
    • MOODLE_400_STABLE
    • MDL-73084-master
    • Hide
      Test
      1. As an admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      2. Create a new course
      3. Enrol one user as student in the course
      4. Create a Token in the mobile app service for the student account created in the previous step
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      5. Open the console and execute this new curl request, replacing wstoken with the token you just created and the site URL with yours. Replace also the USERID with the student user id in the database

        curl 'http://SITE_URL/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=core_enrol_get_users_courses&wstoken=WSTOKEN&userid=USERID' --compressed | python -m "json.tool"

      6. Confirm that:
        • In the curl request response you see the course the user is enrolled, including a field "timemodified"
      7. Copy somewhere the value of the field
      8. As site admin, login to the site, edit the course created in step 2 settings and change the course name (remember to Save changes)
      9. Execute again the previous CURL request and confirm that
        • The timemodified field value is different from the one you copied, it should be higher and represent a current timestamp (you can use this tool https://www.epochconverter.com/ to convert a timestamp to human date)
      Show
      Test As an admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings Create a new course Enrol one user as student in the course Create a Token in the mobile app service for the student account created in the previous step Click on Site administration ► Plugins ► Web services ► Manage tokens Open the console and execute this new curl request, replacing wstoken with the token you just created and the site URL with yours. Replace also the USERID with the student user id in the database curl 'http://SITE_URL/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=core_enrol_get_users_courses&wstoken=WSTOKEN&userid=USERID' --compressed | python -m "json.tool" Confirm that: In the curl request response you see the course the user is enrolled, including a field "timemodified" Copy somewhere the value of the field As site admin, login to the site, edit the course created in step 2 settings and change the course name (remember to Save changes) Execute again the previous CURL request and confirm that The timemodified field value is different from the one you copied, it should be higher and represent a current timestamp (you can use this tool https://www.epochconverter.com/ to convert a timestamp to human date)

    Description

      WebService core_enrol_get_users_courses should return the timemodified field so the app can apply the same sortening for starred courses.

      Attachments

        Issue Links

          Activity

            People

              jleyva Juan Leyva
              jleyva Juan Leyva
              Pau Ferrer Pau Ferrer
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Angelia Dela Cruz Angelia Dela Cruz
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                19/Apr/22

                Time Tracking

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