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

Return the module intro/summary file area files in the get_mods_by_courses WS

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.1
    • 3.2
    • Web Services
    • MOODLE_31_STABLE
    • MOODLE_32_STABLE
    • MDL-54951-master
    • Hide
      1. Create a new course
      2. Create a new assignment, book, chat, database, glossary, IMSCP, LTI, external tool, quiz, SCORM, survey, wiki activity (maybe you can use a backup of the Moodle features demo course)
      3. In each activity/resource edit the summary adding a couple of files (images or embedded videos)
      4. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile
      5. Create a Token for one user enrolled in the course:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      6. Next, you can do a CURL REST call simulating a WS client with the user.
        • You need to replace the wstoken, courseid and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseids%5B0%5D=4&wsfunction=mod_forum_get_forums_by_courses&wstoken=ffbe3a3002f235bf9d01fd9369e10b66&moodlewssettingfilter=true' | python -m "json.tool"

      7. You need to execute that CURL request for each activity (replacing the wsfunction value with.. mod_chat_get_chats_by_courses, mod_quiz_get_quizzes_by_courses, etc...) and check that a "infofiles" field containing all the files you added in the description is returned.
      Show
      Create a new course Create a new assignment, book, chat, database, glossary, IMSCP, LTI, external tool, quiz, SCORM, survey, wiki activity (maybe you can use a backup of the Moodle features demo course) In each activity/resource edit the summary adding a couple of files (images or embedded videos) As admin, enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token for one user enrolled in the course: Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the user. You need to replace the wstoken, courseid and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseids%5B0%5D=4&wsfunction=mod_forum_get_forums_by_courses&wstoken=ffbe3a3002f235bf9d01fd9369e10b66&moodlewssettingfilter=true' | python -m "json.tool" You need to execute that CURL request for each activity (replacing the wsfunction value with.. mod_chat_get_chats_by_courses, mod_quiz_get_quizzes_by_courses, etc...) and check that a "infofiles" field containing all the files you added in the description is returned.

    Description

      We need the list of files (including size) in all the file areas associated with the module, in some cases like quiz there will be two file areas (info/summary and feedback)

      Attachments

        Issue Links

          Activity

            People

              jleyva Juan Leyva
              jleyva Juan Leyva
              Pau Ferrer Pau Ferrer
              Andrew Lyons Andrew Lyons
              Jake Dallimore Jake Dallimore
              Juan Leyva, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                5/Dec/16