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

Add an additional return field in get_forums_by_courses in order to specify if the current user can create discussions

XMLWordPrintable

    • MOODLE_29_STABLE
    • MOODLE_30_STABLE
    • MDL-51413-master
    • Hide
      1. Create in a new course a general forum. Ensure that the course has the news forum enabled.
      2. Enrol a user as student in the course
      3. Add a discussion in each forum (in the new forum as teacher in the general forum as student)
      4. Enable "Mobile services": Plugins ► Web Services ► Mobile
      5. You need a token for the user for the Mobile Service, for creating a Token:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
        • Click add, select user and service (Mobile Service)
          all the forum discussions
      6. Execute the following CURL command in a shell (replace courseids - 4 value - with your course id and wstoken with your token)

        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. Confirm that you receive a list of forums and that the field cancreatediscussions is false for the news forum and true for the other forum
      Show
      Create in a new course a general forum. Ensure that the course has the news forum enabled. Enrol a user as student in the course Add a discussion in each forum (in the new forum as teacher in the general forum as student) Enable "Mobile services": Plugins ► Web Services ► Mobile You need a token for the user for the Mobile Service, for creating a Token: Click on Site administration ► Plugins ► Web services ► Manage tokens Click add, select user and service (Mobile Service) all the forum discussions Execute the following CURL command in a shell (replace courseids - 4 value - with your course id and wstoken with your token) 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" Confirm that you receive a list of forums and that the field cancreatediscussions is false for the news forum and true for the other forum

      Currently, get_forum_discussion_posts, returns a field called "canreply" that indicates if the user is able to reply to the forum posts

      It should be great to have a similar field in get_forums_by_courses so we can have information about the user capability to create discussions

            jleyva Juan Leyva
            jleyva Juan Leyva
            Dani Palou Dani Palou
            Andrew Lyons Andrew Lyons
            John Okely John Okely
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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