Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-29934 Web service API Roadmap
  3. MDL-49337

mod_data_get_databases_by_courses

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Note: Version numbers iare 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 database activities, you don't need to create entries. 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, courseid and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' -H 'Pragma: no-cache' -H 'Origin: file://' -H 'Accept-Encoding: gzip,deflate,sdch' -H 'Accept-Language: es,en;q=0.8,de-DE;q=0.6,de;q=0.4,nb;q=0.2' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1798.0 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Cache-Control: no-cache' -H 'Connection: keep-alive' --data 'courseids%5B0%5D=4&wsfunction=mod_data_get_databases_by_courses&wstoken=1b9cc9f44630b554bb2c9428b8744338' --compressed
          

      6. Confirm that
        • As student you only see the visible database activity, and a few parameter settings: id, coursemodule, name, intro, introformat, comments, time..*4 and required..*2
        • As a teacher you see all the database activities and all the settings
      Show
      Note: Version numbers iare 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 database activities, you don't need to create entries. 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, courseid and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' -H 'Pragma: no-cache' -H 'Origin: file://' -H 'Accept-Encoding: gzip,deflate,sdch' -H 'Accept-Language: es,en;q=0.8,de-DE;q=0.6,de;q=0.4,nb;q=0.2' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1798.0 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Cache-Control: no-cache' -H 'Connection: keep-alive' --data 'courseids%5B0%5D=4&wsfunction=mod_data_get_databases_by_courses&wstoken=1b9cc9f44630b554bb2c9428b8744338' --compressed Confirm that As student you only see the visible database activity, and a few parameter settings: id, coursemodule, name, intro, introformat, comments, time..*4 and required..*2 As a teacher you see all the database activities and all the settings
    • Affected Branches:
      MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_29_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-49337-master

      Description

      Web services for retrieving a list of databases activities you have permissions to see in the course

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/May/15