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

New Web Service mod_imscp_get_imscps_by_courses

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Note: Version numbers are bumped because a new web service is added into the Mobile app service and also in a module.

      1. Create a course with a teacher and a student.
      2. Create a couple of IMSCP activities. Hide one of the activities.
      3. Enable "Mobile services": Plugins ► Web Services ► Mobile
      4. Create a Token for the teacher and the student
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      5. Next, you can do a couple of CURL REST call simulating a WS client with the teacher and the student user .
        • You need to replace the wstoken and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=mod_imscp_get_imscps_by_courses&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' --compressed | python -m "json.tool"

      6. Confirm that
        • As student you only see the visible IMSCP activity, and you see all the IMSCP configuration settings except the one reserved for managers (like section, visible, groupmode)
        • As a teacher you see all the IMSCP activities and all the settings
      7. If you specify a valid course id you should receive your courses also, (replace courseids..5 with a valid number in this request)

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

      8. If you use a course id where you are not enrolled, you will receive a warning No access rights in course context
      Show
      Note: Version numbers are bumped because a new web service is added into the Mobile app service and also in a module. Create a course with a teacher and a student. Create a couple of IMSCP activities. Hide one of the activities. Enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token for the teacher and the student Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a couple of CURL REST call simulating a WS client with the teacher and the student user . You need to replace the wstoken and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=mod_imscp_get_imscps_by_courses&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' --compressed | python -m "json.tool" Confirm that As student you only see the visible IMSCP activity, and you see all the IMSCP configuration settings except the one reserved for managers (like section, visible, groupmode) As a teacher you see all the IMSCP activities and all the settings If you specify a valid course id you should receive your courses also, (replace courseids..5 with a valid number in this request) curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseids%5B0%5D=5&wsfunction=mod_imscp_get_imscps_by_courses&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' --compressed | python -m "json.tool" If you use a course id where you are not enrolled, you will receive a warning No access rights in course context
    • Affected Branches:
      MOODLE_29_STABLE
    • Fixed Branches:
      MOODLE_30_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-50541-master

      Description

      Retrieve a list of imscps from several courses

        Attachments

          Activity

            People

            Assignee:
            jleyva Juan Leyva
            Reporter:
            ccito Costantino Cito
            Peer reviewer:
            Dani Palou
            Integrator:
            Dan Poltawski
            Tester:
            John Okely
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              16/Nov/15