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

mod_wiki_get_wikis_by_courses

XMLWordPrintable

    • MOODLE_29_STABLE, MOODLE_31_STABLE
    • MOODLE_31_STABLE
    • MDL-50550-master
    • Hide

      Note: Version number is bumped because a new web service is added into the Mobile app service.

      1. Create a course with a teacher and a student.
      2. Create a couple of wikis. Hide one of the wikis.
      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_wiki_get_wikis_by_courses&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' --compressed

      6. Confirm that
        • As student you only see the visible wiki, and you see all the data except timecreated and timemodified.
        • As a teacher you see all the wikis and all their data (including timecreated and timemodified).
      7. You can also specify which courses to retrieve, (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_wiki_get_wikis_by_courses&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' --compressed

      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 number is bumped because a new web service is added into the Mobile app service. Create a course with a teacher and a student. Create a couple of wikis. Hide one of the wikis. 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_wiki_get_wikis_by_courses&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' --compressed Confirm that As student you only see the visible wiki, and you see all the data except timecreated and timemodified. As a teacher you see all the wikis and all their data (including timecreated and timemodified). You can also specify which courses to retrieve, (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_wiki_get_wikis_by_courses&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' --compressed If you use a course id where you are not enrolled, you will receive a warning "No access rights in course context".

      Retrieve a list of wikis from several courses

            dpalou Dani Palou
            ccito Costantino Cito
            Simey Lameze Simey Lameze
            David Monllaó David Monllaó
            John Okely John Okely
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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