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

Assignments submission comments cannot be accessed via webservice

    XMLWordPrintable

Details

    • MOODLE_30_STABLE, MOODLE_31_STABLE
    • MOODLE_30_STABLE, MOODLE_31_STABLE
    • MDL-54894-master
    • Hide
      1. Create a course with a student. The course must have at least one section.
      2. Add and assignment with submission comments.
      3. As the student submit and add some comments to the submission comments.
      4. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile
      5. Create a Token for the student user.
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      6. Take note of the student token (to be used in following instructions).
      7. Next, you can do a CURL REST call simulating a WS client with the student user.
        • You need to replace the wstoken, instanceid, itemid and the URL of your moodle instance.
        • Where:
          • wstoken is the token of the student user you created.
          • instanceid is the coursemodule id of the assignment.
          • itemid is the submission id.
        • curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=core_comment_get_comments&contextlevel=module&component=assignsubmission_comments&area=submission_comments&page=0&instanceid=72&itemid=34&wstoken=cd2be328e7db5fefa407274d1e1073a7' --compressed

      8. Confirm that the comments info is returned.
      Show
      Create a course with a student. The course must have at least one section. Add and assignment with submission comments. As the student submit and add some comments to the submission comments. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token for the student user. Click on Site administration ► Plugins ► Web services ► Manage tokens Take note of the student token (to be used in following instructions). Next, you can do a CURL REST call simulating a WS client with the student user. You need to replace the wstoken, instanceid, itemid and the URL of your moodle instance. Where: wstoken is the token of the student user you created. instanceid is the coursemodule id of the assignment. itemid is the submission id. curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=core_comment_get_comments&contextlevel=module&component=assignsubmission_comments&area=submission_comments&page=0&instanceid=72&itemid=34&wstoken=cd2be328e7db5fefa407274d1e1073a7' --compressed Confirm that the comments info is returned.

    Description

      When retrieving comments for Assignment submissions an error is raised informfing that course module does not exists.

      It happens because course is not informed and it search in site course.

      Attachments

        Issue Links

          Activity

            People

              pferre22 Pau Ferrer
              pferre22 Pau Ferrer
              Dani Palou Dani Palou
              Andrew Lyons Andrew Lyons
              cameron1729 cameron1729
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                11/Jul/16